]> rtime.felk.cvut.cz Git - l4.git/commitdiff
update
authorl4check <l4check@d050ee49-bd90-4346-b210-929a50b99cfc>
Sun, 10 Mar 2013 19:15:35 +0000 (19:15 +0000)
committerl4check <l4check@d050ee49-bd90-4346-b210-929a50b99cfc>
Sun, 10 Mar 2013 19:15:35 +0000 (19:15 +0000)
git-svn-id: http://svn.tudos.org/repos/oc/tudos/trunk@49 d050ee49-bd90-4346-b210-929a50b99cfc

973 files changed:
l4/Makefile
l4/mk/Makeconf
l4/mk/binary.inc
l4/mk/defconfig/config.arm-rv
l4/mk/install.inc
l4/mk/modes.inc
l4/mk/rules.inc
l4/pkg/bootstrap/server/src/Make.rules
l4/pkg/examples/libs/libgomp/Makefile
l4/pkg/examples/misc/fortran-hello/Makefile [new file with mode: 0644]
l4/pkg/examples/misc/fortran-hello/main.f90 [new file with mode: 0644]
l4/pkg/io/server/src/gpio
l4/pkg/io/server/src/vgpio.cc
l4/pkg/l4sys/include/ARCH-arm/kdebug.h
l4/pkg/l4sys/include/ARCH-ppc32/kdebug.h
l4/pkg/l4sys/include/ARCH-sparc/kdebug.h
l4/pkg/libc_backends/Control
l4/pkg/libgfortran/Control [new file with mode: 0644]
l4/pkg/libgfortran/Makefile [new file with mode: 0644]
l4/pkg/libgfortran/lib/Makefile [new file with mode: 0644]
l4/pkg/libgfortran/lib/README [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/ARCH-amd64/fpu-target.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/ARCH-amd64/kinds.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/ARCH-amd64/kinds.inc [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/ARCH-amd64/selected_int_kind.inc [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/ARCH-x86/fpu-target.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/ARCH-x86/kinds.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/ARCH-x86/kinds.inc [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/ARCH-x86/selected_int_kind.inc [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/Makefile [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/Makefile.dist-c [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/Makefile.dist-f [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/gstdint.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/include/c99_protos.inc [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/include/config.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/build/include/selected_real_kind.inc [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2002 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2003 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2004 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2005 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2006 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2007 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2008 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2009 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2010 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/ChangeLog-2011 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/Makefile.am [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/Makefile.in [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/acinclude.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/aclocal.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/c99_protos.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/caf/libcaf.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/caf/mpi.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/caf/single.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/config.h.in [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/config/fpu-387.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/config/fpu-aix.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/config/fpu-generic.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/config/fpu-glibc.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/config/fpu-sysv.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/configure [new file with mode: 0755]
l4/pkg/libgfortran/lib/contrib/configure.ac [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/configure.host [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/fmain.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_c10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_c16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_c4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_c8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_i16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_i4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_i8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_abs_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_acos_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_acos_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_acos_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_acos_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_acosh_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_acosh_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_acosh_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_acosh_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_aimag_c10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_aimag_c16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_aimag_c4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_aimag_c8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_aint_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_aint_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_aint_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_aint_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_anint_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_anint_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_anint_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_anint_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_asin_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_asin_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_asin_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_asin_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_asinh_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_asinh_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_asinh_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_asinh_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atan2_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atan2_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atan2_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atan2_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atan_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atan_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atan_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atan_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atanh_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atanh_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atanh_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_atanh_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_conjg_c10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_conjg_c16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_conjg_c4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_conjg_c8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cos_c10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cos_c16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cos_c4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cos_c8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cos_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cos_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cos_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cos_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cosh_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cosh_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cosh_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_cosh_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_dim_i16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_dim_i4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_dim_i8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_dim_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_dim_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_dim_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_dim_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_exp_c10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_exp_c16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_exp_c4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_exp_c8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_exp_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_exp_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_exp_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_exp_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log10_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log10_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log10_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log10_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log_c10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log_c16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log_c4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log_c8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_log_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_mod_i16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_mod_i4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_mod_i8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_mod_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_mod_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_mod_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_mod_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sign_i16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sign_i4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sign_i8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sign_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sign_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sign_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sign_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sin_c10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sin_c16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sin_c4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sin_c8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sin_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sin_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sin_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sin_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sinh_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sinh_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sinh_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sinh_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_tan_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_tan_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_tan_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_tan_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_tanh_r10.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_tanh_r16.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_tanh_r4.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/_tanh_r8.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/all_l1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/all_l16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/all_l2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/all_l4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/all_l8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/any_l1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/any_l16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/any_l2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/any_l4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/any_l8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/bessel_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/bessel_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/bessel_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/bessel_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/count_16_l.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/count_1_l.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/count_2_l.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/count_4_l.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/count_8_l.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift0_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift1_16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift1_4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/cshift1_8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/eoshift1_16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/eoshift1_4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/eoshift1_8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/eoshift3_16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/eoshift3_4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/eoshift3_8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/exponent_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/exponent_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/exponent_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/exponent_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/fraction_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/fraction_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/fraction_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/fraction_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iall_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iall_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iall_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iall_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iall_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iany_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iany_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iany_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iany_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iany_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_pack_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iparity_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iparity_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iparity_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iparity_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/iparity_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_l16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_l4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_l8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/matmul_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxval_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxval_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxval_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxval_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxval_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxval_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxval_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxval_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/maxval_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minval_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minval_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minval_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minval_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minval_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minval_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minval_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minval_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/minval_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/misc_specifics.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/nearest_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/nearest_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/nearest_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/nearest_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/norm2_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/norm2_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/norm2_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/norm2_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pack_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/parity_l1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/parity_l16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/parity_l2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/parity_l4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/parity_l8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c10_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c10_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c10_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c16_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c16_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c16_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c4_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c4_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c4_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c8_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c8_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_c8_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_i16_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_i16_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_i16_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_i4_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_i4_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_i4_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_i8_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_i8_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_i8_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_r10_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_r10_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_r16_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_r16_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_r16_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_r4_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_r4_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_r8_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/pow_r8_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/product_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/reshape_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/shape_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/shape_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/shape_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spacing_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spacing_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spacing_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spacing_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/spread_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/sum_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/transpose_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_c10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_c16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_c4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_c8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_i1.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_i16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_i2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_i4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_i8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_r10.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_r16.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_r4.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/generated/unpack_r8.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/gfortran.map [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/abort.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/access.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/args.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/associated.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/bit_intrinsics.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/c99_functions.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/chdir.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/chmod.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/clock.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/cpu_time.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/cshift0.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/ctime.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/date_and_time.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/dprod_r8.f90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/dtime.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/env.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/eoshift0.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/eoshift2.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/erfc_scaled.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/erfc_scaled_inc.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/etime.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/execute_command_line.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/exit.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/extends_type_of.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/f2c_specifics.F90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/fnum.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/gerror.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/getXid.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/getcwd.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/getlog.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/hostnm.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/ierrno.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/ishftc.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/iso_c_binding.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/iso_c_binding.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/iso_c_generated_procs.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/kill.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/link.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/malloc.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/move_alloc.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/mvbits.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/pack_generic.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/perror.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/rand.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/random.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/rename.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/reshape_generic.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/reshape_packed.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/selected_char_kind.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/selected_int_kind.f90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/selected_real_kind.f90 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/signal.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/size.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/sleep.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/spread_generic.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/stat.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/string_intrinsics.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/string_intrinsics_inc.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/symlnk.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/system.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/system_clock.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/time.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/time_1.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/transpose_generic.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/umask.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/unlink.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/intrinsics/unpack_generic.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/close.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/fbuf.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/fbuf.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/file_pos.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/format.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/format.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/inquire.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/intrinsics.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/io.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/list_read.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/lock.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/open.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/read.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/size_from_kind.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/transfer.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/transfer128.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/unit.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/unix.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/unix.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/write.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/io/write_float.def [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/kinds-override.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/libgfortran.h [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/libgfortran.spec.in [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/libtool-version [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/all.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/any.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/bessel.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/count.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/cshift0.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/cshift1.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/eoshift1.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/eoshift3.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/exponent.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/fraction.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/head.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/iall.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/iany.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/iforeach.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/ifunction.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/ifunction_logical.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/in_pack.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/in_unpack.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/iparity.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/iparm.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/matmul.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/matmull.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/maxloc0.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/maxloc1.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/maxval.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/minloc0.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/minloc1.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/minval.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/misc_specifics.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/mtype.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/nearest.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/norm2.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/pack.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/parity.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/pow.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/product.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/reshape.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/rrspacing.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/set_exponent.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/shape.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/spacing.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/specific.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/specific2.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/spread.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/sum.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/transpose.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/types.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/m4/unpack.m4 [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/mk-kinds-h.sh [new file with mode: 0755]
l4/pkg/libgfortran/lib/contrib/mk-sik-inc.sh [new file with mode: 0755]
l4/pkg/libgfortran/lib/contrib/mk-srk-inc.sh [new file with mode: 0755]
l4/pkg/libgfortran/lib/contrib/runtime/backtrace.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/bounds.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/compile_options.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/convert_char.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/environ.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/error.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/fpu.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/in_pack_generic.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/in_unpack_generic.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/main.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/memory.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/pause.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/select.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/select_inc.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/stop.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/contrib/runtime/string.c [new file with mode: 0644]
l4/pkg/libgfortran/lib/gcc/fortran/libgfortran.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-amd64/gcc-4.3/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-amd64/gcc-4.7/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-arm/gcc-4.3/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-arm/gcc-4.7/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-ppc32/gcc-4.3/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-ppc32/gcc-4.7/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-sparc/gcc-4.3/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-sparc/gcc-4.7/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-x86/gcc-4.3/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/ARCH-x86/gcc-4.7/libgomp_f.h [new file with mode: 0644]
l4/pkg/libgomp/lib/build/Makefile
l4/pkg/libgomp/lib/build/config.h
l4/pkg/libgomp/lib/build/gstdint.h
l4/pkg/libgomp/lib/build/libgomp_f_size.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/README.L4 [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/ChangeLog [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/ChangeLog.graphite [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/Makefile.am [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/Makefile.in [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/acinclude.m4 [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/aclocal.m4 [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/alloc.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/barrier.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config.h.in [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/bsd/proc.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/affinity.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/alpha/futex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/bar.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/bar.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/futex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/ia64/futex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/lock.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/mips/futex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/mutex.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/mutex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/omp-lock.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/powerpc/futex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/proc.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/proc.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/ptrlock.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/ptrlock.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/s390/futex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/sem.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/sem.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/sparc/futex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/tile/futex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/wait.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/x86/futex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/mingw32/proc.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/mingw32/time.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/osf/sem.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/affinity.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/bar.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/bar.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/lock.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/mutex.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/mutex.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/omp-lock.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/proc.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/ptrlock.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/ptrlock.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/sem.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/sem.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/time.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/configure [new file with mode: 0755]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/configure.ac [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/configure.tgt [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/critical.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/env.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/error.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/fortran.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/iter.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/iter_ull.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.map [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.spec.in [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.texi [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp_f.h.in [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp_g.h [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/loop.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/loop_ull.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/omp.h.in [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/omp_lib.f90.in [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/omp_lib.h.in [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/ordered.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/parallel.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/sections.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/single.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/task.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/team.c [new file with mode: 0644]
l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/work.c [new file with mode: 0644]
l4/pkg/libpng/lib/README
l4/pkg/libpng/lib/build/Makefile
l4/pkg/libpng/lib/build/pnglibconf.h
l4/pkg/libpng/lib/dist/ANNOUNCE
l4/pkg/libpng/lib/dist/CHANGES
l4/pkg/libpng/lib/dist/CMakeLists.txt
l4/pkg/libpng/lib/dist/INSTALL
l4/pkg/libpng/lib/dist/LICENSE
l4/pkg/libpng/lib/dist/Makefile.am
l4/pkg/libpng/lib/dist/Makefile.in
l4/pkg/libpng/lib/dist/README
l4/pkg/libpng/lib/dist/aclocal.m4
l4/pkg/libpng/lib/dist/autogen.sh
l4/pkg/libpng/lib/dist/config.sub
l4/pkg/libpng/lib/dist/configure
l4/pkg/libpng/lib/dist/configure.ac
l4/pkg/libpng/lib/dist/depcomp
l4/pkg/libpng/lib/dist/example.c
l4/pkg/libpng/lib/dist/libpng-manual.txt
l4/pkg/libpng/lib/dist/libpng.3
l4/pkg/libpng/lib/dist/libpngpf.3
l4/pkg/libpng/lib/dist/missing
l4/pkg/libpng/lib/dist/png.5
l4/pkg/libpng/lib/dist/png.c
l4/pkg/libpng/lib/dist/png.h
l4/pkg/libpng/lib/dist/pngconf.h
l4/pkg/libpng/lib/dist/pngerror.c
l4/pkg/libpng/lib/dist/pngget.c
l4/pkg/libpng/lib/dist/pnginfo.h
l4/pkg/libpng/lib/dist/pngmem.c
l4/pkg/libpng/lib/dist/pngpread.c
l4/pkg/libpng/lib/dist/pngpriv.h
l4/pkg/libpng/lib/dist/pngread.c
l4/pkg/libpng/lib/dist/pngrio.c
l4/pkg/libpng/lib/dist/pngrtran.c
l4/pkg/libpng/lib/dist/pngrutil.c
l4/pkg/libpng/lib/dist/pngset.c
l4/pkg/libpng/lib/dist/pngstruct.h
l4/pkg/libpng/lib/dist/pngtest.c
l4/pkg/libpng/lib/dist/pngtrans.c
l4/pkg/libpng/lib/dist/pngwio.c
l4/pkg/libpng/lib/dist/pngwrite.c
l4/pkg/libpng/lib/dist/pngwtran.c
l4/pkg/libpng/lib/dist/pngwutil.c
l4/pkg/libpng/lib/dist/scripts/README.txt
l4/pkg/libpng/lib/dist/scripts/checksym.awk
l4/pkg/libpng/lib/dist/scripts/def.dfn
l4/pkg/libpng/lib/dist/scripts/descrip.mms
l4/pkg/libpng/lib/dist/scripts/intprefix.dfn [new file with mode: 0644]
l4/pkg/libpng/lib/dist/scripts/libpng-config-head.in
l4/pkg/libpng/lib/dist/scripts/libpng.pc.in
l4/pkg/libpng/lib/dist/scripts/libtool.m4 [new file with mode: 0644]
l4/pkg/libpng/lib/dist/scripts/ltoptions.m4 [new file with mode: 0644]
l4/pkg/libpng/lib/dist/scripts/ltsugar.m4 [new file with mode: 0644]
l4/pkg/libpng/lib/dist/scripts/ltversion.m4 [new file with mode: 0644]
l4/pkg/libpng/lib/dist/scripts/lt~obsolete.m4 [new file with mode: 0644]
l4/pkg/libpng/lib/dist/scripts/macro.lst [new file with mode: 0644]
l4/pkg/libpng/lib/dist/scripts/makefile.32sunu
l4/pkg/libpng/lib/dist/scripts/makefile.64sunu
l4/pkg/libpng/lib/dist/scripts/makefile.aix
l4/pkg/libpng/lib/dist/scripts/makefile.bc32
l4/pkg/libpng/lib/dist/scripts/makefile.beos
l4/pkg/libpng/lib/dist/scripts/makefile.bor
l4/pkg/libpng/lib/dist/scripts/makefile.cegcc
l4/pkg/libpng/lib/dist/scripts/makefile.darwin
l4/pkg/libpng/lib/dist/scripts/makefile.dec
l4/pkg/libpng/lib/dist/scripts/makefile.dj2
l4/pkg/libpng/lib/dist/scripts/makefile.elf
l4/pkg/libpng/lib/dist/scripts/makefile.freebsd
l4/pkg/libpng/lib/dist/scripts/makefile.gcc
l4/pkg/libpng/lib/dist/scripts/makefile.hp64
l4/pkg/libpng/lib/dist/scripts/makefile.hpgcc
l4/pkg/libpng/lib/dist/scripts/makefile.hpux
l4/pkg/libpng/lib/dist/scripts/makefile.ibmc
l4/pkg/libpng/lib/dist/scripts/makefile.intel
l4/pkg/libpng/lib/dist/scripts/makefile.knr
l4/pkg/libpng/lib/dist/scripts/makefile.linux
l4/pkg/libpng/lib/dist/scripts/makefile.mips
l4/pkg/libpng/lib/dist/scripts/makefile.msc
l4/pkg/libpng/lib/dist/scripts/makefile.msys
l4/pkg/libpng/lib/dist/scripts/makefile.ne12bsd
l4/pkg/libpng/lib/dist/scripts/makefile.netbsd
l4/pkg/libpng/lib/dist/scripts/makefile.openbsd
l4/pkg/libpng/lib/dist/scripts/makefile.sco
l4/pkg/libpng/lib/dist/scripts/makefile.sggcc
l4/pkg/libpng/lib/dist/scripts/makefile.sgi
l4/pkg/libpng/lib/dist/scripts/makefile.so9
l4/pkg/libpng/lib/dist/scripts/makefile.solaris
l4/pkg/libpng/lib/dist/scripts/makefile.solaris-x86
l4/pkg/libpng/lib/dist/scripts/makefile.std
l4/pkg/libpng/lib/dist/scripts/makefile.sunos
l4/pkg/libpng/lib/dist/scripts/makefile.tc3
l4/pkg/libpng/lib/dist/scripts/makefile.vcwin32
l4/pkg/libpng/lib/dist/scripts/makevms.com
l4/pkg/libpng/lib/dist/scripts/options.awk
l4/pkg/libpng/lib/dist/scripts/pnglibconf.dfa
l4/pkg/libpng/lib/dist/scripts/pnglibconf.h.prebuilt
l4/pkg/libpng/lib/dist/scripts/pnglibconf.mak
l4/pkg/libpng/lib/dist/scripts/prefix.dfn [new file with mode: 0644]
l4/pkg/libpng/lib/dist/scripts/symbols.def
l4/pkg/libpng/lib/l4png_wrap/Makefile
l4/pkg/libpng/lib/l4png_wrap/l4png_wrap.c
l4/pkg/libvbus/include/vbus_gpio
l4/pkg/libvbus/include/vbus_gpio-ops.h
l4/pkg/libvbus/include/vbus_gpio.h
l4/pkg/libvbus/lib/src/vbus_gpio.cc
l4/pkg/mag/server/src/mag.lua
l4/pkg/plr/doc/threadini.sh
l4/pkg/plr/ex/Makefile
l4/pkg/plr/ex/eventbuf/main.cc
l4/pkg/plr/ex/large_malloc/Makefile [new file with mode: 0644]
l4/pkg/plr/ex/large_malloc/main.cc [new file with mode: 0644]
l4/pkg/plr/ex/pthread_mutex/main.c
l4/pkg/plr/ex/trap+emulate/vcpu.cc
l4/pkg/plr/include/measurements.h
l4/pkg/plr/include/pthread_rep.h
l4/pkg/plr/lib/libpthread_romain/src/mutex.c
l4/pkg/plr/server/src/app
l4/pkg/plr/server/src/app_loading.cc
l4/pkg/plr/server/src/app_thread.cc
l4/pkg/plr/server/src/configuration
l4/pkg/plr/server/src/constants.h
l4/pkg/plr/server/src/cpuid.h [new file with mode: 0644]
l4/pkg/plr/server/src/fault_handlers/debugger.cc
l4/pkg/plr/server/src/fault_handlers/kiptime.cc
l4/pkg/plr/server/src/fault_handlers/lock_observer.cc
l4/pkg/plr/server/src/fault_handlers/lock_observer.h
l4/pkg/plr/server/src/fault_handlers/observers.h
l4/pkg/plr/server/src/fault_handlers/pagefault.cc
l4/pkg/plr/server/src/fault_handlers/syscalls.cc
l4/pkg/plr/server/src/manager
l4/pkg/plr/server/src/manager.cc
l4/pkg/plr/server/src/memory
l4/pkg/plr/server/src/memory.cc
l4/pkg/plr/server/src/redundancy/dmr.cc
l4/pkg/plr/tools/tsar/tsar
l4/pkg/plr/tools/tsar/tsar_events.py
l4/pkg/plr/tools/tsar/tsar_rules.py
l4/tool/kconfig/Makefile
l4/tool/kconfig/README
l4/tool/kconfig/scripts/Makefile.lib
repomgr

index 9c879b8c868d3d9a353bf62ac836cc8aec0cfb70..16cf14053c5a9ba8303e0fecdf08393cde9f4569 100644 (file)
@@ -254,6 +254,7 @@ Makeconf.bid.local-helper:
                        GCCVERSION GCCMAJORVERSION GCCMINORVERSION      \
                        GCCSUBVERSION GCC_HAS_ATOMICS                   \
                        GCCNOSTACKPROTOPT LDVERSION GCCSYSLIBDIRS       \
+                       GCCFORTRANAVAIL                                 \
                        $(if $(GCCNOFPU_$(ARCH)_f),GCCNOFPU_$(ARCH))    \
                        $(if $(GCCIS_$(ARCH)_leon_f),GCCIS_$(ARCH)_leon),   \
                        echo $(v)=$(call $(v)_f,$(ARCH))                \
index b3075e299b028fae0529fc009a34468257f0393c..6391db03dd8227d748e2d77c8fd46649ae0a46ba 100644 (file)
@@ -162,6 +162,11 @@ CXX_amd64       = $(SYSTEM_TARGET)g++
 CXX_arm         = $(SYSTEM_TARGET)g++
 CXX_ppc32       = $(SYSTEM_TARGET)g++
 CXX_sparc       = $(SYSTEM_TARGET)g++
+FC_x86          = $(SYSTEM_TARGET)gfortran
+FC_amd64        = $(SYSTEM_TARGET)gfortran
+FC_arm          = $(SYSTEM_TARGET)gfortran
+FC_ppc32        = $(SYSTEM_TARGET)gfortran
+FC_sparc        = $(SYSTEM_TARGET)gfortran
 
 SYSTEMS_ABI    := x86-l4f amd64-l4f arm-l4f ppc32-l4f sparc-l4f
 SYSTEMS_PLAIN  := x86     amd64     arm     ppc32     sparc
@@ -173,6 +178,7 @@ $(call dv,AS)        = $(SYSTEM_TARGET)as
 AWKP           ?= gawk --posix
 $(call dv,CC)    = $(if $(USE_CCACHE),ccache )$(CC_$(BUILD_ARCH))
 $(call dv,CXX)   = $(if $(USE_CCACHE),ccache )$(CXX_$(BUILD_ARCH))
+$(call dv,FC)    = $(if $(USE_CCACHE),ccache )$(FC_$(BUILD_ARCH))
 CP             ?= cp
 DICE_SRCDIR    ?= $(L4DIR)/../dice
 DICE_OBJDIR    ?= $(DICE_SRCDIR)
@@ -231,6 +237,9 @@ absfilename_target_dir_needs_to_exist = $(foreach w,$(1),$(addsuffix /$(notdir $
 absfilename     = $(shell PWD=$$($(PWDCMD)) $(L4DIR)/mk/rel2abs.sh $(1))
 findfile       = $(firstword $(wildcard $(addsuffix /$(1),$(2))) $(1)_NOT_FOUND)
 is_dir          = $(shell test -d '$(1)' && echo yes)
+define create_dir
+  $(if $(wildcard $(1)),,$(VERBOSE)$(INSTALL) -d $(1))
+endef
 
 ifneq ($(PT),)
   PLATFORM_TYPE := $(PT)
@@ -424,6 +433,9 @@ MAKEDEP=$(LD_GENDEP_PREFIX) \
                $(if $(4),GENDEP_BINARY_ALT1=$(4))
 endif
 
+# We recognize the following Fortran file extensions.
+FORTRAN_FILE_EXTENSIONS = .f .F .f90 .F90 .f95 .F95
+
 # macros used here and in packages
 checkcc   = $(shell if $(CC)  $(CCXX_FLAGS) $(1) -o /dev/null -c -x c \
                     /dev/null > /dev/null 2>&1; then echo "$(1)"; fi)
@@ -432,12 +444,13 @@ checkcxx  = $(shell if $(CXX) $(CCXX_FLAGS) $(1) -o /dev/null -c -x c++ \
 
 callcc    = LC_ALL=C $(CC)  $(CCXX_FLAGS)
 callcxx   = LC_ALL=C $(CXX) $(CCXX_FLAGS)
+callfc    = LC_ALL=C $(FC)  $(CCXX_FLAGS)
 
 # the gcc specific variables: version, base dir, include dir, gcc lib, ...
 # note: determining these variables is slow, and the values should
 #       be set in .config.all. However, this is the place were
 #       they are determined on a 'make config' in $(L4DIR)
-GCCVERSION_f   = $(shell $(callcc) -dumpversion | sed -e 's/\(.*\)\..*/\1/')
+GCCVERSION_f   = $(shell $(callcc) -dumpversion | sed -e 's/\([^.]\+\.[^.]\+\).*/\1/')
 GCCMAJORVERSION_f=$(shell $(callcc) -dumpversion | sed -e 's/\([^.]*\).*/\1/')
 GCCMINORVERSION_f=$(shell $(callcc) -dumpversion | sed -e 's/[^.]*\.\([^.]*\).*/\1/')
 GCCSUBVERSION_f        = $(shell $(callcc) -dumpversion | sed -e 's/.*\.\(.*\)/\1/')
@@ -450,6 +463,7 @@ GCCLIB_S_SO_f       = $(filter /%,$(shell $(callcc) -print-file-name=libgcc_s.so))
 GCCLIB_EH_f    = $(filter /%,$(shell $(callcc) -print-file-name=libgcc_eh.a))
 GCCINCDIR_f    = $(addprefix $(call GCCDIR_f),/include /include-fixed)
 GCCNOSTACKPROTOPT_f= $(call checkcc,-fno-stack-protector)
+GCCFORTRANAVAIL_f = $(shell echo | $(callfc) -dD -E - 2>&1 | grep -q __GNUC__ && echo y)
 GCCNOFPU_x86_f  = $(call checkcc,-mno-mmx) $(call checkcc,-mno-3dnow) \
                   $(call checkcc,-mno-sse) $(call checkcc,-mno-sse2)  \
                   $(call checkcc,-mno-sse3) $(call checkcc,-mno-sse4) \
index 39b22a8b413080ea4419e10de46a516e834164b0..b9686866008613396b1e84957f64a632b8e956cc 100644 (file)
@@ -47,6 +47,23 @@ BID_MISSING_PCS := \
              $(strip $(foreach i,$(DEPENDS_PKGS),            \
                       $(if $(strip $(wildcard $(OBJ_BASE)/pc/$(i).pc)),,$(i))))))
 
+ifneq ($(strip $(SRC_F)$(foreach t,$(TARGET),$(SRC_F_$(t)))),)
+  ifeq ($(filter x86 amd64,$(BUILD_ARCH)),)
+    $(info $(shell echo -e "\033[32mFortran is only available on x86 and amd64 currently, skipping directory '$(SRC_DIR)'.\033[0m"))
+    SYSTEMS =
+  else
+    ifeq ($(GCCFORTRANAVAIL),)
+      $(info $(shell echo -e "\033[32mFortran compiler (gcc-4.6 or later) missing, skipping directory '$(SRC_DIR)'.\033[0m"))
+      SYSTEMS =
+    else
+      ifeq ($(filter 4.6 4.7 4.8,$(GCCVERSION)),)
+        $(info $(shell echo -e "\033[32mFortran compiler gcc version 4.6 or later required, skipping directory '$(SRC_DIR)'.\033[0m"))
+        SYSTEMS =
+      endif
+    endif
+  endif
+endif
+
 ifneq ($(BID_MISSING_PCS),)
   # clear SYSTEMS to prevent building anything
   SYSTEMS =
@@ -116,6 +133,7 @@ $(foreach sys,$(TARGET_SYSTEMS),$(OBJ_DIR)/OBJ-$(sys)/$(BID_OBJ_Makefile)):$(OBJ
        @echo 'vpath %.c $(VPATH_SRC_BASE)'>>$@
        @echo 'vpath %.cc $(VPATH_SRC_BASE)'>>$@
        @echo 'vpath %.cpp $(VPATH_SRC_BASE)'>>$@
+       @for fext in $(FORTRAN_FILE_EXTENSIONS); do echo "vpath %$$fext $(VPATH_SRC_BASE)">>$@ ; done
        @echo 'vpath %.S $(VPATH_SRC_BASE)'>>$@
        @echo 'vpath %.y $(VPATH_SRC_BASE)'>>$@
        @echo 'vpath %.l $(VPATH_SRC_BASE)'>>$@
@@ -210,10 +228,11 @@ endif
 # CPPFLAGS     - options for the c preprocessor, included in CFLAGS
 # CFLAGS       - options for the c compiler
 # CXXFLAGS     - options for the c++ compiler
+# FFLAGS       - options for the fortran compiler
 # ASFLAGS      - options for the assembler
 #
 # Addtitionally, the following varibales are supported:
-# SRC_C, SRC_CC, SRC_S - .c, .cc, .S source files
+# SRC_C, SRC_CC, SRC_F, SRC_S - .c, .cc, .f90, .S source files
 # CRT0, CRTN   - startup and finish code
 # LIBS         - additional libs to link (with -l), including paths (-L)
 # IDL          - interface definition files
@@ -405,7 +424,7 @@ CPPFLAGS+= $(DEFINES)
 CPPFLAGS+= $(addprefix -I, $(PRIVATE_INCDIR) $(PRIVATE_INCDIR_$(OSYSTEM)) $(PRIVATE_INCDIR_$@) $(PRIVATE_INCDIR_$@_$(OSYSTEM)))
 CPPFLAGS+= $(if $(CONTRIB_INCDIR),$(addprefix -I$(OBJ_BASE)/include/contrib/,$(CONTRIB_INCDIR)))
 CPPFLAGS+= $(BID_PKG_CONFIG_CFLAGS)
-CPPFLAGS+= $(if $(CLIENTIDL)$(SERVERIDL)$(addprefix CLIENTIDL_,$(TARGET))$(addprefix SERVERIDL_,$(TARGET)),$(addprefix -I, $(IDL_PATH)))
+#CPPFLAGS+= $(if $(CLIENTIDL)$(SERVERIDL)$(addprefix CLIENTIDL_,$(TARGET))$(addprefix SERVERIDL_,$(TARGET)),$(addprefix -I, $(IDL_PATH)))
 ifneq ($(MODE),host)
 CPPFLAGS+= $(addprefix -I, $(L4INCDIR))
 endif
@@ -426,6 +445,8 @@ CXXFLAGS+= $(CXXFLAGS-y)
 CXXFLAGS+= -fno-common
 CXXFLAGS+= $(CXXFLAGS_L4_GENERIC)
 
+FFLAGS  += $(CFLAGS_L4_GENERIC)
+
 PICFLAGS += -fPIC -U__PIC__ -D__PIC__=1
 
 ifneq ($(MODE),host)
@@ -489,16 +510,23 @@ convert_cc_to_o_file = $(patsubst %.cc,%$(2).o, $(filter %.cc,$(1)))     \
                        $(if $(BID_ALLOW_CPP_AS_CPLUSPLUS_FILE),          \
                         $(patsubst %.cpp,%$(2).o,$(filter %.cpp,$(1))))
 
+# convert list of Fortran file names to .o files
+# arg: 1 - list of files
+#      2 - infix between the basename and the .o
+convert_f_to_o_file = $(foreach e,$(FORTRAN_FILE_EXTENSIONS),$(patsubst %$e,%$(2).o,$(filter %$e,$(1))))
+
 # generic targetobjs
 # arg: 1 - target
 #      2 - infix between the basename and the .o
 #      3 - additional infix before .o in case of .cc files
 targetobjs_gen = $(SRC_C:.c=$(2).o) $(SRC_S:.S=$(2).o)                  \
                  $(call convert_cc_to_o_file,$(SRC_CC),$(2)$(3))        \
+                 $(call convert_f_to_o_file,$(SRC_F),$(2)$(3))          \
                  $(foreach inter, $(OSYSTEM) $(1) $(1)_$(OSYSTEM),     \
                      $(SRC_C_$(inter):.c=$(2).o)                       \
                      $(SRC_S_$(inter):.S=$(2).o)                       \
-                     $(call convert_cc_to_o_file,$(SRC_CC_$(inter)),$(2)$(3))) \
+                     $(call convert_cc_to_o_file,$(SRC_CC_$(inter)),$(2)$(3)) \
+                     $(call convert_f_to_o_file,$(SRC_F_$(inter)),$(2)$(3))) \
                  $(patsubst %.c,%$(2).o,$(call IDL_SRC_Cfn,$(1)))
 
 # a helper function to generate the object-files for a given target
@@ -703,21 +731,18 @@ $(eval $(call BID_GENERATE_CXX_MAKE_RULES,cc))
 $(if $(BID_ALLOW_CPP_AS_CPLUSPLUS_FILE),$(eval $(call BID_GENERATE_CXX_MAKE_RULES,cpp)))
 # generate rules to compile %.c files to %.o, %.s.o etc
 $(eval $(call BID_GENERATE_C_MAKE_RULES,c))
+# generate rules to compile %.f90 files to %.o, %.s.o etc
+$(foreach e,$(FORTRAN_FILE_EXTENSIONS),$(eval $(call BID_GENERATE_F_MAKE_RULES,$(subst .,,$e))))
 # generate rules to compile %.S files to %.o, %.s.o etc
 $(eval $(call BID_GENERATE_DEFAULT_MAKE_RULES,%,%.S,AS))
 
 # Reset implicit rules, mind the TAB.
-%:     %.c
-       
-
-%:     %.cc
+define reset_implicit_rule =
+%: $(1)
        
+endef
 
-%:     %.cpp
-       
-
-%:     %.S
-       
+$(foreach e,.c .cc .cpp .S $(FORTRAN_FILE_EXTENSIONS),$(eval $(call reset_implicit_rule,$e)))
 
 $(eval $(call BID_GENERATE_I_MAKE_RULE,%.i,%.c,$(CC),$(CFLAGS)))
 $(eval $(call BID_GENERATE_I_MAKE_RULE,%.s.i,%.c,$(CC),$(CFLAGS) $(PICFLAGS)))
index 6ab421af255d4c732e1835654cb72c27bba67702..5f6704c90786983161e40f5e36764a1d72ffc917 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_CPU_ARM_ARMV5TE=y
 # CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
 # CONFIG_PLATFORM_TYPE_omap3evm is not set
 # CONFIG_PLATFORM_TYPE_pandaboard is not set
+# CONFIG_PLATFORM_TYPE_rpi_a is not set
 # CONFIG_PLATFORM_TYPE_rpi_b is not set
 CONFIG_PLATFORM_TYPE_rv=y
 # CONFIG_PLATFORM_TYPE_rv_pbx is not set
index f311ea977d2c22aafb772de06a79a327626b9e20..6bfd2109b5a707c0b89cb864fd91fb89e43aa7a5 100644 (file)
@@ -36,7 +36,7 @@ install:: $(addprefix $(INSTALLDIR)/,$(INSTALL_TARGET))
 ifeq ($(ROLE),prog.mk)
 $(foreach f,$(INSTALL_TARGET),$(INSTALLDIR_LOCAL)/$(f)):$(INSTALLDIR_LOCAL)/%:%
        @$(INSTALL_LOCAL_MESSAGE)
-       $(if $(INSTALLFILE_LOCAL),$(VERBOSE)$(INSTALL) -d $(dir $@))
+       $(if $(INSTALLFILE_LOCAL),$(call create_dir,$(dir $@)))
        $(VERBOSE)$(call INSTALLFILE_LOCAL,$<,$@)
 else
 # with others, we symlink
@@ -56,7 +56,7 @@ endif
 
 $(foreach f,$(INSTALL_TARGET),$(INSTALLDIR)/$(f)):$(INSTALLDIR)/%:%
        @$(INSTALL_MESSAGE)
-       $(if $(INSTALLFILE),$(VERBOSE)$(INSTALL) -d $(dir $@))
+       $(if $(INSTALLFILE),$(call create_dir,$(dir $@)))
        $(VERBOSE)$(call INSTALLFILE,$<,$@)
 
 # unconditionally install on "make install"
index 8d2bda91f41112df0abb5b9dfac885fac158ea5d..90a2577d5d76319a63611ec2f8a6ff34707bf7e2 100644 (file)
@@ -39,11 +39,9 @@ LDS_stat_bin      = $(call findfile,main_stat.ld,$(L4LIBDIR))
 
 
 LIBC_INCLUDE   = -nostdinc                                  \
-                 -I$(OBJ_BASE)/include/$(ARCH)/uclibc       \
                  -I$(OBJ_BASE)/include/uclibc               \
                  -I$(OBJ_BASE)/include/contrib/libstdc++-v3        \
                  $(if $(CONFIG_USE_DROPS_STDDIR),           \
-                 -I$(DROPS_STDDIR)/include/$(ARCH)/uclibc  \
                   -I$(DROPS_STDDIR)/include/uclibc          \
                   -I$(DROPS_STDDIR)/include/contrib/libstdc++-v3,)      \
                  $(I_GCCINCDIR)
index 46bbd82a755a27d053f8abde096ef1dc73f9b355..850a0af67f06969ea2f4d2104680be422c2a787f 100644 (file)
@@ -9,6 +9,9 @@ BID_CXX_COMPILER_INT_NAME = INT_CXX_NAME
 # for C compile (C) use $(CC), $(INT_CPP_NAME), and $(CFLAGS)
 BID_C_COMPILER = CC
 BID_C_COMPILER_INT_NAME = INT_CPP_NAME
+# for F compile (Fortran) use $(FC)
+BID_F_COMPILER = FC
+BID_F_COMPILER_INT_NAME = FC
 # for AS compile (AS) use $(CC), $(INT_CPP_NAME), and $(ASFLAGS)
 BID_AS_COMPILER = CC
 BID_AS_COMPILER_INT_NAME = INT_CPP_NAME
@@ -61,7 +64,6 @@ define BID_GENERATE_CXX_MAKE_RULES
   $(call BID_MAKE_RULE_template,%.s.ne.o,%.$(1),CXX,$$(CXXFLAGS_NOEXC) $$(PICFLAGS))
 endef
 
-#
 #
 # Generate the C set of make rules.
 # prerequisites: %.<arg1> (usually %.c)
@@ -71,6 +73,15 @@ define BID_GENERATE_C_MAKE_RULES
   $(call BID_GENERATE_DEFAULT_MAKE_RULES,%,%.$(1),C)
 endef
 
+#
+# Generate the F set of make rules.
+# prerequisites: %.<arg1> (usually %.f90)
+# targets: %.o, %.s.o, %.pr.o, and %.pr.s.o
+#
+define BID_GENERATE_F_MAKE_RULES
+  $(call BID_GENERATE_DEFAULT_MAKE_RULES,%,%.$(1),F)
+endef
+
 #
 # arg 1: target pattern
 #     2: source pattern
index 746e2cfac8f1217dfb18e0d042b21dc305d355eb..7da83ff915f9a7dd02d4ade99429ed07ff468ba5 100644 (file)
@@ -6,7 +6,7 @@
 # - BOOTSTRAP_MODULES_LIST
 # - BOOTSTRAP_DO_RAW_IMAGE
 # - BOOTSTRAP_DO_UIMAGE
-# - BOOTSTRAP_NO_STRIP if set no stripping of iamge
+# - BOOTSTRAP_NO_STRIP if set no stripping of image
 # - BOOTSTRAP_UIMAGE_COMPRESSION: set to none, gzip, or bzip2
 # - BOOTSTRAP_CMDLINE: compiled-in command line, only used if no cmdline
 #                      given via multi-boot boot loader (e.g. on arm)
index 2cd169973bbe9081d407c8a263f9eabd41149b1d..d25dd7207293179e006aeeb17342d3b1a5d31a2a 100644 (file)
@@ -2,6 +2,9 @@ PKGDIR          ?= ../..
 L4DIR           ?= $(PKGDIR)/../..
 
 DEPENDS_PKGS     = libgomp
+# missing sync_* functions in (my) sparc compiler
+SYSTEMS          = $(filter-out sparc-l4f,$(SYSTEMS_ABI))
+
 include $(L4DIR)/mk/Makeconf
 
 ifneq ($(SYSTEM),)
@@ -11,7 +14,7 @@ ifneq ($(SYSTEM),)
   ifeq ($(strip $(OMP_H_PATH)),include/omp.h)
     $(info \e[32m $(CC) does not have omp.h header file available, skipping.\e[0m)
   else
-    TARGET        = $(if $(filter 4.2 4.3 4.4,$(GCCVERSION)),ex_omp)
+    TARGET        = $(if $(filter 4.2 4.3 4.4 4.5 4.6 4.7,$(GCCVERSION)),ex_omp)
     REQUIRES_LIBS = libgomp libc_support_misc
   endif
 endif
diff --git a/l4/pkg/examples/misc/fortran-hello/Makefile b/l4/pkg/examples/misc/fortran-hello/Makefile
new file mode 100644 (file)
index 0000000..473c274
--- /dev/null
@@ -0,0 +1,9 @@
+PKGDIR         ?= ../..
+L4DIR          ?= $(PKGDIR)/../..
+
+TARGET         = fortran-hello
+SRC_F           = main.f90
+
+REQUIRES_LIBS  = libgfortran
+
+include $(L4DIR)/mk/prog.mk
diff --git a/l4/pkg/examples/misc/fortran-hello/main.f90 b/l4/pkg/examples/misc/fortran-hello/main.f90
new file mode 100644 (file)
index 0000000..29723b6
--- /dev/null
@@ -0,0 +1,7 @@
+! -*- Mode: F90 -*-
+
+program hello
+  print *, "Hello World!"
+end program hello
+
+! EOF
index 9be79256891094fe6f1deb37d5889b7d4089db39..57c3460b03785fdade3a3d53661eb791a5dcb8ce 100644 (file)
@@ -24,6 +24,8 @@ public:
   virtual void setup(unsigned pin, unsigned mode, int value = 0) = 0;
   virtual void config_pad(unsigned pin, unsigned pinmask,
                           unsigned func, unsigned value) = 0;
+  virtual void config_get(unsigned pin, unsigned pinmask,
+                          unsigned func, unsigned *value) = 0;
 
   virtual int get(unsigned pin) = 0;
   virtual void set(unsigned pin, int value) = 0;
index 99cdd7e2742e35f0f95976e4234cdce6b5f09169..8f88b8b397c9bfd42ac8ff4bd7fbed89d771be02 100644 (file)
@@ -77,6 +77,7 @@ private:
 
   int setup(L4::Ipc::Iostream &ios);
   int config_pad(L4::Ipc::Iostream &ios);
+  int config_get(L4::Ipc::Iostream &ios);
   int get(L4::Ipc::Iostream &ios);
   int set(L4::Ipc::Iostream &ios);
   int multi_setup(L4::Ipc::Iostream &ios);
@@ -124,6 +125,17 @@ Gpio::config_pad(L4::Ipc::Iostream &ios)
   return 0;
 }
 
+int
+Gpio::config_get(L4::Ipc::Iostream &ios)
+{
+  unsigned pin, func, value;
+  ios >> pin >> func;
+  check(pin);
+  _hwd->config_get(pin, _mask, func, &value);
+  ios << value;
+  return 0;
+}
+
 int
 Gpio::get(L4::Ipc::Iostream &ios)
 {
@@ -223,6 +235,7 @@ Gpio::dispatch(l4_umword_t, l4_uint32_t func, L4::Ipc::Iostream &ios)
        {
        case L4VBUS_GPIO_OP_SETUP: return setup(ios);
        case L4VBUS_GPIO_OP_CONFIG_PAD: return config_pad(ios);
+       case L4VBUS_GPIO_OP_CONFIG_GET: return config_get(ios);
        case L4VBUS_GPIO_OP_GET: return get(ios);
        case L4VBUS_GPIO_OP_SET: return set(ios);
        case L4VBUS_GPIO_OP_MULTI_SETUP: return multi_setup(ios);
index eb6e9cb27e790326ad833b95b1c13ddbe90fb9b2..7ed7ce6a7c248fa6b32eb358dc29cb669916ead3 100644 (file)
@@ -78,12 +78,6 @@ kd_display(char *text) L4_NOTHROW;
 L4_INLINE int
 l4kd_inchar(void) L4_NOTHROW;
 
-L4_INLINE void
-l4_sys_cli(void) L4_NOTHROW;
-
-L4_INLINE void
-l4_sys_sti(void) L4_NOTHROW;
-
 /*
  * -------------------------------------------------------------------
  * Implementations
@@ -273,16 +267,4 @@ l4kd_inchar(void) L4_NOTHROW
   return __KDEBUG_ARM_PARAM_0(0xd);
 }
 
-L4_INLINE void
-l4_sys_cli(void) L4_NOTHROW
-{
-  __KDEBUG_ARM_PARAM_0(0x32);
-}
-
-L4_INLINE void
-l4_sys_sti(void) L4_NOTHROW
-{
-  __KDEBUG_ARM_PARAM_0(0x33);
-}
-
 #endif //__GNUC__
index 0745ec6d9d89701484d0b8c6e2cfdbfada3d70ac..039dfcb38ab70486a2b2ce5fc010511a7cde6aaa 100644 (file)
@@ -75,18 +75,9 @@ kd_display(char *text);
 L4_INLINE int
 l4kd_inchar(void);
 
-L4_INLINE void
-l4_sys_cli(void);
-
-L4_INLINE void
-l4_sys_sti(void);
-
 L4_INLINE void
 l4_kdebug_imb(void);
 
-L4_INLINE int
-l4_irq_enabled(void);
-
 L4_INLINE void __touch_ro(const char *x, unsigned len);
 
 L4_INLINE unsigned long
@@ -214,28 +205,11 @@ l4kd_inchar(void)
   return __kdebug_param(0xd, 0, 0);
 }
 
-L4_INLINE void
-l4_sys_cli(void)
-{
-  __kdebug_param(0x32, 0, 0);
-}
-
-L4_INLINE void
-l4_sys_sti(void)
-{
-  __kdebug_param(0x33, 0, 0);
-}
-
 L4_INLINE void
 l4_kdebug_imb(void)
 {
  // __KDEBUG_ARM_PARAM_0(0x3f);
 }
-L4_INLINE int
-l4_irq_enabled(void)
-{
-  return __kdebug_param(0x34, 0, 0);
-}
 #endif //__GNUC__
 
 #endif /* ! __L4SYS__INCLUDE__ARCH_PPC32__KDEBUG_H__ */
index d4ed6fd9c3e8e49dd702739ebffc6149212704a9..8770ea79ad5893b7e51aa395648fbbd2088f627e 100644 (file)
@@ -63,18 +63,9 @@ kd_display(char *text);
 L4_INLINE int
 l4kd_inchar(void);
 
-L4_INLINE void
-l4_sys_cli(void);
-
-L4_INLINE void
-l4_sys_sti(void);
-
 L4_INLINE void
 l4_kdebug_imb(void);
 
-L4_INLINE int
-l4_irq_enabled(void);
-
 L4_INLINE void __touch_ro(const char *x, unsigned len);
 
 L4_INLINE unsigned long
@@ -188,28 +179,11 @@ l4kd_inchar(void)
   return __kdebug_param(0xd, 0, 0);
 }
 
-L4_INLINE void
-l4_sys_cli(void)
-{
-  __kdebug_param(0x32, 0, 0);
-}
-
-L4_INLINE void
-l4_sys_sti(void)
-{
-  __kdebug_param(0x33, 0, 0);
-}
-
 L4_INLINE void
 l4_kdebug_imb(void)
 {
  // __KDEBUG_ARM_PARAM_0(0x3f);
 }
-L4_INLINE int
-l4_irq_enabled(void)
-{
-  return __kdebug_param(0x34, 0, 0);
-}
 #endif //__GNUC__
 
 #endif /* ! __L4SYS__INCLUDE__ARCH_SPARC__KDEBUG_H__ */
index dbe623e886fddb1cf80de4f4695103500119b323..0692e84e3cea9199d3e13283776228cc39a2d912 100644 (file)
@@ -1,5 +1,5 @@
 Provides: libc_be_socket_noop libc_be_l4re libc_support_misc
           libc_be_fs_noop libc_be_math libc_be_l4refile
-         libc_be_minimal_log_io libmount
+         libc_be_minimal_log_io libmount libc_be_sig
 Requires: l4re libsupc++ libl4re-vfs
 Maintainer: adam@os.inf.tu-dresden.de
diff --git a/l4/pkg/libgfortran/Control b/l4/pkg/libgfortran/Control
new file mode 100644 (file)
index 0000000..c659d93
--- /dev/null
@@ -0,0 +1,3 @@
+provides: libgfortran
+requires: libc libstdc++ libc_support_misc libc_be_sig
+Maintainer: jsteckli@os.inf.tu-dresden.de, adam@os.inf.tu-dresden.de
diff --git a/l4/pkg/libgfortran/Makefile b/l4/pkg/libgfortran/Makefile
new file mode 100644 (file)
index 0000000..a6ff4ea
--- /dev/null
@@ -0,0 +1,4 @@
+PKGDIR         = .
+L4DIR          ?= $(PKGDIR)/../..
+
+include $(L4DIR)/mk/subdir.mk
diff --git a/l4/pkg/libgfortran/lib/Makefile b/l4/pkg/libgfortran/lib/Makefile
new file mode 100644 (file)
index 0000000..ea23f74
--- /dev/null
@@ -0,0 +1,6 @@
+PKGDIR ?= ..
+L4DIR  ?= $(PKGDIR)/../..
+
+TARGET = build 
+
+include $(L4DIR)/mk/subdir.mk
diff --git a/l4/pkg/libgfortran/lib/README b/l4/pkg/libgfortran/lib/README
new file mode 100644 (file)
index 0000000..aca7f55
--- /dev/null
@@ -0,0 +1,3 @@
+
+The dist/ directory contains the unmodified contents of libgfortran from gcc 4.7.2.
+
diff --git a/l4/pkg/libgfortran/lib/build/ARCH-amd64/fpu-target.h b/l4/pkg/libgfortran/lib/build/ARCH-amd64/fpu-target.h
new file mode 100644 (file)
index 0000000..d2b7a05
--- /dev/null
@@ -0,0 +1,136 @@
+/* FPU-related code for x86 and x86_64 processors.
+   Copyright 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef __x86_64__
+#include "cpuid.h"
+#endif
+
+#if defined(__sun__) && defined(__svr4__)
+#include <signal.h>
+#include <ucontext.h>
+
+static volatile sig_atomic_t sigill_caught;
+
+static void
+sigill_hdlr (int sig __attribute((unused)),
+            siginfo_t *sip __attribute__((unused)),
+            ucontext_t *ucp)
+{
+  sigill_caught = 1;
+  /* Set PC to the instruction after the faulting one to skip over it,
+     otherwise we enter an infinite loop.  3 is the size of the movaps
+     instruction.  */
+  ucp->uc_mcontext.gregs[EIP] += 3;
+  setcontext (ucp);
+}
+#endif
+
+static int
+has_sse (void)
+{
+#ifndef __x86_64__
+  unsigned int eax, ebx, ecx, edx;
+
+  if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+    return 0;
+
+#if defined(__sun__) && defined(__svr4__)
+  /* Solaris 2 before Solaris 9 4/04 cannot execute SSE instructions even
+     if the CPU supports them.  Programs receive SIGILL instead, so check
+     for that at runtime.  */
+
+  if (edx & bit_SSE)
+    {
+      struct sigaction act, oact;
+
+      act.sa_handler = sigill_hdlr;
+      sigemptyset (&act.sa_mask);
+      /* Need to set SA_SIGINFO so a ucontext_t * is passed to the handler.  */
+      act.sa_flags = SA_SIGINFO;
+      sigaction (SIGILL, &act, &oact);
+
+      /* We need a single SSE instruction here so the handler can safely skip
+        over it.  */
+      __asm__ volatile ("movaps %xmm0,%xmm0");
+
+      sigaction (SIGILL, &oact, NULL);
+
+      if (sigill_caught)
+       return 0;
+    }
+#endif /* __sun__ && __svr4__ */
+
+  return edx & bit_SSE;
+#else
+  return 1;
+#endif
+}
+
+/* i387 -- see linux <fpu_control.h> header file for details.  */
+#define _FPU_MASK_IM  0x01
+#define _FPU_MASK_DM  0x02
+#define _FPU_MASK_ZM  0x04
+#define _FPU_MASK_OM  0x08
+#define _FPU_MASK_UM  0x10
+#define _FPU_MASK_PM  0x20
+
+void set_fpu (void)
+{
+  unsigned short cw;
+
+  asm volatile ("fnstcw %0" : "=m" (cw));
+
+  cw |= (_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM
+        | _FPU_MASK_UM | _FPU_MASK_PM);
+
+  if (options.fpe & GFC_FPE_INVALID) cw &= ~_FPU_MASK_IM;
+  if (options.fpe & GFC_FPE_DENORMAL) cw &= ~_FPU_MASK_DM;
+  if (options.fpe & GFC_FPE_ZERO) cw &= ~_FPU_MASK_ZM;
+  if (options.fpe & GFC_FPE_OVERFLOW) cw &= ~_FPU_MASK_OM;
+  if (options.fpe & GFC_FPE_UNDERFLOW) cw &= ~_FPU_MASK_UM;
+  if (options.fpe & GFC_FPE_INEXACT) cw &= ~_FPU_MASK_PM;
+
+  asm volatile ("fldcw %0" : : "m" (cw));
+
+  if (has_sse())
+    {
+      unsigned int cw_sse;
+
+      asm volatile ("%vstmxcsr %0" : "=m" (cw_sse));
+
+      cw_sse &= 0xffff0000;
+      cw_sse |= (_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM
+                | _FPU_MASK_UM | _FPU_MASK_PM ) << 7;
+
+      if (options.fpe & GFC_FPE_INVALID) cw_sse &= ~(_FPU_MASK_IM << 7);
+      if (options.fpe & GFC_FPE_DENORMAL) cw_sse &= ~(_FPU_MASK_DM << 7);
+      if (options.fpe & GFC_FPE_ZERO) cw_sse &= ~(_FPU_MASK_ZM << 7);
+      if (options.fpe & GFC_FPE_OVERFLOW) cw_sse &= ~(_FPU_MASK_OM << 7);
+      if (options.fpe & GFC_FPE_UNDERFLOW) cw_sse &= ~(_FPU_MASK_UM << 7);
+      if (options.fpe & GFC_FPE_INEXACT) cw_sse &= ~(_FPU_MASK_PM << 7);
+
+      asm volatile ("%vldmxcsr %0" : : "m" (cw_sse));
+    }
+}
diff --git a/l4/pkg/libgfortran/lib/build/ARCH-amd64/kinds.h b/l4/pkg/libgfortran/lib/build/ARCH-amd64/kinds.h
new file mode 100644 (file)
index 0000000..139d69c
--- /dev/null
@@ -0,0 +1,75 @@
+typedef int8_t GFC_INTEGER_1;
+typedef uint8_t GFC_UINTEGER_1;
+typedef GFC_INTEGER_1 GFC_LOGICAL_1;
+#define HAVE_GFC_LOGICAL_1
+#define HAVE_GFC_INTEGER_1
+
+typedef int16_t GFC_INTEGER_2;
+typedef uint16_t GFC_UINTEGER_2;
+typedef GFC_INTEGER_2 GFC_LOGICAL_2;
+#define HAVE_GFC_LOGICAL_2
+#define HAVE_GFC_INTEGER_2
+
+typedef int32_t GFC_INTEGER_4;
+typedef uint32_t GFC_UINTEGER_4;
+typedef GFC_INTEGER_4 GFC_LOGICAL_4;
+#define HAVE_GFC_LOGICAL_4
+#define HAVE_GFC_INTEGER_4
+
+typedef int64_t GFC_INTEGER_8;
+typedef uint64_t GFC_UINTEGER_8;
+typedef GFC_INTEGER_8 GFC_LOGICAL_8;
+#define HAVE_GFC_LOGICAL_8
+#define HAVE_GFC_INTEGER_8
+
+typedef __int128_t GFC_INTEGER_16;
+typedef __uint128_t GFC_UINTEGER_16;
+typedef GFC_INTEGER_16 GFC_LOGICAL_16;
+#define HAVE_GFC_LOGICAL_16
+#define HAVE_GFC_INTEGER_16
+
+#define GFC_INTEGER_LARGEST GFC_INTEGER_16
+#define GFC_UINTEGER_LARGEST GFC_UINTEGER_16
+#define GFC_DEFAULT_CHAR 1
+
+typedef float GFC_REAL_4;
+typedef complex float GFC_COMPLEX_4;
+#define HAVE_GFC_REAL_4
+#define HAVE_GFC_COMPLEX_4
+#define GFC_REAL_4_HUGE 3.40282347e38f
+#define GFC_REAL_4_LITERAL_SUFFIX f
+#define GFC_REAL_4_LITERAL(X) (X ## f)
+#define GFC_REAL_4_DIGITS 24
+#define GFC_REAL_4_RADIX 2
+
+typedef double GFC_REAL_8;
+typedef complex double GFC_COMPLEX_8;
+#define HAVE_GFC_REAL_8
+#define HAVE_GFC_COMPLEX_8
+#define GFC_REAL_8_HUGE 1.7976931348623157e308
+#define GFC_REAL_8_LITERAL_SUFFIX 
+#define GFC_REAL_8_LITERAL(X) (X)
+#define GFC_REAL_8_DIGITS 53
+#define GFC_REAL_8_RADIX 2
+
+typedef long double GFC_REAL_10;
+typedef complex long double GFC_COMPLEX_10;
+#define HAVE_GFC_REAL_10
+#define HAVE_GFC_COMPLEX_10
+#define GFC_REAL_10_HUGE 1.18973149535723176502e4932l
+#define GFC_REAL_10_LITERAL_SUFFIX l
+#define GFC_REAL_10_LITERAL(X) (X ## l)
+#define GFC_REAL_10_DIGITS 64
+#define GFC_REAL_10_RADIX 2
+
+typedef __float128 GFC_REAL_16;
+typedef _Complex float __attribute__((mode(TC))) GFC_COMPLEX_16;
+#define HAVE_GFC_REAL_16
+#define HAVE_GFC_COMPLEX_16
+#define GFC_REAL_16_HUGE 1.18973149535723176508575932662800702e4932q
+#define GFC_REAL_16_LITERAL_SUFFIX q
+#define GFC_REAL_16_LITERAL(X) (X ## q)
+#define GFC_REAL_16_DIGITS 113
+#define GFC_REAL_16_RADIX 2
+
+#include "kinds-override.h"
diff --git a/l4/pkg/libgfortran/lib/build/ARCH-amd64/kinds.inc b/l4/pkg/libgfortran/lib/build/ARCH-amd64/kinds.inc
new file mode 100644 (file)
index 0000000..5f1ade9
--- /dev/null
@@ -0,0 +1,42 @@
+#define HAVE_GFC_LOGICAL_1
+#define HAVE_GFC_INTEGER_1
+#define HAVE_GFC_LOGICAL_2
+#define HAVE_GFC_INTEGER_2
+#define HAVE_GFC_LOGICAL_4
+#define HAVE_GFC_INTEGER_4
+#define HAVE_GFC_LOGICAL_8
+#define HAVE_GFC_INTEGER_8
+#define HAVE_GFC_LOGICAL_16
+#define HAVE_GFC_INTEGER_16
+#define GFC_INTEGER_LARGEST GFC_INTEGER_16
+#define GFC_UINTEGER_LARGEST GFC_UINTEGER_16
+#define GFC_DEFAULT_CHAR 1
+#define HAVE_GFC_REAL_4
+#define HAVE_GFC_COMPLEX_4
+#define GFC_REAL_4_HUGE 3.40282347e38f
+#define GFC_REAL_4_LITERAL_SUFFIX f
+#define GFC_REAL_4_LITERAL(X) (X ## f)
+#define GFC_REAL_4_DIGITS 24
+#define GFC_REAL_4_RADIX 2
+#define HAVE_GFC_REAL_8
+#define HAVE_GFC_COMPLEX_8
+#define GFC_REAL_8_HUGE 1.7976931348623157e308
+#define GFC_REAL_8_LITERAL_SUFFIX 
+#define GFC_REAL_8_LITERAL(X) (X)
+#define GFC_REAL_8_DIGITS 53
+#define GFC_REAL_8_RADIX 2
+#define HAVE_GFC_REAL_10
+#define HAVE_GFC_COMPLEX_10
+#define GFC_REAL_10_HUGE 1.18973149535723176502e4932l
+#define GFC_REAL_10_LITERAL_SUFFIX l
+#define GFC_REAL_10_LITERAL(X) (X ## l)
+#define GFC_REAL_10_DIGITS 64
+#define GFC_REAL_10_RADIX 2
+#define HAVE_GFC_REAL_16
+#define HAVE_GFC_COMPLEX_16
+#define GFC_REAL_16_HUGE 1.18973149535723176508575932662800702e4932q
+#define GFC_REAL_16_LITERAL_SUFFIX q
+#define GFC_REAL_16_LITERAL(X) (X ## q)
+#define GFC_REAL_16_DIGITS 113
+#define GFC_REAL_16_RADIX 2
+#include "kinds-override.h"
diff --git a/l4/pkg/libgfortran/lib/build/ARCH-amd64/selected_int_kind.inc b/l4/pkg/libgfortran/lib/build/ARCH-amd64/selected_int_kind.inc
new file mode 100644 (file)
index 0000000..d7260c0
--- /dev/null
@@ -0,0 +1,7 @@
+  integer, parameter :: c = 5
+  type (int_info), parameter :: int_infos(c) = (/ &
+    int_info (1, range(0_1)), &
+    int_info (2, range(0_2)), &
+    int_info (4, range(0_4)), &
+    int_info (8, range(0_8)), &
+    int_info (16, range(0_16)) /)
diff --git a/l4/pkg/libgfortran/lib/build/ARCH-x86/fpu-target.h b/l4/pkg/libgfortran/lib/build/ARCH-x86/fpu-target.h
new file mode 100644 (file)
index 0000000..d2b7a05
--- /dev/null
@@ -0,0 +1,136 @@
+/* FPU-related code for x86 and x86_64 processors.
+   Copyright 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef __x86_64__
+#include "cpuid.h"
+#endif
+
+#if defined(__sun__) && defined(__svr4__)
+#include <signal.h>
+#include <ucontext.h>
+
+static volatile sig_atomic_t sigill_caught;
+
+static void
+sigill_hdlr (int sig __attribute((unused)),
+            siginfo_t *sip __attribute__((unused)),
+            ucontext_t *ucp)
+{
+  sigill_caught = 1;
+  /* Set PC to the instruction after the faulting one to skip over it,
+     otherwise we enter an infinite loop.  3 is the size of the movaps
+     instruction.  */
+  ucp->uc_mcontext.gregs[EIP] += 3;
+  setcontext (ucp);
+}
+#endif
+
+static int
+has_sse (void)
+{
+#ifndef __x86_64__
+  unsigned int eax, ebx, ecx, edx;
+
+  if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+    return 0;
+
+#if defined(__sun__) && defined(__svr4__)
+  /* Solaris 2 before Solaris 9 4/04 cannot execute SSE instructions even
+     if the CPU supports them.  Programs receive SIGILL instead, so check
+     for that at runtime.  */
+
+  if (edx & bit_SSE)
+    {
+      struct sigaction act, oact;
+
+      act.sa_handler = sigill_hdlr;
+      sigemptyset (&act.sa_mask);
+      /* Need to set SA_SIGINFO so a ucontext_t * is passed to the handler.  */
+      act.sa_flags = SA_SIGINFO;
+      sigaction (SIGILL, &act, &oact);
+
+      /* We need a single SSE instruction here so the handler can safely skip
+        over it.  */
+      __asm__ volatile ("movaps %xmm0,%xmm0");
+
+      sigaction (SIGILL, &oact, NULL);
+
+      if (sigill_caught)
+       return 0;
+    }
+#endif /* __sun__ && __svr4__ */
+
+  return edx & bit_SSE;
+#else
+  return 1;
+#endif
+}
+
+/* i387 -- see linux <fpu_control.h> header file for details.  */
+#define _FPU_MASK_IM  0x01
+#define _FPU_MASK_DM  0x02
+#define _FPU_MASK_ZM  0x04
+#define _FPU_MASK_OM  0x08
+#define _FPU_MASK_UM  0x10
+#define _FPU_MASK_PM  0x20
+
+void set_fpu (void)
+{
+  unsigned short cw;
+
+  asm volatile ("fnstcw %0" : "=m" (cw));
+
+  cw |= (_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM
+        | _FPU_MASK_UM | _FPU_MASK_PM);
+
+  if (options.fpe & GFC_FPE_INVALID) cw &= ~_FPU_MASK_IM;
+  if (options.fpe & GFC_FPE_DENORMAL) cw &= ~_FPU_MASK_DM;
+  if (options.fpe & GFC_FPE_ZERO) cw &= ~_FPU_MASK_ZM;
+  if (options.fpe & GFC_FPE_OVERFLOW) cw &= ~_FPU_MASK_OM;
+  if (options.fpe & GFC_FPE_UNDERFLOW) cw &= ~_FPU_MASK_UM;
+  if (options.fpe & GFC_FPE_INEXACT) cw &= ~_FPU_MASK_PM;
+
+  asm volatile ("fldcw %0" : : "m" (cw));
+
+  if (has_sse())
+    {
+      unsigned int cw_sse;
+
+      asm volatile ("%vstmxcsr %0" : "=m" (cw_sse));
+
+      cw_sse &= 0xffff0000;
+      cw_sse |= (_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM
+                | _FPU_MASK_UM | _FPU_MASK_PM ) << 7;
+
+      if (options.fpe & GFC_FPE_INVALID) cw_sse &= ~(_FPU_MASK_IM << 7);
+      if (options.fpe & GFC_FPE_DENORMAL) cw_sse &= ~(_FPU_MASK_DM << 7);
+      if (options.fpe & GFC_FPE_ZERO) cw_sse &= ~(_FPU_MASK_ZM << 7);
+      if (options.fpe & GFC_FPE_OVERFLOW) cw_sse &= ~(_FPU_MASK_OM << 7);
+      if (options.fpe & GFC_FPE_UNDERFLOW) cw_sse &= ~(_FPU_MASK_UM << 7);
+      if (options.fpe & GFC_FPE_INEXACT) cw_sse &= ~(_FPU_MASK_PM << 7);
+
+      asm volatile ("%vldmxcsr %0" : : "m" (cw_sse));
+    }
+}
diff --git a/l4/pkg/libgfortran/lib/build/ARCH-x86/kinds.h b/l4/pkg/libgfortran/lib/build/ARCH-x86/kinds.h
new file mode 100644 (file)
index 0000000..25991f3
--- /dev/null
@@ -0,0 +1,69 @@
+typedef int8_t GFC_INTEGER_1;
+typedef uint8_t GFC_UINTEGER_1;
+typedef GFC_INTEGER_1 GFC_LOGICAL_1;
+#define HAVE_GFC_LOGICAL_1
+#define HAVE_GFC_INTEGER_1
+
+typedef int16_t GFC_INTEGER_2;
+typedef uint16_t GFC_UINTEGER_2;
+typedef GFC_INTEGER_2 GFC_LOGICAL_2;
+#define HAVE_GFC_LOGICAL_2
+#define HAVE_GFC_INTEGER_2
+
+typedef int32_t GFC_INTEGER_4;
+typedef uint32_t GFC_UINTEGER_4;
+typedef GFC_INTEGER_4 GFC_LOGICAL_4;
+#define HAVE_GFC_LOGICAL_4
+#define HAVE_GFC_INTEGER_4
+
+typedef int64_t GFC_INTEGER_8;
+typedef uint64_t GFC_UINTEGER_8;
+typedef GFC_INTEGER_8 GFC_LOGICAL_8;
+#define HAVE_GFC_LOGICAL_8
+#define HAVE_GFC_INTEGER_8
+
+#define GFC_INTEGER_LARGEST GFC_INTEGER_8
+#define GFC_UINTEGER_LARGEST GFC_UINTEGER_8
+#define GFC_DEFAULT_CHAR 1
+
+typedef float GFC_REAL_4;
+typedef complex float GFC_COMPLEX_4;
+#define HAVE_GFC_REAL_4
+#define HAVE_GFC_COMPLEX_4
+#define GFC_REAL_4_HUGE 3.40282347e38f
+#define GFC_REAL_4_LITERAL_SUFFIX f
+#define GFC_REAL_4_LITERAL(X) (X ## f)
+#define GFC_REAL_4_DIGITS 24
+#define GFC_REAL_4_RADIX 2
+
+typedef double GFC_REAL_8;
+typedef complex double GFC_COMPLEX_8;
+#define HAVE_GFC_REAL_8
+#define HAVE_GFC_COMPLEX_8
+#define GFC_REAL_8_HUGE 1.7976931348623157e308
+#define GFC_REAL_8_LITERAL_SUFFIX 
+#define GFC_REAL_8_LITERAL(X) (X)
+#define GFC_REAL_8_DIGITS 53
+#define GFC_REAL_8_RADIX 2
+
+typedef long double GFC_REAL_10;
+typedef complex long double GFC_COMPLEX_10;
+#define HAVE_GFC_REAL_10
+#define HAVE_GFC_COMPLEX_10
+#define GFC_REAL_10_HUGE 1.18973149535723176502e4932l
+#define GFC_REAL_10_LITERAL_SUFFIX l
+#define GFC_REAL_10_LITERAL(X) (X ## l)
+#define GFC_REAL_10_DIGITS 64
+#define GFC_REAL_10_RADIX 2
+
+typedef __float128 GFC_REAL_16;
+typedef _Complex float __attribute__((mode(TC))) GFC_COMPLEX_16;
+#define HAVE_GFC_REAL_16
+#define HAVE_GFC_COMPLEX_16
+#define GFC_REAL_16_HUGE 1.18973149535723176508575932662800702e4932q
+#define GFC_REAL_16_LITERAL_SUFFIX q
+#define GFC_REAL_16_LITERAL(X) (X ## q)
+#define GFC_REAL_16_DIGITS 113
+#define GFC_REAL_16_RADIX 2
+
+#include "kinds-override.h"
diff --git a/l4/pkg/libgfortran/lib/build/ARCH-x86/kinds.inc b/l4/pkg/libgfortran/lib/build/ARCH-x86/kinds.inc
new file mode 100644 (file)
index 0000000..b18bcba
--- /dev/null
@@ -0,0 +1,40 @@
+#define HAVE_GFC_LOGICAL_1
+#define HAVE_GFC_INTEGER_1
+#define HAVE_GFC_LOGICAL_2
+#define HAVE_GFC_INTEGER_2
+#define HAVE_GFC_LOGICAL_4
+#define HAVE_GFC_INTEGER_4
+#define HAVE_GFC_LOGICAL_8
+#define HAVE_GFC_INTEGER_8
+#define GFC_INTEGER_LARGEST GFC_INTEGER_8
+#define GFC_UINTEGER_LARGEST GFC_UINTEGER_8
+#define GFC_DEFAULT_CHAR 1
+#define HAVE_GFC_REAL_4
+#define HAVE_GFC_COMPLEX_4
+#define GFC_REAL_4_HUGE 3.40282347e38f
+#define GFC_REAL_4_LITERAL_SUFFIX f
+#define GFC_REAL_4_LITERAL(X) (X ## f)
+#define GFC_REAL_4_DIGITS 24
+#define GFC_REAL_4_RADIX 2
+#define HAVE_GFC_REAL_8
+#define HAVE_GFC_COMPLEX_8
+#define GFC_REAL_8_HUGE 1.7976931348623157e308
+#define GFC_REAL_8_LITERAL_SUFFIX 
+#define GFC_REAL_8_LITERAL(X) (X)
+#define GFC_REAL_8_DIGITS 53
+#define GFC_REAL_8_RADIX 2
+#define HAVE_GFC_REAL_10
+#define HAVE_GFC_COMPLEX_10
+#define GFC_REAL_10_HUGE 1.18973149535723176502e4932l
+#define GFC_REAL_10_LITERAL_SUFFIX l
+#define GFC_REAL_10_LITERAL(X) (X ## l)
+#define GFC_REAL_10_DIGITS 64
+#define GFC_REAL_10_RADIX 2
+#define HAVE_GFC_REAL_16
+#define HAVE_GFC_COMPLEX_16
+#define GFC_REAL_16_HUGE 1.18973149535723176508575932662800702e4932q
+#define GFC_REAL_16_LITERAL_SUFFIX q
+#define GFC_REAL_16_LITERAL(X) (X ## q)
+#define GFC_REAL_16_DIGITS 113
+#define GFC_REAL_16_RADIX 2
+#include "kinds-override.h"
diff --git a/l4/pkg/libgfortran/lib/build/ARCH-x86/selected_int_kind.inc b/l4/pkg/libgfortran/lib/build/ARCH-x86/selected_int_kind.inc
new file mode 100644 (file)
index 0000000..e252eef
--- /dev/null
@@ -0,0 +1,6 @@
+  integer, parameter :: c = 4
+  type (int_info), parameter :: int_infos(c) = (/ &
+    int_info (1, range(0_1)), &
+    int_info (2, range(0_2)), &
+    int_info (4, range(0_4)), &
+    int_info (8, range(0_8)) /)
diff --git a/l4/pkg/libgfortran/lib/build/Makefile b/l4/pkg/libgfortran/lib/build/Makefile
new file mode 100644 (file)
index 0000000..ef784d8
--- /dev/null
@@ -0,0 +1,36 @@
+PKGDIR          ?= ../..
+L4DIR           ?= $(PKGDIR)/../..
+
+TARGET          = libgfortran.a libgfortran.so libgfortranbegin.a
+PC_FILENAMES   = libgfortran
+
+# The -fallow-leading-underscore is only needed for some Fortran
+# files, but it does not hurt for all the others.
+CFLAGS         += -fcx-fortran-rules -ftree-vectorize -funroll-loops
+FFLAGS         += -fno-underscoring -fimplicit-none -fno-repack-arrays \
+                  -fallow-leading-underscore \
+                  -ftree-vectorize -funroll-loops
+
+include $(L4DIR)/mk/Makeconf
+
+REQUIRES_LIBS = libc_be_sig libc_support_misc libstdc++ libc
+
+include $(SRC_DIR)/Makefile.dist-c
+include $(SRC_DIR)/Makefile.dist-f
+
+SRC_C_libgfortran.a      = $(C_FILES)
+SRC_F_libgfortran.a      = $(F_FILES)
+SRC_C_libgfortran.so     = $(C_FILES)
+SRC_F_libgfortran.so     = $(F_FILES)
+SRC_C_libgfortranbegin.a = fmain.c
+
+CONTRIB_DIR     = $(SRC_DIR)/../contrib
+PRIVATE_INCDIR  = $(SRC_DIR) $(SRC_DIR)/include $(CONTRIB_DIR)
+PRIVATE_INCDIR += $(SRC_DIR)/ARCH-$(ARCH)
+PRIVATE_INCDIR += $(OBJ_BASE)/include/contrib/libstdc++-v3/bits
+
+vpath %.c   $(CONTRIB_DIR)
+vpath %.f90 $(CONTRIB_DIR)
+vpath %.F90 $(CONTRIB_DIR)
+
+include $(L4DIR)/mk/lib.mk
diff --git a/l4/pkg/libgfortran/lib/build/Makefile.dist-c b/l4/pkg/libgfortran/lib/build/Makefile.dist-c
new file mode 100644 (file)
index 0000000..ca53b2e
--- /dev/null
@@ -0,0 +1,468 @@
+C_FILES += \
+io/close.c \
+io/file_pos.c \
+io/format.c \
+io/inquire.c \
+io/intrinsics.c \
+io/list_read.c \
+io/lock.c \
+io/open.c \
+io/read.c \
+io/size_from_kind.c \
+io/transfer.c \
+io/transfer128.c \
+io/unit.c \
+io/unix.c \
+io/write.c \
+io/fbuf.c \
+intrinsics/associated.c \
+intrinsics/abort.c \
+intrinsics/access.c \
+intrinsics/args.c \
+intrinsics/bit_intrinsics.c \
+intrinsics/c99_functions.c \
+intrinsics/chdir.c \
+intrinsics/chmod.c \
+intrinsics/clock.c \
+intrinsics/cpu_time.c \
+intrinsics/cshift0.c \
+intrinsics/ctime.c \
+intrinsics/date_and_time.c \
+intrinsics/dtime.c \
+intrinsics/env.c \
+intrinsics/eoshift0.c \
+intrinsics/eoshift2.c \
+intrinsics/erfc_scaled.c \
+intrinsics/etime.c \
+intrinsics/execute_command_line.c \
+intrinsics/exit.c \
+intrinsics/extends_type_of.c \
+intrinsics/fnum.c \
+intrinsics/gerror.c \
+intrinsics/getcwd.c \
+intrinsics/getlog.c \
+intrinsics/getXid.c \
+intrinsics/hostnm.c \
+intrinsics/ierrno.c \
+intrinsics/ishftc.c \
+intrinsics/iso_c_generated_procs.c \
+intrinsics/iso_c_binding.c \
+intrinsics/kill.c \
+intrinsics/link.c \
+intrinsics/malloc.c \
+intrinsics/mvbits.c \
+intrinsics/move_alloc.c \
+intrinsics/pack_generic.c \
+intrinsics/perror.c \
+intrinsics/selected_char_kind.c \
+intrinsics/signal.c \
+intrinsics/size.c \
+intrinsics/sleep.c \
+intrinsics/spread_generic.c \
+intrinsics/string_intrinsics.c \
+intrinsics/system.c \
+intrinsics/rand.c \
+intrinsics/random.c \
+intrinsics/rename.c \
+intrinsics/reshape_generic.c \
+intrinsics/reshape_packed.c \
+intrinsics/stat.c \
+intrinsics/symlnk.c \
+intrinsics/system_clock.c \
+intrinsics/time.c \
+intrinsics/transpose_generic.c \
+intrinsics/umask.c \
+intrinsics/unlink.c \
+intrinsics/unpack_generic.c \
+runtime/in_pack_generic.c \
+runtime/in_unpack_generic.c \
+runtime/backtrace.c \
+runtime/bounds.c \
+runtime/compile_options.c \
+runtime/convert_char.c \
+runtime/environ.c \
+runtime/error.c \
+runtime/fpu.c \
+runtime/main.c \
+runtime/memory.c \
+runtime/pause.c \
+runtime/stop.c \
+runtime/string.c \
+runtime/select.c \
+generated/all_l1.c \
+generated/all_l2.c \
+generated/all_l4.c \
+generated/all_l8.c \
+generated/all_l16.c \
+generated/any_l1.c \
+generated/any_l2.c \
+generated/any_l4.c \
+generated/any_l8.c \
+generated/any_l16.c \
+generated/bessel_r4.c \
+generated/bessel_r8.c \
+generated/bessel_r10.c \
+generated/bessel_r16.c \
+generated/count_1_l.c \
+generated/count_2_l.c \
+generated/count_4_l.c \
+generated/count_8_l.c \
+generated/count_16_l.c \
+generated/iall_i1.c \
+generated/iall_i2.c \
+generated/iall_i4.c \
+generated/iall_i8.c \
+generated/iall_i16.c \
+generated/iany_i1.c \
+generated/iany_i2.c \
+generated/iany_i4.c \
+generated/iany_i8.c \
+generated/iany_i16.c \
+generated/iparity_i1.c \
+generated/iparity_i2.c \
+generated/iparity_i4.c \
+generated/iparity_i8.c \
+generated/iparity_i16.c \
+generated/maxloc0_4_i1.c \
+generated/maxloc0_8_i1.c \
+generated/maxloc0_16_i1.c \
+generated/maxloc0_4_i2.c \
+generated/maxloc0_8_i2.c \
+generated/maxloc0_16_i2.c \
+generated/maxloc0_4_i4.c \
+generated/maxloc0_8_i4.c \
+generated/maxloc0_16_i4.c \
+generated/maxloc0_4_i8.c \
+generated/maxloc0_8_i8.c \
+generated/maxloc0_16_i8.c \
+generated/maxloc0_4_i16.c \
+generated/maxloc0_8_i16.c \
+generated/maxloc0_16_i16.c \
+generated/maxloc0_4_r4.c \
+generated/maxloc0_8_r4.c \
+generated/maxloc0_16_r4.c \
+generated/maxloc0_4_r8.c \
+generated/maxloc0_8_r8.c \
+generated/maxloc0_16_r8.c \
+generated/maxloc0_4_r10.c \
+generated/maxloc0_8_r10.c \
+generated/maxloc0_16_r10.c \
+generated/maxloc0_4_r16.c \
+generated/maxloc0_8_r16.c \
+generated/maxloc0_16_r16.c \
+generated/maxloc1_4_i1.c \
+generated/maxloc1_8_i1.c \
+generated/maxloc1_16_i1.c \
+generated/maxloc1_4_i2.c \
+generated/maxloc1_8_i2.c \
+generated/maxloc1_16_i2.c \
+generated/maxloc1_4_i4.c \
+generated/maxloc1_8_i4.c \
+generated/maxloc1_16_i4.c \
+generated/maxloc1_4_i8.c \
+generated/maxloc1_8_i8.c \
+generated/maxloc1_16_i8.c \
+generated/maxloc1_4_i16.c \
+generated/maxloc1_8_i16.c \
+generated/maxloc1_16_i16.c \
+generated/maxloc1_4_r4.c \
+generated/maxloc1_8_r4.c \
+generated/maxloc1_16_r4.c \
+generated/maxloc1_4_r8.c \
+generated/maxloc1_8_r8.c \
+generated/maxloc1_16_r8.c \
+generated/maxloc1_4_r10.c \
+generated/maxloc1_8_r10.c \
+generated/maxloc1_16_r10.c \
+generated/maxloc1_4_r16.c \
+generated/maxloc1_8_r16.c \
+generated/maxloc1_16_r16.c \
+generated/maxval_i1.c \
+generated/maxval_i2.c \
+generated/maxval_i4.c \
+generated/maxval_i8.c \
+generated/maxval_i16.c \
+generated/maxval_r4.c \
+generated/maxval_r8.c \
+generated/maxval_r10.c \
+generated/maxval_r16.c \
+generated/minloc0_4_i1.c \
+generated/minloc0_8_i1.c \
+generated/minloc0_16_i1.c \
+generated/minloc0_4_i2.c \
+generated/minloc0_8_i2.c \
+generated/minloc0_16_i2.c \
+generated/minloc0_4_i4.c \
+generated/minloc0_8_i4.c \
+generated/minloc0_16_i4.c \
+generated/minloc0_4_i8.c \
+generated/minloc0_8_i8.c \
+generated/minloc0_16_i8.c \
+generated/minloc0_4_i16.c \
+generated/minloc0_8_i16.c \
+generated/minloc0_16_i16.c \
+generated/minloc0_4_r4.c \
+generated/minloc0_8_r4.c \
+generated/minloc0_16_r4.c \
+generated/minloc0_4_r8.c \
+generated/minloc0_8_r8.c \
+generated/minloc0_16_r8.c \
+generated/minloc0_4_r10.c \
+generated/minloc0_8_r10.c \
+generated/minloc0_16_r10.c \
+generated/minloc0_4_r16.c \
+generated/minloc0_8_r16.c \
+generated/minloc0_16_r16.c \
+generated/minloc1_4_i1.c \
+generated/minloc1_8_i1.c \
+generated/minloc1_16_i1.c \
+generated/minloc1_4_i2.c \
+generated/minloc1_8_i2.c \
+generated/minloc1_16_i2.c \
+generated/minloc1_4_i4.c \
+generated/minloc1_8_i4.c \
+generated/minloc1_16_i4.c \
+generated/minloc1_4_i8.c \
+generated/minloc1_8_i8.c \
+generated/minloc1_16_i8.c \
+generated/minloc1_4_i16.c \
+generated/minloc1_8_i16.c \
+generated/minloc1_16_i16.c \
+generated/minloc1_4_r4.c \
+generated/minloc1_8_r4.c \
+generated/minloc1_16_r4.c \
+generated/minloc1_4_r8.c \
+generated/minloc1_8_r8.c \
+generated/minloc1_16_r8.c \
+generated/minloc1_4_r10.c \
+generated/minloc1_8_r10.c \
+generated/minloc1_16_r10.c \
+generated/minloc1_4_r16.c \
+generated/minloc1_8_r16.c \
+generated/minloc1_16_r16.c \
+generated/minval_i1.c \
+generated/minval_i2.c \
+generated/minval_i4.c \
+generated/minval_i8.c \
+generated/minval_i16.c \
+generated/minval_r4.c \
+generated/minval_r8.c \
+generated/minval_r10.c \
+generated/minval_r16.c \
+generated/norm2_r4.c \
+generated/norm2_r8.c \
+generated/norm2_r10.c \
+generated/norm2_r16.c \
+generated/parity_l1.c \
+generated/parity_l2.c \
+generated/parity_l4.c \
+generated/parity_l8.c \
+generated/parity_l16.c \
+generated/sum_i1.c \
+generated/sum_i2.c \
+generated/sum_i4.c \
+generated/sum_i8.c \
+generated/sum_i16.c \
+generated/sum_r4.c \
+generated/sum_r8.c \
+generated/sum_r10.c \
+generated/sum_r16.c \
+generated/sum_c4.c \
+generated/sum_c8.c \
+generated/sum_c10.c \
+generated/sum_c16.c \
+generated/product_i1.c \
+generated/product_i2.c \
+generated/product_i4.c \
+generated/product_i8.c \
+generated/product_i16.c \
+generated/product_r4.c \
+generated/product_r8.c \
+generated/product_r10.c \
+generated/product_r16.c \
+generated/product_c4.c \
+generated/product_c8.c \
+generated/product_c10.c \
+generated/product_c16.c \
+generated/matmul_i1.c \
+generated/matmul_i2.c \
+generated/matmul_i4.c \
+generated/matmul_i8.c \
+generated/matmul_i16.c \
+generated/matmul_r4.c \
+generated/matmul_r8.c \
+generated/matmul_r10.c \
+generated/matmul_r16.c \
+generated/matmul_c4.c \
+generated/matmul_c8.c \
+generated/matmul_c10.c \
+generated/matmul_c16.c \
+generated/matmul_l4.c \
+generated/matmul_l8.c \
+generated/matmul_l16.c \
+generated/transpose_i4.c \
+generated/transpose_i8.c \
+generated/transpose_i16.c \
+generated/transpose_r4.c \
+generated/transpose_r8.c \
+generated/transpose_r10.c \
+generated/transpose_r16.c \
+generated/transpose_c4.c \
+generated/transpose_c8.c \
+generated/transpose_c10.c \
+generated/transpose_c16.c \
+generated/shape_i4.c \
+generated/shape_i8.c \
+generated/shape_i16.c \
+generated/reshape_i4.c \
+generated/reshape_i8.c \
+generated/reshape_i16.c \
+generated/reshape_r4.c \
+generated/reshape_r8.c \
+generated/reshape_r10.c \
+generated/reshape_r16.c \
+generated/reshape_c4.c \
+generated/reshape_c8.c \
+generated/reshape_c10.c \
+generated/reshape_c16.c \
+generated/eoshift1_4.c \
+generated/eoshift1_8.c \
+generated/eoshift1_16.c \
+generated/eoshift3_4.c \
+generated/eoshift3_8.c \
+generated/eoshift3_16.c \
+generated/cshift0_i1.c \
+generated/cshift0_i2.c \
+generated/cshift0_i4.c \
+generated/cshift0_i8.c \
+generated/cshift0_i16.c \
+generated/cshift0_r4.c \
+generated/cshift0_r8.c \
+generated/cshift0_r10.c \
+generated/cshift0_r16.c \
+generated/cshift0_c4.c \
+generated/cshift0_c8.c \
+generated/cshift0_c10.c \
+generated/cshift0_c16.c \
+generated/cshift1_4.c \
+generated/cshift1_8.c \
+generated/cshift1_16.c \
+generated/in_pack_i1.c \
+generated/in_pack_i2.c \
+generated/in_pack_i4.c \
+generated/in_pack_i8.c \
+generated/in_pack_i16.c \
+generated/in_pack_r4.c \
+generated/in_pack_r8.c \
+generated/in_pack_r10.c \
+generated/in_pack_r16.c \
+generated/in_pack_c4.c \
+generated/in_pack_c8.c \
+generated/in_pack_c10.c \
+generated/in_pack_c16.c \
+generated/in_unpack_i1.c \
+generated/in_unpack_i2.c \
+generated/in_unpack_i4.c \
+generated/in_unpack_i8.c \
+generated/in_unpack_i16.c \
+generated/in_unpack_r4.c \
+generated/in_unpack_r8.c \
+generated/in_unpack_r10.c \
+generated/in_unpack_r16.c \
+generated/in_unpack_c4.c \
+generated/in_unpack_c8.c \
+generated/in_unpack_c10.c \
+generated/in_unpack_c16.c \
+generated/exponent_r4.c \
+generated/exponent_r8.c \
+generated/exponent_r10.c \
+generated/exponent_r16.c \
+generated/spacing_r4.c \
+generated/spacing_r8.c \
+generated/spacing_r10.c \
+generated/spacing_r16.c \
+generated/rrspacing_r4.c \
+generated/rrspacing_r8.c \
+generated/rrspacing_r10.c \
+generated/rrspacing_r16.c \
+generated/fraction_r4.c \
+generated/fraction_r8.c \
+generated/fraction_r10.c \
+generated/fraction_r16.c \
+generated/nearest_r4.c \
+generated/nearest_r8.c \
+generated/nearest_r10.c \
+generated/nearest_r16.c \
+generated/set_exponent_r4.c \
+generated/set_exponent_r8.c \
+generated/set_exponent_r10.c \
+generated/set_exponent_r16.c \
+generated/pow_i4_i4.c \
+generated/pow_i8_i4.c \
+generated/pow_i16_i4.c \
+generated/pow_r16_i4.c \
+generated/pow_c4_i4.c \
+generated/pow_c8_i4.c \
+generated/pow_c10_i4.c \
+generated/pow_c16_i4.c \
+generated/pow_i4_i8.c \
+generated/pow_i8_i8.c \
+generated/pow_i16_i8.c \
+generated/pow_r4_i8.c \
+generated/pow_r8_i8.c \
+generated/pow_r10_i8.c \
+generated/pow_r16_i8.c \
+generated/pow_c4_i8.c \
+generated/pow_c8_i8.c \
+generated/pow_c10_i8.c \
+generated/pow_c16_i8.c \
+generated/pow_i4_i16.c \
+generated/pow_i8_i16.c \
+generated/pow_i16_i16.c \
+generated/pow_r4_i16.c \
+generated/pow_r8_i16.c \
+generated/pow_r10_i16.c \
+generated/pow_r16_i16.c \
+generated/pow_c4_i16.c \
+generated/pow_c8_i16.c \
+generated/pow_c10_i16.c \
+generated/pow_c16_i16.c \
+generated/pack_i1.c \
+generated/pack_i2.c \
+generated/pack_i4.c \
+generated/pack_i8.c \
+generated/pack_i16.c \
+generated/pack_r4.c \
+generated/pack_r8.c \
+generated/pack_r10.c \
+generated/pack_r16.c \
+generated/pack_c4.c \
+generated/pack_c8.c \
+generated/pack_c10.c \
+generated/pack_c16.c \
+generated/unpack_i1.c \
+generated/unpack_i2.c \
+generated/unpack_i4.c \
+generated/unpack_i8.c \
+generated/unpack_i16.c \
+generated/unpack_r4.c \
+generated/unpack_r8.c \
+generated/unpack_r10.c \
+generated/unpack_r16.c \
+generated/unpack_c4.c \
+generated/unpack_c8.c \
+generated/unpack_c10.c \
+generated/unpack_c16.c \
+generated/spread_i1.c \
+generated/spread_i2.c \
+generated/spread_i4.c \
+generated/spread_i8.c \
+generated/spread_i16.c \
+generated/spread_r4.c \
+generated/spread_r8.c \
+generated/spread_r10.c \
+generated/spread_r16.c \
+generated/spread_c4.c \
+generated/spread_c8.c \
+generated/spread_c10.c \
+generated/spread_c16.c 
diff --git a/l4/pkg/libgfortran/lib/build/Makefile.dist-f b/l4/pkg/libgfortran/lib/build/Makefile.dist-f
new file mode 100644 (file)
index 0000000..50a65c8
--- /dev/null
@@ -0,0 +1,140 @@
+F_FILES += \
+intrinsics/selected_real_kind.f90 \
+intrinsics/selected_int_kind.f90 \
+generated/_abs_c4.F90 \
+generated/_abs_c8.F90 \
+generated/_abs_c10.F90 \
+generated/_abs_c16.F90 \
+generated/_abs_i4.F90 \
+generated/_abs_i8.F90 \
+generated/_abs_i16.F90 \
+generated/_abs_r4.F90 \
+generated/_abs_r8.F90 \
+generated/_abs_r10.F90 \
+generated/_abs_r16.F90 \
+generated/_aimag_c4.F90 \
+generated/_aimag_c8.F90 \
+generated/_aimag_c10.F90 \
+generated/_aimag_c16.F90 \
+generated/_exp_r4.F90 \
+generated/_exp_r8.F90 \
+generated/_exp_r10.F90 \
+generated/_exp_r16.F90 \
+generated/_exp_c4.F90 \
+generated/_exp_c8.F90 \
+generated/_exp_c10.F90 \
+generated/_exp_c16.F90 \
+generated/_log_r4.F90 \
+generated/_log_r8.F90 \
+generated/_log_r10.F90 \
+generated/_log_r16.F90 \
+generated/_log_c4.F90 \
+generated/_log_c8.F90 \
+generated/_log_c10.F90 \
+generated/_log_c16.F90 \
+generated/_log10_r4.F90 \
+generated/_log10_r8.F90 \
+generated/_log10_r10.F90 \
+generated/_log10_r16.F90 \
+generated/_sqrt_r4.F90 \
+generated/_sqrt_r8.F90 \
+generated/_sqrt_r10.F90 \
+generated/_sqrt_r16.F90 \
+generated/_sqrt_c4.F90 \
+generated/_sqrt_c8.F90 \
+generated/_sqrt_c10.F90 \
+generated/_sqrt_c16.F90 \
+generated/_asin_r4.F90 \
+generated/_asin_r8.F90 \
+generated/_asin_r10.F90 \
+generated/_asin_r16.F90 \
+generated/_asinh_r4.F90 \
+generated/_asinh_r8.F90 \
+generated/_asinh_r10.F90 \
+generated/_asinh_r16.F90 \
+generated/_acos_r4.F90 \
+generated/_acos_r8.F90 \
+generated/_acos_r10.F90 \
+generated/_acos_r16.F90 \
+generated/_acosh_r4.F90 \
+generated/_acosh_r8.F90 \
+generated/_acosh_r10.F90 \
+generated/_acosh_r16.F90 \
+generated/_atan_r4.F90 \
+generated/_atan_r8.F90 \
+generated/_atan_r10.F90 \
+generated/_atan_r16.F90 \
+generated/_atanh_r4.F90 \
+generated/_atanh_r8.F90 \
+generated/_atanh_r10.F90 \
+generated/_atanh_r16.F90 \
+generated/_sin_r4.F90 \
+generated/_sin_r8.F90 \
+generated/_sin_r10.F90 \
+generated/_sin_r16.F90 \
+generated/_sin_c4.F90 \
+generated/_sin_c8.F90 \
+generated/_sin_c10.F90 \
+generated/_sin_c16.F90 \
+generated/_cos_r4.F90 \
+generated/_cos_r8.F90 \
+generated/_cos_r10.F90 \
+generated/_cos_r16.F90 \
+generated/_cos_c4.F90 \
+generated/_cos_c8.F90 \
+generated/_cos_c10.F90 \
+generated/_cos_c16.F90 \
+generated/_tan_r4.F90 \
+generated/_tan_r8.F90 \
+generated/_tan_r10.F90 \
+generated/_tan_r16.F90 \
+generated/_sinh_r4.F90 \
+generated/_sinh_r8.F90 \
+generated/_sinh_r10.F90 \
+generated/_sinh_r16.F90 \
+generated/_cosh_r4.F90 \
+generated/_cosh_r8.F90 \
+generated/_cosh_r10.F90 \
+generated/_cosh_r16.F90 \
+generated/_tanh_r4.F90 \
+generated/_tanh_r8.F90 \
+generated/_tanh_r10.F90 \
+generated/_tanh_r16.F90 \
+generated/_conjg_c4.F90 \
+generated/_conjg_c8.F90 \
+generated/_conjg_c10.F90 \
+generated/_conjg_c16.F90 \
+generated/_aint_r4.F90 \
+generated/_aint_r8.F90 \
+generated/_aint_r10.F90 \
+generated/_aint_r16.F90 \
+generated/_anint_r4.F90 \
+generated/_anint_r8.F90 \
+generated/_anint_r10.F90 \
+generated/_anint_r16.F90 \
+generated/_sign_i4.F90 \
+generated/_sign_i8.F90 \
+generated/_sign_i16.F90 \
+generated/_sign_r4.F90 \
+generated/_sign_r8.F90 \
+generated/_sign_r10.F90 \
+generated/_sign_r16.F90 \
+generated/_dim_i4.F90 \
+generated/_dim_i8.F90 \
+generated/_dim_i16.F90 \
+generated/_dim_r4.F90 \
+generated/_dim_r8.F90 \
+generated/_dim_r10.F90 \
+generated/_dim_r16.F90 \
+generated/_atan2_r4.F90 \
+generated/_atan2_r8.F90 \
+generated/_atan2_r10.F90 \
+generated/_atan2_r16.F90 \
+generated/_mod_i4.F90 \
+generated/_mod_i8.F90 \
+generated/_mod_i16.F90 \
+generated/_mod_r4.F90 \
+generated/_mod_r8.F90 \
+generated/_mod_r10.F90 \
+generated/_mod_r16.F90 \
+generated/misc_specifics.F90
diff --git a/l4/pkg/libgfortran/lib/build/gstdint.h b/l4/pkg/libgfortran/lib/build/gstdint.h
new file mode 100644 (file)
index 0000000..1ad8ad8
--- /dev/null
@@ -0,0 +1,4 @@
+
+#pragma once
+
+#include <stdint.h>
diff --git a/l4/pkg/libgfortran/lib/build/include/c99_protos.inc b/l4/pkg/libgfortran/lib/build/include/c99_protos.inc
new file mode 100644 (file)
index 0000000..9b726e9
--- /dev/null
@@ -0,0 +1,336 @@
+#ifndef C99_PROTOS_H
+#define C99_PROTOS_H 1
+#ifndef HAVE_ACOSF
+#define HAVE_ACOSF 1
+#endif
+#if HAVE_ACOSH && !HAVE_ACOSHF
+#define HAVE_ACOSHF 1
+#endif
+#ifndef HAVE_ASINF
+#define HAVE_ASINF 1
+#endif
+#if HAVE_ASINH && !HAVE_ASINHF
+#define HAVE_ASINHF 1
+#endif
+#ifndef HAVE_ATAN2F
+#define HAVE_ATAN2F 1
+#endif
+#ifndef HAVE_ATANF
+#define HAVE_ATANF 1
+#endif
+#if HAVE_ATANH && !HAVE_ATANHF
+#define HAVE_ATANHF 1
+#endif
+#ifndef HAVE_CEILF
+#define HAVE_CEILF 1
+#endif
+#ifndef HAVE_COPYSIGNF
+#define HAVE_COPYSIGNF 1
+#endif
+#ifndef HAVE_COSF
+#define HAVE_COSF 1
+#endif
+#ifndef HAVE_COSHF
+#define HAVE_COSHF 1
+#endif
+#ifndef HAVE_EXPF
+#define HAVE_EXPF 1
+#endif
+#ifndef HAVE_FABSF
+#define HAVE_FABSF 1
+#endif
+#ifndef HAVE_FLOORF
+#define HAVE_FLOORF 1
+#endif
+#ifndef HAVE_FLOORL
+#define HAVE_FLOORL 1
+#endif
+#ifndef HAVE_FMODF
+#define HAVE_FMODF 1
+#endif
+#ifndef HAVE_FMODL
+#define HAVE_FMODL 1
+#endif
+#ifndef HAVE_FREXPF
+#define HAVE_FREXPF 1
+#endif
+#ifndef HAVE_HYPOTF
+#define HAVE_HYPOTF 1
+#endif
+#ifndef HAVE_LOGF
+#define HAVE_LOGF 1
+#endif
+#ifndef HAVE_LOG10F
+#define HAVE_LOG10F 1
+#endif
+#ifndef HAVE_SCALBN
+#define HAVE_SCALBN 1
+#endif
+#ifndef HAVE_SCALBNF
+#define HAVE_SCALBNF 1
+#endif
+#ifndef HAVE_SINF
+#define HAVE_SINF 1
+#endif
+#ifndef HAVE_SINHF
+#define HAVE_SINHF 1
+#endif
+#ifndef HAVE_SQRTF
+#define HAVE_SQRTF 1
+#endif
+#ifndef HAVE_TANF
+#define HAVE_TANF 1
+#endif
+#ifndef HAVE_TANHF
+#define HAVE_TANHF 1
+#endif
+#ifndef HAVE_TRUNC
+#define HAVE_TRUNC 1
+#endif
+#ifndef HAVE_TRUNCF
+#define HAVE_TRUNCF 1
+#endif
+#ifndef HAVE_NEXTAFTERF
+#define HAVE_NEXTAFTERF 1
+#endif
+#ifndef HAVE_POWF
+#define HAVE_POWF 1
+#endif
+#ifndef HAVE_ROUND
+#define HAVE_ROUND 1
+#endif
+#ifndef HAVE_ROUNDF
+#define HAVE_ROUNDF 1
+#endif
+#if !defined(HAVE_ROUNDL)
+#define HAVE_ROUNDL 1
+#endif
+#if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
+#define HAVE_LROUNDF 1
+#endif
+#if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
+#define HAVE_LROUND 1
+#endif
+#if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
+#define HAVE_LROUNDL 1
+#endif
+#if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
+#define HAVE_LLROUNDF 1
+#endif
+#if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
+#define HAVE_LLROUND 1
+#endif
+#if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
+#define HAVE_LLROUNDL 1
+#endif
+#if defined(HAVE_J0) && ! defined(HAVE_J0F)
+#define HAVE_J0F 1
+#endif
+#if defined(HAVE_J1) && !defined(HAVE_J1F)
+#define HAVE_J1F 1
+#endif
+#if defined(HAVE_JN) && !defined(HAVE_JNF)
+#define HAVE_JNF 1
+#endif
+#if defined(HAVE_Y0) && !defined(HAVE_Y0F)
+#define HAVE_Y0F 1
+#endif
+#if defined(HAVE_Y1) && !defined(HAVE_Y1F)
+#define HAVE_Y1F 1
+#endif
+#if defined(HAVE_YN) && !defined(HAVE_YNF)
+#define HAVE_YNF 1
+#endif
+#if defined(HAVE_ERF) && !defined(HAVE_ERFF)
+#define HAVE_ERFF 1
+#endif
+#if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
+#define HAVE_ERFCF 1
+#endif
+#ifndef HAVE_LOG10L
+#define HAVE_LOG10L 1
+#endif
+#if !defined(HAVE_CABSF)
+#define HAVE_CABSF 1
+#endif
+#if !defined(HAVE_CABS)
+#define HAVE_CABS 1
+#endif
+#if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
+#define HAVE_CABSL 1
+#endif
+#if !defined(HAVE_CARGF)
+#define HAVE_CARGF 1
+#endif
+#if !defined(HAVE_CARG)
+#define HAVE_CARG 1
+#endif
+#if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
+#define HAVE_CARGL 1
+#endif
+#if !defined(HAVE_CEXPF)
+#define HAVE_CEXPF 1
+#endif
+#if !defined(HAVE_CEXP)
+#define HAVE_CEXP 1
+#endif
+#if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(EXPL)
+#define HAVE_CEXPL 1
+#endif
+#if !defined(HAVE_CLOGF)
+#define HAVE_CLOGF 1
+#endif
+#if !defined(HAVE_CLOG)
+#define HAVE_CLOG 1
+#endif
+#if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
+#define HAVE_CLOGL 1
+#endif
+#if !defined(HAVE_CLOG10F)
+#define HAVE_CLOG10F 1
+#endif
+#if !defined(HAVE_CLOG10)
+#define HAVE_CLOG10 1
+#endif
+#if !defined(HAVE_CLOG10L) && defined(HAVE_LOG10L) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
+#define HAVE_CLOG10L 1
+#endif
+#if !defined(HAVE_CPOWF)
+#define HAVE_CPOWF 1
+#endif
+#if !defined(HAVE_CPOW)
+#define HAVE_CPOW 1
+#endif
+#if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
+#define HAVE_CPOWL 1
+#endif
+#if !defined(HAVE_CSQRTF)
+#define HAVE_CSQRTF 1 
+#endif
+#if !defined(HAVE_CSQRT)
+#define HAVE_CSQRT 1
+#endif
+#if !defined(HAVE_CSQRTL) && defined(HAVE_COPYSIGNL) && defined(HAVE_SQRTL) && defined(HAVE_FABSL) && defined(HAVE_HYPOTL)
+#define HAVE_CSQRTL 1
+#endif
+#if !defined(HAVE_CSINHF)
+#define HAVE_CSINHF 1
+#endif
+#if !defined(HAVE_CSINH)
+#define HAVE_CSINH 1
+#endif
+#if !defined(HAVE_CSINHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CSINHL 1
+#endif
+#if !defined(HAVE_CCOSHF)
+#define HAVE_CCOSHF 1
+#endif
+#if !defined(HAVE_CCOSH)
+#define HAVE_CCOSH 1
+#endif
+#if !defined(HAVE_CCOSHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CCOSHL 1
+#endif
+#if !defined(HAVE_CTANHF)
+#define HAVE_CTANHF 1
+#endif
+#if !defined(HAVE_CTANH)
+#define HAVE_CTANH 1
+#endif
+#if !defined(HAVE_CTANHL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
+#define HAVE_CTANHL 1
+#endif
+#if !defined(HAVE_CSINF)
+#define HAVE_CSINF 1
+#endif
+#if !defined(HAVE_CSIN)
+#define HAVE_CSIN 1
+#endif
+#if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CSINL 1
+#endif
+#if !defined(HAVE_CCOSF)
+#define HAVE_CCOSF 1
+#endif
+#if !defined(HAVE_CCOS)
+#define HAVE_CCOS 1
+#endif
+#if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CCOSL 1
+#endif
+#if !defined(HAVE_CTANF)
+#define HAVE_CTANF 1
+#endif
+#if !defined(HAVE_CTAN)
+#define HAVE_CTAN 1
+#endif
+#if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
+#define HAVE_CTANL 1
+#endif
+#if !defined(HAVE_CACOSF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CACOSF 1
+#endif
+#if !defined(HAVE_CACOS) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CACOS 1
+#endif
+#if !defined(HAVE_CACOSL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CACOSL 1
+#endif
+#if !defined(HAVE_CASINF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CASINF 1
+#endif
+#if !defined(HAVE_CASIN) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CASIN 1
+#endif
+#if !defined(HAVE_CASINL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CASINL 1
+#endif
+#if !defined(HAVE_CATANF) && defined(HAVE_CLOGF)
+#define HAVE_CATANF 1
+#endif
+#if !defined(HAVE_CATAN) && defined(HAVE_CLOG)
+#define HAVE_CATAN 1
+#endif
+#if !defined(HAVE_CATANL) && defined(HAVE_CLOGL)
+#define HAVE_CATANL 1
+#endif
+#if !defined(HAVE_CASINHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CASINHF 1
+#endif
+#if !defined(HAVE_CASINH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CASINH 1
+#endif
+#if !defined(HAVE_CASINHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CASINHL 1
+#endif
+#if !defined(HAVE_CACOSHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CACOSHF 1
+#endif
+#if !defined(HAVE_CACOSH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CACOSH 1
+#endif
+#if !defined(HAVE_CACOSHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CACOSHL 1
+#endif
+#if !defined(HAVE_CATANHF) && defined(HAVE_CLOGF)
+#define HAVE_CATANHF 1
+#endif
+#if !defined(HAVE_CATANH) && defined(HAVE_CLOG)
+#define HAVE_CATANH 1
+#endif
+#if !defined(HAVE_CATANHL) && defined(HAVE_CLOGL)
+#define HAVE_CATANHL 1
+#endif
+#if !defined(HAVE_TGAMMA)
+#define HAVE_TGAMMA 1
+#endif
+#if !defined(HAVE_LGAMMA)
+#define HAVE_LGAMMA 1
+#endif
+#if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
+#define HAVE_TGAMMAF 1
+#endif
+#if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
+#define HAVE_LGAMMAF 1
+#endif
+#endif  /* C99_PROTOS_H  */
diff --git a/l4/pkg/libgfortran/lib/build/include/config.h b/l4/pkg/libgfortran/lib/build/include/config.h
new file mode 100644 (file)
index 0000000..fb67953
--- /dev/null
@@ -0,0 +1,925 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 0 if the target shouldn't use #pragma weak */
+/* #undef GTHREAD_USE_WEAK */
+
+/* Define to 1 if you have the `access' function. */
+#define HAVE_ACCESS 1
+
+/* libm includes acos */
+#define HAVE_ACOS 1
+
+/* libm includes acosf */
+#define HAVE_ACOSF 1
+
+/* libm includes acosh */
+#define HAVE_ACOSH 1
+
+/* libm includes acoshf */
+#define HAVE_ACOSHF 1
+
+/* libm includes acoshl */
+#define HAVE_ACOSHL 1
+
+/* libm includes acosl */
+#define HAVE_ACOSL 1
+
+/* Define to 1 if you have the `alarm' function. */
+#define HAVE_ALARM 1
+
+/* libm includes asin */
+#define HAVE_ASIN 1
+
+/* libm includes asinf */
+#define HAVE_ASINF 1
+
+/* libm includes asinh */
+#define HAVE_ASINH 1
+
+/* libm includes asinhf */
+#define HAVE_ASINHF 1
+
+/* libm includes asinhl */
+#define HAVE_ASINHL 1
+
+/* libm includes asinl */
+#define HAVE_ASINL 1
+
+/* libm includes atan */
+#define HAVE_ATAN 1
+
+/* libm includes atan2 */
+#define HAVE_ATAN2 1
+
+/* libm includes atan2f */
+#define HAVE_ATAN2F 1
+
+/* libm includes atan2l */
+#define HAVE_ATAN2L 1
+
+/* libm includes atanf */
+#define HAVE_ATANF 1
+
+/* libm includes atanh */
+#define HAVE_ATANH 1
+
+/* libm includes atanhf */
+#define HAVE_ATANHF 1
+
+/* libm includes atanhl */
+#define HAVE_ATANHL 1
+
+/* libm includes atanl */
+#define HAVE_ATANL 1
+
+/* Define to 1 if the target supports __attribute__((alias(...))). */
+#define HAVE_ATTRIBUTE_ALIAS 1
+
+/* Define to 1 if the target supports __attribute__((dllexport)). */
+/* #undef HAVE_ATTRIBUTE_DLLEXPORT */
+
+/* Define to 1 if the target supports __attribute__((visibility(...))). */
+#define HAVE_ATTRIBUTE_VISIBILITY 1
+
+/* Define if powf is broken. */
+/* #undef HAVE_BROKEN_POWF */
+
+/* libm includes cabs */
+#define HAVE_CABS 1
+
+/* libm includes cabsf */
+#define HAVE_CABSF 1
+
+/* libm includes cabsl */
+#define HAVE_CABSL 1
+
+/* libm includes cacos */
+#define HAVE_CACOS 1
+
+/* libm includes cacosf */
+#define HAVE_CACOSF 1
+
+/* libm includes cacosh */
+#define HAVE_CACOSH 1
+
+/* libm includes cacoshf */
+#define HAVE_CACOSHF 1
+
+/* libm includes cacoshl */
+#define HAVE_CACOSHL 1
+
+/* libm includes cacosl */
+#define HAVE_CACOSL 1
+
+/* libm includes carg */
+#define HAVE_CARG 1
+
+/* libm includes cargf */
+#define HAVE_CARGF 1
+
+/* libm includes cargl */
+#define HAVE_CARGL 1
+
+/* libm includes casin */
+#define HAVE_CASIN 1
+
+/* libm includes casinf */
+#define HAVE_CASINF 1
+
+/* libm includes casinh */
+#define HAVE_CASINH 1
+
+/* libm includes casinhf */
+#define HAVE_CASINHF 1
+
+/* libm includes casinhl */
+#define HAVE_CASINHL 1
+
+/* libm includes casinl */
+#define HAVE_CASINL 1
+
+/* libm includes catan */
+#define HAVE_CATAN 1
+
+/* libm includes catanf */
+#define HAVE_CATANF 1
+
+/* libm includes catanh */
+#define HAVE_CATANH 1
+
+/* libm includes catanhf */
+#define HAVE_CATANHF 1
+
+/* libm includes catanhl */
+#define HAVE_CATANHL 1
+
+/* libm includes catanl */
+#define HAVE_CATANL 1
+
+/* libm includes ccos */
+#define HAVE_CCOS 1
+
+/* libm includes ccosf */
+#define HAVE_CCOSF 1
+
+/* libm includes ccosh */
+#define HAVE_CCOSH 1
+
+/* libm includes ccoshf */
+#define HAVE_CCOSHF 1
+
+/* libm includes ccoshl */
+#define HAVE_CCOSHL 1
+
+/* libm includes ccosl */
+#define HAVE_CCOSL 1
+
+/* libm includes ceil */
+#define HAVE_CEIL 1
+
+/* libm includes ceilf */
+#define HAVE_CEILF 1
+
+/* libm includes ceill */
+#define HAVE_CEILL 1
+
+/* libm includes cexp */
+#define HAVE_CEXP 1
+
+/* libm includes cexpf */
+#define HAVE_CEXPF 1
+
+/* libm includes cexpl */
+#define HAVE_CEXPL 1
+
+/* Define to 1 if you have the `chdir' function. */
+#define HAVE_CHDIR 1
+
+/* Define to 1 if you have the `chsize' function. */
+/* #undef HAVE_CHSIZE */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+/* #undef HAVE_CLOCK_GETTIME */
+
+/* Define to 1 if you have the `clock_gettime' function in librt. */
+#define HAVE_CLOCK_GETTIME_LIBRT 1
+
+/* libm includes clog */
+#define HAVE_CLOG 1
+
+/* libm includes clog10 */
+#define HAVE_CLOG10 1
+
+/* libm includes clog10f */
+#define HAVE_CLOG10F 1
+
+/* libm includes clog10l */
+#define HAVE_CLOG10L 1
+
+/* libm includes clogf */
+#define HAVE_CLOGF 1
+
+/* libm includes clogl */
+#define HAVE_CLOGL 1
+
+/* Define to 1 if you have the `close' function. */
+#define HAVE_CLOSE 1
+
+/* Define to 1 if you have the <complex.h> header file. */
+#define HAVE_COMPLEX_H 1
+
+/* libm includes copysign */
+#define HAVE_COPYSIGN 1
+
+/* libm includes copysignf */
+#define HAVE_COPYSIGNF 1
+
+/* libm includes copysignl */
+#define HAVE_COPYSIGNL 1
+
+/* libm includes cos */
+#define HAVE_COS 1
+
+/* libm includes cosf */
+#define HAVE_COSF 1
+
+/* libm includes cosh */
+#define HAVE_COSH 1
+
+/* libm includes coshf */
+#define HAVE_COSHF 1
+
+/* libm includes coshl */
+#define HAVE_COSHL 1
+
+/* libm includes cosl */
+#define HAVE_COSL 1
+
+/* libm includes cpow */
+#define HAVE_CPOW 1
+
+/* libm includes cpowf */
+#define HAVE_CPOWF 1
+
+/* libm includes cpowl */
+#define HAVE_CPOWL 1
+
+/* Define if CRLF is line terminator. */
+/* #undef HAVE_CRLF */
+
+/* libm includes csin */
+#define HAVE_CSIN 1
+
+/* libm includes csinf */
+#define HAVE_CSINF 1
+
+/* libm includes csinh */
+#define HAVE_CSINH 1
+
+/* libm includes csinhf */
+#define HAVE_CSINHF 1
+
+/* libm includes csinhl */
+#define HAVE_CSINHL 1
+
+/* libm includes csinl */
+#define HAVE_CSINL 1
+
+/* libm includes csqrt */
+#define HAVE_CSQRT 1
+
+/* libm includes csqrtf */
+#define HAVE_CSQRTF 1
+
+/* libm includes csqrtl */
+#define HAVE_CSQRTL 1
+
+/* libm includes ctan */
+#define HAVE_CTAN 1
+
+/* libm includes ctanf */
+#define HAVE_CTANF 1
+
+/* libm includes ctanh */
+#define HAVE_CTANH 1
+
+/* libm includes ctanhf */
+#define HAVE_CTANHF 1
+
+/* libm includes ctanhl */
+#define HAVE_CTANHL 1
+
+/* libm includes ctanl */
+#define HAVE_CTANL 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the `dup' function. */
+#define HAVE_DUP 1
+
+/* Define to 1 if you have the `dup2' function. */
+#define HAVE_DUP2 1
+
+/* libm includes erf */
+#define HAVE_ERF 1
+
+/* libm includes erfc */
+#define HAVE_ERFC 1
+
+/* libm includes erfcf */
+#define HAVE_ERFCF 1
+
+/* libm includes erfcl */
+#define HAVE_ERFCL 1
+
+/* libm includes erff */
+#define HAVE_ERFF 1
+
+/* libm includes erfl */
+#define HAVE_ERFL 1
+
+/* Define to 1 if you have the `execl' function. */
+#define HAVE_EXECL 1
+
+/* Define to 1 if you have the `execve' function. */
+/* #undef HAVE_EXECVE */
+
+/* libm includes exp */
+#define HAVE_EXP 1
+
+/* libm includes expf */
+#define HAVE_EXPF 1
+
+/* libm includes expl */
+#define HAVE_EXPL 1
+
+/* libm includes fabs */
+#define HAVE_FABS 1
+
+/* libm includes fabsf */
+#define HAVE_FABSF 1
+
+/* libm includes fabsl */
+#define HAVE_FABSL 1
+
+/* libm includes feenableexcept */
+#define HAVE_FEENABLEEXCEPT 1
+
+/* Define to 1 if you have the <fenv.h> header file. */
+#define HAVE_FENV_H 1
+
+/* Define if have a usable __float128 type. */
+#define HAVE_FLOAT128 1
+
+/* Define to 1 if you have the <floatingpoint.h> header file. */
+/* #undef HAVE_FLOATINGPOINT_H */
+
+/* libm includes floor */
+#define HAVE_FLOOR 1
+
+/* libm includes floorf */
+#define HAVE_FLOORF 1
+
+/* libm includes floorl */
+#define HAVE_FLOORL 1
+
+/* libm includes fmod */
+#define HAVE_FMOD 1
+
+/* libm includes fmodf */
+#define HAVE_FMODF 1
+
+/* libm includes fmodl */
+#define HAVE_FMODL 1
+
+/* Define to 1 if you have the `fork' function. */
+/* #undef  HAVE_FORK */
+
+/* Define if you have fpsetmask. */
+/* #undef HAVE_FPSETMASK */
+
+/* Define to 1 if you have the <fptrap.h> header file. */
+/* #undef HAVE_FPTRAP_H */
+
+/* fp_enable is present */
+/* #undef HAVE_FP_ENABLE */
+
+/* fp_trap is present */
+/* #undef HAVE_FP_TRAP */
+
+/* libm includes frexp */
+#define HAVE_FREXP 1
+
+/* libm includes frexpf */
+#define HAVE_FREXPF 1
+
+/* libm includes frexpl */
+#define HAVE_FREXPL 1
+
+/* Define to 1 if you have the `fstat' function. */
+#define HAVE_FSTAT 1
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the `geteuid' function. */
+#define HAVE_GETEUID 1
+
+/* Define to 1 if you have the `getgid' function. */
+#define HAVE_GETGID 1
+
+/* Define to 1 if you have the `gethostname' function. */
+#define HAVE_GETHOSTNAME 1
+
+/* Define if _Unwind_GetIPInfo is available. */
+#define HAVE_GETIPINFO 1
+
+/* Define to 1 if you have the `getlogin' function. */
+#define HAVE_GETLOGIN 1
+
+/* Define to 1 if you have the `getpid' function. */
+/* #undef HAVE_GETPID */
+
+/* Define to 1 if you have the `getppid' function. */
+#define HAVE_GETPPID 1
+
+/* Define to 1 if you have the `getpwuid' function. */
+#define HAVE_GETPWUID 1
+
+/* Define to 1 if you have the `getpwuid_r' function. */
+#define HAVE_GETPWUID_R 1
+
+/* Define to 1 if you have the `getrlimit' function. */
+#define HAVE_GETRLIMIT 1
+
+/* Define to 1 if you have the `getrusage' function. */
+#define HAVE_GETRUSAGE 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `getuid' function. */
+#define HAVE_GETUID 1
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#define HAVE_GMTIME_R 1
+
+/* libm includes hypot */
+#define HAVE_HYPOT 1
+
+/* libm includes hypotf */
+#define HAVE_HYPOTF 1
+
+/* libm includes hypotl */
+#define HAVE_HYPOTL 1
+
+/* Define to 1 if you have the <ieeefp.h> header file. */
+/* #undef HAVE_IEEEFP_H */
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#define HAVE_INTPTR_T 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* libm includes j0 */
+#define HAVE_J0 1
+
+/* libm includes j0f */
+#define HAVE_J0F 1
+
+/* libm includes j0l */
+#define HAVE_J0L 1
+
+/* libm includes j1 */
+#define HAVE_J1 1
+
+/* libm includes j1f */
+#define HAVE_J1F 1
+
+/* libm includes j1l */
+#define HAVE_J1L 1
+
+/* libm includes jn */
+#define HAVE_JN 1
+
+/* libm includes jnf */
+#define HAVE_JNF 1
+
+/* libm includes jnl */
+#define HAVE_JNL 1
+
+/* Define to 1 if you have the `kill' function. */
+#define HAVE_KILL 1
+
+/* libm includes ldexp */
+#define HAVE_LDEXP 1
+
+/* libm includes ldexpf */
+#define HAVE_LDEXPF 1
+
+/* libm includes ldexpl */
+#define HAVE_LDEXPL 1
+
+/* libm includes lgamma */
+#define HAVE_LGAMMA 1
+
+/* libm includes lgammaf */
+#define HAVE_LGAMMAF 1
+
+/* libm includes lgammal */
+#define HAVE_LGAMMAL 1
+
+/* Define to 1 if you have the `link' function. */
+#define HAVE_LINK 1
+
+/* libm includes llround */
+#define HAVE_LLROUND 1
+
+/* libm includes llroundf */
+#define HAVE_LLROUNDF 1
+
+/* libm includes llroundl */
+#define HAVE_LLROUNDL 1
+
+/* Define to 1 if you have the `localtime_r' function. */
+#define HAVE_LOCALTIME_R 1
+
+/* libm includes log */
+#define HAVE_LOG 1
+
+/* libm includes log10 */
+#define HAVE_LOG10 1
+
+/* libm includes log10f */
+#define HAVE_LOG10F 1
+
+/* libm includes log10l */
+#define HAVE_LOG10L 1
+
+/* libm includes logf */
+#define HAVE_LOGF 1
+
+/* libm includes logl */
+#define HAVE_LOGL 1
+
+/* libm includes lround */
+#define HAVE_LROUND 1
+
+/* libm includes lroundf */
+#define HAVE_LROUNDF 1
+
+/* libm includes lroundl */
+#define HAVE_LROUNDL 1
+
+/* Define to 1 if you have the `lstat' function. */
+#define HAVE_LSTAT 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have __mingw_snprintf. */
+/* #undef HAVE_MINGW_SNPRINTF */
+
+/* Define to 1 if you have the `mkstemp' function. */
+#define HAVE_MKSTEMP 1
+
+/* libm includes nextafter */
+#define HAVE_NEXTAFTER 1
+
+/* libm includes nextafterf */
+#define HAVE_NEXTAFTERF 1
+
+/* libm includes nextafterl */
+#define HAVE_NEXTAFTERL 1
+
+/* Define to 1 if you have the `pipe' function. */
+/* #undef HAVE_PIPE */
+
+/* Define to 1 if we have POSIX getpwuid_r which takes 5 arguments. */
+#define HAVE_POSIX_GETPWUID_R 1
+
+/* libm includes pow */
+#define HAVE_POW 1
+
+/* libm includes powf */
+#define HAVE_POWF 1
+
+/* libm includes powl */
+#define HAVE_POWL 1
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#define HAVE_PTRDIFF_T 1
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#define HAVE_PWD_H 1
+
+/* Define to 1 if you have the `readlink' function. */
+#define HAVE_READLINK 1
+
+/* libm includes round */
+#define HAVE_ROUND 1
+
+/* libm includes roundf */
+#define HAVE_ROUNDF 1
+
+/* libm includes roundl */
+#define HAVE_ROUNDL 1
+
+/* libm includes scalbn */
+#define HAVE_SCALBN 1
+
+/* libm includes scalbnf */
+#define HAVE_SCALBNF 1
+
+/* libm includes scalbnl */
+#define HAVE_SCALBNL 1
+
+/* Define to 1 if you have the `setmode' function. */
+/* #undef HAVE_SETMODE */
+
+/* libm includes sin */
+#define HAVE_SIN 1
+
+/* libm includes sinf */
+#define HAVE_SINF 1
+
+/* libm includes sinh */
+#define HAVE_SINH 1
+
+/* libm includes sinhf */
+#define HAVE_SINHF 1
+
+/* libm includes sinhl */
+#define HAVE_SINHL 1
+
+/* libm includes sinl */
+#define HAVE_SINL 1
+
+/* Define to 1 if you have the `sleep' function. */
+#define HAVE_SLEEP 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* libm includes sqrt */
+#define HAVE_SQRT 1
+
+/* libm includes sqrtf */
+#define HAVE_SQRTF 1
+
+/* libm includes sqrtl */
+#define HAVE_SQRTL 1
+
+/* Define to 1 if you have the `stat' function. */
+#define HAVE_STAT 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strcasestr' function. */
+#define HAVE_STRCASESTR 1
+
+/* Define to 1 if you have the `strerror_r' function. */
+#define HAVE_STRERROR_R 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtof' function. */
+#define HAVE_STRTOF 1
+
+/* Define to 1 if you have the `strtold' function. */
+#define HAVE_STRTOLD 1
+
+/* Define to 1 if `struct stat' is a member of `st_blksize'. */
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+
+/* Define to 1 if `struct stat' is a member of `st_blocks'. */
+#define HAVE_STRUCT_STAT_ST_BLOCKS 1
+
+/* Define to 1 if `struct stat' is a member of `st_rdev'. */
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+
+/* Define to 1 if you have the `symlink' function. */
+#define HAVE_SYMLINK 1
+
+/* Define to 1 if the target supports __sync_fetch_and_add */
+#define HAVE_SYNC_FETCH_AND_ADD 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+#define HAVE_SYS_TIMES_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
+
+/* libm includes tan */
+#define HAVE_TAN 1
+
+/* libm includes tanf */
+#define HAVE_TANF 1
+
+/* libm includes tanh */
+#define HAVE_TANH 1
+
+/* libm includes tanhf */
+#define HAVE_TANHF 1
+
+/* libm includes tanhl */
+#define HAVE_TANHL 1
+
+/* libm includes tanl */
+#define HAVE_TANL 1
+
+/* libm includes tgamma */
+#define HAVE_TGAMMA 1
+
+/* libm includes tgammaf */
+#define HAVE_TGAMMAF 1
+
+/* libm includes tgammal */
+#define HAVE_TGAMMAL 1
+
+/* Define to 1 if you have the `times' function. */
+#define HAVE_TIMES 1
+
+/* libm includes trunc */
+#define HAVE_TRUNC 1
+
+/* libm includes truncf */
+#define HAVE_TRUNCF 1
+
+/* libm includes truncl */
+#define HAVE_TRUNCL 1
+
+/* Define to 1 if you have the `ttyname' function. */
+#define HAVE_TTYNAME 1
+
+/* Define to 1 if you have the `ttyname_r' function. */
+#define HAVE_TTYNAME_R 1
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#define HAVE_UINTPTR_T 1
+
+/* Define to 1 if you have the `umask' function. */
+#define HAVE_UMASK 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if target can unlink open files. */
+#define HAVE_UNLINK_OPEN_FILE 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `wait' function. */
+#define HAVE_WAIT 1
+
+/* Define if target has a reliable stat. */
+#define HAVE_WORKING_STAT 1
+
+/* libm includes y0 */
+#define HAVE_Y0 1
+
+/* libm includes y0f */
+#define HAVE_Y0F 1
+
+/* libm includes y0l */
+#define HAVE_Y0L 1
+
+/* libm includes y1 */
+#define HAVE_Y1 1
+
+/* libm includes y1f */
+#define HAVE_Y1F 1
+
+/* libm includes y1l */
+#define HAVE_Y1L 1
+
+/* libm includes yn */
+#define HAVE_YN 1
+
+/* libm includes ynf */
+#define HAVE_YNF 1
+
+/* libm includes ynl */
+#define HAVE_YNL 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "GNU Fortran Runtime Library"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "GNU Fortran Runtime Library 0.3"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libgfortran"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "http://www.gnu.org/software/libgfortran/"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "0.3"
+
+/* The size of `char', as computed by sizeof. */
+/* #undef SIZEOF_CHAR */
+
+/* The size of `int', as computed by sizeof. */
+/* #undef SIZEOF_INT */
+
+/* The size of `long', as computed by sizeof. */
+/* #undef SIZEOF_LONG */
+
+/* The size of `short', as computed by sizeof. */
+/* #undef SIZEOF_SHORT */
+
+/* The size of `void *', as computed by sizeof. */
+/* #undef SIZEOF_VOID_P */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if the target supports #pragma weak */
+#define SUPPORTS_WEAK 1
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define to the type of a signed integer type wide enough to hold a pointer,
+   if such a type exists, and if the system does not define it. */
+/* #undef intptr_t */
+
+/* Define to `long int' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to the type of an unsigned integer type wide enough to hold a
+   pointer, if such a type exists, and if the system does not define it. */
+/* #undef uintptr_t */
diff --git a/l4/pkg/libgfortran/lib/build/include/selected_real_kind.inc b/l4/pkg/libgfortran/lib/build/include/selected_real_kind.inc
new file mode 100644 (file)
index 0000000..b9462e7
--- /dev/null
@@ -0,0 +1,6 @@
+  integer, parameter :: c = 4
+  type (real_info), parameter :: real_infos(c) = (/ &
+    real_info (4, precision(0.0_4), range(0.0_4), radix(0.0_4)), &
+    real_info (8, precision(0.0_8), range(0.0_8), radix(0.0_8)), &
+    real_info (10, precision(0.0_10), range(0.0_10), radix(0.0_10)), &
+    real_info (16, precision(0.0_16), range(0.0_16), radix(0.0_16)) /)
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog b/l4/pkg/libgfortran/lib/contrib/ChangeLog
new file mode 100644 (file)
index 0000000..cfddafe
--- /dev/null
@@ -0,0 +1,107 @@
+2012-09-20  Release Manager
+
+       * GCC 4.7.2 released.
+
+2012-09-05  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/fpu-387.h (set_fpu): Prefix stmxcsr and ldmxcsr with %v.
+
+2012-06-14  Release Manager
+
+       * GCC 4.7.1 released.
+
+2012-05-31  Benjamin Kosnik  <bkoz@redhat.com>
+
+        PR libstdc++/52007
+        * configure.ac: Allow gnu, gnu* variants for --enable-symvers argument.
+        * configure: Regenerated.
+
+2012-05-12  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/53310
+       * intrinsics/eoshift2.c (eoshift2): Do not leak
+       memory by allocating it in the loop.
+
+2012-03-30  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR libgfortran/52758
+       * intrinsics/chmod.c (chmod_func): Remove out-of-bounds
+       initialization of rwxXstugo.
+
+2012-03-22  Release Manager
+
+       * GCC 4.7.0 released.
+
+2012-01-20  Tobias Burnus  <burnus@net-b.de>
+
+       PR libgfortran/51899
+       * configure.ac: Check whether umask is available.
+       * intrinsics/chmod.c (chmod_func): Make compile with MinGW.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2012-01-12  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/36755
+       * intrinsics/chmod.c (chmod_func): Replace call to /bin/chmod
+
+2012-01-12  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * configure.ac: Remove check for fdopen.
+       * runtime/backtrace.c (CAN_PIPE): Fix comment, remove check for
+       fdopen.
+       * configure: Regenerated.
+       * config.h.in: Regenerated.
+
+2012-01-12  Janne Blomqvist  <jb@gcc.gnu.org>
+           Tobias Burnus  <burnus@net-b.de>
+
+       PR libfortran/51803
+       * runtime/main.c (store_exe_path): Avoid malloc if getcwd fails or
+       is not available.
+
+2012-01-11  Tobias Burnus  <burnus@net-b.de>
+
+       * runtime/main.c (store_exe_path): Fix absolute path
+       detection for Windows.
+
+2012-01-11  Janne Blomqvist  <jb@gcc.gnu.org>
+           Mike Stump  <mikestump@comcast.net>
+
+       PR libfortran/51803
+       * runtime/main.c (store_exe_path): Handle getcwd failure and lack
+       of the function better.
+
+2012-01-10  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51197
+       * runtime/compile_options.c (show_signal): List
+       more signals.
+
+2012-01-09  Harald Anlauf  <anlauf@gmx.de>
+           Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51197
+       * runtime/backtrace.c (show_backtrace): Modify wording written
+       before the backtrace.
+       * runtime/compile_options.c (show_signal): New function.
+       (backtrace_handler): Use it.
+
+2012-01-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * Makefile.am (libgfortran_la_LDFLAGS): Add -Wc,-shared-libgcc.
+       * Makefile.in: Regenerate.
+
+2012-01-06  Tobias Burnus <burnus@net-b.de>
+
+       * caf/single.c (_gfortran_caf_register, _gfortran_caf_deregister):
+       Fix token handling.
+       * caf/mpi.c  (_gfortran_caf_register, _gfortran_caf_deregister): Ditto.
+       * caf/libcaf.h (STAT_STOPPED_IMAGE): Sync with libgfortran.h.
+       (_gfortran_caf_register, _gfortran_caf_deregister): Update prototype.
+\f
+Copyright (C) 2012 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2002 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2002
new file mode 100644 (file)
index 0000000..a7043dd
--- /dev/null
@@ -0,0 +1,67 @@
+2002-12-29  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/reshape.*: New files.
+       * gcc_config.patch: Update to new GCC configure system.
+
+2002-10-10  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/size.c: New file.
+       * intrinsics/shape.m4: New file.
+       * Makefile.am: Add above files.
+
+2002-10-02  Paul Brook  <paul@nowt.org>
+
+       * fmain.c (main): Move here.
+       * libgfor.c: From here.
+       * libgfor.h (gfor_init, gfor_runtime_cleanup): Declare.
+       * Makefile.am: Build libgforbegin.
+       * gcc_config.patch: Remove stray -march=athlon.
+       * dotprodl.m4: Fix use of L8_TO_L4 macro.
+       * ifunction.m4: Move variable declarations to allow compilation with
+       gcc < 3.0
+       * specific.m4, specific4.m4: Fix typo typecode->type_code.
+       * README: Document use of patch -p1.
+
+2002-09-12  Paul Brook  <paul@nowt.org>
+
+       * math/*: Add complex math library functions.
+       * intrinsics/specific(2).m4: Generate Specific intrinsic functions.
+       * Makefile.am: Add details for above.
+       * configure.in: Use AC_PROG_F95.  Test for the presence of csin.
+
+2002-09-09  Paul Brook  <paul@nowt.org>
+
+       * libgfor.c (determine_endianness): Use an array rather than a struct.
+       * intrinsics/dotprod*, matmul*: Implement DOT_PRODUCT and MATMUL.
+
+2002-09-09  Steven Bosscher  <s.bosscher@student.tudelft.nl>
+
+       * libgfor.c: Add fatal signal handler.
+       Romove superfluous abort() calls.
+
+2002-09-07  Paul Brook <paul@nowt.org>
+
+       * Makefile.am, intrinsics: Major rewrite.
+
+2002-09-02  Paul Brook <paul@nowt.org>
+
+       * Makefile.am: Added -I$(srcdir) to m4 rule.
+
+2002-08-30  Paul Brook <paul@nowt.org>
+
+       * io/*: Integrated libgforio.
+       * Makefile.am, configure.in: Make compatable with GCC. Build code for
+       intrinsics in the intrisics directory.
+       * intrinsics/intrinsics.m4: Move here. Strip directories from the
+       filename. Add 'and' and 'all' intrinsics.
+
+2002-08-17  Paul Brook <paul@nowt.org>
+
+       * ALL: First release as more than just a single file
+
+\f
+Copyright (C) 2002 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2003 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2003
new file mode 100644 (file)
index 0000000..98b3508
--- /dev/null
@@ -0,0 +1,549 @@
+2003-12-12  Huang Chun <chunhuang73@hotmal.com>
+
+       * intrinsics/string_intrinsics.c (string_index): Fix logics thinko.
+
+2003-12-05  Melvin Hadasht  <melvin.hadasht@free.fr>
+
+       * io/transfer.c (data_transfer_init): Give a runtime error for list
+       formatted reads and writes from/to files opened for unformatted IO.
+
+2003-11-30  Paul Brook  <paul@nowt.org>
+
+       * runtime/memory.c (push_context): Remove.
+       (pop_context): Remove.
+       * libgfortran.h: Remove prototypes.
+
+2003-11-27  Paul Brook  <paul@nowt.org>
+
+       * runtime/memory.c (deallocate): Nullify pointer after freeing.
+
+2003-11-27  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/string_intrinsics.c: Use new memory allocation interface.
+       * libgfortran.h: Ditto.
+       * m4/in_pack.m4: Ditto.
+       * runtime/in_pack_generic.c: Ditto.
+       * runtime/memory.c: Ditto.
+
+2003-11-26  Richard Henderson  <rth@redhat.com>
+
+       * m4/exponent.m4, m4/fraction.m4: New.
+       * m4/nearest.m4, m4/set_exponent.m4: New.
+       * generated/*: Update.
+       * Makefile.am: Add them.
+       (AM_CFLAGS): New.  Use -std=gnu99.
+       * Makefile.in: Regenerate.
+
+2003-11-08  Paul Brook  <paul@nowt.org>
+
+       PR fortran/12704
+       * m4/maxloc0.m4: Use default value of 1. Handle zero sized arrays.
+       * m4/maxloc1.m4: Ditto.
+       * m4/minloc0.m4: Ditto.
+       * m4/minloc1.m4: Ditto.
+       * m4/ifunction.m4: Set return value for zero sized arrays.
+       * m4/iforeach.m4: Ditto.
+       * m4/all.m4, m4/any.m4, m4/count.m4, m4/maxloc1.m4, m4/minloc1.m4,
+       m4/mxaval.m4, m4/minval.m4, m4/product.m4, m4/sum.m4: Ditto.
+       * generated/*: Update.
+
+2003-10-30  Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       PR fortran/12702
+       * io/list_read.c (eat_spaces): Treat tab as space.
+
+2003-10-30  Lars Segerlund  <Lars.Segerlund@comsys.se>
+
+       * intrinsics/random.c: Add reference to paper containing algorithm.
+       (random_seed): Extra error checking and proper handling of arrays.
+       (arandom_r4, arandom_r8): Implement.
+
+2003-10-29  Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       PR fortran/12703
+       * runtime/memory.c (allocate_size): Allow allocation
+       of zero-sized objects.
+
+2003-10-29  Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       PR fortran/12701
+       * open.c (new_unit): Open without a file name opens
+       a file with name fort.<unit>.
+
+2003-10-12  Feng Wang  <wf_cs@yahoo.com>
+
+       * intrinsics/cshift0.c: New file.
+       * m4/cshift1.m4: New file
+       * generated/cshift*.c: New files.
+       * Makefile.am: Add them.
+       * Makefile.in: Regenerate.
+
+2003-10-12  XiaoQiang Zhang  <zhangapache@yahoo.com>
+
+       * io/list_read.c (read_character): Remove unwanted call to free_saved.
+
+2003-10-11  Huang Chun  <jiwang@mail.edu.cn>
+
+       * intrinsics/string_intrinsics.c (string_trim): New function.
+       (string_repeat): New function.
+
+2003-10-11  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/dprod_r8.f90: New file.
+       * Makefile.am (gfor_specific_src): Add it.
+       (gfor_built_specific_src): Rename from gfor_build_specific_c.
+       Add new intrinsics.
+       (gfor_specific2_src): Rename from gfor_built_specific2_c.
+       Add new intrinsics.
+       * Makefile.in: Regenerate.
+       * generated/_aint_*.f90: New files.
+       * generated/_anint*.f90: New files.
+       * generated/_atan2*.f90: New files.
+       * generated/_mod*.f90: New files.
+
+2003-09-20  Kejia Zhao  <kejia_zh@yahoo.com.cn>
+
+       * intrinsics/selected_kind.f90: New file.
+       * Makefile.am: Add it.
+       * Makefile.in: regenerate.
+
+2003-09-19  Lars Segerlund  <Lars.Segerlund@comsys.se>
+       Paul Brook  <paul@nowt.org>
+
+       * intrinsics/random.c: New file.
+       * Makefile.am (gfor_hemper_src): Add it.
+       (gfor_specific_c): Fix typo.
+
+2003-09-19  Paul Brook  <paul@nowt.org>
+
+       * All: rename g95->gfc.
+
+2003-09-18  XiaoQiang Zhang  <zhangapache@yahoo.com>
+
+       * io/write.c (output_float): Fix bug of FMT_E, Add comments.
+
+2003-09-09  XiaoQiang Zhang  <zhangapache@yahoo.com>
+
+       * io/write.c (write_float): Dectection of positive infinite number,
+       Not a Number(NaN) and negative infinite number.
+       (ioutput_float): Bug fix for FMT_E and FMT_D processing to
+       output a very_very small number ( < 0.1e-100 ).
+
+2003-09-07  XiaoQiang Zhang  <zhangapache@yahoo.com>
+
+       * libgfortran.h (xtoa, itoa): Parameter modified.
+       * io/io.h (namelist_info): Declaration to support namelist I/O
+       (st_parameter): Add namelist related component
+       (ionml, empty_internal_buffer, st_set_nml_var_int,
+       st_set_nml_var_float, st_set_nml_var_char, st_set_nml_var_complex,
+       st_set_nml_var_log): Declaration
+       (set_integer, set_integer): Parameter changed
+       * io/format.c (free_nodes): Fix annoying bug of lefting "deallocated"
+        fnodes
+       (parse_format_list): Fix bug about FMT_SLASH
+       * io/list_read.c (push_char): Totally clear old saved_string, zeroize
+       newly allocated saved_string
+       (next_char): Add detection of End_Of_Line support
+       (convert_integer): Now can process 64 bits interger
+       (read_real): Bug fixed
+       (init_at_eol, find_nml_node, match_namelist_name): Add new functions
+       (match_namelist_name): New implemention
+       * io/lock.c (ionml): New global variable
+       (library_end): Free memory in ionml
+       * io/open.c (st_open): Variable initializtion
+       * io/read.c (max_value): 64 bits interger support
+       (convert_precsion_real): New procedure to replace "strtod" with more
+        features
+       (read_f, read_radix): Input bug fix
+       * io/transfer.c: (sf_seen_eor): New static variable
+       (read_sf): Zeroize base buffer; fix bugs: single read statement can
+       not get input in mutli line when read from stdin
+       (formatted_transfer): Fix bug of FMT_O, FMT_B, FMT_Z for INTEGER type
+        request
+       (data_transfer_init): Clear internal buffer for Internel File I/O.
+       Internal File now worked. Detect some error condition for namelist.
+       Some minor bug fix
+       (next_record_w): Internal file and Namelist I/O support.
+       (st_set_nml_var, st_set_nml_var_float, st_set_nml_var_char,
+       st_set_nml_var_complex, st_set_nml_var_log): Implemention.
+       * io/unit.c (implicit_unit): Deletion
+       (get_unit): Now cannot open a unit implicitly.
+       * io/unix.c (mmap_alloc): Fix fatal error in calculating the length of
+       mapped buffer.
+       (mem_alloc_r_at): Internal file I/O support added
+       (empty_internal_buffer): New function
+       * io/write.c (extract_int): Support 64 bits interger processing
+       (output_float): Varibale initialization
+       (write_float): Infinite real number detection.
+       (write_int): 64 bits integer I/O support
+       (write_decimal): New function to output decimal number
+       (otoa, btoa): Better implemention and 64 bits interger support
+       (namelist_write): New function
+       * runtime/error.c (itoa, xtoa): Better implemention and 64 bits
+       interger support
+
+2003-08-15  Arnaud Desitter  <arnaud.desitter@geography.oxford.ac.uk>
+
+       * libgfortran.h (os_error, runtime_error,internal_error, sys_exit,
+       get_mem ): Add attribute.
+       * intrinsics/spread_generic.c (__spread): Fix spelling.
+       * io/inquire.c (inquire_via_filename): Add const.
+       * io/io.h (sys_exit): Add attribute.
+       * io/io.h (move_pos_offset): Add move_pos_offset.
+       * io/io.h (compare_file_filename, inquire_sequential, inquire_direct,
+       inquire_formatted, inquire_unformatted, inquire_read, inquire_write,
+       inquire_readwrite, convert_real, write_a, write_b, write_d, write_e,
+       write_en, write_es, write_f, write_i, write_l, write_o, write_x,
+       write_z): Add const.
+       * io/read.c (convert_real): Add const.
+       * io/transfer.c (type_name): Add const.
+       * io/unix.c (unpack_filename, compare_file_filename,inquire_sequential,
+       inquire_direct, inquire_formatted, inquire_unformatted, inquire_access,
+       inquire_read, inquire_write, inquire_readwrite): Add const.
+       * io/write.c (output_float): Remove unused variable.
+       * io/write.c (write_a, extract_int, extract_real, output_float,
+       write_float, write_int, write_i, write_b, write_o, write_z, write_d,
+       write_e, write_f, write_en, write_es, write_logical, write_integer,
+       write_character, write_real, write_complex): Add const.
+       * runtime/error.c (rtoa): Remove unused variable.
+       * runtime/select.c (select_string): Add const.
+       * runtime/stop.c (stop_string): Add const.
+
+2003-08-10  Paul Brook  <paul@nowt.org>
+
+       * Makefile.am (gfor_helper_src): Add intrinsics/abort.c.
+       (FFLAGS): Add -fno-underscoring.
+       * Makefile.in: Regenerate.
+       * intrinsics/abort.c: New file.
+
+2003-08-10  Erik Schnetter  <schnetter@uni-tuebingen.de>
+
+       * fmain.c (main): Do not call init and cleanup; call set_args instead.
+       * libgfortran.h (init, cleanup): Remove declarations.
+       (set_args): Add declaration.
+       * runtime/main.c (init, cleanup): Make them static, and give them
+       the constructor and destructor attributes.
+       (set_args): New function.
+
+2003-08-10  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/strinf_intrinsics.c (compare_string): Return value based
+       on which string is longest.
+
+2003-08-10  Paul Brook  <paul@nowt.org>
+
+       * Makefile.am (EXTRA_DIST): Remove old files.
+       * Makefile.in: Regenerate.
+
+2003-07-26  Paul Brook  <paul@nowt.org>
+
+       Rename library to libgfortran.
+       * libgfortran.h: Change prefix to _libgfortran_.
+
+2003-07-24  Paul Brook  <paul@nowt.org>
+
+       * configure.in: Don't pull in system libtool.  Use toplevel
+       auxiliary files.
+
+2003-07-22  Paul Brook  <paul@nowt.org>
+
+       Regenerate all configury files.
+
+2003-07-09  Chun Huang  <compiler@sohu.com>
+
+       * intrinsics/string_intrinsic.c (string_scan): New function.
+       (string_verify): New function.
+
+2003-06-25  Paul Brook  <paul@nowt.org>
+
+       * io/unix.c (mem_alloc_r_at, mem_alloc_w_at): Advance logical_offset.
+       (mem_seek): Don't bother setting physical_offset.
+
+2003-06-20  Paul Brook  <paul@nowt.org>
+
+       * libgfor.h (stop_numeric): Declare.
+       * runtime/pause.c: New file.
+       * Makefile.am: Add it.
+
+2003-06-08  Paul Brook  <paul@nowt.org>
+
+       * m4/cexp.m4 (cabs): Use correct typed version.
+       (csqrt): New function.
+
+2003-06-07  Canqun Yang  <canqun@yahoo.com.cn>
+
+       Spotted by Benjamin and Tobias:
+       * io/list_read.c: Add Separator '\t'.
+       (parse_real, read_real): Accept real values starting with an optional
+       sign follows a decimal point.
+
+2003-06-06  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * Makefile.am: Don't put cmath objects in subdir.
+       * configure.in: Rename MATHOBJ to MATH_OBJ.
+
+2003-06-02  Kejia Zhao  <Kejia_zh@yahoo.com.cn>
+
+       * intrinsics/associated.c: New file.
+       * Makefile.am: Add it. Regenerate Makefile.in.
+       * libgfor.h: Define g95_array_void, G95_DESCRIPTOR_DATA, and
+       G95_DESCRIPTOR_DTYPE.
+
+2003-06-01  Canqun Yang  <canqun@yahoo.com.cn>
+
+       * io/write.c (calcuate_exp): Rewrite it to avoid overflow.
+       (calculate_G_format): Rewrite it to eliminate an infinte loop and set
+       the scale_factor to 0 for F editing.
+
+2003-05-11  Tobias Schlter  <innenminister@gmx.de>
+
+       * libgfor.h: Only include stdint.h if it exists.
+
+2003-05-07  Paul Brook  <paul@nowt.org>
+
+       * libgfor.h: Use stdint.h types.
+       * intrinsics/ishift.c: Ditto.
+       * runtime/memory.c (malloc_t): Reorder fields for better alignment.
+
+2003-05-05  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * libgfor.h (offsetof): Define if nobody else does.
+       * runtime/memory.c (HEADER_SIZE): Use it.
+
+2003-05-01  Tobias Schlter  <innenminister@gmx.de>
+
+       * configure.in: Require autoconf 2.54.
+
+2003-04-28  Tobias Schlter  <innenminister@gmx.de>
+       Paul Brook  <paul@nowt.org>
+
+       * intrinsics/reshape_generic.c: Copy the whole element, not just the
+       first byte.
+       * m4/transpose.m4: New file.
+       * Makefile.am: Add them.
+       Regenerate generated files.
+
+2003-04-18  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * io/format.c (parse_format_list): Allow 'X' without integer
+       prefix.  This is an extension.  Interpretation is '1X'.
+
+2003-04-18  Tobias Schlter  <Tobias.Schlueter@physik.uni-muenchen.de>
+
+       * io/format.c (parse_format_list): Allow '0P'.
+
+2003-04-18  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * Makefile.in: Re-regenerate for automake 1.7.3.
+
+2003-04-18  Canqun Yang  <canqun@yahoo.com.cn>
+
+       Port implementation for CHARACTER SELECT from Andy's tree.
+       * runtime/select.c: New file
+       * Makefile.am: Add it.
+       * Makefile.in: Regenerate.
+
+2003-04-17  Xiaoqiang Zhang <zhangapache@yahoo.com>
+
+       * io/transfer.c (formatted_transfer): Modified
+       * io/unix.c (move_pos_offset): New Function.
+       * io/format.c (parse_format_list): Modified.
+
+2003-04-15  Xiaoqiang Zhang <zhangapache@yahoo.com>
+
+       * io/write.c (write_float,write_real): New implemention of
+       FMT_G and default float editing.
+       (calculate_exp,calculate_G_format,output_float): New Function.
+       (write_float,write_real,write_logical): Modified
+       * libgfor.h (default_rtoa): Remove Declaration.
+       * runtime/error.c (default_rtoa): Remove Function.
+
+2003-04-15  Steven Bosscher  <steven@gcc.gnu.org>
+
+       Spotted by Yang:
+       * io/write.c (extract_real): Add missing break statement.
+
+2003-04-13  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * cpu_time.c: Make sure we have a definition of HZ.  Don't
+       rely on CLOCKS_PER_SEC, it is always 1000000, on any system.
+
+2003-04-13  Steven Bosscher  <steven@gcc.gnu.org>
+           Paul Brook  <paul@nowt.org>
+
+       * configure.in: Check for process time headers and GETTIMEOFDAY.
+       * makefile.am: Add intrinsics/cpu_time.c.
+       * acinclude.m4: New file.
+       * intrinsics/cpu_time.c: New file.
+       * m4/dotprodl.m4: Fix typo.
+       Regenerate generated files.
+
+2003-04-11  Xiaoqiang Zhang <zhangapache@yahoo.com>
+
+       * io/write.c (extract_real): Ouput floating point value.
+       (write_float): New Function.
+       (write_e, write_f, write_en, write_es): Modified
+       * io/transfer.c (formatted_transfer): Modified.
+       * libgfor.h (default_rtoa): Declaration.
+       (rtoa): Declaration.
+       * runtime/error.c (default_rtoa): New Function.
+       (rtoa): New Function.
+
+2003-04-05  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/spread_generic.c: New file.
+       * Makefile.am: Add it. Regenerate Makefile.in.
+
+2003-03-29  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/pack_generic.c: New file.
+       * intrinsics/unpack_generic.c: New file.
+       * Makefile.am: Add them. Regenerate Makefile.in.
+
+2003-03-25  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/eoshift0.c: New file.
+       * intrinsics/eoshift2.c: New file.
+       * m4/eoshift1.m4: New file.
+       * m4/eoshift3.m4: New file.
+       * Makefile.am: Add them.
+       * in_unpack_generic.c: Initialize src.
+       Regenerate generated files.
+
+2003-03-14  Paul Brook  <paul@nowt.org>
+
+       * m4/shape.m4: Work properly with array temporaries.
+       * m4/in_pack.m4: Skip redundant checks for array temporaries.
+       * runtime/in_pack_generic.c: Ditto.
+
+2003-03-12  Paul Brook  <paul@nowt.org>
+
+       * m4/shape.m4: Work properly with noncontiguous arrays.
+
+2003-03-08  Paul Brook  <paul@nowt.org>
+
+       * m4/in_pack.m4: Correctly handle zero sized and assumed size arrays.
+       * runtime/in_pack_generic.c: Ditto.
+
+2003-02-08  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/reshape_generic.c: Use runtime_error to report errors.
+       * io/close.c (st_close): Return void.
+       * io/open.c (st_open): Return void.
+       * libgfor.h (g95_array_char): Declare.
+       (internal_malloc_size): Ditto.
+       (internal_pack*, internal_unpack*): Ditto.
+       * m4/in_pack.m4: Allocate storage if neccessary.  Fix logic for packed
+       arrays.
+       * m4/in_unpack.m4: Include file fixes.
+       * m4/reshape.m4: Increment the correct source pointer.
+       * Makefile.am (maxloc): Fix typo.
+       * runtime/in_pack_generic.c: Call optimized functions. Allocate
+       storage if neccessary. Fix logic for packed arrays.
+       * runtime/in_unpack_generic.c: Call optimized functions.
+       * runtime/main.c: Use runtime_error to report errors.
+       * memory.c (internal_malloc_size): Make non-static.
+
+2003-02-02  Arnaud Desitter  <arnaud.desitter@geography.oxford.ac.uk>
+
+       * reshape_packed.c, lock.c: Add #include <string.h>.
+       * libgfor.h, format.c, inquire.c, io.h, transfer.c, unix.c,
+       environ.c, error.c, memory.c, string.c: Add const.
+       * error.c (show_locus): Add void.
+
+2003-02-21  Paul Brook  <paul@nowt.org>
+
+       * m4/in_pack.m4: Avoid returning const * parameter.
+       * Makefile.am: Only regenerate files in maintainer mode.
+
+2003-02-20  Paul Brook  <paul@nowt.org>
+
+       Add array repacking support functions.
+       * m4/in_pack.m4, m4/in_unpack.m4: New files.
+       * runtime/in_pack_generic.c, runtime/in_unpack_generic.c: New files.
+       * Makefile.am: Build them.  Regenerate configury files.
+       * generated/: New directory for generated files (need to move
+       everything else there).
+
+2003-02-07  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * m4/cexp.m4: Fix typo.
+
+2003-01-26  Paul Brook  <paul@nowt.org>
+
+       * intrinsics/: Add missing generated files.
+
+2003-01-26  Paul Brook  <paul@nowt.org>
+
+       * Makefile.am: Put -I before the filename.
+
+2003-01-24  Paul Brook  <paul@nowt.org>
+
+       * configure.in: Add AM_MAINTAINER_MODE.
+
+2003-01-23  Paul Brook  <paul@nowt.org>
+
+       * configure.in, Makefile.am: Modify to work with unmodified autoconf
+       and auotmake.
+       Also regenerate other configury files.
+
+2003-01-21  Paul Brook  <paul@nowt.org>
+
+       * io/read.c: Don't use stdint.h, it doesn't exist on cygwin.
+
+2003-01-20  Steven Bosscher  <s.bosscher@student.tudelft.nl>
+
+       * io/read.c (read_f): Don't use alloca, but safe get_mem instead.
+       Don't include "alloca.h".
+
+2003-01-20  Steven Bosscher  <s.bosscher@student.tudelft.nl>
+
+       * intrinsics/string.c: Rename to intrinsics/string_intrinsics.c.
+       * Makefile.am: Adjust file name.
+       * Makefile.in: Regenerate.
+       * gfortypes.h: Kill, include everything in...
+       * libgfor.h: ...here.  Include config.h
+       * fmain.c, intrinsics/ishftc.c, intrinsic/reshape_generic.c,
+       intrinsics/reshape_i4.c, intrinsics/reshape_i8.c,
+       intrinsics/reshape_packed.c, intrinsics/size.c,
+       m4/reshape.m4, runtime/main.c, runtime/memory.c: Use macro
+       for prefix for all functions instead of hardcoded.
+
+2003-01-19  Steven Bosscher  <s.bosscher@student.tudelft.nl>
+
+       * io/lock.c (library_end): Propagate library return
+       code.
+
+2003-01-19  Steven Bosscher  <s.bosscher@student.tudelft.nl>
+
+       Port fixes from Andy's tree:
+       * io/read.c (read_decimal): Reverse sense of overflow
+       comparison during integer reads.
+       * io/format.c (revert): Fix comment.
+       (next_format): Fix format revision.
+       * io/unix.c: Fix and simplify mmap version of stream
+       functions.
+
+2003-01-11  Paul Brook  <paul@nowt.org>
+
+       * configure, Makefile.in: Regenerate.
+
+2003-01-11  Paul Brook  <paul@nowt.org>
+
+       * runtime/stop.c: Rewrite.
+
+2003-01-08  Paul Brook  <paul@nowt.org>
+
+       * configure, Makefile.in: Regenerate.
+
+2003-01-05  Paul Brook  <paul@nowt.org>
+
+       * (*.m4) Move to m4/.
+       * intrinsics/string.c (_gfor_string_index): New Function.
+
+\f
+Copyright (C) 2003 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2004 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2004
new file mode 100644 (file)
index 0000000..4775115
--- /dev/null
@@ -0,0 +1,1111 @@
+2004-12-27  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * libgfortran/libgfortran.h (GFC_UINTEGER_1, GFC_UINTEGER_2):
+       Define.
+       * intrinsics/ishftc.c: Update copyright years.
+       (ishftc8): Change 'shift' and 'size' to GFC_INTEGER_4.
+       * intrinsics/mvbits.c: Correct non-ASCII character in my name.
+       Add implementations for GFC_INTEGER_1 and GFC_INTEGER_2.
+
+2004-12-23  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/19071
+       * io/tranfer.c (formatted_transfer): moved check for
+       format reversion inside the processing loop.
+
+2004-12-19  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>
+
+       PR libfortran/19074
+       * libgfortran.h (itoa): Rename to gfc_itoa.
+       * io/write.c (itoa): Same.
+       * runtime/environ.c (itoa): Same.
+       * runtime/error.c (itoa): Same.
+
+2004-12-15  Bud Davis  <bdavis9659@comcast.net>
+           Steven G. Kargl  <kargls@comcast.net>
+
+       PR fortran/17597
+       * io/list_read.c (read_real): do not push back a comma when
+       it delimits a real value without a decimal point
+
+2004-12-14  Steve Ellcey  <sje@cup.hp.com>
+
+       * libgfortran/io/transfer.c (us_read): Use memcpy/memset
+       instead of assignment to fill unaligned buffer.
+       (us_write): Ditto.
+       (next_record_w): Ditto.
+
+2004-12-14  Steven G. Kargl  <kargls@comcast.net>
+
+       PR libfortran/18966
+       * gfortran.h: typedef GFC_INTEGER_1 and GFC_INTEGER_2
+       * intrinsics/cshift0.c (cshift0_1,cshift0_2): New functions.
+       * intrinsics/eoshift0.c (eoshift0_1,eoshift0_2): New functions.
+       * intrinsics/eoshift2.c (eoshift2_1,eoshift2_2): New functions.
+
+2004-12-13  David Edelsohn  <edelsohn@gnu.org>
+
+       * io/transfer.c (read_sf): Change bitwise "and" to logical "and".
+
+2004-12-12  Richard Henderson  <rth@redhat.com>
+
+       * intrinsics/cshift0.c, intrinsics/eoshift0.c, intrinsics/eoshift2.c,
+       intrinsics/pack_generic.c, intrinsics/reshape_generic.c,
+       intrinsics/spread_generic.c, intrinsics/transpose_generic.c,
+       intrinsics/unpack_generic.c, m4/cshift1.m4, m4/dotprod.m4,
+       m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4, m4/eoshift3.m4,
+       m4/iforeach.m4, m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4,
+       m4/reshape.m4, m4/shape.m4, m4/transpose.m4: Use standard prefix
+       instead of "__".
+       * generated/*: Rebuild.
+
+2004-12-12  Richard Henderson  <rth@redhat.com>
+
+       * acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
+       (LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT): New.
+       (LIBGFOR_CHECK_ATTRIBUTE_ALIAS): New.
+       * configure.ac: Use them.
+       * configure, config.h.in, aclocal.m4: Rebuild.
+       * libgfortran.h (prefix): Remove.
+       (PREFIX, IPREFIX): New.
+       (sym_rename, sym_rename1, sym_rename2): New.
+       (internal_proto, export_proto, export_proto_np): New.
+       (iexport_proto, iexport): New.
+       (iexport_data_proto, iexport_data): New.
+       * intrinsics/abort.c, intrinsics/args.c, intrinsics/associated.c,
+       intrinsics/cpu_time.c, intrinsics/cshift0.c,
+       intrinsics/date_and_time.c, intrinsics/env.c, intrinsics/eoshift0.c,
+       intrinsics/eoshift2.c, intrinsics/etime.c, intrinsics/exit.c,
+       intrinsics/flush.c, intrinsics/fnum.c, intrinsics/getXid.c,
+       intrinsics/getcwd.c, intrinsics/ishftc.c, intrinsics/mvbits.c,
+       intrinsics/pack_generic.c, intrinsics/rand.c, intrinsics/random.c,
+       intrinsics/reshape_generic.c, intrinsics/size.c,
+       intrinsics/spread_generic.c, intrinsics/stat.c,
+       intrinsics/string_intrinsics.c, intrinsics/system.c,
+       intrinsics/system_clock.c, intrinsics/transpose_generic.c,
+       intrinsics/umask.c, intrinsics/unlink.c, intrinsics/unpack_generic.c,
+       io/backspace.c, io/close.c, io/endfile.c, io/inquire.c, io/io.h,
+       io/open.c, io/rewind.c, io/transfer.c, libgfortran.h, m4/cshift1.m4,
+       m4/dotprod.m4, m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4,
+       m4/eoshift3.m4, m4/exponent.m4, m4/fraction.m4, m4/iforeach.m4,
+       m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4, m4/nearest.m4,
+       m4/pow.m4, m4/reshape.m4, m4/set_exponent.m4, m4/shape.m4,
+       m4/transpose.m4, runtime/environ.c, runtime/error.c,
+       runtime/in_pack_generic.c, runtime/in_unpack_generic.c,
+       runtime/main.c, runtime/memory.c, runtime/pause.c, runtime/select.c,
+       runtime/stop.c: Use them to mark symbols internal or external.
+       * generated/*: Rebuild.
+
+2004-12-09  David Edelsohn  <edelsohn@gnu.org>
+
+       PR bootstrap/18895
+       Revert 2004-12-07 change.
+       * Makefile.am (AM_MAKEFLAGS): Delete.
+       * Makefile.in: Regenerate.
+
+2004-12-07  Steve Ellcey  <sje@cup.hp.com>
+
+       * libgfortran/Makefile.am (AM_MAKEFLAGS): New.
+       * libgfortran/Makefile.in: Regenerate
+
+2004-12-07  Steve Ellcey  <sje@cup.hp.com>
+
+       * io/io.h (open_external): Change prototype.
+       * io/unix.c (regular_file): Change prototype and set flags->action if
+       needed.
+       (open_external): Ditto.
+       * io/open.c (new_unit): Let open_external set flags->action.
+
+2004-12-07  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * configure.ac: Check for ieeefp.h.  Check for fabsf in libm.
+       * configure: Regenerate.
+       * config.h.in: Likewise.
+       * c99_protos.h: New file.
+       * libgfortran.h: Include c99_protos.h and conditionally ieeefp.h.
+       * intrinsics/c99_functions.c (fabsf): New function.
+
+2004-12-06  Richard Henderson  <rth@redhat.com>
+
+       * intrinsics/cshift0.c, intrinsics/eoshift0.c, intrinsics/eoshift2.c,
+       intrinsics/pack_generic.c, intrinsics/string_intrinsics.c,
+       intrinsics/transpose_generic.c, m4/ifunction.m4, m4/matmul.m4,
+       m4/matmull.m4, m4/transpose.m4: Use internal_malloc_size instead
+       of internal_malloc.
+       * generated/*: Rebuild.
+
+2004-12-06  Richard Henderson  <rth@redhat.com>
+
+       * intrinsics/c99_functions.c, intrinsics/eoshift0.c,
+       intrinsics/eoshift2.c, intrinsics/exit.c, intrinsics/flush.c,
+       intrinsics/ishftc.c, intrinsics/mvbits.c, intrinsics/pack_generic.c,
+       intrinsics/random.c, intrinsics/reshape_generic.c, intrinsics/size.c,
+       intrinsics/spread_generic.c, intrinsics/stat.c,
+       intrinsics/string_intrinsics.c, intrinsics/system_clock.c,
+       intrinsics/transpose_generic.c, intrinsics/unlink.c,
+       intrinsics/unpack_generic.c, io/backspace.c, io/format.c,
+       io/list_read.c, io/lock.c, io/open.c, io/transfer.c, io/unix.c,
+       io/write.c, runtime/environ.c, runtime/error.c,
+       runtime/in_pack_generic.c, runtime/in_unpack_generic.c, runtime/main.c,
+       runtime/memory.c, runtime/pause.c, runtime/stop.c,
+       runtime/string.c: Whitespace fixes.
+
+2004-12-06  Richard Henderson  <rth@redhat.com>
+
+       * Makefile.am: Generate all m4 output under $(srcdir).
+       * Makefile.in: Regenerate.
+
+2004-12-02  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/18710
+       * io/transfer.c (unformatted_read, unformatted_write): width of
+       a COMPLEX is twice its kind.
+
+2004-12-02  Richard Sandiford  <rsandifo@redhat.com>
+
+       * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version.
+       * configure, aclocal.m4, Makefile.in: Regenerate.
+
+2004-12-02  Bud Davis  <bdavis9659@comcast.net>
+
+       PR libfortran/18284
+       * io/unix.c (fd_alloc_w_at): Update file_length when extending.
+       * io/backspace.c (formatted_backspace): Reset endfile after backspace.
+
+2004-12-02  Bud Davis  <bdavis9659@comcast.net>
+
+       * io/inquire.c (inquire_via_unit): do not allow a direct access
+       file to be opened for sequential I/O.
+
+2004-12-02  Steven G. Kargl  <kargls@comcast.net>
+       Paul Brook  <paul@codesourcery.com>
+
+       * intrinsics/flush.c: New file.
+       * intrinsics/fnum.c: ditto
+       * intrinsics/stat.c: ditto
+       * io/io.h (unit_to_fd): Add prototype.
+       * io/unix.c (unit_to_fd): New function.
+       * configure.ac: Add test for members of struct stat.  Check for
+       sys/types.h and sys/stat.h
+       * Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
+       * configure.in: Regenerate.
+       * config.h.in: Regenerate.
+       * Makefile.in: Regenerate.
+
+2004-12-01  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>
+
+       * Makefile.am (AM_CPPFLAGS): Use -iquote instead of -I.
+
+2004-11-28  Bud Davis  <bdavis9659@comcast.net>
+
+       * io/unix.c (mmap_alloc_w_a): check for a write to a location
+       less than the mapped area.
+
+2004-11-27  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/18364
+       *  io/endfile.c (st_endfile): flush the stream before truncating.
+
+2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
+
+       * configure: Regenerate for libtool change.
+
+2004-11-22  Steven Bosscher  <stevenb@suse.de>
+
+       PR libfortran/15960
+       * configure.ac: Check for finite in libm.
+       * libgfortran.h: Define isfinite macro if not defined.
+       * intrinsics/c99_functions.c: Use defined(fpclassify) instead of
+       HAVE_FPCLASSIFY.
+       * io/write.c (write_float): Use isfinite instead of finite.
+       * configure, config.h.in: Rebuilt.
+
+2004-11-20  Roger Sayle  <roger@eyesopen.com>
+
+       * io/write.c (write_float, list_formatted_write): Fix indentation.
+
+2004-11-20  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR target/16135
+       * acinclude.m4 (LIBGFOR_TARGET_ILP32): New check.
+       * configure.ac: Include LIBGFOR_TARGET_ILP32.
+       * configure: Regenerate.
+       * config.h.in: Likewise.
+       * libgfortran.h: Provide default definitions for C99 types
+       on ILP32 targets that don't have them.
+
+       PR target/17999
+       * configure.ac: Check for snprintf.
+       * configure: Regenerate.
+       * config.h.in: Likewise.
+       * intrinsics/date_and_time.c (date_and_time): Do not
+       use snprinf if it is not available.
+       * io/write.c (output_float): Likewise.
+
+2004-11-20  Steven G. Kargl  <kargls@comcast.net>
+
+       * Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
+       * Makefile.in: Regenerated
+       * intrinsics/umask.c: New file
+       * intrinsics/unlink.c: ditto
+       * intrinsics/exit.c: ditto
+
+2004-11-18  Victor Leikehman  <lei@il.ibm.com>
+
+       * m4/matmul.m4: Loops reordered to improve cache behavior.
+       * generated/matmul_??.c: Regenerated.
+
+2004-11-10  Paul Brook  <paul@codesourcery.com>
+
+       PR fortran/18218
+       * configure.ac: Check for strtof.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+       * io/read.c (convert_real): Use strtof if available.
+       (convert_precision_real): Remove.
+       (read_f): Avoid poor exponentiation algorithm.
+
+2004-11-05  Andreas Schwab  <schwab@suse.de>
+
+       * configure.ac: Use AC_PROG_FC, FC and FCFLAGS instead of
+       AC_PROG_F77, F77 and FFLAGS.
+       * Makefile.am (selected_int_kind.inc, selected_real_kind.inc): Use
+       FCCOMPILE instead of F77COMPILE.
+       * configure, Makefile.in: Regenerate.
+
+2004-11-05  Kelley Cook  <kcook@gcc.gnu.org>
+
+       * acinclude.m4: Properly quote AC_CACHE_CHECK.
+       * Makefile.am: Add in ACLOCAL_AMFLAGS.
+       * aclocal.m4, configure, Makefile.in: Regenerate.
+
+2004-10-30  Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * configure.ac (AC_CHECK_FUNCS): Add mkstemp.
+       * io/unix.c (S_IRGRP): Define if undefined.
+       (S_IWGRP): Same.
+       (S_IROTH): Same.
+       (S_IWOTH): Same.
+       (tempfile): Use mktemp if mkstemp missing, fix typos.
+
+2004-10-30  Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+       *  intrinsics/system.c ("libgfortran.h"): Move after system headers.
+
+2004-10-30  Canqun Yang  <canqun@nudt.edu.cn>
+
+       * intrinsics/rand.c (irand): Handle NULL argument.
+
+2004-10-07  Paul Brook  <paul@codesourcery.com>
+
+       * io/transfer.c (finalize_transfer): Free internal streams.
+       * io/unix.c (mem_close): Free stream object.
+
+2004-10-07  Paul Brook  <paul@codesourcery.com>
+
+       * intrinsics/string_intrinsics.c (string_verify): Fix off by one
+       error.
+
+2004-10-06  Paul Brook  <paul@codesourcery.com>
+
+       PR libfortran/17709
+       * io/transfer.c (data_transfer_init): Reset sf_seen_eor.
+
+2004-10-04  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * intrinsics/mvbits.c: Commit the file.
+
+2004-10-04  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/17283
+       * intrinsics/pack_generic.c (__pack): Allocate memory for return array
+       if not done by caller.
+       (__pack_s): New function.
+       * runtime/memory.c (internal_malloc, internal_malloc64): Allow
+       allocating zero memory.
+
+       PR fortran/17631
+       * Makefile.am (gfor_helper_src): Add intrinsics/mvbits.h.
+       * Makefile.in: Regenerate.
+       * intrinsics/mvbits.h: New file.
+
+       PR fortran/17776
+       * intrinsics/system.c: New file.
+       * Makefile.am: Add dependency for the new file.
+       * Makefile.in: Regenerate.
+
+2004-10-04  Paul Brook  <paul@codesourcery.com>
+       Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/17706
+       PR fortran/16434
+       * io/format.c (parse_format_list): Set repeat count for S, SP, SS,
+       BN and BZ formats.
+       * io/write.c (output_float): Don't output minus zero.
+
+2004-10-03  Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+       * intrinsics/abort.c ("libgfortran.h"): Move.
+       * intrinsics/date_and_time.c ("libgfortran.h"): Same.
+       * intrinsics/write.c ("libgfortran.h"): Same.
+
+2004-09-26  Tobias Schlueter  <tobis.schlueter@physik.uni-muenchen.de>
+
+       PR libfortran/16137
+       * config.h.in (HAVE_POWF): Undefine.
+       * configure.ac: Check for 'powf' in library.
+       * configure: Regenerate.
+       * intrinsics/c99_functions.c (powf): New function.
+
+2004-09-24  Tobias Schlueter  <tobis.schlueter@physik.uni-muenchen.de>
+
+       * intrinsics/etime.c (etime_): New function.
+
+2004-09-21  Steven G. Kargl  <kargls@comcast.net>
+
+       * libgfortran.h: define gfc_alloca()
+       * intrinsics/env.c (getenv, get_environment_variable_i4): Use it.
+
+2004-09-21  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/17286
+       * io/list_read.c (namelist_read): ignore spaces after
+       the '=' for namelist reads.
+
+2004-09-15  Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * configure.ac (AC_CHECK_HEADERS): Check for sys/mman.h.
+       * unix.c: Include stdio.h.
+       (HAVE_SYS_MMAN_H): Check.
+       (PROT_READ, PROT_WRITE): Provide default definitions.
+
+2004-09-15  Steven G. Kargl  <kargls@comcast.net>
+
+       * intrincics/getcwd.c: New file.
+       * Makefile.am: Add getcwd.c.
+       * Makefile.in: Regenerated.
+
+2004-09-15  Steven G. Kargl  <kargls@comcast.net>
+       Paul Brook  <paul@codesourcery.com>
+
+       * intrinsics/env.c (getenv, get_environmental_variable): Remove
+       trailing white space.  Use alloca.  Honour trim_name.
+
+2004-09-13  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/17090
+
+       * io/list_read.c (list_formatted_read): Handle trailing spaces
+       at end of line.
+
+2004-09-06  Steven G. Kargl  <kargls@comcast.net>
+
+       * io/write.c (output_float): Typo in comment.  Remove debugging
+       printf.  Fix format for FP of form 1e10.
+
+2004-09-03  Richard Henderson  <rth@redhat.com>
+
+       * intrinsics/cshift0.c (DEF_COPY_LOOP, copy_loop_int, copy_loop_long,
+       copy_loop_double, copy_loop_ldouble): New.
+       (__cshift0): Make shift type ssize_t.  Use % operator instead of
+       div.  Use specialized versions of copy loop depending on the shape.
+
+2004-09-02  Paul Brook  <paul@codesourcery.com>
+
+       * io/format.c (parse_format_list): Set repeat count for P descriptors.
+       * write.c (output_float): Fix condition.  Correctly handle nonzero
+       scale factor.
+
+2004-09-01  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * mk-sik-inc.sh: Use a temporary string instead of 'echo -n'.
+       * mk-srk-inc.sh: Likewise.
+
+2004-09-01  Paul Brook  <paul@codesourcery.com>
+
+       * runtime/error.c (generate_error): Set both iostat and
+       library_return.
+
+2004-08-31  Paul Brook  <paul@codesourcery.com>
+
+       PR libfortran/16805
+       * io/list_read.c (next_char): Don't signal EOF for internal files.
+       * io/unix.c (mem_alloc_r_at): Don't return NULL for incomplete reads.
+
+2004-08-31  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * io/unit.c: Separate copyright years by ','.
+       (compare, insert_unit, delete_unit, is_internal_unit, close_units):
+       Remove blank line in beginning of function.
+       (get_unit): Simplify code.
+
+2004-08-31  Paul Brook  <paul@codesourcery.com>
+
+       * io/unit.c (get_unit): Remove superfluous if.
+
+2004-08-31  Paul Brook  <paul@codesourcery.com>
+
+       * io/transfer.c (read_sf): Rename uinty to readlen.  Detect EOF.
+       (finalize_transfer): Move setjmp after namlist IO.
+       * io/unix.c (mem_alloc_r_at): Calculate remaining length correctly.
+
+2004-08-31  Paul Brook  <paul@codesourcery.com>
+
+       * list_read.c (eat_separator): Set at_eo when a '/' is seen.
+
+2004-08-31  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * libgfortran.h: Replace 'gfc_strlen_type' by
+       'gfc_charlen_type'. Update comment accordingly.
+       * intrinsics/args.c, intrinsics/env.c, io/io.h, io/transfer.c:
+       Replace all occurences of 'gfc_strlen_type' by 'gfc_charlen_type'.
+
+2004-08-31  Paul Brook  <paul@codesourcery.com>
+
+       * libgfortran.h: Add comments.
+
+2004-08-30  Richard Henderson  <rth@redhat.com>
+
+       * Makefile.am (gfor_helper_src): Split selected_kind.f90.
+       (gfor_built_src): Add selected_int_kind.inc selected_real_kind.inc.
+       (selected_int_kind.inc selected_real_kind.inc): New rules.
+       * Makefile.in: Regenerate.
+       * mk-sik-inc.sh, mk-srk-inc.sh: New files.
+       * intrinsics/selected_int_kind.f90: Split from selected_kind.f90,
+       include table of detected kinds.
+       * intrinsics/selected_real_kind.f90: Similarly.
+
+2004-08-29  Steven G. Kargl  <kargls@comcast.net>
+       Paul Brook  <paul@codesourcery.com>
+
+       * intrinsics/bessel.c: New file.
+       * intrinsics/erf.c: New file.
+       * Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
+       * configure.ac: Test for C99 Bessel and Error functions.
+       * Makefile.in: Regenerate.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2004-08-29  Steven G. Kargl  <kargls@comcast.net>
+       Paul Brook  <paul@codesourcery.com>
+
+       * Makefile.am: Add intrinsics/getXid.c.
+       * configure.ac: Add tests for get{g,p,u}id.
+       * config.h.in: Regenerate.
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+
+2004-08-28  Paul Brook  <paul@codesourcery.com>
+
+       PR libfortran/17195
+       * libgfortran.h (rtoa): Remove prototype.
+       * runtime/error.c (rtoa): Remove.
+       * io/write.c (calculate_G_format): Don't add blanks if E format is
+       used.  Add correct number of blanks when exponent width is specified.
+       (output_float): Rewrite.
+
+2004-08-27  Paul Brook  <paul@codesourcery.com>
+
+       * io/rewind.c (st_rewind): Reset unit to read mode.
+
+2004-08-27  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/16597
+       * io/io.h: created typedef for unit_mode.
+       * io/io.h (gfc_unit): added mode to unit structure.
+       * io/transfer.c (data_transfer_init): flush if a write then
+       read is done on a unit (direct access files).
+       * io/rewind.c (st_rewind): Used unit mode instead of global.
+
+2004-08-24  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/17143
+       * runtime/error.c (itoa): keep from overflowing during
+       mod operation by using unsigned variable.
+
+2004-08-24  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/17164
+       * runtime/string_intrinsics.c (string_index):check for
+       substring longer than string.
+
+2004-08-24  David Edelsohn  <edelsohn@gnu.org>
+
+       * Makefile.am (libgfortran_la_LDFLAGS): Add -lm.
+       * Makefile.in: Rebuilt.
+
+2004-08-23  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * io/io.h, io/list_read.c, io/open.c, io/transfer.c, io/write.c:
+       Fix formatting issues, update copyright years.
+
+2004-08-21  Bud Davis  <bdavis9659@comcast.net>
+
+       PR 16908
+       * io/transfer.c (next_record_w): Do not blank pad.
+       * io/transfer.c (next_record): Take into account partial records.
+
+2004-08-18  Victor Leikehman  <lei@il.ibm.com>
+
+       PR fortran/13278
+       * io/transfer.c (st_set_nml_var)
+       * io/write.c (namelist_write): Allow var_name and var_name_len to be
+       null. For strings, use string_length field instead of len.
+       * io/io.h (struct namelist_type): New field string_length.
+       (st_set_nml_var_char): New argument string_length.
+
+2004-08-13  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/16935
+       * io/open.c (st_open): use flags instead of the unit structure.
+
+2004-08-10  Victor Leikehman  <lei@il.ibm.com>
+
+       * io/list_read.c (namelist_read): Convert variable names
+       to lower case, so that mixed-case names are recognized.
+       Don't read beyond terminating slash.
+
+2004-08-09  Richard Henderson  <rth@redhat.com>
+           Roger Sayle  <roger@eyesopen.com>
+
+       * intrinsics/c99_functions.c (nextafterf): New implementation that
+       works correctly with denormalized numbers.
+
+2004-08-09  Victor Leikehman  <lei@il.ibm.com>
+
+       * m4/matmul.m4, m4/matmull.m4, intrinsics/eoshift0.c,
+       intrinsics/eoshift2.c, intrinsics/transpose_generic.c:
+       Allocate space if return value has NULL in its data field.
+       * generated/*.c: Regenerate.
+
+2004-08-06  Janne Blomqvist  <jblomqvi@cc.hut.fi>
+
+       * intrinsics/env.c: New file.
+       * Makefile.am: Add env.c to build.
+       * Makefile.in: Regenerate.
+
+2004-08-05  Victor Leikehman  <lei@il.ibm.com>
+
+       PR libfortran/16704
+       * io/read.c (read_radix): Understand letters f and F as hex digits.
+
+2004-08-04  Victor Leikehman  <lei@il.ibm.com>
+
+       * libgfortran.h (array_t, size0) New declarations.
+       * m4/ifunction.m4, m4/transpose.m4, intrinsics/cshift0.c: Allocate
+       space if return value descriptor has NULL in its data field,
+       and initialize bounds and stride.
+       * intrinsics/size.c (array_t, size0): Declarations moved to
+       libgfortran.h.
+       * generated/*.c: Regenerate.
+
+2004-08-03  Roger Sayle  <roger@eyesopen.com>
+
+       PR libfortran/16137
+       * configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
+       copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
+       scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+       * instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
+       copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
+       nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
+       implementations for targets that don't support C99 float functions.
+
+2004-08-01  Roger Sayle  <roger@eyesopen.com>
+
+       * io/write.c (write_float): Use the slightly more portable isnan
+       in preference to isinf.
+
+2004-07-18  Bud Davis  <bdavis9659@comcast.net>
+
+       * configure.ac: Add check for LFS support.
+       * configure: Regenerate
+
+2004-07-11  Paul Brook  <paul@codesourcery.com>
+
+       PR fortran/16303
+       * m4/cexp.m4 (carg): Return -pi to pi.
+       * generated/exp_c?.c: Regenerate.
+
+2004-07-08  Andreas Krebbel  <krebbel1@de.ibm.com>
+
+       PR fortran/16291
+       * libgfortran/io/write.c: (write_float): Added length check.
+       Remove pointless memset calls.
+
+2004-07-04  Bud Davis  <bdavis9659@comcast.net>
+           Paul Brook  <paul@codesourcery.com>
+
+       PR fortran/15472
+       * io/transfer.c(us_write): set recl for seq unform writes to max size.
+       * io/transfer.c(data_transfer_init): handle un-opened seq unform unit.
+       * io/unix.c(fd_alloc_w_at): handle requests at start, fd_flush at
+       right time.
+       * io/unix.c(is_seekable): set based upon the file/device, not the
+       method being used to access it (fd or mmap).
+       * io/unix.c(fd_flush): don't set file_size if !seekable.
+       * io/unix.c(fd_truncate: ditto.
+
+2004-07-04  Janne Blomqvist  <jblomqvi@cc.hut.fi>
+       Paul Brook  <paul@codesourcery.com>
+
+       PR fortran/15280
+       PR fortran/15665
+       * libgfortran.h (gfc_strlen_type): Define.
+       * intrinsics/args.c (getarg): Rename ...
+       (getarg_i4): ... to this.
+       (getarg_i8, get_command_argument_i4, get_command_argument_i8,
+       get_command_i4, get_command_i8): New functions.
+
+2004-07-04  Matthias Klose  <doko@debian.org>
+
+       * libtool-version: New.
+       * Makefile.am (libgfortran_la_LDFLAGS): Use -version-info for soname.
+       * Makefile.in: Regenerate.
+       * configure.ac: Remove libtool_VERSION macro
+       * configure: Regenerate
+
+2004-06-30  Steve Kargl  <sgk@troutmask.apl.washington.edu>
+           Steven Bosscher  <stevenb@suse.de>
+
+       * intrinsics/rand.c (rand): Wrap the irand() call from the previous
+       commit in prefix.
+
+2004-06-29  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+       Paul Brook  <paul@codesourcery.com>
+
+       * runtime/normalize.c (normalize_r4_i4, normalize_r8_i8): Fix
+       comments.
+       * intrinsics/rand.c (rand): Call irand() in call to normalize_r4_i4.
+
+2004-06-27  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/12839
+       * io/write.c (write_float): check signbit for Infinity.
+
+2004-06-26  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/16196
+       * unix.c(regular_file): create file if it does not exist.
+
+2004-06-24  Andrew Pinski  <apinski@apple.com>
+
+       * configure.ac: Remove check for libmx.
+       * configure: Regenerate.
+
+2004-06-22  Janne Blomqvist  <jblomqvi@cc.hut.fi>
+
+       PR fortran/15750
+       * inquire.c (st_inquire): Add comment
+       * io.h (st_parameter): Add iolength.
+       (st_iolength, st_iolength_done): Declare.
+       * transfer.c (iolength_transfer, iolength_transfer_init,
+       st_iolength, st_iolength_done): New functions.
+
+2004-06-21  Steven G. Kargl  <kargls@comcast.net>
+
+       * etime.c (etime_sub): Remove array rank check;
+       Add check for sufficient space.
+
+2004-06-19  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/16080
+       * io/list_read.c(set_value): fixed spelling.
+
+2004-06-19  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/16080
+       * io/list_read.c(set_value): don't copy if the string is null.
+
+2004-06-14  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/15292
+       * intrinsics/c99_functions.c: Use fpclassify if it exists.
+
+2004-06-13  Paul Brook  <paul@codesourcery.com>
+
+       * Makefile.am (gfor_helper_src): Add runtime/normalize.f90.
+       * configure.ac: Add checks for nextafter and nextafterf.
+       * Makefile.in, config.h.in, configure: Regenerate.
+       * libgfortran.h (normalize_r4_i4, normalize_r8_i8): Declare.
+       * intrinsics/rand.c (rand): Use normalize_r4_i4.
+       * intrinsics/random.c (random_r4): Use normalize_r4_i4.
+       (random_r8): Use normalize_r8_i8.
+       * runtime/normalize.c: New file.
+
+2004-06-13  Steven G. Kargl  <kargls@comcast.net>
+           Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * random.c: Fix several spelling and formatting mistakes in
+       comments.
+       (random_r8): Fix loop to make random numbers range in [0,1(.
+
+
+2004-06-13  Steven G. Kargl  <kargls@comcast.net>
+
+       * random.c (random_r4): Burn a random number.
+       (random_r8): fix infinite loop.
+
+2004-06-12  Bud Davis  <bdavis9659@comcast.net>
+           Steve Kargl  <sgk@troutmask.apl.washington.edu>
+
+       PR gfortran/15292
+       * intrinsics/c99_functions.c: New file.
+       * Makefile.am: Add new file.
+       * configure.ac: Added test for round/roundf.
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+       * configure.h.in: Regenerate.
+
+2004-06-12  Steven G. Kargl  <kargls@comcast.net>
+
+       * Makefile.am: Add rand.c and etime.c
+       * Makefile.in: Regenerated.
+       * aclocal.in: Regenerated.
+       * cpu_time.c (second_sub, second): New functions.
+       * rand.c (irand, rand, srand): New file.
+       * etime.c (etime_sub, etime): New file.
+
+2004-06-12  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+           Steven Bosscher  <stevenb@suse.de>
+
+       PR fortran/14923
+       * intrinsics/date_and_time.c: New file.
+       * Makefile.am (gfor_helper_src): Add intrinsics/date_and_time.c.
+       * Makefile.in, aclocal.m4: Regenerate.
+       * libgfortran.h: Prototype date_and_time().
+
+2004-06-12  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/15665
+       * intrinsics/args.c: Implement GETARG and IARGC.
+       * Makefile.am: Add it.
+       * Makefile.in: Regenerate.
+
+2004-06-12  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/12839
+       * io/write.c(write_float): Format inf and nan IAW F2003.
+
+2004-06-09  Bud Davis  <bdavis9659@comcaste.net>
+
+       PR gfortran/14897
+       * io/transfer.c (formatted_transfer): position is unique
+        for T and TL edit descriptors.
+       (data_transfer_init): set record length to size of internal
+        file.
+
+2004-06-09  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/15755
+       * io/backspace.c(st_backspace): call correct routine for
+       formatted and un-formatted units.
+
+2004-05-30  Andreas Jaeger  <aj@suse.de>, Steven Bosscher <stevenb@suse.de>
+
+       PR gfortran/11800
+       * Makefile.am (AM_CPPFLAGS): Renamed from INCLUDES.
+       (lib_LTLIBRARIES): Rename to ...
+       (toolexeclib_LTLIBRARIES): this for multilib support.
+       * configure.in: Rename to ...
+       * configure.ac: this.  Update to modern autoconf style, enable
+       multilibs, support --enable-version-specific-runtime-libs.
+       * Makefile.in: Regenerated.
+       * configure: Regenerated.
+       * aclocal.m4: Regenerated.
+
+2004-05-30  Steven G. Kargl  <kargls@comcast.net>
+
+       * libgfortran.h (random_seed): Update prototype.
+       * intrinsics/random.c: Disable old implementation and add new one.
+
+2004-05-30  Andreas Jaeger  <aj@suse.de>
+
+       * intrinsics/random.c: Include unistd.h for close and read
+       prototypes, remove unneeded inclusion of assert.h.
+
+       * intrinsics/abort.c: Include stdlib.h for abort prototype, remove
+       unneeded inclusion of assert.h.
+
+2004-05-27  Tobias Schlueter  <tobias.shclueter@physik.uni-muenchen.de>
+
+       PR fortran/15234
+       * intrinsics/associated.c: Remove enum.
+       (associated): Replace TRUE/FALSE by 1/0.
+
+2004-05-23  Steven G. Kargl  <kargls@comcast.net>
+
+       * random.c (random_seed): Use correct variable.
+
+2004-05-22  Steven G. Kargl  <kargls@comcast.net>
+
+       * intrinsics/system_clock: New file.
+       * Makefile.am: Add intrinsics/system_clock.c.
+       * Makefile.in: Regenerate.
+
+2004-05-21  Roger Sayle  <roger@eyesopen.com>
+
+       * io/format.c (parse_format_list): Allow the comma after a string
+       literal to be optional.
+
+2004-05-18  Paul Brook  <paul@codesourcery.com>
+       Feng Wang  <fengwang@nudt.edu.cn>
+
+       * Makefile.am (i_pow_c): Set it. Add build rule.
+       (gfor_built_src): Use it.
+       (m4_files): add m4/pow.m4.
+       * Makefile.in: Regenerate.
+       * m4/pow.m4: New file.
+       * generated/pow_*.c: Regenerate.
+
+2004-05-18  Paul Brook  <paul@codesourcery.com>
+
+       * Makefile.am: Remove references to types.m4.
+       * m4/iparm.m4: Merge with types.m4.
+       * m4/types.m4: Remove.
+       * m4/cshift1.m4, m4/dotprod.m4, m4/dotprodc.m4, m4/dotprodl.m4,
+       m4/eoshift1.m4, m4/eoshift3.m4, m4/iforeach.m4, m4/ifunction.m4,
+       m4/in_pack.m4, m4/in_unpack.m4, m4/iparm.m4, m4/matmul.m4,
+       m4/matmull.m4, m4/maxloc0.m4, m4/maxloc1.m4, m4/maxval.m4,
+       m4/minloc0.m4, m4/minloc1.m4, m4/minval.m4, m4/reshape.m4,
+       m4/shape.m4, m4/specific.m4, m4/specific2.m4, m4/transpose.m4):
+       Update to use new iparm.m4.
+       * generated/*.c: Regenerate.
+
+2004-05-18  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/15235
+       * gfortran.h (offset_t): Rename to ...
+       (gfc_offset): ... this.
+       * io/backspace.c (formatted_backspace, unformatted_backspace),
+       io/io.h (stream, gfc_unit, global_t, file_length, file_position),
+       transfer.c (us_read, us_write, next_record_r, next_record_w),
+       io/unit.c (init_units), unix.c (unix_stream, fd_alloc,
+       fd_alloc_r_at, fd_alloc_w_at, fd_seek, mmap_alloc,
+       mmap_alloc_r_at, mmap_alloc_w_at, mmap_seek, mem_alloc_r_at,
+       mem_alloc_w_at, mem_seek, file_length, file_position): Replace all
+       occurences of offset_t by gfc_offset.
+
+2004-05-16  Paul Brook  <paul@codesourcery.com>
+
+       * io/format.c (write_real): Don't include padding in format.
+
+2004-05-16  Paul Brook  <paul@codesourcery.com>
+
+       * io/format.c (format_lex): Make c an int.
+
+2004-05-16  Janne Blomqvist  <jblomqvi@cc.hut.fi>
+       Paul Brook  <paul@codesourcery.com>
+
+       * io/write.c (write_logical): Don't print extra blank.
+       (write_integer): Base field width on kind.
+       (list_formatted_write): Output initial blank.
+
+2004-05-16  Janne Blomqvist  <jblomqvi@cc.hut.fi>
+
+       * io/io.h (flush): Add prototype.
+       * io/transfer.c (finalize_transfer): Flush partial records.
+       * io/unix.c (flush): New function.
+
+2004-05-15  Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/15234
+       * io/io.h (unit_t): Rename to ...
+       (gfc_unit) ... this.
+       (unit_root, current_unit, find_file, find_unit, get_unit): Now
+       of type gfc_unit.
+       (delete_file, insert_unit, close_unit): Argument now of type
+       gfc_unit.
+       * backspace.c (st_backspace), close.c (st_close), endfile.c
+       (st_endfile), inquire.c (inquire_via_unit, st_inquire), open.c
+       (test_endfile, edit_modes, new_unit, already_open, st_open),
+       rewind.c (st_rewind), transfer.c (current_unit), unit.c
+       (internal_unit, unit_cache, rotate_left, rotate_right, insert,
+       insert_unit, delete_root, delete_treap, delete_unit, find_unit,
+       get_unit, init_units, close_unit), unix.c (find_file0,
+       find_file, delete_file): Replace all occurences of unit_t by
+       gfc_unit.
+
+2004-05-15  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/15311
+       * io/write.c (write_a): right justify A edit output.
+
+2004-05-14  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/15149
+       * libgfortan.h,intrinsics/random.c: Made random_seed visible.
+       * runtime/main.c(init): Call random_seed as part of MAIN init.
+
+2004-05-13  Tobias Schlter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * io/format.c: (parse_format_list): No comma is required after
+       P descriptor.
+
+2004-05-13  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/15204
+       * io/intrinsic/string_intrinsics.c (adjustr): rework logic.
+
+2004-05-06  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+           Steven Bosscher  <stevenb@suse.de>
+
+       PR libfortran/15234
+       * libgfortran.h: Include <inttypes.h> if available.
+
+2004-05-03  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+       * io/unix.c (MAP_FAILED): Define if missing.
+       (mmap_alloc): Cast MAP_FAILED to char *.
+       (mmap_open): Likewise.
+
+2004-04-26  Bud Davis  <bdavis9659@comcast.net>
+
+       * generated/_abs_i8.f90: New file.
+       * generated/_abs_c4.f90: New file.
+       * generated/_abs_c8.f90: New file.
+       * Makefile.am: Add them.
+       * Makefile.in: Regenerate.
+`
+2004-04-26  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/14056
+       * generated/_abs_i4.f90: New file.
+       * Makefile.am: Add it.
+       * Makefile.in: Regenerate.
+
+2004-04-25  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/14942
+       * io/list_read.c(list_formatted_read): finish consuming the
+       spaces and seperators at eoln to get ready for next item.
+
+2004-04-23  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/15113
+       * io/read.c(read_a): Handle field width > destination and no field width.
+
+2004-04-22  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/14906
+       * io/format.c (format_item): gracefully handle a ')'
+       when it is the first character encountered in the string.
+
+2004-04-11  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/14904
+       * io/transfer.c (next_record): Update last_record when
+       more than one record is written to a direct access file
+       with one write statement.
+
+2004-04-11  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/14901
+       * io/transfer.c (next_record_w) : No '\n' if internal.
+       * io/unix.c (empty_internal_buffer) : Init to spaces, not '\n'.
+
+2004-04-11  Bud Davis  <bdavis9659@comcast.net>
+
+       * io.h (ioparm): Interface from FE is 32 bit, irregardless of offset_t.
+       Will need to change this later to support direct access files > 2gb.
+
+2004-04-03  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/14762
+       * io/transfer.c (next_record_r) : Skip to next record.
+
+2004-04-03  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/14836
+       * io/transfer.c (next_record): Update last_record for DIRECT
+
+2004-04-03  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/14837
+       * io/unix.c (find_file0): Use fd field of struct
+
+2004-04-03  Bud Davis  <bdavis9659@comcast.net>
+
+       PR 14831
+       * io/inquire.c (inquire_via_unit): Changed return string for
+       BLANK=NULL. Use correct variable for ACTION.
+
+2004-04-01  Bud Davis  <bdavis9659@comcast.net>
+
+       PR 14746
+       * io/read.c (read_f): Allow a decimal without a leading digit.
+       * io/write.c (output_float): remove a leading '0' to keep from
+       overflowing the field (F edit descriptor).
+
+2004-04-01  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/14565
+       * io/open.c (new_unit),
+       * io/io.h : new_unit is now visible
+       * io/transfer.c (data_transfer_init): open unit if no OPEN statement.
+       * io/transfer.c (data_transfer_init): remove compile warnings.
+       * io/rewind.c (st_rewind): ftruncate if writing.
+
+2004-03-24  Bud Davis  <bdavis9659@comcast.net>
+
+       * write.c (write_l): Use extract_int for 'L' edit descriptor.
+
+2004-03-24  Bud Davis  <bdavis9659@comcast.net>
+
+       PR 13919
+       * io/io.h (global_t):
+       * io/list_read.c (next_char,list_formatted_read,ist_formatted_read):
+         Move eof_jmp to a global structure.
+       * io/transfer.c(finalize_transfer) : Set up eof_jump for callers.
+
+2004-03-24  Bud Davis  <bdavis9659@comcast.net>
+
+       * m4/cexp.m4 (csqrt): Actually use the passed value.
+       * generated/exp_c?.c: Regenerate.
+
+2004-03-24  Bud Davis  <bdavis9659@comcast.net>
+
+       PR 12921
+       * io.h, transfer.c, open.c : recl_in changed from ptr to variable.
+       * open.c (new_unit): Moved test for positioned direct access error.
+       (init_units): Corrected calculation of max records.
+
+2004-02-06  Feng Wang  <fengwang@nudt.edu.cn>
+
+       * Makefile.am: Add m4/dotprodc.m4. And fix spelling.
+       * Makefile.in: Regenerate.
+       * m4/dotprodc.m4: New file. Implement complex dot_product.
+       * m4/dotprod.m4: Delete the complex implementation.
+       * generated/dotprod_*: Update.
+
+2004-02-07  Bud Davis  <bdavis9659@comcast.net>
+
+       * transfer.c (write_constant_string): Do not delete H's in hollerith
+       formats.
+
+2004-01-05  Andrew Pinski  <apinski@apple.com>
+
+       * configure.in: Check for csin in -lmx also.
+       * configure: Regenerate.
+
+2004-01-01  Paul Brook  <paul@codesourcery.com>
+
+       * io/list_read.c (find_nml_node): Make static.
+       (match_namelist_name): Ditto.
+       * io/read.c (convert_precision_real): Make static, fix spelling.
+       * io/transfer.c (extract_real): Remove unused prototype.
+       (st_set_nml_var): Make static.
+       * io/write.c (extract_real): Make static.
+
+\f
+Copyright (C) 2004 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2005 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2005
new file mode 100644 (file)
index 0000000..1e04f52
--- /dev/null
@@ -0,0 +1,2922 @@
+2005-12-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25594
+       PR libfortran/25419
+       * io/list_read.c (list_formatted_read_scalar): Test for comma to return
+       a null value (default). Revert patch of 25419 on 2005-12-28.  
+
+2005-12-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25139
+       * io/unix.c (fd_truncate): Set s->active to zero.
+       PR libfortran/25510
+       * libgfortran.h: Add ERROR_INTERNAL and ERROR_INTERNAL_UNIT.
+       * runtime/error.c (translate_error): Add messages for new errors.
+       * io/list_read.c (next_char): Use new errors.
+       * io/transfer.c (next_record_r) (next_record_w): Use new errors.
+
+2005-12-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25550
+       * io/file_pos.c (st_rewind): Reset bytes left so no error occurs in
+       next_record_r.
+
+2005-12-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25419
+       * io/list_read.c (list_formatted_read_scalar): Allow comma to return a
+       null value (default).
+
+2005-12-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25307
+       * io/list_read.c (next_char): Handle end-of-file conditions for
+       internal units and add support for internal character array units.
+
+2005-12-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25463
+       * io/transfer.c (finalize_transfer): Fix execution order so that
+       next_record is set to zero in all cases.
+
+2005-12-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25264
+       PR libfortran/25349
+       * io/unit.c (get_unit): Delete code that cleared the string when the
+       unit was opened, which is too soon.
+       * io/transfer.c (next_record_w): Pass done flag in.  Change logic for
+       setting max_pos.  Add code to position unit and pad record as needed.
+
+2005-12-13  Richard Sandiford  <richard@codesourcery.com>
+           Victor Leikehman  <LEI@il.ibm.com>
+
+       * m4/matmul.m4: Use a different order in the special case of a
+       transposed first argument.
+       * generated/matmul_c4.c, generated/matmul_c8.c, generated/matmul_c10.c,
+       * generated/matmul_c16.c, generated/matmul_i4.c, generated/matmul_i8.c,
+       * generated/matmul_i10.c, generated/matmul_r4.c, generated/matmul_r8.c
+       * generated/matmul_r10.c, generated/matmul_r16.c: Regenerated.
+
+2005-12-10  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * Makefile.am: Enable loop unrolling for matmul.
+       * configure: Regenerated.
+       * Makefile.in: Regenerated.
+       * aclocal.m4: Regenerated.
+
+2005-12-10  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR fortran/23815
+       * io/file_pos.c (unformatted_backspace):  If flags.convert
+       does not equal CONVERT_NATIVE, reverse the record marker.
+       * io/open.c:  Add convert_opt[].
+       (st_open):  If no convert option is given, set CONVERT_NATIVE.
+       If CONVERT_BIG or CONVERT_LITTLE are given, set flags.convert to
+       CONVERT_NATIVE or CONVERT_SWAP (depending on wether we have
+       a big- or little-endian system).
+       * io/transfer.c (unformatted_read):  Remove unused attribute
+       from arguments.
+       If we need to reverse
+       bytes, break up large transfers into a loop.  Split complex
+       numbers into its two parts.
+       (unformatted_write):  Likewise.
+       (us_read):  If flags.convert does not equal CONVERT_NATIVE,
+       reverse the record marker.
+       (next_record_w): Likewise.
+       (reverse_memcpy):  New function.
+       * io/inquire.c (inquire_via_unit):  Implement convert.
+       * io/io.h (top level):  Add enum unit_convert.
+       Add convert to st_parameter_open and st_parameter_inquire.
+       Define IOPARM_OPEN_HAS_CONVERT and IOPARM_INQUIRE_HAS_CONVERT.
+       Increase padding for st_parameter_dt.
+       Declare reverse_memcpy().
+
+2005-12-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libfortran/24991
+       * acinclude.m4: Include acx.m4 and no-executables.m4.
+       * configure.ac: Add GCC_TOPLEVEL_SUBDIRS.
+       * configure: Rebuilt.
+       * Makefile.am (AM_CPPFLAGS): Use $(host_subdir) in build dir
+       path.
+       * Makefile.in: Rebuilt.
+
+2005-12-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25039
+       * io/io.h: Create a new flag sf_read_comma to control comma
+       separators in numeric reads.
+       * io/transfer.c (formatted_transfer_scalar): Initialize the flag.
+       (read_sf): Check for commas coming in and if the flag is set,
+       shortcut the read.
+       * io/read.c (read_a) (read_x): Clear the flag for character reads and
+       reset it after the reads.
+
+2005-12-04  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * io/format.c: Removing unused code.
+       * intrinsics/random.c: Likewise.
+
+2005-12-02  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/25116
+       * io/transfer.c (data_transfer_init): Don't set the default for
+       namelist I/O on preconnected files to UNFORMATTED.
+
+2005-11-30  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * libgfortran.h (ILP32 typedefs): Define _UINT8_T, _UINT32_T and
+       _UINT64_T on Solaris.
+
+2005-11-28  Steven G. Kargl  <kargls@comcast.net>
+
+       PR libfortran/25149
+       * intrinsics/abort.c: Add external abort_ to allow linking when 
+       invoking -std=f95 in testsuite.
+
+2005-11-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libfortran/24991
+       * acinclude.m4 (LIBGFOR_CHECK_PRAGMA_WEAK): Rename to...
+       (LIBGFOR_GTHREAD_WEAK): ... this.  Define SUPPORTS_WEAK rather
+       than HAVE_PRAGMA_WEAK.  Define GTHREAD_USE_WEAK to 0 on hosts
+       that shouldn't use weak in gthr.h.
+       * configure.ac: Use LIBGFOR_GTHREAD_WEAK instead of
+       LIBGFOR_CHECK_PRAGMA_WEAK.
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+       * io/io.h (SUPPORTS_WEAK): Don't define here.
+
+       * intrinsics/ftell.c (ftell, FTELL_SUB): Add unlock_unit call.
+       * intrinsics/fget.c (fgetc, fputs): Likewise.
+       * intrinsics/tty.c (ttynam): Likewise.
+
+2005-11-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25109
+       * io/unit.c (init_units): Set default flag to BLANK_NULL per
+       requirement of F95 standard.  Set PAD_YES for stdin.
+
+2005-11-27  David Edelsohn  <edelsohn@gnu.org>
+
+       * intrinsics/random.c: Include config.h
+       * io/size_from_kind.c: Include config.h and libgfortran.h
+       * io/io.h: Revert 2005-11-21 change.
+
+2005-11-27  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * io/write.c (namelist_write): Correct type in previous
+       commit.
+
+2005-11-27  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/24919
+       * io/list_read.c (eat_separator, finish_separator,
+       read_character): Handle CRLF separators correctly during reads.
+       (nml_query): Use the HAVE_CRLF macro to print adequate newlines.
+       * io/io.h (st_parameter_dt): Add comment about the possible
+       values for sf_seen_eor.
+       * io/unix.c (tempfile, regular_file): HAVE_CRLF doesn't imply
+       that O_BINARY is defined, so we add that condition.
+       (stream_at_bof): Fix typo in comment.
+       * io/transfer.c (read_sf): Handle correctly CRLF, setting
+       sf_seen_eor value to 2 instead of 1.
+       (formatted_transfer_scalar): Use the sf_seen_eor value to
+       handle CRLF the right way.
+       * io/write.c (nml_write_obj, namelist_write): Use CRLF as newline
+       when HAVE_CRLF is defined.
+
+2005-11-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * m4/ifunction.m4: Add const restrict to function arguments.
+       * m4/iforeach.m4: Likewise.
+       * m4/eoshift1.m4: Likewise.
+       * m4/eoshift3.m4: Likewise.
+       * m4/dotprod.m4: Likewise.
+       * m4/dotprodc.m4: Likewise.
+       * m4/dotprodl.m4: Likewise.
+       * m4/shape.m4: Likewise.
+       * m4/cshift1.m4: Likewise.
+       * m4/reshape.m4: Likewise.
+       * m4/transpose.m4: Likewise.
+       * generated/eoshift*: Regenerated
+       * generated/dotprod*: Likewise.
+       * generated/shape*: Likewise.
+       * generated/cshift1*: Likewise.
+       * generated/reshape*: Likewise.
+       * generated/transpose*: Likewise.
+
+2005-11-26  Richard Henderson  <rth@redhat.com>
+
+       * io/list_read.c (nml_parse_qualifier): Use ssize_t instead of int
+       in dtp->u.p.value.
+
+2005-11-26  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/24945
+       * io/open.c (edit_modes): Check for STATUS_UNKNOWN flag.
+       
+2005-11-25  Richard Henderson  <rth@redhat.com>
+
+       * io/list_read.c (nml_parse_qualifier): Use memcpy to extract
+       values from dtp->u.p.value.
+       * io/io.h (struct st_parameter_dt): Change reversion_flag, first_item,
+       seen_dollar, sf_seen_eor, eor_condition, no_leading_blank, char_flag,
+       input_complete, at_eol, comma_flag, namelist_mode, nml_read_error to
+       single-bit fields.  Move value to where it'll be at least pointer
+       aligned.
+
+2005-11-23  Alan Modra  <amodra@bigpond.net.au>
+
+       * io/open.c (new_unit): Use the right unit number when checking
+       for stdin, stdout, stderr.
+
+2005-11-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/24794
+       * io/list_read.c (read_character): Add auto completion on short
+       namelist reads.
+
+2005-11-21  David Edelsohn  <edelsohn@gnu.org>
+
+       * io/io.h (_LARGE_FILES): Undefine for AIX.
+       (_LARGE_FILE_API): Define for AIX.
+
+2005-11-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/24774
+       PR fortran/14943
+       PR fortran/21647
+       * Makefile.am (AM_CPPFLAGS): Add gcc directories as -I paths,
+       add -D_GNU_SOURCE.
+       * Makefile.in: Regenerated.
+       * acinclude.m4 (LIBGFOR_CHECK_SYNC_FETCH_AND_ADD,
+       LIBGFOR_CHECK_GTHR_DEFAULT, LIBGFOR_CHECK_PRAGMA_WEAK): New macros.
+       * configure.ac: Add them.
+       * configure: Rebuilt.
+       * config.h.in: Rebuilt.
+       * libtool-version: Bump libgfortran.so SONAME to libgfortran.so.1.
+       * libgfortran.h (library_start, show_locus, internal_error,
+       generate_error, find_option): Add st_parameter_common * argument.
+       (library_end): Change into a dummy macro.
+       * io/io.h: Include gthr.h.
+       (SUPPORTS_WEAK): Define if HAVE_PRAGMA_WEAK.
+       (CHARACTER): Remove define.
+       (st_parameter, global_t): Remove typedef.
+       (ioparm, g, ionml, current_unit): Remove variables.
+       (init_error_stream): Remove prototype.
+       (CHARACTER1, CHARACTER2): Define.
+       (st_parameter_common, st_parameter_open, st_parameter_close,
+       st_parameter_filepos, st_parameter_inquire, st_parameter_dt): New
+       typedefs.
+       (IOPARM_LIBRETURN_MASK, IOPARM_LIBRETURN_OK, IOPARM_LIBRETURN_ERROR,
+       IOPARM_LIBRETURN_END, IOPARM_LIBRETURN_EOR, IOPARM_ERR, IOPARM_END,
+       IOPARM_EOR, IOPARM_HAS_IOSTAT, IOPARM_HAS_IOMSG, IOPARM_COMMON_MASK,
+       IOPARM_OPEN_HAS_RECL_IN, IOPARM_OPEN_HAS_FILE, IOPARM_OPEN_HAS_STATUS,
+       IOPARM_OPEN_HAS_ACCESS, IOPARM_OPEN_HAS_FORM, IOPARM_OPEN_HAS_BLANK,
+       IOPARM_OPEN_HAS_POSITION, IOPARM_OPEN_HAS_ACTION,
+       IOPARM_OPEN_HAS_DELIM, IOPARM_OPEN_HAS_PAD, IOPARM_CLOSE_HAS_STATUS,
+       IOPARM_INQUIRE_HAS_EXIST, IOPARM_INQUIRE_HAS_OPENED,
+       IOPARM_INQUIRE_HAS_NUMBER, IOPARM_INQUIRE_HAS_NAMED,
+       IOPARM_INQUIRE_HAS_NEXTREC, IOPARM_INQUIRE_HAS_RECL_OUT,
+       IOPARM_INQUIRE_HAS_FILE, IOPARM_INQUIRE_HAS_ACCESS,
+       IOPARM_INQUIRE_HAS_FORM, IOPARM_INQUIRE_HAS_BLANK,
+       IOPARM_INQUIRE_HAS_POSITION, IOPARM_INQUIRE_HAS_ACTION,
+       IOPARM_INQUIRE_HAS_DELIM, IOPARM_INQUIRE_HAS_PAD,
+       IOPARM_INQUIRE_HAS_NAME, IOPARM_INQUIRE_HAS_SEQUENTIAL,
+       IOPARM_INQUIRE_HAS_DIRECT, IOPARM_INQUIRE_HAS_FORMATTED,
+       IOPARM_INQUIRE_HAS_UNFORMATTED, IOPARM_INQUIRE_HAS_READ,
+       IOPARM_INQUIRE_HAS_WRITE, IOPARM_INQUIRE_HAS_READWRITE,
+       IOPARM_DT_LIST_FORMAT, IOPARM_DT_NAMELIST_READ_MODE,
+       IOPARM_DT_HAS_REC, IOPARM_DT_HAS_SIZE, IOPARM_DT_HAS_IOLENGTH,
+       IOPARM_DT_HAS_FORMAT, IOPARM_DT_HAS_ADVANCE,
+       IOPARM_DT_HAS_INTERNAL_UNIT, IOPARM_DT_HAS_NAMELIST_NAME,
+       IOPARM_DT_IONML_SET): Define.
+       (gfc_unit): Add lock, waiting and close fields.  Change file
+       from flexible array member into pointer to char.
+       (open_external): Add st_parameter_open * argument.
+       (find_file, file_exists): Add file and file_len arguments.
+       (flush_all_units): New prototype.
+       (max_offset, unit_root, unit_lock): New variable.
+       (is_internal_unit, is_array_io, next_array_record,
+       parse_format, next_format, unget_format, format_error,
+       read_block, write_block, next_record, convert_real,
+       read_a, read_f, read_l, read_x, read_radix, read_decimal,
+       list_formatted_read, finish_list_read, namelist_read,
+       namelist_write, write_a, write_b, write_d, write_e, write_en,
+       write_es, write_f, write_i, write_l, write_o, write_x, write_z,
+       list_formatted_write, get_unit): Add st_parameter_dt * argument.
+       (insert_unit): Remove prototype.
+       (find_or_create_unit, unlock_unit): New prototype.
+       (new_unit): Return gfc_unit *.  Add st_parameter_open *
+       and gfc_unit * arguments.
+       (free_fnodes): Remove prototype.
+       (free_format_data): New prototype.
+       (scratch): Remove.
+       (init_at_eol): Remove prototype.
+       (free_ionml): New prototype.
+       (inc_waiting_locked, predec_waiting_locked, dec_waiting_unlocked):
+       New inline functions.
+       * io/unit.c (max_offset, unit_root, unit_lock): New variables.
+       (insert): Adjust os_error caller.
+       (insert_unit): Made static.  Allocate memory here, initialize
+       lock and after inserting it return it, locked.
+       (delete_unit): Adjust for deletion of g.
+       (find_unit_1): New function.
+       (find_unit): Use it.
+       (find_or_create_unit): New function.
+       (get_unit): Add dtp argument, change meaning of the int argument
+       as creation request flag.  Adjust for different st_* calling
+       conventions, lock internal unit's lock before returning it
+       and removal of g.  Call find_unit_1 instead of find_unit.
+       (is_internal_unit, is_array_io): Add dtp argument, adjust for
+       removal of most of global variables.
+       (init_units): Initialize unit_lock.  Adjust insert_unit callers
+       and adjust for g removal.
+       (close_unit_1): New function.
+       (close_unit): Use it.
+       (unlock_unit): New function.
+       (close_units): Lock unit_lock, use close_unit_1 rather than
+       close_unit.
+       * io/close.c (st_close): Add clp argument.  Adjust for new
+       st_* calling conventions and internal function API changes.
+       * io/file_pos.c (st_backspace, st_endfile, st_rewind, st_flush):
+       Add fpp argument.  Adjust for new st_* calling conventions and
+       internal function API changes.
+       (formatted_backspace, unformatted_backspace): Likewise.  Add
+       u argument.
+       * io/open.c (edit_modes, st_open): Add opp argument.  Adjust for
+       new st_* calling conventions and internal function API changes.
+       (already_open): Likewise.  If not HAVE_UNLINK_OPEN_FILE, unlink
+       scratch file.  Instead of calling close_unit just call sclose,
+       free u->file if any and clear a few u fields before calling
+       new_unit.
+       (new_unit): Return gfc_unit *.  Add opp and u arguments.
+       Adjust for new st_* calling conventions and internal function
+       API changes.  Don't allocate unit here, rather than work with
+       already created unit u already locked on entry.  In case
+       of failure, close_unit it.
+       * io/unix.c: Include unix.h.
+       (BUFFER_SIZE, unix_stream): Moved to unix.h.
+       (unit_to_fd): Add unlock_unit call.
+       (tempfile): Add opp argument, use its fields rather than ioparm.
+       (regular_file): Likewise.
+       (open_external): Likewise.  Only unlink file if fd >= 0.
+       (init_error_stream): Add error argument, set structure it points
+       to rather than filling static variable and returning its address.
+       (FIND_FILE0_DECL, FIND_FILE0_ARGS): Define.
+       (find_file0): Use them.  Don't crash if u->s == NULL.
+       (find_file): Add file and file_len arguments, use them instead
+       of ioparm.  Add locking.  Pass either an array of 2 struct stat
+       or file and file_len pair to find_file0.
+       (flush_all_units_1, flush_all_units): New functions.
+       (file_exists): Add file and file_len arguments, use them instead
+       of ioparm.
+       * io/unix.h: New file.
+       * io/lock.c (ioparm, g, ionml): Remove variables.
+       (library_start): Add cmp argument, adjust for new st_* calling
+       conventions.
+       (library_end): Remove.
+       (free_ionml): New function.
+       * io/inquire.c (inquire_via_unit, inquire_via_filename,
+       st_inquire): Add iqp argument, adjust for new st_* calling
+       conventions and internal function API changes.
+       * io/format.c (FARRAY_SIZE): Decrease to 64.
+       (fnode_array, format_data): New typedefs.
+       (avail, array, format_string, string, error, saved_token, value,
+       format_string_len, reversion_ok, saved_format): Remove variables.
+       (colon_node): Add const.
+       (free_fnode, free_fnodes): Remove.
+       (free_format_data): New function.
+       (next_char, unget_char, get_fnode, format_lex, parse_format_list,
+       format_error, parse_format, revert, unget_format, next_test): Add
+       fmt or dtp arguments, pass it all around, adjust for internal
+       function API changes and adjust for removal of global variables.
+       (next_format): Likewise.  Constify return type.
+       (next_format0): Constify return type.
+       * io/transfer.c (current_unit, sf_seen_eor, eor_condition, max_pos,
+       skips, pending_spaces, scratch, line_buffer, advance_status,
+       transfer): Remove variables.
+       (transfer_integer, transfer_real, transfer_logical,
+       transfer_character, transfer_complex, transfer_array, current_mode,
+       read_sf, read_block, read_block_direct, write_block,
+       write_block_direct, unformatted_read, unformatted_write,
+       type_name, write_constant_string, require_type,
+       formatted_transfer_scalar, us_read, us_write, pre_position,
+       data_transfer_init, next_record_r, next_record_w, next_record,
+       finalize_transfer, iolength_transfer, iolength_transfer_init,
+       st_iolength, st_iolength_done, st_read, st_read_done, st_write,
+       st_write_done, st_set_nml_var, st_set_nml_var_dim,
+       next_array_record): Add dtp argument, pass it all around, adjust for
+       internal function API changes and removal of global variables.
+       * io/list_read.c (repeat_count, saved_length, saved_used,
+       input_complete, at_eol, comma_flag, last_char, saved_string,
+       saved_type, namelist_mode, nml_read_error, value, parse_err_msg,
+       nml_err_msg, prev_nl): Remove variables.
+       (push_char, free_saved, next_char, unget_char, eat_spaces,
+       eat_separator, finish_separator, nml_bad_return, convert_integer,
+       parse_repeat, read_logical, read_integer, read_character,
+       parse_real, read_complex, read_real, check_type,
+       list_formatted_read_scalar, list_formatted_read, finish_list_read,
+       find_nml_node, nml_untouch_nodes, nml_match_name, nml_query,
+       namelist_read): Add dtp argument, pass it all around, adjust for
+       internal function API changes and removal of global variables.
+       (nml_parse_qualifier): Likewise.  Add parse_err_msg argument.
+       (nml_read_obj): Likewise.  Add pprev_nl, nml_err_msg, clow and
+       chigh arguments.
+       (nml_get_obj_data): Likewise.  Add pprev_nl and nml_err_msg
+       arguments.
+       (init_at_eol): Removed.
+       * io/read.c (convert_real, read_l, read_a, next_char, read_decimal,
+       read_radix, read_f, read_x): Add dtp argument, pass it all around,
+       adjust for internal function API changes and removal of global
+       variables.
+       (set_integer): Adjust internal_error caller.
+       * io/write.c (no_leading_blank, nml_delim): Remove variables.
+       (write_a, calculate_sign, calculate_G_format, output_float,
+       write_l, write_float, write_int, write_decimal, write_i, write_b,
+       write_o, write_z, write_d, write_e, write_f, write_en, write_es,
+       write_x, write_char, write_logical, write_integer, write_character,
+       write_real, write_complex, write_separator,
+       list_formatted_write_scalar, list_formatted_write, nml_write_obj,
+       namelist_write): Add dtp argument, pass it all around, adjust for
+       internal function API changes and removal of global variables.
+       (extract_int, extract_uint, extract_real): Adjust internal_error
+       callers.
+       * runtime/fpu.c (_GNU_SOURCE): Don't define here.
+       * runtime/error.c: Include ../io/unix.h.
+       (filename, line): Remove variables.
+       (st_printf): Pass address of a local variable to init_error_stream.
+       (show_locus): Add cmp argument.  Use fields it points to rather than
+       filename and line variables.
+       (os_error, runtime_error): Remove show_locus calls.
+       (internal_error): Add cmp argument.  Pass it down to show_locus.
+       (generate_error): Likewise.  Use flags bitmask instead of non-NULL
+       check for iostat and iomsg parameter presence, adjust for st_*
+       calling convention changes.
+       * runtime/stop.c (stop_numeric, stop_string): Remove show_locus
+       calls.
+       * runtime/pause.c (pause_numeric, pause_string): Likewise.
+       * runtime/string.c: Include ../io/io.h.
+       (find_option): Add cmp argument.  Pass it down to generate_error.
+       * intrinsics/flush.c (recursive_flush): Remove.
+       (flush_i4, flush_i8): Use flush_all_units.  Add unlock_unit
+       call.
+       * intrinsics/rand.c: Include ../io/io.h.
+       (rand_seed_lock): New variable.
+       (srand, irand): Add locking.
+       (init): New constructor function.
+       * intrinsics/random.c: Include ../io/io.h.
+       (random_lock): New variable.
+       (random_r4, random_r8, arandom_r4, arandom_r8): Add locking.
+       (random_seed): Likewise.  open failed if fd < 0.  Set i correctly.
+       (init): New constructor function.
+       * intrinsics/system_clock.c (tp0, t0): Remove.
+       (system_clock_4, system_clock_8): Don't subtract tp0/t0 from current
+       time, use just integer arithmetics.
+       * intrinsics/tty.c (isatty_l4, isatty_l8, ttynam_sub): Add
+       unlock_unit calls.
+
+2005-11-20  Richard Henderson  <rth@redhat.com>
+
+        * Makefile.am: Revert 2005-11-14 change.  Enable -free-vectorize
+        via gmake per-target variables.
+       * Makefile.in, aclocal.m4: Regenerate.
+
+2005-11-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * configure.ac: Add "-I ." to the AM_FCFLAGS.
+       * configure: Regenerate.
+
+2005-11-18  Hans-Peter Nilsson  <hp@axis.com>
+
+       * config/fpu-glibc.h (set_fpu): Only call fedisableexcept for
+       nonzero FE_ALL_EXCEPT.
+
+2005-11-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/24892
+       * io/io.h (unit_access): Add ACCESS_APPEND.
+       * io/open.c (access_opt): Add APPEND value for ACCESS keyword.
+       (st_open): Use that new value to set the POSITION accordingly.
+
+2005-11-14  Janne Blomqvist  <jb@gcc.gnu.org>
+
+        PR fortran/21468
+        * Makefile.am: Add -ftree-vectorize for compiling matmul.
+        * m4/matmul.m4: Add const and restrict to type declarations as
+        appropriate.
+        * m4/matmull.m4: Likewise.
+        * Makefile.in: Regenerated.
+        * generated/matmul_*.c: Likewise.
+       
+2005-11-13  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/fget.c: New file.
+       * intrinsics/ftell.c: New file.
+       * io/unix.c (stream_offset): New function.
+       * io/io.h: Add prototype for stream_offset.
+       * Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
+       * Makefile.in: Regenerate.
+
+2005-11-12  Steven G. Kargl  <kargls@comcast.net>
+
+       PR libfortran/24787
+       *  intrinsics/string_intrinsics.c (string_scan): Off by one; Fix typos
+       in nearby comment.
+
+2005-11-10  Andreas Jaeger  <aj@suse.de>
+
+       * libgfortran.h: Add proper defines where needed.
+
+2005-11-10  Andreas Jaeger  <aj@suse.de>
+
+       * libgfortran.h: Add missing prototypes for internal_pack
+       functions.
+
+2005-11-06  Janne Blomqvist <jb@gcc.gnu.org>
+
+       PR fortran/24174
+       PR fortran/24305
+       * io/io.h: Add argument to prototypes, add prototypes for
+       size_from_*_kind functions.
+       * io/list_read.c (read_complex): Add size argument, use
+       it.
+       (list_formatted_read): Add size argument, cleanup.
+       (list_formatted_read_scalar): Add size argument.
+       (nml_read_obj): Fix for padding.
+       * io/transfer.c: Add argument to transfer function pointer.
+       (unformatted_read): Add size argument.
+       (unformatted_write): Likewise.
+       (formatted_transfer_scalar): Fix for padding with complex(10).
+       (formatted_transfer): Add size argument, cleanup.
+       (transfer_integer): Add size argument to transfer call.
+       (transfer_real): Likewise.
+       (transfer_logical): Likewise.
+       (transfer_character): Likewise.
+       (transfer_complex): Likewise.
+       (transfer_array): New kind argument, use it.
+       (data_transfer_init): Add size argument to formatted_transfer
+       call.
+       (iolength_transfer): Add size argument, cleanup.
+       * io/write.c (write_complex): Add size argument, fix for padding
+       with complex(10).
+       (list_formatted_write): Add size argument, cleanup.
+       (list_formatted_write_scalar): Add size argument, use it.
+       (nml_write_obj): Fix for size vs. kind issue.
+       * io/size_from_kind.c: New file.
+       * Makefile.am: Add io/size_from_kind.c.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+
+2005-11-06  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/ctime.c: New file.
+       * configure.ac: Add check for ctime.
+       * Makefile.am: Add ctime.c
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+       * Makefile.in: Regenerate.
+
+2005-11-05  Richard Guenther  <rguenther@suse.de>
+
+       * configure.ac: Use AM_FCFLAGS for extra flags, not FCFLAGS.
+       * configure: Regenerate.
+
+2005-11-05  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/tty.c (ttynam): New function.
+
+2005-11-04  Steven G. Kargl <kargls@comcast.net>
+
+       PR fortran/24636
+       * runtime/stop.c (stop_numeric): Use stop_code = -1.
+
+2005-11-04  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/22298
+       * runtime/main.c (stupid_function_name_for_static_linking): New
+       function.
+       * runtime/error.c (internal_error): Call
+       stupid_function_name_for_static_linking.
+       * libgfortran.h: Add prototype for
+       stupid_function_name_for_static_linking.
+
+2005-11-01  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/14994
+       * libgfortran/intrinsics/date_and_time.c: Add interface to
+       the functions date_and_time for the intrinsic function secnds.
+
+2005-10-31  Jerry DeLisle  <jvdelisle@verizon.net>
+
+       PR libfortran/24584
+       * io/list_read.c (free_saved): Set saved_used to zero.
+
+2005-10-30  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20179
+       * io/unix.c (flush_if_preconnected): New function.
+       * io/io.h: Add prototype for flush_if_preconnected.
+       * io/transfer.c (data_transfer_init): Use flush_if_preconnected
+       to workaround buggy mixed C-Fortran code.
+
+2005-10-30  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * Makefile.am: Add intrinsics/malloc.c file.
+       * Makefile.in: Regenerate.
+       * intrinsics/malloc.c: New file, with implementations for free
+       and malloc library functions.
+
+2005-10-29  Mike Stump  <mrs@apple.com>
+
+       * Makefile.am (kinds.h): Remove target, if command fails.
+       (selected_int_kind.inc): Likewise.
+       (selected_real_kind.inc): Likewise.
+       * Makefile.in: Regenerate.
+
+2005-10-28  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+
+       * Makefile.am (intrinsics): Add signal.c.
+       * Makefile.in: Regenerate.
+       * configure.ac: Checks for signal and alarm.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
+
+2005-10-28  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * acinclude.m4 (LIBGFOR_CHECK_FPSETMASK): New check.
+       * configure.ac: Check for floatingpoint.h, fptrap.h and float.h
+       headers. Use LIBGFOR_CHECK_FPSETMASK. Check for fp_trap and
+       fp_enable functions.
+       * configure.host: Add case for systems with fpsetmask and systems
+       with fp_trap/fp_enable.
+       * config/fpu-sysv.h: New file, FPU code using fpsetmask.
+       * config/fpu-aix.h: New file, FPU code for AIX using fp_trap and
+       fp_enable.
+       * aclocal.m4: Regenerate.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2005-10-24  Jerry DeLisle  <jvdelisle@verizon.net>
+
+       PR libfortran/24224
+       * libgfortran.h: Remove array stride error code.
+       * runtime/error.c: Remove array stride error.
+       * io/io.h: Change name of 'nml_loop_spec' to 'array_loop_spec' to be
+       generic.  Add pointer to array_loop_spec and rank to gfc_unit
+       structure.
+       * io/list_read.c: Revise nml_loop_spec references to array_loop_spec.
+       * io/transfer.c (init_loop_spec): New function to initialize
+       an array_loop_spec.
+       (next_array_record): New function to return the index to the next array
+       record by incrementing through the array_loop_spec.
+       (next_record_r): Use new function.
+       (next_record_w): Use new function.
+       (finalize_transfer): Free memory allocated for array_loop_spec.
+       * io/unit.c (get_array_unit_len): Delete this function. Use new
+       function init_loop_spec to initialize the array_loop_spec.
+
+2005-10-24  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/24416
+       * libgfortran/io/list_read.c (namelist_read): Exit with call to
+       free_saved () so that character strings do not accumulate.
+
+2005-10-23  Jerry DeLisle  <jvdelisle@verizon.net>
+
+       PR libfortran/24489
+       * io/transfer.c (read_block): Change the order of execution to not read
+       past end-of-record.
+       (read_block_direct): Same change.
+
+2005-10-23  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/23272
+       * acinclude.m4 (LIBGFOR_CHECK_WORKING_STAT): New check.
+       * configure.ac: Use LIBGFOR_CHECK_WORKING_STAT.
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+       * aclocal.m4: Regenerate.
+       * io/unix.c (compare_file_filename): Add fallback case for
+       systems without working stat.
+       * io/open.c (already_open): Correct call to
+       compare_file_filename.
+       * io/io.h: Correct proto for compare_file_filename.
+
+2005-10-23  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * runtime/fpu.c: Add _GNU_SOURCE definition.
+       * config/fpu-glibc.h: Remove __USE_GNU definition.
+
+2005-10-23  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/24384
+       * intrinsics/spread_generic.c (spread_internal_scalar): New
+       function that handles the special case of spread with a scalar
+       source. This has new interface functions -
+       (spread_scalar, spread_char_scalar): New functions to interface
+       with the calls specified in gfc_resolve_spread.
+
+2005-10-21  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/24383
+       * io/unix.c: Add fallback definition for SSIZE_MAX.
+
+2005-10-19  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * c99_protos.h: Define preprocessor HAVE_ macros with value 1
+       instead of empty value.
+       * intrinsics/c99_functions.c: Likewise.
+       * intrinsics/getXid.c: Define HAVE_GETPID with value 1 instead of
+       empty value.
+       * intrinsics/sleep.c: Define HAVE_SLEEP with value 1 instead of
+       empty value.
+
+2005-10-19  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/24432
+       * c99_protos.h: Define HAVE_ macros for all provided functions.
+
+2005-10-14  Uros Bizjak  <uros@kss-loka.si>
+
+       * config/fpu-387.h (set_fpu): Remove extra ":" in stmxcsr.
+       Change cw and cw_sse variables to unsigned.
+       (SSE): New definition.
+       (has_sse): Use it.
+
+2005-10-13  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       * io/unix.c(fd_alloc_r_at):  Use read() instead of do_read()
+       only in case of special files (e.g. terminals).
+
+2005-10-13  Uros Bizjak  <uros@kss-loka.si>
+
+       * config/fpu-387.h (set_fpu): Add "=m" for stmxcsr.
+
+2005-10-12  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * Makefile.am: Add fpu.c to the build process, and
+       target-dependent code as fpu-target.h.
+       * Makefile.in: Regenerate.
+       * configure.ac: Add call to configure.host to set
+       FPU_HOST_HEADER.
+       * configure: Regenerate.
+       * configure.host: New script to determine which host-dependent
+       code should go in.
+       * libgfortran.h: Add fpe option, remove previous fpu_ options.
+       Add bitmasks for different FPE traps. Add prototype for set_fpu.
+       * runtime/environ.c: Remove environment variables to control
+       fpu behaviour.
+       * runtime/fpu.c (set_fpe): New function for the front-end.
+       * runtime/main.c (init): Set FPU state.
+       * config: New directory to store host-dependent code.
+       * config/fpu-387.h: New file with code handling the i387 FPU.
+       * config/fpu-glibc.h: New file with code for glibc systems.
+       * config/fpu-generic.h: Fallback for the most generic host. Issue
+       warnings.
+
+2005-10-12  Janne Blomqvist <jblomqvi@cc.hut.fi>
+
+       * io/unix.c(fd_alloc_r_at): Remove parts of patch of 2005/10/07 that
+       cause input from the terminal to hang.
+
+2005-10-11  Steven G. Kargl  <kargls@comcast.net>
+
+       PR libfortran/24313
+       *  c99_functions.c (csqrtf, csqrt): Fix choice of branch cut.  Note
+       csqrt{f} were imported from glibc, and this bug is still present
+       there. glibc PR is 1146.
+
+2005-10-07  Janne Blomqvist <jblomqvi@cc.hut.fi>
+
+       PR fortran/16339
+       PR fortran/23363
+       * io/io.h: Add read and write members to stream, define access
+       macros.
+       * io/transfer.c (read_block_direct): New function.
+       (write_block_direct): New function.
+       (unformatted_read): Change to use read_block_direct.
+       (unformatted_write): Change to use write_block_direct.
+       * io/unix.c: Remove mmap includes and defines.
+       (writen): Remove.
+       (readn): Remove.
+       (reset_stream): New function.
+       (do_read): New function.
+       (do_write): New function.
+       (fd_flush): Change to use do_write() instead of writen().
+       (fd_alloc_r_at): Change to use do_read().
+       (fd_seek): Change return type to try, as the prototype. Add check
+       to avoid syscall overhead if possible.
+       (fd_read): New function.
+       (fd_write): New function.
+       (fd_open): Set pointers for new functions.
+       (mem_read): New function.
+       (mem_write): New function.
+       (open_internal): Set pointers for new functions.
+       (is_seekable): Clean up comment.
+
+2005-10-07  Jerry DeLisle  <jvdelisle@verizon.net>
+
+        * io/transfer.c (write_block): Add test for end-of-file condition,
+        removed from mem_alloc_w_at. (next_record_w): Clean up checks for
+        NULL pointer returns from s_alloc_w.
+        * io/unix.c (mem_alloc_w_at): Remove call to generate_error end-of-file.
+        * io/write.c (write_float): Add checks for NULL pointer returns from
+        write_block calls. (write_integer): Same.
+
+2005-10-03  Jakub Jelinek  <jakub@redhat.com>
+
+       * runtime/memory.c (allocate_size): Malloc 1 byte if size == 0.
+
+2005-10-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/19308
+       PR libfortran/22437
+       * Makefile.am: Add generated files for large real and integers
+       kinds. Add a rule to create the kinds.inc c99_protos.inc files.
+       Use kinds.inc to preprocess Fortran generated files.
+       * libgfortran.h: Add macro definitions for GFC_INTEGER_16_HUGE,
+       GFC_REAL_10_HUGE and GFC_REAL_16_HUGE. Add types gfc_array_i16,
+       gfc_array_r10, gfc_array_r16, gfc_array_c10, gfc_array_c16,
+       gfc_array_l16.
+       * mk-kinds-h.sh: Define macros HAVE_GFC_LOGICAL_* and
+       HAVE_GFC_COMPLEX_* when these types are available.
+       * intrinsics/ishftc.c (ishftc16): New function for GFC_INTEGER_16.
+       * m4/all.m4, m4/any.m4, m4/count.m4, m4/cshift1.m4, m4/dotprod.m4,
+       m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4, m4/eoshift3.m4,
+       m4/exponent.m4, m4/fraction.m4, m4/in_pack.m4, m4/in_unpack.m4,
+       m4/matmul.m4, m4/matmull.m4, m4/maxloc0.m4, m4/maxloc1.m4,
+       m4/maxval.m4, m4/minloc0.m4, m4/minloc1.m4, m4/minval.m4, m4/mtype.m4,
+       m4/nearest.m4, m4/pow.m4, m4/product.m4, m4/reshape.m4,
+       m4/set_exponent.m4, m4/shape.m4, m4/specific.m4, m4/specific2.m4,
+       m4/sum.m4, m4/transpose.m4: Protect generated functions with
+       appropriate "#if defined (HAVE_GFC_type_kind)" preprocessor directives.
+       * Makefile.in: Regenerate.
+       * all files in generated/: Regenerate.
+
+2005-10-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * runtime/memory.c (malloc_t): Remove.
+       (GFC_MALLOC_MAGIC, HEADER_SIZE, DATA_POINTER, DATA_HEADER): Remove.
+       (mem_root, runtime_cleanup, malloc_with_header): Remove.
+       (internal_malloc_size): Use just get_mem if size != 0, return NULL
+       otherwise.
+       (internal_free): Just free if non-NULL.
+       (internal_realloc_size): Remove debugging stuff.
+       (allocate_size): Use malloc directly, remove debugging stuff.
+       (deallocate): Use free directly, fix error message wording.
+
+       * libgfortran.h (GFC_ITOA_BUF_SIZE, GFC_XTOA_BUF_SIZE,
+       GFC_OTOA_BUF_SIZE, GFC_BTOA_BUF_SIZE): Define.
+       (gfc_itoa, xtoa): Add 2 extra arguments.
+       * runtime/environ.c: Include stdio.h.
+       (check_buffered): Use sprintf.
+       * runtime/error.c: Include assert.h.
+       (gfc_itoa, xtoa): Add 2 extra arguments, avoid using static
+       buffers.
+       (st_printf, st_sprintf): Adjust callers.
+       * io/write.c (otoa, btoa): Add 2 extra arguments, avoid using
+       static buffers.
+       (write_int, write_decimal): Add 2 extra arguments to conv
+       function pointer, adjust caller.
+       (write_integer): Adjust gfc_itoa caller.
+
+       * io/unit.c (get_array_unit_len): Return 0 rather than NULL.
+
+       * io/read.c (read_f): Remove spurious pointer dereference.
+
+2005-09-30  Janne Blomqvist <jblomqvi@cc.hut.fi>
+
+       PR 24112
+       * io/open.c (edit_modes): Check for correct flag.
+
+2005-09-29  Jakub Jelinek  <jakub@redhat.com>
+
+       * runtime/string.c (find_option): Change 3rd argument to
+       const st_option *.
+       * libgfortran.h (find_option): Likewise.
+       * runtime/environ.c (rounding, precision, signal_choices): Constify.
+       (init_choice, show_choice): Change 2nd argument to const choice *.
+       * io/open.c (access_opt, action_opt, blank_opt, delim_opt, form_opt,
+       position_opt, status_opt, pad_opt): Constify.
+       * io/transfer.c (advance_opt): Likewise.
+       * io/inquire.c (undefined): Likewise.
+       * io/close.c (status_opt): Likewise.
+       * io/format.c (posint_required, period_required, nonneg_required,
+       unexpected_element, unexpected_end, bad_string, bad_hollerith,
+       reversion_error): Likewise.
+       * io/unix.c (yes, no, unknown): Change from const char *
+       into const char [].
+
+2005-09-27  Steve Ellcey  <sje@cup.hp.com>
+
+       PR target/23552
+       * acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE): New.
+       (LIBGFOR_CHECK_FOR_BROKEN_ISNAN): New.
+       (LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY): New.
+       * configure.ac (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE): Add use.
+       (LIBGFOR_CHECK_FOR_BROKEN_ISNAN): Add use.
+       (LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY): Add use.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+       * libgfortan.h (isfinite): undef if broken, set if needed.
+       (isnan): undef if broken, set if needed.
+       (fpclassify): undef if broken, set if needed.
+       * io/write.c: Remove TODO comment about working isfinite.
+       * intrinsics/c99_functions.c (round): Use isfinite instead
+       of fpclassify.
+       * intrinsics/c99_functions.c (roundf): Ditto.
+
+2005-09-24  Janne Blomqvist <jblomqvi@cc.hut.fi>
+
+       * io.h: Changed prototypes of list_formatted_{read|write}.
+       * list_read.c (list_formatted_read): Renamed to
+       list_formatted_read_scalar and made static.
+       (list_formatted_read): New function.
+       * transfer.c: Prototype for transfer_array. Changed transfer
+       function pointer.
+       (unformatted_read): Add nelems argument, use it.
+       (unformatted_write): Likewise.
+       (formatted_transfer): Changed name to formatted_transfer_scalar.
+       (formatted_transfer): New function.
+       (transfer_integer): Add nelems argument to transfer call, move
+       updating item count to transfer functions.
+       (transfer_real): Likewise.
+       (transfer_logical): Likewise.
+       (transfer_character): Likewise.
+       (transfer_complex): Likewise.
+       (transfer_array): New function.
+       (data_transfer_init): Call formatted_transfer with new argument.
+       (iolength_transfer): New argument, use it.
+       * write.c (list_formatted_write): Renamed to
+       list_formatted_write_scalar, made static.
+       (list_formatted_write): New function.
+
+2005-09-26  David Edelsohn  <edelsohn@gnu.org>
+
+       * configure.ac: Add check for __clog.
+       * configure: Regenerate.
+
+2005-09-25  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * c99_protos.h: Add prototypes for C99 complex functions.
+       * libgfortran.h: Include complex.h before c99_protos.h.
+       * intrinsics/c99_functions.c: Define HAVE_ macros for the
+       fallback functions we provide.
+       (cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
+       clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
+       cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
+       ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
+       ccosl, ctanf, ctan, ctanl): New fallback functions.
+       * Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
+       gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
+       * Makefile.in: Regenerate.
+       * configure.ac: Remove checks for csin. Add checks for all C99
+       complex functions.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * aclocal.m4: Regenerate.
+
+2005-09-25  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+           Danny Smith  <dannysmith@users.sourceforge.net>
+
+       PR libfortran/23803
+       * intrinsics/getXid.c: Add getpid wrapper for MinGW.
+       * intrinsics/getlog.c: Add getlogin wrapper for MinGW.
+       * intrinsics/hostnm.c: Add gethostname wrapper for MinGW.
+
+2005-09-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/23802
+       * intrinsics/sleep.c: Add correct sleep macro for MinGW.
+
+2005-09-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/23380
+       * intrinsics/cpu_time.c (__cpu_time_1): Provide a MS Windows
+       version.
+
+2005-09-14  Jerry DeLisle  <jvdelisle@verizon.net
+
+       PR fortran/21875 Internal Unit Array I/O, NIST
+       * libgfortran.h: Add run time error code for array stride.
+       * runtime/error.c (translate_error): Add error message for
+       array stride.
+       * io/io.h: Add array descriptor pointer to IOPARM structure.
+       Add prtotypes for two new functions.
+       * io/transfer.c (data_transfer_init): Removed initialization and
+       moved to unit.c (get_unit)
+       * io/transfer.c (next_record_r): Include internal unit read
+       functionality.
+       * io/transfer.c (next_record_w): Include internal unit write
+       functionality, including padding of character array records.
+       * io/unit.c (get_array_unit_len): New function to return the number
+       of records in the character array 'file' from the array descriptor.
+       * io/unit.c (get_unit): Gathered initialization code from
+       init_data_transfer for internal units and added initialization of
+       character array unit.
+       * io/unit.c (is_array_io): New function to determine if internal unit
+       is an array.
+       * io/unix.c (mem_alloc_w_at): Add error checks for bad record length
+       and end of file.
+
+2005-09-13  Richard Sandiford  <richard@codesourcery.com>
+
+       PR target/19269
+       * intrinsics/cshift0.c (cshift0): Add an extra size argument.
+       (cshift0_1, cshift0_2, cshift0_4, cshift0_8): Replace explicit
+       implementations with...
+       (DEFINE_CSHIFT): ...this new macro.  Define character versions too.
+       * intrinsics/eoshift0.c (zeros): Delete.
+       (eoshift0): Add extra size and filler arguments.  Use memset if no
+       bound is provided.
+       (eoshift0_1, eoshift0_2, eoshift0_4, eoshift0_8): Replace explicit
+       implementations with...
+       (DEFINE_EOSHIFT): ...this new macro.  Define character versions too.
+       * intrinsics/eoshift2.c (zeros): Delete.
+       (eoshift2): Add extra size and filler arguments.  Use memset if no
+       bound is provided.
+       (eoshift2_1, eoshift2_2, eoshift2_4, eoshift2_8): Replace explicit
+       implementations with...
+       (DEFINE_EOSHIFT): ...this new macro.  Define character versions too.
+       * intrinsics/pack.c (pack_internal): New static function, reusing
+       the contents of pack and adding an extra size argument.  Change
+       "mptr" rather than "m" when calculating the array size.
+       (pack): Redefine as a forwarder to pack_internal.
+       (pack_s_internal): New static function, reusing the contents of
+       pack_s and adding an extra size argument.
+       (pack_s): Redefine as a forwarder to pack_s_internal.
+       (pack_char, pack_s_char): New functions.
+       * intrinsics/reshape.c (reshape_internal): New static function,
+       reusing the contents of reshape and adding an extra size argument.
+       (reshape): Redefine as a forwarder to reshape_internal.
+       (reshape_char): New function.
+       * intrinsics/spread.c (spread_internal): New static function,
+       reusing the contents of spread and adding an extra size argument.
+       (spread): Redefine as a forwarder to spread_internal.
+       (spread_char): New function.
+       * intrinsics/transpose.c (transpose_internal): New static function,
+       reusing the contents of transpose and adding an extra size argument.
+       (transpose): Redefine as a forwarder to transpose_internal.
+       (transpose_char): New function.
+       * intrinsics/unpack.c (unpack_internal): New static function, reusing
+       the contents of unpack1 and adding extra size and fsize arguments.
+       (unpack1): Redefine as a forwarder to unpack_internal.
+       (unpack0): Call unpack_internal instead of unpack1.
+       (unpack1_char, unpack0_char): New functions.
+       * m4/cshift1.m4 (cshift1): New static function, reusing the contents
+       of cshift1_<kind> and adding an extra size argument.
+       (cshift1_<kind>): Redefine as a forwarder to cshift1.
+       (cshift1_<kind>_char): New function.
+       * m4/eoshift1.m4 (zeros): Delete.
+       (eoshift1): New static function, reusing the contents of
+       eoshift1_<kind> and adding extra size and filler arguments.
+       Fix calculation of hstride.  Use memset if no bound is provided.
+       (eoshift1_<kind>): Redefine as a forwarder to eoshift1.
+       (eoshift1_<kind>_char): New function.
+       * m4/eoshift3.m4 (zeros): Delete.
+       (eoshift3): New static function, reusing the contents of
+       eoshift3_<kind> and adding extra size and filler arguments.
+       Use memset if no bound is provided.
+       (eoshift3_<kind>): Redefine as a forwarder to eoshift3.
+       (eoshift3_<kind>_char): New function.
+       * generated/cshift1_4.c, generated/cshift1_8.c,
+       * generated/eoshift1_4.c, generated/eoshift1_8.c,
+       * generated/eoshift3_4.c, generated/eoshift3_8.c: Regenerate.
+
+2005-09-11  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20179
+       * io/unix.c (is_preconnected): Add function to test if a stream
+       corresponds to a preconnected unit.
+       * io/io.h: Add prototype for is_preconnected.
+       * io/transfer.c (data_transfer_init): Do not truncate
+       preconnected units.
+
+2005-09-10  Janne Blomqvist  <jblomqvi@cc.hut.fi>
+
+       * io/unix.c: Remove mmap code.
+
+2005-09-09  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/23784
+       * io/close.c (st_close): Call library_end even in case of error.
+
+2005-09-09  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       * io/io.h:  Add iomsg as last field of st_parameter.
+       * runtime/error.c (generate_error):  If iomsg is present, copy
+       the message there.
+
+2005-09-09  Richard Sandiford  <richard@codesourcery.com>
+
+       PR fortran/12840
+       * runtime/memory.c (internal_malloc_size): Return a null pointer
+       if the size is zero.
+       (internal_free): Do nothing if the pointer is null.
+       (internal_realloc_size, internal_realloc, internal_realloc64): New.
+
+2005-09-07  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/23262
+       * acinclude.m4 (LIBGFOR_CHECK_CRLF): New check.
+       * configure.ac: Use new check.
+       * configure.in: Regenerate.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * io/transfer.c (next_record_w): Add case for CRLF as line
+       terminator.
+       * io/unix.c (tempfile, regular_file): Open files with
+       O_BINARY on systems with CRLF.
+
+2005-09-07  Steve Ellcey  <sje@cup.hp.com>
+
+       PR libfortran/23419
+       * io/write.c (extract_int): Use memcpy to access buffer.
+       (extract_uint): Ditto.
+       (extract_real): Ditto.
+
+2005-09-05  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       * io/list_read.c:  Adjust size of of value to 32 (to hold
+       kind=16 complex values).
+
+2005-09-04  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/23321
+       * io/transfer.c(data_transfer_init):  Check for a too-large
+       record number.  Return if sseek failed.
+
+2005-09-03  Jakub Jelinek  <jakub@redhat.com>
+
+       * io/read.c (read_x): Take int argument instead of fnode * and
+       digging the N from F->u.n.
+       * io/io.h (read_x): Adjust prototype.
+       * io/transfer.c (formatted_transfer): Adjust callers.  Don't clobber
+       f->u.n for FMT_T.
+
+2005-09-02  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * io/unix.c (stream_ttyname): Protect use of ttyname by
+       HAVE_TTYNAME macro.
+       * configure.ac: Add check for ttyname.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2005-09-02  Andreas Jaeger  <aj@suse.de>
+
+       * libgfortran.h: Add prototype for init_compile_options.
+
+       * io/io.h: Add prototype for notify_std.
+
+2005-08-31  Steve Ellcey  <sje@cup.hp.com>
+
+       * io/read.c (set_integer): Use memcpy to fill buffer.
+
+2005-08-31  Steve Ellcey  <sje@cup.hp.com>
+
+       PR target/23556
+       * io/read.c (convert_real): Use memcpy to fill buffer.
+
+2005-08-29  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/23598
+       * io/lock.c(library_start):  If ioparm.iostat is present, clear
+       it unconditionally.
+
+2005-08-27  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * acinclude.m4 (LIBGFOR_CHECK_UNLINK_OPEN_FILE): Add check to see
+       if target can unlink open files.
+       * configure.ac: Use this new test.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+       * aclocal.ac: Regenerate.
+       * io/io.h: Add prototype for unpack_filename.
+       * io/close.c (st_close): Delete file after closing unit if
+       HAVE_UNLINK_OPEN_FILE is not defined.
+       * io/unix.c (unpack_filename): Unlink scratch file after opening
+       it only if HAVE_UNLINK_OPEN_FILE is defined.
+
+2005-08-17  Kelley Cook  <kcook@gcc.gnu.org>
+
+       * All files: Update FSF address.
+
+2005-08-16  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/23428
+       * io/transfer.c (iolength_transfer):  Remove __attribute__ ((unused))
+       from type.  Return correct length for inquire(iolength=)
+       for complex variables.
+
+2005-08-11  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+           Steven Bosscher  <stevenb@suse.de>
+
+       PR libfortran/20006
+       * Makefile.am: Add file runtime/compile_options.c.
+       * Makefile.in: Regenerate.
+       * libgfortran.h: Create structure compile_options_t. Define the
+       compile_options variable and GFC_STD_ macros.
+       * runtime/compile_options.c: New file.
+       * runtime/error.c (notify_std): New function.
+       * runtime/main.c (init): Call init_compile_options during
+       initialization.
+       * io/format.c: Use the new notify_std function for the $
+       descriptor extension.
+
+2005-08-09  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+       * Makefile.am: Add file intrinsics/tty.c to Makefile process.
+       * Makefile.in: Regenerate.
+       * io/io.h: Prototypes for new functions stream_isatty and
+       stream_ttyname.
+       * io/unix (stream_isatty, stream_ttyname): New functions to call
+       isatty() and ttyname() on a given unit.
+       * intrinsics/tty.c: New file to implement g77 intrinsics TTYNAM
+       and ISATTY.
+
+2005-08-08  Jerry DeLisle  <jvdelisle@verizon.net>
+
+       PR libfortran/23154
+       * io/transfer.c (data_transfer_init): Initialize
+       current_unit->bytes_left for a read.
+
+2005-08-07  Janne Blomqvist  <jblomqvi@cc.hut.fi>
+
+       PR fortran/22390
+       * io/backspace.c: File removed, contents moved to ...
+       * io/endfile.c: Ditto.
+       * io/rewind.c: Ditto.
+       * io/file_pos.c: New file, ... here.
+       * Makefile.am: Add file_pos.c to list, remove obsolete files.
+       * Makefile.in: Regenerated.
+
+2005-08-07  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * io/io.h: Change DEFAULT_TEMPDIR to /tmp instead of /var/tmp.
+       * io/unix.c (tempfile): Look at the TEMP environment variable
+       to find the temporary files directory. Whitespace correction.
+
+2005-08-06  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * io/unix.c: Add O_RDWR to open() call.
+
+2005-08-04 Paul Thomas  <pault@gcc.gnu.org>
+
+       * transfer.c (data_transfer_init): Truncate file in
+       sequential WRITE when last_record == 0, rather than
+       current_record.  Cures problem on RH9.
+
+2005-08-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * libgfortran.h: When isfinite is not provided by the system,
+       define it as a macro, so that it can accept any floating point
+       type.
+
+2005-08-01  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/23178
+       * intrinsics/flush.c (flush_i8): Add function flush_i8. Update
+       copyright years.
+
+2005-07-31  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/21787
+       * intrinsics/abort.c (abort): Close units before aborting.
+       Updated copyright years.
+
+2005-07-30  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/22436
+       * io/write.c (write_real): Add default formats for real(10) and
+       real(16).
+
+2005-07-30 Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/22570 and related issues.
+       * transfer.c (formatted_transfer): Make sure that there
+       really is data present before X- or T- editing. Move all
+       treatment of tabbing during writes to start of next data
+       producing format. Suppress incorrect zeroing of bytes_left
+       in slash formating. Insert int cast for assignment of a
+       difference of two gfc_offsets.
+
+2005-07-23  Jerry DeLisle  <jvdelisle@verizon.net>
+
+       * io/write.c (write_float): Revise output of IEEE exceptional
+       values to comply with F95 and F2003 standards.
+
+2005-07-22 Jerry DeLisle <jvdelisle@verizon.net>
+
+       PR libfortran/22570
+       * io/unit.c (init_units): Replace BLANK_ZERO with
+       BLANK_UNSPECIFIED.
+
+2005-07-22 Jerry DeLisle <jvdelisle@verizon.net>
+
+       PR libfortran/21875  (FM111.f)
+       * io/read.c (next_char): Return a ' ' character when BLANK_ZERO
+       or BLANK_NULL are active.
+       (read_decimal): Interpret ' ' character correctly for BZ or BN.
+       (read_radix): Interpret ' ' character correctly for BZ or BN.
+       (read_f): Interpret ' ' character correctly for BZ or BN.
+
+2005-07-22 Paul Thomas  <pault@gcc.gnu.org>
+
+       PR libfortran/22570
+       * read.c (read_x): Correct the condition for doing the
+       x-editing during formatted input.
+       * transfer.c (formatted_transfer): Cast offset difference
+       as int, clean-up arithmetic with new variable, bytes_used,
+       zero counters for FMT_SLASH,
+       (data_transfer_init) Zero X- and T-editing counters
+       unconditionally.
+       (next_record_w) Zero X- and T-editing counters.
+       unconditionally.
+
+2005-07-17  Jerry DeLisle  <jvdelisle@verizon.net>
+
+       * io/write.c (write_float): Fix field width checks for
+       printing 'Infinity' or 'Inf'.
+       (output_float): Fix typo in comment.
+
+2005-07-12 Paul Thomas  <pault@gcc.gnu.org>
+
+       PR libfortran/16435
+       * transfer.c (formatted_transfer): Correct the problems
+       with X- and T-editting that caused TLs followed by TRs
+       to overwrite data, which caused NIST FM908.FOR to fail
+       on many tests.
+       (data_transfer_init): Zero X- and T-editting counters at
+       the start of formatted IO.
+       * write.c (write_x): Write specified number of skips with
+       specified number of spaces at the end.
+
+2005-07-13 Paul Thomas  <pault@gcc.gnu.org>
+
+       * io/read.c (read_complex): Prevent X formatting during reads
+       from going beyond EOR to fix NIST fm908.FOR failure.
+       * io/list_read.c (read_complex): Allow complex data in list-
+       directed reads to have eols either side of the comma to
+       fix NIST FM906.FOR failure.
+
+2005-07-12  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21593
+       * io/unix.c:  Add member special_file to type unix_stream.
+       (fd_truncate):  Don't call ftruncate or chsize if
+       s refers to a special file.
+       (fd_to_stream):  initialize s->special_file.
+
+2005-07-11  David Edelsohn  <edelsohn@gnu.org>
+
+       PR libfortran/22412
+       * io/write.c (otoa): Bias p by SCRATCH_SIZE, not
+       sizeof (SCRATCH_SIZE).
+       (btoa): Same.
+
+2005-07-09  Jerry DeLisle  <jvdelisle@verizon.net>
+
+       PR libfortran/21875  (FM111.f)
+       * io/read.c (next_char): Return a ' ' character when BLANK_ZERO or
+       BLANK_NULL are active.
+       (read_decimal): Interpret ' ' character correctly for BZ or BN.
+       (read_radix): Interpret ' ' character correctly for BZ or BN.
+       (read_f): Interpret ' ' character correctly for BZ or BN.
+       * gfortran.dg/test (fmt_read_bz_bn.f90): New test case.
+
+2005-07-09  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+           Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/22217
+       * io/write.c (extract_unit):  New function; extract
+       ints as unsigned signed int of the correct size.
+       (write_int):  Use it.
+       * runtime/error.c:  Adjust copyright years.
+       Adjust size of buffer to maximum that can occur.
+
+2005-07-07  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * libgfortran.h (GFC_ARRAY_DESCRIPTOR): Replace 'type *base' by
+       'size_t offset'.
+       * intrinsics/cshift0.c, intrinsics/eoshift0.c,
+       intrinsics/eoshift2.c,intrinsics/pack_generic.c,
+       intrinsics/reshape_generic.c, intrinsics/spread_generic.c,
+       intrinsics/transpose_generic.c, intrinsics/unpack_generic,
+       m4/cshift1.m4, m4/eoshift1.m4, m4/eoshift3.m4, m4/iforeach.m4,
+       m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4, m4/reshape.m4,
+       m4,transpose.m4: Set renamed field 'offset' to zero instead of
+       'base'.
+       * generated/all_l4.c, generated/all_l8.c,
+       generated/any_l4.c, generated/any_l8.c, generated/count_4_l4.c,
+       generated/count_4_l8.c, generated/count_8_l4.c,
+       generated/count_8_l8.c, generated/chift1_4.c,
+       generated/cshift1_8.c, generated/eoshift1_4.c,
+       generated/eoshift1_8.c, generated/eoshift3_4.c,
+       generated/eoshift3_8.c, generated/matmul_c4.c,
+       generated/matmul_c8.c, generated/matmul_i4.c, matmul_i8.c,
+       generated/matmul_l4.c, generated/matmul_l8.c,
+       generated/matmul_r4.c, generated/matmul_r8.c,
+       generated/maxloc0_4_i4.c, generated/maxloc0_4_i8.c,
+       generated/maxloc0_4_r4.c, generated/maxloc0_4_r8.c,
+       generated/maxloc0_8_i4.c, generated/maxloc0_8_i8.c,
+       generated/maxloc0_8_r4.c, generated/maxloc0_8_r8.c,
+       generated/maxloc1_4_i4.c, generated/maxloc1_4_i8.c,
+       generated/maxloc1_4_r4.c, generated/maxloc1_4_r8.c,
+       generated/maxloc1_8_i4.c, generated/maxloc1_8_i8.c,
+       generated/maxloc1_8_r4.c, generated/maxloc1_8_r8.c,
+       generated/maxval_i4.c, generated/maxval_i8.c,
+       generated/maxval_r4.c, generated/maxval_r8.c,
+       generated/minloc0_4_i4.c, generated/minloc0_4_i8.c,
+       generated/minloc0_4_r4.c, generated/minloc0_4_r8.c,
+       generated/minloc0_8_i4.c, generated/minloc0_8_i8.c,
+       generated/minloc0_8_r4.c, generated/minloc0_8_r8.c,
+       generated/minloc1_4_i4.c, generated/minloc1_4_i8.c,
+       generated/minloc1_4_r4.c, generated/minloc1_4_r8.c,
+       generated/minloc1_8_i4.c, generated/minloc1_8_i8.c,
+       generated/minloc1_8_r4.c, generated/minloc1_8_r8.c,
+       generated/minval_i4.c, generated/minval_i8.c,
+       generated/minval_r4.c, generated/minval_r8.c,
+       generated/product_c4.c, generated/product_c8.c,
+       generated/product_i4.c, generated/product_i8.c,
+       generated/product_r4.c, generated/product_r8.c,
+       generated/reshape_c4.c, generated/reshape_c8.c,
+       generated/reshape_i4.c, generated/reshape_i8.c,
+       generated/sum_c4.c, generated/sum_c8.c, generated/sum_i4.c,
+       generated/sum_i8.c, generated/sum_r4.c, generated/sum_r8.c,
+       generated/transpose_c4.c, generated/transpose_c8.c,
+       generated/transpose_i4.c, generated/transpose_i8.c: Regenerate:
+
+2005-07-07  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21594
+       * intrinsics/eoshift0.c:  If abs(shift) > len, fill the
+       the whole array with the boundary value, but don't overrun it.
+       * intrinsics/eoshift2.c:  Likewise.
+       * m4/eoshift1.m4:  Likewise.
+       * m4/eoshift3.m4:  Likewise.
+       * generated/eoshift1_4.c:  Regenerated.
+       * generated/eoshift1_8.c:  Regenerated.
+       * generated/eoshift3_4.c:  Regenerated.
+       * generated/eoshift3_8.c:  Regenerated.
+
+2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>
+
+       PR fortran/16531
+       * io/transfer.c (formatted_transfer): Enable FMT_A on other types to
+       support Hollerith constants.
+
+2005-07-01  Andreas Jaeger  <aj@suse.de>
+
+       * intrinsics/unpack_generic.c: Remove const from parameter.
+
+       * io/transfer.c (formatted_transfer): Remove unused variable.
+
+2005-06-28  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/22142
+       * m4/eoshift1.m4:  Correct bstride (it needs to be multiplied
+       by size since it's a char pointer).
+       * m4/eoshift1_4.c:  Regenerated.
+       * m4/eoshift1_8.c:  Regenerated.
+
+2005-06-28  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/22142
+       * m4/eoshift3.m4:  Correct bstride (it needs to be multiplied
+       by size since it's a char pointer).
+       * m4/eoshift3_4.c:  Regenerated.
+       * m4/eoshift3_8.c:  Regenerated.
+
+2005-06-28  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/22170
+       * io/transfer.c (formatted_transfer): Do not iterate on the
+       repeat count of a FMT_SLASH, since this is already done in
+       next_format().
+
+2005-06-25  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/22144
+       * m4/cshift1.m4: Remove const from argument ret.
+       Populate return array descriptor if ret->data is NULL.
+       * m4/eoshift1.m4: Likewise.
+       * m4/eoshift3.m4: Likewise.
+       * generated/cshift1_4.c:  Regenerated.
+       * generated/cshift1_8.c:  Regenerated.
+       * generated/eoshift1_4.c:  Regenerated.
+       * generated/eoshift1_8.c:  Regenerated.
+       * generated/eoshift3_4.c:  Regenerated.
+       * generated/eoshift3_8.c:  Regenerated.
+
+2005-06-24  Jerry DeLisle <jvdelisle@verizon.net>
+
+       PR libfortran/21915
+       * Makefile.am: Include intrinsics/hyper.c.
+       * c99_protos.h: Add prototypes for single precision versions of
+       acosh, asinh, and atanh for platforms that do not have these.
+       * config.h.in: Add #undef for wrappers.
+       * configure.ac: Add checks for single precision versions.
+       * aclocal.m4: Regenerated.
+       * Makefile.in: Regenerated.
+       * configure: Regenerated.
+       * intrinsics/hyper.c: New file, adds new wrapper functions.
+
+2005-06-23  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/c99_functions.c (log10l): New log10l function for
+       systems where this is not available.
+       * c99_protos.h: Prototype for log10l function.
+       * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*,
+       GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update
+       prototypes for gfc_itoa and xtoa.
+       * io/io.h: Update prototypes for set_integer and max_value.
+       * io/list_read.c (convert_integer): Use new
+       GFC_(INTEGER|REAL)_LARGEST type.
+       * io/read.c (set_integer): Likewise.
+       (max_value): Likewise.
+       (convert_real): Likewise.
+       (real_l): Likewise.
+       (next_char): Likewise.
+       (read_decimal): Likewise.
+       (read_radix): Likewise.
+       (read_f): Likewise.
+       * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type.
+       (extract_real): Use new GFC_REAL_LARGEST type.
+       (calculate_exp): Likewise.
+       (calculate_G_format): Likewise.
+       (output_float): Likewise. Use log10l for long double values.
+       Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT.
+       (write_l): Use new GFC_INTEGER_LARGEST type.
+       (write_float): Use new GFC_REAL_LARGEST type.
+       (write_int): Remove useless special case for (len < 8).
+       (write_decimal): Use GFC_INTEGER_LARGEST.
+       (otoa): Use GFC_UINTEGER_LARGEST as argument.
+       (btoa): Use GFC_UINTEGER_LARGEST as argument.
+       * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as
+       argument.
+       (xtoa): Use GFC_UINTEGER_LARGEST as argument.
+       * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h
+       with all Fortran kinds available.
+       * configure.ac: Check for strtold and log10l.
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+       * mk-kinds-h.sh: Configuration script for available integer
+       and real kinds.
+
+
+2005-06-18  Janne Blomqvist  <jblomqvi@cc.hut.fi>
+
+       * unix.c (stream_at_bof): Don't assume that all non-mmapped files
+       are non-seekable.
+       (stream_at_eof): Likewise.
+
+2005-06-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/19155
+       * io/read.c (convert_real): strtod can set errno to EINVAL on an
+       empty string, but we shouldn't have an error in that case.
+
+2005-06-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/19216
+       * io/list_read.c (eat_separator): No need to call next_record,
+       even in non-namelist_mode.
+
+2005-06-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * io/transfer.c (formatted_transfer): Fix typo in error message.
+
+2005-06-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/16436
+       * io/transfer.c (read_sf): Correct updating of bytes_left field.
+       (formatted_transfer): Correct updating of bytes_left field and
+       reformatting code (comments and whitespace).
+       * io/unix.c (move_pos_offset): "active" field should not be
+       changed here. Whitespace corrections.
+
+2005-06-15  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/21950
+       * intrinsics/c99_functions.c (scalbn): Provide fallback
+       implementation for scalbn.
+       * c99_protos.h: Prototype for scalbn.
+       * configure.ac: Add check for scalbn.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2005-06-14  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       * intrinsics/eoshift0.c:  Removed prototype for eoshift0.
+       * intrinsics/eoshift2.c:  Removed prototype for eoshift2.
+
+2005-06-14  Tom Tromey  <tromey@redhat.com>
+
+       PR libgcj/19877:
+       * configure, aclocal.m4, Makefile.in: Rebuilt.
+
+2005-06-12  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21594
+       * intrinsics/eoshift0.c:  Add prototype for eoshift0.
+       * intrinsics/eoshift2.c:  Add prototype for eoshift2.
+
+2005-06-12  Steven G. Kargl <kargls@comcast.net>
+           Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/PR21797
+       * m4/cexp.m4 (csqrt`'q):  Add type qualifyer to
+       sqrt and fabs.
+       * generated/exp_c4.c:  Regenerated.
+
+2005-06-12  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/19155
+       * io/read.c (read_f): Take care of spaces after initial sign.
+
+2005-06-11  Thomas Koenig  <Thomas.Koenig@onlinde.de>
+
+       PR libfortran/21333
+       * Makefile.am: Add in_pack_c4.c, in_pack_c8.c, in_unpack_c4.c
+       and in_unpack_c8.c.
+       * Makefile.in: Regenerate.
+       * libgfortran.h:  Declare internal_pack_c4, internal_pack_c8,
+       internal_unpack_c4 and internal_unpack_c8.
+       * m4/in_pack.m4: Use rtype_ccode insteald of rtype_kind
+       in function name.
+       Use sizeof (rtype_name) as size for memory allocation.
+       * m4/in_unpack.m4: Use rtype_ccode insteald of rtype_kind
+       in function name.
+       Use sizeof (rtype_name) for calculation of sizes for memcpy.
+       * runtime/in_pack_generic.c:  For real, integer and logical
+       call internal_pack_4 if size==4 and internal_pack_8 if
+       size==8.
+       For complex, call internal_pack_c4 if size==8 and
+       internal_pack_c8 if size==16.
+       * runtime/in_unpack_generic.c: For real, integer and logical
+       call internal_unpack_4 if size==4 and internal_unpack_8 if
+       size==8.
+       For complex, call internal_unpack_c4 if size==8 and
+       internal_unpack_c8 if size==16.
+       * generated/in_pack_i4.c:  Regenerated.
+       * generated/in_pack_i8.c:  Regenerated.
+       * generated/in_unpack_i4.c:  Regenerated.
+       * generated/in_unpack_i8.c:  Regenerated.
+       * generated/in_pack_c4.c:  New file.
+       * generated/in_pack_c8.c:  New file.
+       * generated/in_unpack_c4.c:  New file.
+       * generated/in_unpack_c8.c:  New file.
+
+2005-06-09  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21480
+       * m4/reshape.m4:  Use sizeof (rtype_name) for sizes to be passed
+       to reshape_packed.
+       * generated/reshape_c4.c:  Regenerated.
+       * generated/reshape_c8.c:  Regenerated.
+       * generated/reshape_i4.c:  Regenerated.
+       * generated/reshape_i8.c:  Regenerated.
+
+2005-06-07  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21926
+       * m4/matmul.m4:  Correct zeroing of result for non-packed
+       arrays with lowest stride is one.
+       * generated/matmul_c4.c:  Regenerated.
+       * generated/matmul_c8.c:  Regenerated.
+       * generated/matmul_i4.c:  Regenerated.
+       * generated/matmul_i8.c:  Regenerated.
+       * generated/matmul_r4.c:  Regenerated.
+       * generated/matmul_r8.c:  Regenerated.
+
+2005-05-30  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20179
+       * io/unix.c (fd_close): Add test so that we don't close()
+       stdout and stderr.
+
+2005-05-29  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20006
+       * io/format.c (parse_format_list): Set repeat count of $ format
+       node to 1.
+       * io/transfer.c (read_sf): Add g.seen_dollar to the test
+       concerning advancing I/O.
+       (data_transfer_init): Likewise.
+       (finalize_transfer): Likewise.
+
+2005-05-27  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       * runtime/in_pack_generic.c:  Adjust copyright years.
+       (in_pack_generic):  Change dimension of auxiliary arrays from
+       GFC_MAX_DIMENSION - 1 to GFC_MAX_DIMENSION.
+       * runtime/in_unpack_generic.c:  Adjust copyright years.
+       (in_unpack_generic):  Change dimension of auxiliary arrays from
+       GFC_MAX_DIMENSION - 1 to GFC_MAX_DIMENSION.
+
+2005-05-26  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/17283
+       * intrinsics/unpack_generic.c:  Fix name of routine
+       on top.  Update copyright years.
+       (unpack1):  Remove const from return array descriptor.
+       rs:  New variable, for calculating return sizes.
+       Populate return array descriptor if ret->data is NULL.
+
+2005-05-22  Peter Wainwright  <prw@ceiriog1.demon.co.uk>
+
+       PR libfortran/21376
+       * io/write.c (output_float): Rework logic to avoid call to log10
+       with argument equal to zero.
+
+2005-05-21  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * configure.ac: Check for trunc and truncf in libm.
+       * configure: Regenerate.
+       * config.h.in: Likewise.
+       * intrinsics/c99_functions.c (trunc, truncf): New functions.
+       * c99_protos.h (trunc, truncf): Declare them.
+
+2005-05-18  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21127
+       * Makefile.am:  Really commit.
+       * Makefile.in:  Really commit.
+
+2005-05-18  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21127
+       * Makefile.am:  Add generated/reshape_c4.c and
+       generated/reshape_c8.c.
+       * Makefile.in:  Regenerated.
+       * m4/iparm.m4:  Define rtype_ccode to be c4 or c8 for
+       complex types, 4 or 8 otherwise.
+       * m4/reshape.m4:  Use rtype_ccode instead of rtype_kind
+       in function name.
+       * generated/reshape_c4.c: New file.
+       * generated/reshape_c8.c: New file.
+
+2005-05-16  Andreas Jaeger  <aj@suse.de>
+
+       * configure.ac: Add additional warning flags.
+       * configure: Regenerate.
+
+       * io/write.c (calculate_G_format): Remove unused parameter.
+       (output_float): Remove unused parameter.
+       (write_float): Change callers.
+       (nml_write_obj): Avoid signed warning.
+       Make variable const to support -Wwrite-strings.
+
+       * io/unix.c (fd_alloc, mmap_open, mmap_sfree, mem_sfree,
+       mem_truncate): Mark argument as unused.
+
+       * io/unit.c (get_unit): Mark argument as unused.
+       (init_units): Avoid warning about signed comparision.
+
+       * io/transfer.c (next_record_r): Remove unused parameter.
+       (next_record_w): Remove unused parameter.
+       (next_record): Change callers.
+       (iolength_transfer): Mark arguments as unused.
+
+       * io/open.c: Add initializer.
+
+       * io/list_read.c (read_character): Mark argument as unused.
+       (nml_match_name): Add const to make compile with -Wwrite-strings.
+
+       * io/format.c: Add initializer.
+
+2005-05-15  Andreas Jaeger  <aj@suse.de>
+
+       * m4/eoshift1.m4: Initialize variables to avoid warnings.
+       * m4/eoshift3.m4: Initialize variables to avoid warnings.
+       * generated/eoshift1_4.c, generated/eoshift1_8.c,
+       generated/eoshift3_4.c, generated/eoshift3_8.c: Regenerated.
+
+       * intrinsics/spread_generic.c (spread): Initialize variables to
+       avoid warnings.
+
+       * intrinsics/eoshift0.c (eoshift0): Initialize variables to avoid
+       warnings.
+       * intrinsics/eoshift2.c (eoshift2): Initialize variables to avoid
+       warnings.
+
+       * io/list_read.c (nml_get_obj_data): Initialize variables to avoid
+       warnings.
+
+       * intrinsics/pack_generic.c (pack): Remove unneeded calculation.
+
+       * m4/matmull.m4 (matmul_): Remove unneeded calculations, fix
+       pointer cast to avoid warning.
+       * generated/matmul_l4.c: Regenerated.
+       * generated/matmul_l8.c: Regenerated.
+
+       * Makefile.am: Remove AM_CFLAGS here.
+       * configure.ac: Define AM_CFLAGS and AM_FCFLAGS so that warnings
+       are set.  Set additionally -Wstrict-prototypes for CFLAGS.
+       * Makefile.in: Regenerated.
+       * aclocal.m4: Regenerated.
+       * configure: Regenerated.
+
+       * intrinsics/system_clock.c (system_clock_4, system_clock_8): Add
+       missing returns, reformat a bit.
+
+       * io/write.c (nml_write_obj): Use %d again - and cast to int,
+       st_sprintf does not handle %ld.
+
+       * io/unit.c (is_internal_unit): Add void as parameter list.
+
+       * io/transfer.c: Move prototype declarations before the functions.
+
+       * runtime/normalize.c (almostone_r4, almostone_r8): Fix parameter
+       list.
+
+       * intrinsics/random.c (KISS_DEFAULT_SEED): Remove extra semicolon.
+
+       * io/transfer.c: Do not use empty initializers for global objects.
+       Add missing initializers.
+
+       * io/lock.c: Do not use empty initializers for global objects.
+
+       * io/close.c: Add missing initializers.
+
+       * runtime/environ.c: Add missing initializers. Do not use empty
+       initializers for global object.
+       (init_string): Mark argument as unused.
+
+       * runtime/main.c (cleanup): Fix parameter list.
+
+       * io/io.h: Fix parameter lists.
+
+       * m4/transpose.m4, m4/matmul.m4: Fix pointer cast to avoid
+       warning.
+
+       * generated/transpose_c4.c, generated/transpose_c8.c,
+       generated/transpose_i4.c, generated/transpose_i8.c,
+       generated/matmul_c4.c, generated/matmul_c8.c,
+       generated/matmul_i4.c, generated/matmul_i8.c,
+       generated/matmul_r4.c, generated/matmul_r8.c: Regenerated.
+
+       * io/write.c (nml_write_obj): Fix 64-bit problem.
+
+       * io/list_read.c (nml_get_obj_data): Add missing braces around
+       initializer to avoid warnings.
+
+       * intrinsics/etime.c (etime_sub): Remove unused variable.
+
+       * intrinsics/chdir.c, intrinsics/getlog.c, intrinsics/link.c,
+       intrinsics/symlnk.c, intrinsics/perror.c: Include <string.h> for
+       prototypes.
+
+       * runtime/string.c (compare0): Remove unused variable.
+       * io/unit.c (init_units): Remove unused variables.
+       * intrinsics/getcwd.c (getcwd_i4_sub): Remove unused variable.
+       * intrinsics/unlink.c (unlink_i4_sub): Remove unused variable.
+       * intrinsics/stat.c (stat_i4_sub, fstat_i8_sub, fstat_i4_sub,
+       stat_i8_sub): Remove unused variable.
+
+2005-05-12  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21324
+       * runtime/memory.c:  Don't define GFC_CLEAR_MEMORY (it's a
+       performance hog).
+       * io/open.c (new_unit): Zero freshly allocated memory for
+       unit structure.
+       * io/unit.c (init_units):  Zero freshly allocated memory for
+       STDIN, STDOUT and STDERR.
+       * io/unix.c (open_internal):  Zero freshly allocated memory
+       for unix_stream.
+       (fd_to_stream):  Likewise.
+
+2005-05-11  Bud Davis  <bdavis@gfortran.org>
+
+       PR fortran/19478
+       * io/unix.c (fd_truncate): update positions when ftruncate
+       fails (like writing to /dev/null).
+
+2005-05-10  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/21471
+       * open.c (new_unit): Take care of the case where POSITION_APPEND
+       is specified (sseek to the end, and set u>-endfile).
+
+2005-05-10  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/20178
+       * Makefile.am (gfor_specific_src): Add 'intrinsics/f2c_intrinsics.F90'
+       to dependencies.
+       * Makefile.in: Regenerate.
+       * intrinsics/f2c_specific.F90: New file.
+
+2005-05-10  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20788
+       * io/unix.c (fd_to_stream): Add an avoid_mmap argument indicating
+       we don't we to mmap this stream. Use fd_open instead of mmap_open
+       in that case.
+       (open_external): Call fd_to_stream with avoid_mmap = 0.
+       (input_stream): Call fd_to_stream with avoid_mmap = 1.
+       (output_stream): Likewise.
+       (error_stream): Likewise.
+
+2005-05-09  Mike Stump  <mrs@apple.com>
+
+       * configure: Regenerate.
+
+2005-05-09  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/19155
+       * io/read.c (read_f): Accept 'e', 'E', 'd' and 'D' as first
+       non-blank characters of a real number.
+
+2005-05-04  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21354
+       * m4/cshift1.m4: Change dimension of auxiliary arrays from
+       GFC_MAX_DIMENSION - 1 to GFC_MAX_DIMENSION.
+       * m4/eoshift1.m4: Likewise.
+       * m4/eoshift3.m4: Likewise.
+       * m4/ifunction.m4: Likewise.
+       * m4/in_pack.m4: Likewise.
+       * m4/in_unpack.m4: Likewise.
+       * intrinsics/cshift0.c: Likewise.
+       * intrinsics/eoshift0.c: Likewise.
+       * intrinsics/eoshift2.c: Likewise.
+       * intrinsics/random.c: Likewise.
+       * intrinsics/spread_generic.c: Likewise.
+       * intrinsics/stat.c: Likewise.
+       * generated/all_l4.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/count_4_l4.c: Regenerated.
+       * generated/count_4_l8.c: Regenerated.
+       * generated/count_8_l4.c: Regenerated.
+       * generated/count_8_l8.c: Regenerated.
+       * generated/cshift1_4.c: Regenerated.
+       * generated/cshift1_8.c: Regenerated.
+       * generated/eoshift1_4.c: Regenerated.
+       * generated/eoshift1_8.c: Regenerated.
+       * generated/eoshift3_4.c: Regenerated.
+       * generated/eoshift3_8.c: Regenerated.
+       * generated/in_pack_i4.c: Regenerated.
+       * generated/in_pack_i8.c: Regenerated.
+       * generated/in_unpack_i4.c: Regenerated.
+       * generated/in_unpack_i8.c: Regenerated.
+       * generated/maxloc0_4_i4.c: Regenerated.
+       * generated/maxloc0_4_i8.c: Regenerated.
+       * generated/maxloc0_4_r4.c: Regenerated.
+       * generated/maxloc0_4_r8.c: Regenerated.
+       * generated/maxloc0_8_i4.c: Regenerated.
+       * generated/maxloc0_8_i8.c: Regenerated.
+       * generated/maxloc0_8_r4.c: Regenerated.
+       * generated/maxloc0_8_r8.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc0_4_i4.c: Regenerated.
+       * generated/minloc0_4_i8.c: Regenerated.
+       * generated/minloc0_4_r4.c: Regenerated.
+       * generated/minloc0_4_r8.c: Regenerated.
+       * generated/minloc0_8_i4.c: Regenerated.
+       * generated/minloc0_8_i8.c: Regenerated.
+       * generated/minloc0_8_r4.c: Regenerated.
+       * generated/minloc0_8_r8.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2005-04-30  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/18958
+       libgfortran.h:  Change typedef of index_type from size_t
+       to ssize_t.
+
+2005-04-30  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR libfortran/18857
+       * generated/matmul_r8.c: Remove incorrect assertions.
+       * generated/matmul_c4.c: Regenerate
+       * generated/matmul_c8.c: Regenerate
+       * generated/matmul_i4.c: Regenerate
+       * generated/matmul_i8.c: Regenerate
+       * generated/matmul_r4.c: Regenerate
+       * generated/matmul_r8.c: Regenerate
+
+2005-04-29  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * configure.ac: Check for ftruncate and chsize.
+       * io/unix.c (fd_truncate): Provide chsize as alternative to
+       ftruncate.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2005-04-29  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * intrinsics/rename.c: Add missing #includes.
+
+2005-04-28  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * AUTHORS, COPYING, INSTALL, NEWS, README: Remove.
+
+2005-04-26  David Edelsohn  <edelsohn@gnu.org>
+
+       PR libfortran/20930
+       * io/rewind.c (st_rewind): Flush the stream when resetting the mode
+       from WRITING to READING.
+
+2005-04-22  Paul Thomas  <pault@gcc.gnu.org>
+           Jerry DeLisle  <jvdelisle@verizon.net>
+
+       * io/write.c (nml_write_obj): Provide 1 more byte for ext_name.
+       * io/list_read.c (nml_get_obj_data): Put extra brackets in get_mem
+       call for ext_name.  These fix the bug reported by Jerry DeLisle to
+       the fortran list and are based on his suggested fix.
+
+2005-04-22  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/20074
+       PR libfortran/20436
+       PR libfortran/21108
+       * m4/reshape.m4 (reshape_`'rtype_kind):  rs, rex:  New
+       variables, to be used in calculation of return array sizes.
+       Populate return array descriptor if ret->data is NULL.
+       Fix condition for early return (it used to test something
+       undefined if order was used).
+       Remove duplicate check wether pad is used.
+       * intrinsics/reshape_generic.c (reshape_generic): Likewise.
+       Fix a few places where the wrong variables were set.
+       * generated/reshape_i4.c: Regenerated.
+       * generated/reshape_i8.c: Regenerated.
+
+2005-04-18  Paul  Thomas <pault@gcc.gnu.org>
+
+       * io/list_read.c (nml_touch_nodes, nml_read_obj,
+       nml_get_obj_data): Fix memory leaks in code for derived types.
+
+2005-04-11  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20950
+       * io/inquire.c (inquire_via_unit): Check for the gfc_unit being
+       NULL when setting ioparm.sequential.
+
+2005-04-17  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21075
+       * m4/reshape.m4 (reshape_`'rtype_kind):  Change dimension
+       of auxiliary arrays from GFC_MAX_DIMENSIONS - 1 to
+       GFC_MAX_DIMENSIONS.
+       * intrinsics/reshape_generic.c (reshape_generic):  Likewise.
+       * generated/reshape_i4.c:  Regenerated.
+       * generated/reshape_i8.c:  Regenerated.
+
+2005-04-17 Paul Thomas <pault@gcc.gnu.org>
+
+       * io/list_read.c (eat_separator): at_eol = 1 replaced
+       (zapped at some time?).
+
+2005-04-17 Paul Thomas <pault@gcc.gnu.org>
+
+       PR libfortran/12884
+       PR libfortran/17285
+       PR libfortran/18122
+       PR libfortran/18210
+       PR libfortran/18392
+       PR libfortran/18591
+       PR libfortran/18879
+       * io/io.h (nml_ls): Declare.
+       (namelist_info): Modify for arrays.
+       * io/list_read.c (namelist_read): Reduced to call to new functions.
+       (match_namelist_name): Simplified.
+       (nml_query): Handles stdin queries ? and =?. New function.
+       (nml_get_obj_data): Parses object name. New function.
+       (touch_nml_nodes): Marks objects for read. New function.
+       (untouch_nml_nodes): Resets objects. New function.
+       (parse_qualifier): Parses and checks qualifiers. New function
+       (nml_read_object): Reads and stores object data. New function.
+       (eat_separator): No new_record on '/' in namelist.
+       (finish_separator): No new_record on '/' in namelist.
+       (read_logical): Error return for namelist.
+       (read_integer): Error return for namelist.
+       (read_complex): Error return for namelist.
+       (read_real): Error return for namelist.
+       * io/lock.c (library_end): Free extended namelist_info types.
+       * io/transfer.c (st_set_nml_var): Modified for arrays.
+       (st_set_nml_var_dim): Dimension descriptors. New function.
+       * io/write.c (namelist_write): Reduced to call to new functions.
+       (nml_write_obj): Writes output for object. New function.
+       (write_integer): Suppress leading blanks for repeat counts.
+       (write_int): Suppress leading blanks for repeat counts.
+       (write_float): Suppress leading blanks for repeat counts.
+       (output_float): Suppress leading blanks for repeat counts.
+
+2005-04-15  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/18495
+       * intrinsics/spread_generic.c (spread):  Remove const from
+       return array descriptor.
+       New variables: rrank (rank of return array),  rs (for
+       calculating the size of the return array), srank (rank
+       of the source array).
+       Generate runtime error if the dim= argument is larger than
+       the rank of the return array.
+       Generate runtime error if the needed rank of the return
+       array is larger than 7.
+       If ret->data is null, populate the return array descriptor
+       and initialize the variables for the actual operation.
+       Otherwise, set ret->dim[0].stride to one if it is zero.
+       Change second, independent use of variable dim to srank.
+
+2005-04-12  Mike Stump  <mrs@apple.com>
+
+       * configure: Regenerate.
+
+2005-04-13  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/19106
+       * m4/iforeach.c (name`'rtype_qual`_'atype_code):  Add TODO
+       that setting correct strides is a front end job.
+       (`m'name`'rtype_qual`_'atype_code):  Likewise.  If mask has
+       a lowest stride of 0, adjust to 1.
+       * m4/ifunction.c (name`'rtype_qual`_'atype_code):  Add TODO
+       that setting correct strides is a front end job.
+       (`m'name`'rtype_qual`_'atype_code):  Likewise.  If mask has
+       a lowest stride of 0, adjust to 1.
+       * maxloc0_4_i4.c: Regenerated
+       * maxloc0_4_i8.c: Regenerated
+       * maxloc0_4_r4.c: Regenerated
+       * maxloc0_4_r8.c: Regenerated
+       * maxloc0_8_i4.c: Regenerated
+       * maxloc0_8_i8.c: Regenerated
+       * maxloc0_8_r4.c: Regenerated
+       * maxloc0_8_r8.c: Regenerated
+       * maxloc1_4_i4.c: Regenerated
+       * maxloc1_4_i8.c: Regenerated
+       * maxloc1_4_r4.c: Regenerated
+       * maxloc1_4_r8.c: Regenerated
+       * maxloc1_8_i4.c: Regenerated
+       * maxloc1_8_i8.c: Regenerated
+       * maxloc1_8_r4.c: Regenerated
+       * maxloc1_8_r8.c: Regenerated
+       * maxval_i4.c: Regenerated
+       * maxval_i8.c: Regenerated
+       * maxval_r4.c: Regenerated
+       * maxval_r8.c: Regenerated
+       * minloc0_4_i4.c: Regenerated
+       * minloc0_4_i8.c: Regenerated
+       * minloc0_4_r4.c: Regenerated
+       * minloc0_4_r8.c: Regenerated
+       * minloc0_8_i4.c: Regenerated
+       * minloc0_8_i8.c: Regenerated
+       * minloc0_8_r4.c: Regenerated
+       * minloc0_8_r8.c: Regenerated
+       * minloc1_4_i4.c: Regenerated
+       * minloc1_4_i8.c: Regenerated
+       * minloc1_4_r4.c: Regenerated
+       * minloc1_4_r8.c: Regenerated
+       * minloc1_8_i4.c: Regenerated
+       * minloc1_8_i8.c: Regenerated
+       * minloc1_8_r4.c: Regenerated
+       * minloc1_8_r8.c: Regenerated
+       * minval_i4.c: Regenerated
+       * minval_i8.c: Regenerated
+       * minval_r4.c: Regenerated
+       * minval_r8.c: Regenerated
+       * product_c4.c: Regenerated
+       * product_c8.c: Regenerated
+       * product_i4.c: Regenerated
+       * product_i8.c: Regenerated
+       * product_r4.c: Regenerated
+       * product_r8.c: Regenerated
+       * sum_c4.c: Regenerated
+       * sum_c8.c: Regenerated
+       * sum_i4.c: Regenerated
+       * sum_i8.c: Regenerated
+       * sum_r4.c: Regenerated
+       * sum_r8.c: Regenerated
+
+2005-04-10  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20788
+       * runtime/environ.c (init_unsigned_integer): Function for
+       environment variables we want to be positive.
+       (init_integer): Function to allow negative environment
+       variables (e.g. for GFORTRAN_STDIN_UNIT).
+
+2005-04-10  Thomas Koenig <Thomas.Koenig@online.de>
+
+       PR libfortran/17992
+       PR libfortran/19568
+       PR libfortran/19595
+       PR libfortran/20005
+       PR libfortran/20092
+       PR libfortran/20131
+       PR libfortran/20661
+       PR libfortran/20744
+       * io/transfer.c (top level): eor_condition: New static variable.
+       (read_sf): Remove unnecessary zeroing of buffer (there is enough
+       information in its length).
+       Return a string of length 0 (to be padded by caller) if EOR was
+       seen previously.
+       Remove erroneous special casing of EOR for standard input.
+       Set eor_condition for non-advancing I/O if an end of line was
+       detected.
+       Increment ioparm.size if necessary.
+       (formatted_transfer):  Skip the function if there is an EOR condition.
+       (data_transfer_init):  Initialize eor_condition to zero (false).
+       (next_record_r):  Clear sf_seen_eor if a \n has been seen already.
+       (finalize_transfer):  If there is an EOR condition, raise the error.
+
+2005-04-09  Bud Davis  <bdavis@gfortran.org>
+           Steven G. Kargl <kargls@comcast.net>
+
+       PR fortran/19872
+       * io/transfer.c (data_transfer_init): truncate an existing
+       file on the first write.
+
+2005-04-09  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/19106
+       PR libfortran/19014
+       * m4/ifunction.m4 (name`'rtype_qual`_'atype_code): ditto.
+       If retarray->data is NULL (i.e. the front end does not
+       know the rank and dimenson of the array), fill in its
+       properties and allocate memory.
+       Change the assertions about rank and dimension of retarray into
+       runtime errors and only check them for retarray->data != NULL.
+       Do the same for correcting the stride from 0 to 1 in retarray.
+       (`m'name`'rtype_qual`_'atype_code): Likewise.
+       * m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Likewise.
+       Change assertion about rank of array to runtime error.
+       (`m'name`'rtype_qual`_'atype_code): Likewise.
+       * generated/all_l4.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/count_4_l4.c: Regenerated.
+       * generated/count_4_l8.c: Regenerated.
+       * generated/count_8_l4.c: Regenerated.
+       * generated/count_8_l8.c: Regenerated.
+       * generated/maxloc0_4_i4.c: Regenerated.
+       * generated/maxloc0_4_i8.c: Regenerated.
+       * generated/maxloc0_4_r4.c: Regenerated.
+       * generated/maxloc0_4_r8.c: Regenerated.
+       * generated/maxloc0_8_i4.c: Regenerated.
+       * generated/maxloc0_8_i8.c: Regenerated.
+       * generated/maxloc0_8_r4.c: Regenerated.
+       * generated/maxloc0_8_r8.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc0_4_i4.c: Regenerated.
+       * generated/minloc0_4_i8.c: Regenerated.
+       * generated/minloc0_4_r4.c: Regenerated.
+       * generated/minloc0_4_r8.c: Regenerated.
+       * generated/minloc0_8_i4.c: Regenerated.
+       * generated/minloc0_8_i8.c: Regenerated.
+       * generated/minloc0_8_r4.c: Regenerated.
+       * generated/minloc0_8_r8.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2005-04-09  Thomas Koenig <Thomas.Koenig@online.de>
+
+       PR libfortran/20163
+       * runtime/string.c (compare0): Use fstrlen() to
+       strip trailing blanks from option string.
+
+2005-04-09  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR fortran/13257
+       * format.c (parse_format_list): Allow an optional comma
+       between descriptors.
+
+2005-04-08  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * io/backspace.c (unformatted_backspace): Do not dereference
+       the pointer to the stream.
+
+2005-04-07  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR libfortran/20766
+       * configure.ac (extra_ldflags_libgfortran): Set for *-darwin* to
+       "-Wl,-single_module".
+       * configure: Regenerate.
+       * Makefile.am (libgfortran_la_LDFLAGS): Add extra_ldflags_libgfortran.
+       * Makefile.in: Regenerate.
+
+2005-04-05  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20755
+       * write.c (write_float): A G edit descriptor may locally change
+       the scale factor, but it needs to be restored afterwards.
+
+2005-04-03  Dale Ranta  <dir@lanl.gov>
+           Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20068
+       PR libfortran/20125
+       PR libfortran/20156
+       PR libfortran/20471
+       * io/backspace.c (unformatted_backspace): Fix error in arithmetic.
+       (st_backspace): When in WRITING mode, we flush and falling back
+       into READING mode. In all cases, correctly position the stream.
+
+2005-03-31  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20660
+       * io/inquire.c (inquire_via_unit): Non-opened units should still be
+       reported by an INQUIRE statement as existing.
+       * io/transfer.c (data_transfer_init): Never accept negative units.
+
+2005-03-29  Dale Ranta  <dir@lanl.gov>
+           Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20163
+       * io/open.c (st_open): call library_end() before returning even if
+       an error arises.
+
+2005-03-25  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/19678
+       * list_read.c (next_char, eat_separator, finish_separator, read_real)
+       (namelist_read): Add support for '\r' as well as '\n' as EOL
+       character.
+
+       PR libfortran/19679
+       * list_read.c (read_sf): Add a '\r' in a test to support DOS
+       line-endings when line length is exceeded.
+
+2005-03-25  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/15332
+       * io/format.c (parse_format_list): format node for colon edit
+       descriptor needs a repeat counter set to 1.
+
+2005-02-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * config.h.in: Regenerate.
+
+2005-02-23  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/18025
+       * write.c (output_float): Handling the "F0.d" format similarly as
+       commercial compilers.
+
+2005-03-22  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * Makefile.am: Added new files.
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+       * configure.ac: add checks for signal.h headers file, as well as
+       following functions: chdir, strerror, getlogin, gethostname, kill,
+       link, symlink, perror, sleep, time.
+       * configure: Regenerate.
+       * intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
+       intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
+       intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
+       intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
+       implementend g77 intrinsics.
+
+2005-03-21  Zack Weinberg  <zack@codesourcery.com>
+
+       * configure.ac: Do not invoke TL_AC_GCC_VERSION.
+       In all substitutions, leave gcc_version to be expanded by the Makefile.
+       * aclocal.m4, configure: Regenerate.
+       * Makefile.am: Set gcc_version.
+       * Makefile.in: Regenerate.
+
+2005-03-16  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20257
+       * open.c (new_unit): set record length to max_offset rather than
+         using a hard-coded limit (which was too low).
+
+2005-03-16  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20480
+       * write.c (output_float): special check when writing 0.0 with
+         EN and ES formats.
+
+2005-03-11  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20124
+       * write.c (output_float): Adds a nzero_real variable to store
+       the number of leading zeros whatever the format width is. Corrects
+       the rounding of numbers less than 10^(-width). Fixes typo in an
+       error message. Updates copyright years
+
+2005-02-27  Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       * runtime/environ.c: Update copyright years.
+
+2005-02-27  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * io/write.c: Update copyright years.
+
+2005-02-27  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20101
+       * io/write.c (output_float): Added special check for value 0.0 in
+       PE format.
+
+2005-02-27  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * io/write.c (output_float): Fix typo in condition.
+
+2005-02-25  Peter O'Gorman  <peter@pogma.com>
+           Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       PR libfortran/17748
+       * runtime/environ.c: Remove references to environ.
+       (show_variables): remove GFORTRAN_UNBUFFERED_* and
+       GFORTRAN_NAME_* because they require environ.
+       (pattern_scan): Remove function.
+
+2005-02-22  Paul Thomas <paulthomas2@wannado.fr>
+           Bud Davis  <bdavis@gfortran.org>
+
+       * io/list_read.c (read_real): Handle separators properly
+       in list directed read.
+
+2005-02-21  Bud Davis  <bdavis@gfortran.org>
+
+       PR fortran/20086
+       * io/transfer.c (write_constant_string): accept an 'h' as
+       the start of a hollerith format string.
+
+2005-02-21  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR libfortran/19302
+       * intrinsics/c99_functions.c (nextafterf): Special-case infinite
+       numbers.
+
+2005-02-21  Steven G. Kargl  <kargls@comcast.net>
+
+       * io/write.c (output_float):  Typo in error meesage.
+
+2005-02-20  Steven G. Kargl  <kargls@comcast.net>
+
+       PR 20085
+       * intrinsic/args.c (iargc): Off by 1.
+
+2005-02-19  Steven G. Kargl  <kargls@comcast.net>
+
+       *  intrinsic/date_and_time.c: Fix conformance problems.
+
+2005-02-01  Paul Thomas <paulthomas2@wanadoo.fr>
+
+       PR libfortran/19363
+       PR libfortran/19691
+       * libgfortran.h (isfinite): Work around broken isfinite(x) in Cygwin.
+
+2005-01-30  Bud Davis  <bdavis@gfortran.org>
+
+       PR fortran/19647
+       * io/inquire.c (inquire_via_unit): Use correct variable for
+       pad.
+
+2005-01-29  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/19595
+       * io/transfer.c (data_transfer_init): eor requires advance="NO".
+
+2005-01-25  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR libfortran/19524
+       * io/read.c (read_f): Don't free uninitialized pointer.
+
+2005-01-23  James A. Morrison  <phython@gcc.gnu.org>
+       Paul Brook  <paul@codesourcery.com>
+
+       PR fortran/19294
+       * Makefile.am: Add transpose_c4.c and transpose_c8.c.
+       * intrinsics/cshift0.c: Use separate optimized loops for complex types.
+       * m4/transpose.m4: Include type letter in function name.
+       * Makefile.in: Regenerate.
+       * generated/transpose_*.c: Regenerate.
+
+2005-01-22  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/19451
+       * io/transfer.c (finalize_transfer):  Don't do anything if
+       there is an error condition.
+
+2005-01-22  David Edelsohn  <edelsohn@gnu.org>
+
+       PR libfortran/19052
+       * libgfortran.h (options_t): Add stderr_unit.
+       * io/io.h (error_stream): Declare.
+       * io/open.c (new_unit): Do not terminate abnormally if opening
+       file preconnected to stdin, stdout, or stderr.
+       * io/unit.c (init_units): Initialize stderr_unit.
+       * io/unix.c (error_stream): New function.
+       * runtime/environ.c (GFORTRAN_STDERR_UNIT): New environment variable.
+
+2005-01-22  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/18982
+       * io/unix.c (regular_file):  No need to change flags->action
+       if an error occurs.  Document this.
+       No need to call stat() for STATUS_OLD, open() will
+       fail anyway.
+       For ACTION_UNSPECIFIED, try open for read-write, then for
+       read-only if open fails with EACCES, then for write-only
+       if that fails with EACCES again.
+       * io/unix.c (open_external): Document changed behavior of
+       regular_file.
+
+2005-01-22  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/19194
+       * io/io.h (st_parameter): Use 'GFC_INTEGER_4' instead of 'int',
+       use CHARACTER macro for definition of string valued paramters.
+
+2005-01-22  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/19314
+       * io/inquire.c(inquire_via_unit): implement POSITION=.
+       * io/transfer.c(next_record): update position for
+       INQUIRE.
+       * io/rewind.c(st_rewind): update position for
+       INQUIRE.
+
+2005-01-16  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/18778
+       * io/transfer.c (us_read): no bytes available is not a
+       runtime error.
+
+2005-01-15  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/18983
+       * io/transfer.c (st_write_done): only truncate when it
+       is required.
+
+2005-01-12  Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       PR libfortran/19280
+       c99_protos.h: License changed to GPL+exception.
+       libgfortran.h: Ditto.
+       intrinsics/abort.c: Ditto.
+       intrinsics/args.c: Ditto.
+       intrinsics/associated.c: Ditto.
+       intrinsics/bessel.c: Ditto.
+       intrinsics/c99_functions.c: Ditto.
+       intrinsics/cpu_time.c: Ditto.
+       intrinsics/cshift0.c: Ditto.
+       intrinsics/date_and_time.c: Ditto.
+       intrinsics/env.c: Ditto.
+       intrinsics/eoshift0.c: Ditto.
+       intrinsics/eoshift2.c: Ditto.
+       intrinsics/erf.c: Ditto.
+       intrinsics/etime.c: Ditto.
+       intrinsics/exit.c: Ditto.
+       intrinsics/flush.c: Ditto.
+       intrinsics/fnum.c: Ditto.
+       intrinsics/getXid.c: Ditto.
+       intrinsics/getcwd.c: Ditto.
+       intrinsics/ishftc.c: Ditto.
+       intrinsics/mvbits.c: Ditto.
+       intrinsics/pack_generic.c: Ditto.
+       intrinsics/rand.c: Ditto.
+       intrinsics/random.c: Ditto.
+       intrinsics/reshape_generic.c: Ditto.
+       intrinsics/reshape_packed.c: Ditto.
+       intrinsics/size.c: Ditto.
+       intrinsics/spread_generic.c: Ditto.
+       intrinsics/stat.c: Ditto.
+       intrinsics/string_intrinsics.c: Ditto.
+       intrinsics/system.c: Ditto.
+       intrinsics/system_clock.c: Ditto.
+       intrinsics/transpose_generic.c: Ditto.
+       intrinsics/umask.c: Ditto.
+       intrinsics/unlink.c: Ditto.
+       intrinsics/unpack_generic.c: Ditto.
+       io/backspace.c: Ditto.
+       io/close.c: Ditto.
+       io/endfile.c: Ditto.
+       io/format.c: Ditto.
+       io/inquire.c: Ditto.
+       io/io.h: Ditto.
+       io/list_read.c: Ditto.
+       io/lock.c: Ditto.
+       io/open.c: Ditto.
+       io/read.c: Ditto.
+       io/rewind.c: Ditto.
+       io/transfer.c: Ditto.
+       io/unit.c: Ditto.
+       io/unix.c: Ditto.
+       io/write.c: Ditto.
+       m4/all.m4: Ditto.
+       m4/any.m4: Ditto.
+       m4/cexp.m4: Ditto.
+       m4/chyp.m4: Ditto.
+       m4/count.m4: Ditto.
+       m4/cshift1.m4: Ditto.
+       m4/ctrig.m4: Ditto.
+       m4/dotprod.m4: Ditto.
+       m4/dotprodc.m4: Ditto.
+       m4/dotprodl.m4: Ditto.
+       m4/eoshift1.m4: Ditto.
+       m4/eoshift3.m4: Ditto.
+       m4/exponent.m4: Ditto.
+       m4/fraction.m4: Ditto.
+       m4/head.m4: Ditto.
+       m4/iforeach.m4: Ditto.
+       m4/ifunction.m4: Ditto.
+       m4/in_pack.m4: Ditto.
+       m4/in_unpack.m4: Ditto.
+       m4/iparm.m4: Ditto.
+       m4/matmul.m4: Ditto.
+       m4/matmull.m4: Ditto.
+       m4/maxloc0.m4: Ditto.
+       m4/maxloc1.m4: Ditto.
+       m4/maxval.m4: Ditto.
+       m4/minloc0.m4: Ditto.
+       m4/minloc1.m4: Ditto.
+       m4/minval.m4: Ditto.
+       m4/mtype.m4: Ditto.
+       m4/nearest.m4: Ditto.
+       m4/pow.m4: Ditto.
+       m4/product.m4: Ditto.
+       m4/reshape.m4: Ditto.
+       m4/set_exponent.m4: Ditto.
+       m4/shape.m4: Ditto.
+       m4/specific.m4: Ditto.
+       m4/specific2.m4: Ditto.
+       m4/sum.m4: Ditto.
+       m4/transpose.m4: Ditto.
+       m4/types.m4: Ditto.
+       runtime/environ.c: Ditto.
+       runtime/error.c: Ditto.
+       runtime/in_pack_generic.c: Ditto.
+       runtime/in_unpack_generic.c: Ditto.
+       runtime/main.c: Ditto.
+       runtime/memory.c: Ditto.
+       runtime/normalize.c: Ditto.
+       runtime/pause.c: Ditto.
+       runtime/select.c: Ditto.
+       runtime/stop.c: Ditto.
+       runtime/string.c: Ditto.
+       generated/_abs_c4.f90: Regenerated.
+       generated/_abs_c8.f90: Regenerated.
+       generated/_abs_i4.f90: Regenerated.
+       generated/_abs_i8.f90: Regenerated.
+       generated/_abs_r4.f90: Regenerated.
+       generated/_abs_r8.f90: Regenerated.
+       generated/_acos_r4.f90: Regenerated.
+       generated/_acos_r8.f90: Regenerated.
+       generated/_aint_r4.f90: Regenerated.
+       generated/_aint_r8.f90: Regenerated.
+       generated/_anint_r4.f90: Regenerated.
+       generated/_anint_r8.f90: Regenerated.
+       generated/_asin_r4.f90: Regenerated.
+       generated/_asin_r8.f90: Regenerated.
+       generated/_atan2_r4.f90: Regenerated.
+       generated/_atan2_r8.f90: Regenerated.
+       generated/_atan_r4.f90: Regenerated.
+       generated/_atan_r8.f90: Regenerated.
+       generated/_conjg_c4.f90: Regenerated.
+       generated/_conjg_c8.f90: Regenerated.
+       generated/_cos_c4.f90: Regenerated.
+       generated/_cos_c8.f90: Regenerated.
+       generated/_cos_r4.f90: Regenerated.
+       generated/_cos_r8.f90: Regenerated.
+       generated/_cosh_r4.f90: Regenerated.
+       generated/_cosh_r8.f90: Regenerated.
+       generated/_dim_i4.f90: Regenerated.
+       generated/_dim_i8.f90: Regenerated.
+       generated/_dim_r4.f90: Regenerated.
+       generated/_dim_r8.f90: Regenerated.
+       generated/_exp_c4.f90: Regenerated.
+       generated/_exp_c8.f90: Regenerated.
+       generated/_exp_r4.f90: Regenerated.
+       generated/_exp_r8.f90: Regenerated.
+       generated/_log10_r4.f90: Regenerated.
+       generated/_log10_r8.f90: Regenerated.
+       generated/_log_c4.f90: Regenerated.
+       generated/_log_c8.f90: Regenerated.
+       generated/_log_r4.f90: Regenerated.
+       generated/_log_r8.f90: Regenerated.
+       generated/_mod_i4.f90: Regenerated.
+       generated/_mod_i8.f90: Regenerated.
+       generated/_mod_r4.f90: Regenerated.
+       generated/_mod_r8.f90: Regenerated.
+       generated/_sign_i4.f90: Regenerated.
+       generated/_sign_i8.f90: Regenerated.
+       generated/_sign_r4.f90: Regenerated.
+       generated/_sign_r8.f90: Regenerated.
+       generated/_sin_c4.f90: Regenerated.
+       generated/_sin_c8.f90: Regenerated.
+       generated/_sin_r4.f90: Regenerated.
+       generated/_sin_r8.f90: Regenerated.
+       generated/_sinh_r4.f90: Regenerated.
+       generated/_sinh_r8.f90: Regenerated.
+       generated/_sqrt_c4.f90: Regenerated.
+       generated/_sqrt_c8.f90: Regenerated.
+       generated/_sqrt_r4.f90: Regenerated.
+       generated/_sqrt_r8.f90: Regenerated.
+       generated/_tan_r4.f90: Regenerated.
+       generated/_tan_r8.f90: Regenerated.
+       generated/_tanh_r4.f90: Regenerated.
+       generated/_tanh_r8.f90: Regenerated.
+       generated/all_l4.c: Regenerated.
+       generated/all_l8.c: Regenerated.
+       generated/any_l4.c: Regenerated.
+       generated/any_l8.c: Regenerated.
+       generated/count_4_l4.c: Regenerated.
+       generated/count_4_l8.c: Regenerated.
+       generated/count_8_l4.c: Regenerated.
+       generated/count_8_l8.c: Regenerated.
+       generated/cshift1_4.c: Regenerated.
+       generated/cshift1_8.c: Regenerated.
+       generated/dotprod_c4.c: Regenerated.
+       generated/dotprod_c8.c: Regenerated.
+       generated/dotprod_i4.c: Regenerated.
+       generated/dotprod_i8.c: Regenerated.
+       generated/dotprod_l4.c: Regenerated.
+       generated/dotprod_l8.c: Regenerated.
+       generated/dotprod_r4.c: Regenerated.
+       generated/dotprod_r8.c: Regenerated.
+       generated/eoshift1_4.c: Regenerated.
+       generated/eoshift1_8.c: Regenerated.
+       generated/eoshift3_4.c: Regenerated.
+       generated/eoshift3_8.c: Regenerated.
+       generated/exp_c4.c: Regenerated.
+       generated/exp_c8.c: Regenerated.
+       generated/exponent_r4.c: Regenerated.
+       generated/exponent_r8.c: Regenerated.
+       generated/fraction_r4.c: Regenerated.
+       generated/fraction_r8.c: Regenerated.
+       generated/hyp_c4.c: Regenerated.
+       generated/hyp_c8.c: Regenerated.
+       generated/in_pack_i4.c: Regenerated.
+       generated/in_pack_i8.c: Regenerated.
+       generated/in_unpack_i4.c: Regenerated.
+       generated/in_unpack_i8.c: Regenerated.
+       generated/matmul_c4.c: Regenerated.
+       generated/matmul_c8.c: Regenerated.
+       generated/matmul_i4.c: Regenerated.
+       generated/matmul_i8.c: Regenerated.
+       generated/matmul_l4.c: Regenerated.
+       generated/matmul_l8.c: Regenerated.
+       generated/matmul_r4.c: Regenerated.
+       generated/matmul_r8.c: Regenerated.
+       generated/maxloc0_4_i4.c: Regenerated.
+       generated/maxloc0_4_i8.c: Regenerated.
+       generated/maxloc0_4_r4.c: Regenerated.
+       generated/maxloc0_4_r8.c: Regenerated.
+       generated/maxloc0_8_i4.c: Regenerated.
+       generated/maxloc0_8_i8.c: Regenerated.
+       generated/maxloc0_8_r4.c: Regenerated.
+       generated/maxloc0_8_r8.c: Regenerated.
+       generated/maxloc1_4_i4.c: Regenerated.
+       generated/maxloc1_4_i8.c: Regenerated.
+       generated/maxloc1_4_r4.c: Regenerated.
+       generated/maxloc1_4_r8.c: Regenerated.
+       generated/maxloc1_8_i4.c: Regenerated.
+       generated/maxloc1_8_i8.c: Regenerated.
+       generated/maxloc1_8_r4.c: Regenerated.
+       generated/maxloc1_8_r8.c: Regenerated.
+       generated/maxval_i4.c: Regenerated.
+       generated/maxval_i8.c: Regenerated.
+       generated/maxval_r4.c: Regenerated.
+       generated/maxval_r8.c: Regenerated.
+       generated/minloc0_4_i4.c: Regenerated.
+       generated/minloc0_4_i8.c: Regenerated.
+       generated/minloc0_4_r4.c: Regenerated.
+       generated/minloc0_4_r8.c: Regenerated.
+       generated/minloc0_8_i4.c: Regenerated.
+       generated/minloc0_8_i8.c: Regenerated.
+       generated/minloc0_8_r4.c: Regenerated.
+       generated/minloc0_8_r8.c: Regenerated.
+       generated/minloc1_4_i4.c: Regenerated.
+       generated/minloc1_4_i8.c: Regenerated.
+       generated/minloc1_4_r4.c: Regenerated.
+       generated/minloc1_4_r8.c: Regenerated.
+       generated/minloc1_8_i4.c: Regenerated.
+       generated/minloc1_8_i8.c: Regenerated.
+       generated/minloc1_8_r4.c: Regenerated.
+       generated/minloc1_8_r8.c: Regenerated.
+       generated/minval_i4.c: Regenerated.
+       generated/minval_i8.c: Regenerated.
+       generated/minval_r4.c: Regenerated.
+       generated/minval_r8.c: Regenerated.
+       generated/nearest_r4.c: Regenerated.
+       generated/nearest_r8.c: Regenerated.
+       generated/pow_c4_i4.c: Regenerated.
+       generated/pow_c4_i8.c: Regenerated.
+       generated/pow_c8_i4.c: Regenerated.
+       generated/pow_c8_i8.c: Regenerated.
+       generated/pow_i4_i4.c: Regenerated.
+       generated/pow_i4_i8.c: Regenerated.
+       generated/pow_i8_i4.c: Regenerated.
+       generated/pow_i8_i8.c: Regenerated.
+       generated/pow_r4_i4.c: Regenerated.
+       generated/pow_r4_i8.c: Regenerated.
+       generated/pow_r8_i4.c: Regenerated.
+       generated/pow_r8_i8.c: Regenerated.
+       generated/product_c4.c: Regenerated.
+       generated/product_c8.c: Regenerated.
+       generated/product_i4.c: Regenerated.
+       generated/product_i8.c: Regenerated.
+       generated/product_r4.c: Regenerated.
+       generated/product_r8.c: Regenerated.
+       generated/reshape_i4.c: Regenerated.
+       generated/reshape_i8.c: Regenerated.
+       generated/set_exponent_r4.c: Regenerated.
+       generated/set_exponent_r8.c: Regenerated.
+       generated/shape_i4.c: Regenerated.
+       generated/shape_i8.c: Regenerated.
+       generated/sum_c4.c: Regenerated.
+       generated/sum_c8.c: Regenerated.
+       generated/sum_i4.c: Regenerated.
+       generated/sum_i8.c: Regenerated.
+       generated/sum_r4.c: Regenerated.
+       generated/sum_r8.c: Regenerated.
+       generated/transpose_i4.c: Regenerated.
+       generated/transpose_i8.c: Regenerated.
+       generated/trig_c4.c: Regenerated.
+       generated/trig_c8.c: Regenerated.
+
+2005-01-07  Bud Davis  <bdavis9659@comcast.net>
+
+       PR fortran/18398
+       * transfer.c (next_record_r): always skip the
+       eol search if it was found during sf_read.
+
+\f
+Copyright (C) 2005 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2006 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2006
new file mode 100644 (file)
index 0000000..5c8dfef
--- /dev/null
@@ -0,0 +1,1641 @@
+2006-12-30  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/30321
+       * m4/ifunction.m4 (name`'rtype_qual`_'atype_code):
+       Check for extents < 0 for zero-sized arrays.  If
+       no retarray has been specified and the size is zero,
+       return early.
+       (`m'name`'rtype_qual`_'atype_code): Likewise.
+       * generated/all_l16.c: Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/any_l16.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/count_16_l16.c: Regenerated.
+       * generated/count_16_l4.c: Regenerated.
+       * generated/count_16_l8.c: Regenerated.
+       * generated/count_4_l16.c: Regenerated.
+       * generated/count_4_l4.c: Regenerated.
+       * generated/count_4_l8.c: Regenerated.
+       * generated/count_8_l16.c: Regenerated.
+       * generated/count_8_l4.c: Regenerated.
+       * generated/count_8_l8.c: Regenerated.
+       * generated/cshift1_16.c: Regenerated.
+       * generated/cshift1_4.c: Regenerated.
+       * generated/cshift1_8.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2006-12-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/30014
+       *io/io.h (st_parameter_dt): Change *size and *iolength type to
+       GFC_IO_INT.
+       *io/transfer.c (finalize_transfer): Cast dtp->u.p.size_used to
+       GFC_IO_INT.  (iolength_transfer): Cast size * nelems to GFC_IO_INT.
+
+2006-12-17  Tobias Burnus  <burnus@net-b.de>
+
+       * intrinsics/associated.c: Check for associated(NULL,NULL).
+
+2006-12-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/30145
+       * io/transfer.c (transfer_array):  Check for negative extent.
+
+2006-12-13  Richard Guenther  <rguenther@suse.de>
+
+       PR fortran/30115
+       * runtime/memory.c (allocate_size): Change interface to
+       void *()(size_t, GFC_INTEGER_4 *).
+       (allocate): Likewise.
+       (allocate64): Likewise.
+       (allocate_array): Change interface to
+       void *()(void *, size_t, GFC_INTEGER_4 *).
+       (allocate64_array): Likewise.
+       (deallocate): Change interface to
+       void ()(void *, GFC_INTEGER_4 *).
+
+2006-12-06  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/29810
+       * intrinsics/c99_functions.c (fmodf, fmodl, floorl): New functions.
+       * c99_protos.h (fmodf, fmodl, floorl): New prototypes.
+       * configure.ac: Check for fmodf, fmod and fmodl.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2006-12-06  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/30009
+       PR libfortran/30056
+       * libgfortran.h:  Add ERROR_CORRUPT_FILE to error_codes.
+       * runtime/error.c (translate_error):  Add handling for
+       ERROR_CORRUPT_FILE.
+       * io/transfer.c (read_block_direct):  Add comment about
+       EOR for stream files.
+       Remove test for no bytes left for direct access files.
+       Generate an ERROR_SHORT_RECORD if the read was short.
+       For unformatted sequential files:  Check endfile condition.
+       Remove test for no bytes left.  End of file here means
+       that the file structure has been corrupted.  Pre-position
+       the file for the next record in case of error.
+       (write_buf):  Whitespace fix.  Subtract the number of bytes
+       written from bytes_left.
+
+2006-12-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/30005
+       * io/open.c: Add errno.h include.
+       (new_unit): Add new error messages with file name for file open.
+
+2006-12-01  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/29568
+       * libgfortran/libgfortran.h (compile_options_t):  Add
+       record_marker. (top level):  Define GFC_MAX_SUBRECORD_LENGTH.
+       * runtime/compile_options.c (set_record_marker):  Change
+       default to four-byte record marker.
+       (set_max_subrecord_length):  New function.
+       * runtime/error.c (translate_error):  Change error message
+       for short record on unformatted read.
+       * io/io.h (gfc_unit):  Add recl_subrecord, bytes_left_subrecord
+       and continued.
+       * io/file_pos.c (unformatted_backspace):  Change default of record
+       marker size to four bytes.  Loop over subrecords.
+       * io/open.c:  Default recl is max_offset.  If
+       compile_options.max_subrecord_length has been set, set set
+       u->recl_subrecord to its value, to the maximum value otherwise.
+       * io/transfer.c (top level):  Add prototypes for us_read, us_write,
+       next_record_r_unf and next_record_w_unf.
+       (read_block_direct):  Separate codepaths for unformatted direct
+       and unformatted sequential.  If a recl has been set by the
+       user, use the number of bytes left for the record if it is smaller
+       than the read request.  Loop over subrecords.  Set an error if the
+       user has set a recl and the read was short.
+       (write_buf):  Separate codepaths for unformatted direct and
+       unformatted sequential. If a recl has been set by the
+       user, use the number of bytes left for the record if it is smaller
+       than the read request.  Loop over subrecords.  Set an error if the
+       user has set a recl and the read was short.
+       (us_read):  Add parameter continued (to indicate that bytes_left
+       should not be intialized).  Change default of record marker size
+       to four bytes. Use subrecord.  If the subrecord length is smaller than
+       zero, this indicates a continuation.
+       (us_write):  Add parameter continued (to indicate that the continued
+       flag should be set).  Use subrecord.
+       (pre_position):  Use 0 for continued on us_write and us_read calls.
+       (skip_record):  New function.
+       (next_record_r_unf):  New function.
+       (next_record_r):  Use next_record_r_unf.
+       (write_us_marker):  Default size for record markers is four bytes.
+       (next_record_w_unf):  New function.
+       (next_record_w):  Use next_record_w_unf.
+
+2006-11-25  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * Makefile.am: Remove intrinsics/erf.c and intrinsics/bessel.c.
+       * Makefile.in: Regenerate.
+       * intrinsics/erf.c: Remove.
+       * intrinsics/bessel.c: Remove.
+       * c99_protos.h: Add prototypes for bessel and error functions.
+       * intrinsics/c99_functions.c: Move content for intrinsics/erf.c
+       and intrinsics/bessel.c here.
+
+2006-11-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/io.h (unit_flags): Add new flag has_recl.
+       * io.open.c (new_unit): Set flag if RECL= was specified.
+       * io/transfer.c (us_write): If flag set, leave recl as initialized by
+       new_unit.
+
+2006-11-16  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * io/open.c (new_unit): Format %d expects an int variable.
+       * runtime/error.c (show_locus): Format %d expects an int variable.
+
+2006-11-08  Steven G. Kargl <kargl@gcc.gnu.org>
+
+       * io/read.c (max_value): Hide "int n" in an #ifdef.
+
+2006-11-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/29752
+       * io/transfer.c (finalize_transfer): Flush on ADVANCE_NO.
+
+2006-11-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/transfer.c (next_record_w): Fix indentation.
+
+2006-11-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25545
+       * io/transfer.c (write_block): Cleanup code paths between
+       stream and non-stream I/O.
+       (write_buf):  Cleanup.
+       (read_block): Cleanup.
+       (finalize_transfer): Call next_record for '$' edit descriptor handling
+       of internal unit. Cleanup code for readability.
+
+2006-11-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/27895
+       * intrinsics/reshape_generic.c (reshape_internal): Fix so that it
+       works correctly for zero-sized arrays.
+       * m4/reshape.m4: Likewise.
+       * generated/reshape_r16.c: Regenerate.
+       * generated/reshape_c4.c: Regenerate.
+       * generated/reshape_i4.c: Regenerate.
+       * generated/reshape_c16.c: Regenerate.
+       * generated/reshape_r10.c: Regenerate.
+       * generated/reshape_r8.c: Regenerate.
+       * generated/reshape_c10.c: Regenerate.
+       * generated/reshape_c8.c: Regenerate.
+       * generated/reshape_i8.c: Regenerate.
+       * generated/reshape_i16.c: Regenerate.
+       * generated/reshape_r4.c: Regenerate.
+
+2006-10-31  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/29627
+       * libgfortran.h: Add ERROR_SHORT_RECORD
+       * runtime/error.c (translate_error): Add case
+       for ERROR_SHORT_RECORD.
+       * io/transfer.c (read_block_direct):  Separate codepaths
+       for stream and record unformatted I/O.  Remove unneeded
+       tests for standard input, padding and formatted I/O.
+       If the record is short, read in as much data as possible,
+       then raise the error.
+
+2006-10-30  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/29452
+       * runtime/string.c (compare0): Check whether string lengths match.
+
+2006-10-29  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+
+2006-10-28  Tobias Burnus <burnus@net-b.de>
+
+       PR fortran/29625
+       * io/transfer.c (formatted_transfer_scalar): Allow binary edit
+         descriptors for real variables; give error for BOZ edit
+         descriptor for non-integers when using -std=f*.
+
+2006-10-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/29563
+       * io/list_read.c (next_char): Fix an error in previous commit.
+
+2006-10-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/29563
+       * io/io.h (st_parameter_dt): Add new flag at_eof.
+       * io/list_read.c (next_char): Set flag when EOF and return '\n' to
+       signal EOR.  Check flag on next call and jump out.
+       * io/unit.c (get_internal_unit): Initialize new flag.
+
+2006-10-22  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/26025
+       * m4/matmul.m4: Add possible call to gemm routine.
+       * generated/matmul_r8.c: Regenerate.
+       * generated/matmul_r16.c: Regenerate.
+       * generated/matmul_c8.c: Regenerate.
+       * generated/matmul_i8.c: Regenerate.
+       * generated/matmul_c16.c: Regenerate.
+       * generated/matmul_r10.c: Regenerate.
+       * generated/matmul_r4.c: Regenerate.
+       * generated/matmul_c10.c: Regenerate.
+       * generated/matmul_c4.c: Regenerate.
+       * generated/matmul_i4.c: Regenerate.
+       * generated/matmul_i16.c: Regenerate.
+
+2006-10-21  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * runtime/error.c: Add errno.h
+       (generate_error): Set iostat to errno on OS error.
+       * libgfortran.h: Set ERROR_OS to 5000
+
+2006-10-20  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * generated/minval_r8.c: Regenerate.
+       * generated/maxloc1_4_r8.c: Regenerate.
+       * generated/minloc1_16_r16.c: Regenerate.
+       * generated/sum_i8.c: Regenerate.
+       * generated/eoshift3_4.c: Regenerate.
+       * generated/any_l16.c: Regenerate.
+       * generated/eoshift1_8.c: Regenerate.
+       * generated/reshape_r16.c: Regenerate.
+       * generated/product_r4.c: Regenerate.
+       * generated/maxloc1_8_i4.c: Regenerate.
+       * generated/maxloc0_4_r4.c: Regenerate.
+       * generated/in_unpack_i8.c: Regenerate.
+       * generated/minloc0_4_r16.c: Regenerate.
+       * generated/reshape_c4.c: Regenerate.
+       * generated/maxloc0_4_r16.c: Regenerate.
+       * generated/minloc1_8_r16.c: Regenerate.
+       * generated/maxloc1_8_r16.c: Regenerate.
+       * generated/in_unpack_i16.c: Regenerate.
+       * generated/maxloc0_8_i8.c: Regenerate.
+       * generated/sum_r16.c: Regenerate.
+       * generated/minloc1_4_r8.c: Regenerate.
+       * generated/maxloc1_16_r16.c: Regenerate.
+       * generated/minloc1_16_i4.c: Regenerate.
+       * generated/maxloc1_16_i4.c: Regenerate.
+       * generated/minloc0_16_i8.c: Regenerate.
+       * generated/maxloc0_16_i8.c: Regenerate.
+       * generated/maxval_r16.c: Regenerate.
+       * generated/count_16_l16.c: Regenerate.
+       * generated/count_8_l8.c: Regenerate.
+       * generated/product_c10.c: Regenerate.
+       * generated/minloc1_8_i4.c: Regenerate.
+       * generated/minloc0_16_i16.c: Regenerate.
+       * generated/eoshift1_16.c: Regenerate.
+       * generated/minloc0_4_r4.c: Regenerate.
+       * generated/product_c4.c: Regenerate.
+       * generated/sum_r4.c: Regenerate.
+       * generated/in_pack_c16.c: Regenerate.
+       * generated/reshape_i4.c: Regenerate.
+       * generated/minloc0_8_i8.c: Regenerate.
+       * generated/minloc1_16_r10.c: Regenerate.
+       * generated/in_pack_c4.c: Regenerate.
+       * generated/all_l16.c: Regenerate.
+       * generated/reshape_c16.c: Regenerate.
+       * generated/maxloc1_8_r8.c: Regenerate.
+       * generated/minval_i16.c: Regenerate.
+       * generated/reshape_r10.c: Regenerate.
+       * generated/maxval_i4.c: Regenerate.
+       * generated/any_l4.c: Regenerate.
+       * generated/minval_i8.c: Regenerate.
+       * generated/maxloc1_4_i8.c: Regenerate.
+       * generated/maxloc0_16_i16.c: Regenerate.
+       * generated/maxloc0_8_r4.c: Regenerate.
+       * generated/minloc1_4_i16.c: Regenerate.
+       * generated/minloc0_4_r10.c: Regenerate.
+       * generated/maxloc1_4_i16.c: Regenerate.
+       * generated/minloc0_8_i16.c: Regenerate.
+       * generated/maxloc0_4_r10.c: Regenerate.
+       * generated/maxloc0_8_i16.c: Regenerate.
+       * generated/minloc1_8_r10.c: Regenerate.
+       * generated/product_i4.c: Regenerate.
+       * generated/minloc0_16_r4.c: Regenerate.
+       * generated/sum_c16.c: Regenerate.
+       * generated/maxloc1_8_r10.c: Regenerate.
+       * generated/maxloc0_16_r4.c: Regenerate.
+       * generated/minloc1_16_r8.c: Regenerate.
+       * generated/maxloc0_4_i4.c: Regenerate.
+       * generated/maxloc1_16_r8.c: Regenerate.
+       * generated/cshift1_4.c: Regenerate.
+       * generated/sum_r10.c: Regenerate.
+       * generated/sum_c4.c: Regenerate.
+       * generated/maxloc1_16_r10.c: Regenerate.
+       * generated/count_4_l16.c: Regenerate.
+       * generated/in_pack_i4.c: Regenerate.
+       * generated/minloc1_8_r8.c: Regenerate.
+       * generated/count_4_l4.c: Regenerate.
+       * generated/maxval_r10.c: Regenerate.
+       * generated/minloc1_4_i8.c: Regenerate.
+       * generated/in_unpack_c4.c: Regenerate.
+       * generated/minloc0_8_r4.c: Regenerate.
+       * generated/product_i16.c: Regenerate.
+       * generated/minloc0_16_r16.c: Regenerate.
+       * generated/reshape_r8.c: Regenerate.
+       * generated/all_l4.c: Regenerate.
+       * generated/in_pack_c10.c: Regenerate.
+       * generated/minloc0_4_i4.c: Regenerate.
+       * generated/reshape_c10.c: Regenerate.
+       * generated/minval_r4.c: Regenerate.
+       * generated/maxloc1_4_r4.c: Regenerate.
+       * generated/sum_i4.c: Regenerate.
+       * generated/count_16_l8.c: Regenerate.
+       * generated/maxval_r8.c: Regenerate.
+       * generated/eoshift1_4.c: Regenerate.
+       * generated/eoshift3_8.c: Regenerate.
+       * generated/minval_r16.c: Regenerate.
+       * generated/product_r8.c: Regenerate.
+       * generated/maxloc1_8_i8.c: Regenerate.
+       * generated/maxloc0_4_r8.c: Regenerate.
+       * generated/maxloc0_16_r16.c: Regenerate.
+       * generated/in_unpack_i4.c: Regenerate.
+       * generated/sum_c10.c: Regenerate.
+       * generated/minloc1_4_r16.c: Regenerate.
+       * generated/maxloc1_4_r16.c: Regenerate.
+       * generated/in_unpack_c16.c: Regenerate.
+       * generated/minloc0_8_r16.c: Regenerate.
+       * generated/reshape_c8.c: Regenerate.
+       * generated/maxloc0_8_r16.c: Regenerate.
+       * generated/maxloc0_8_i4.c: Regenerate.
+       * generated/minloc1_4_r4.c: Regenerate.
+       * generated/minloc0_16_i4.c: Regenerate.
+       * generated/maxloc0_16_i4.c: Regenerate.
+       * generated/minloc1_16_i8.c: Regenerate.
+       * generated/maxloc1_16_i8.c: Regenerate.
+       * generated/count_8_l4.c: Regenerate.
+       * generated/minloc0_16_r10.c: Regenerate.
+       * generated/minloc1_8_i8.c: Regenerate.
+       * generated/minloc0_4_r8.c: Regenerate.
+       * generated/product_r16.c: Regenerate.
+       * generated/product_c8.c: Regenerate.
+       * generated/sum_r8.c: Regenerate.
+       * generated/in_pack_i16.c: Regenerate.
+       * generated/minloc0_8_i4.c: Regenerate.
+       * generated/minloc1_16_i16.c: Regenerate.
+       * generated/reshape_i8.c: Regenerate.
+       * generated/in_pack_c8.c: Regenerate.
+       * generated/maxloc1_8_r4.c: Regenerate.
+       * generated/reshape_i16.c: Regenerate.
+       * generated/minval_r10.c: Regenerate.
+       * generated/minval_i4.c: Regenerate.
+       * generated/maxloc1_4_i4.c: Regenerate.
+       * generated/maxval_i8.c: Regenerate.
+       * generated/eoshift3_16.c: Regenerate.
+       * generated/any_l8.c: Regenerate.
+       * generated/maxloc0_16_r10.c: Regenerate.
+       * generated/minloc0_4_i16.c: Regenerate.
+       * generated/maxloc0_8_r8.c: Regenerate.
+       * generated/maxloc0_4_i16.c: Regenerate.
+       * generated/minloc1_4_r10.c: Regenerate.
+       * generated/minloc1_8_i16.c: Regenerate.
+       * generated/maxloc1_4_r10.c: Regenerate.
+       * generated/minloc0_8_r10.c: Regenerate.
+       * generated/maxloc1_8_i16.c: Regenerate.
+       * generated/in_unpack_c10.c: Regenerate.
+       * generated/maxloc0_8_r10.c: Regenerate.
+       * generated/minloc1_16_r4.c: Regenerate.
+       * generated/maxloc1_16_r4.c: Regenerate.
+       * generated/minloc0_16_r8.c: Regenerate.
+       * generated/product_i8.c: Regenerate.
+       * generated/maxloc0_16_r8.c: Regenerate.
+       * generated/sum_i16.c: Regenerate.
+       * generated/maxloc0_4_i8.c: Regenerate.
+       * generated/cshift1_8.c: Regenerate.
+       * generated/maxloc1_16_i16.c: Regenerate.
+       * generated/minloc1_8_r4.c: Regenerate.
+       * generated/sum_c8.c: Regenerate.
+       * generated/count_8_l16.c: Regenerate.
+       * generated/in_pack_i8.c: Regenerate.
+       * generated/maxval_i16.c: Regenerate.
+       * generated/count_4_l8.c: Regenerate.
+       * generated/minloc1_4_i4.c: Regenerate.
+       * generated/product_c16.c: Regenerate.
+       * generated/reshape_r4.c: Regenerate.
+       * generated/minloc0_8_r8.c: Regenerate.
+       * generated/in_unpack_c8.c: Regenerate.
+       * generated/product_r10.c: Regenerate.
+       * generated/cshift1_16.c: Regenerate.
+       * generated/all_l8.c: Regenerate.
+       * generated/minloc0_4_i8.c: Regenerate.
+       * generated/maxval_r4.c: Regenerate.
+       * generated/count_16_l4.c: Regenerate.
+
+2006-10-19  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/27895
+       * intrinsics/cshift0.c: Special cases for zero-sized arrays.
+       * intrinsics/pack_generic.c: Likewise.
+       * intrinsics/spread_generic.c: Likewise.
+
+2006-10-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/29277
+       * io/write.c (write_a): Add conversion of LF to CR-LF for systems with
+       #define HAVE_CRLF.
+
+2006-10-18  Tobias Burnus  <burnus@net-b.de>
+
+       * m4/in_pack.m4: Fixed a typo.
+       * m4/iforeach.m4: Fixed a typo.
+       * m4/eoshift1.m4: Fixed a typo.
+       * m4/eoshift3.m4: Fixed a typo.
+       * m4/cshift1.m4: Fixed a typo.
+       * m4/in_unpack.m4: Fixed a typo.
+       * m4/reshape.m4: Fixed a typo.
+       * m4/ifunction.m4: Fixed a typo.
+       * runtime/environ.c: Fixed a typo.
+       * runtime/in_pack_generic.c: Fixed a typo.
+       * runtime/in_unpack_generic.c: Fixed a typo.
+       * runtime/memory.c: Fixed a typo.
+       * intrinsics/cshift0.c: Fixed a typo.
+       * intrinsics/cpu_time.c: Fixed a typo.
+       * intrinsics/pack_generic.c: Fixed a typo.
+       * intrinsics/unpack_generic.c: Fixed a typo.
+       * intrinsics/eoshift0.c: Fixed a typo.
+       * intrinsics/eoshift2.c: Fixed a typo.
+       * intrinsics/reshape_generic.c: Fixed a typo.
+       * io/open.c: Fixed a typo.
+       * io/list_read.c: Fixed a typo.
+       * io/io.h: Fixed a typo.
+       * io/transfer.c: Fixed a typo.
+       * io/write.c: Fixed a typo.
+
+2006-10-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/29277
+       * io/list_read.c (next_char): Update strm_pos.
+       (eat_separator): Delete extra call to unget_char.
+       * io/transfer.c (read_block): Use read_sf for formatted stream I/O.
+       (next_record_r): Update strm_pos for formatted stream I/O and handle
+       end-of-record correctly.
+       (next_record_w): Ditto.
+       (next_record): Enable next record (r/w) functions and update strm_pos.
+       (finalize_transfer): Call next_record to finish the record.
+
+2006-10-13  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * m4/spacing.m4: Use scalbn[f,l] if ldexp[f,l] is unavailable.
+       * m4/rrspacing.m4: Ditto.
+       * generated/spacing_r4.c: Regenerated.
+       * generated/spacing_r8.c: Ditto.
+       * generated/spacing_r10.c: Ditto.
+       * generated/spacing_r16.c: Ditto.
+       * generated/rrspacing_r4.c: Ditto.
+       * generated/rrspacing_r8.c: Ditto.
+       * generated/rrspacing_r10.c: Ditto.
+       * generated/rrspacing_r16.c: Ditto.
+
+2006-10-06  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/15441
+       PR fortran/29312
+       * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL
+       * m4/spacing.m4: New file.  Use new HAVE_* defines.
+       * m4/rrspacing.m4: Ditto.
+       * Makefile.am: Handle new files.
+       * configure: Regenerated.
+       * Makefile.in: Ditto.
+       * config.h.in: Ditto.
+       * generated/spacing_r4.c: Generated.
+       * generated/spacing_r8.c: Ditto.
+       * generated/spacing_r10.c: Ditto.
+       * generated/spacing_r16.c: Ditto.
+       * generated/rrspacing_r4.c: Ditto.
+       * generated/rrspacing_r8.c: Ditto.
+       * generated/rrspacing_r10.c: Ditto.
+       * generated/rrspacing_r16.c: Ditto.
+
+2006-10-08  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/hyper.c: Remove file.
+       * intrinsics/c99_functions.c: Add fallback functions asinhf,
+       acoshf and atanhf.
+       * Makefile.am: Remove file intrinsics/hyper.c.
+       * Makefile.in: Regenerate.
+
+2006-10-08  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * c99_protos.h: Correctly protect definitions of prototypes for
+       asinhf, acoshf and atanhf to be the same as in intrinsics/hyper.c.
+
+2006-10-08  Paul Thomas  <pault@gcc.gnu.org>
+           Erik Edelmann  <edelmann@gcc.gnu.org>
+
+       PR libfortran/20541
+       * Makefile.in : Add move_alloc.
+       * intrinsics/move_alloc.c: New function.
+       * Makefile.am : Add move_alloc.
+
+2006-10-08  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/26540
+       * intrinsics/signal.c (signal_sub, signal_sub_int): Use intptr_t
+       if available to cast function pointers to int and back.
+       * configure.ac: Check for intptr_t.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2006-10-01  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/16580
+       PR fortran/29288
+       * libgfortran/Makefile.am: Add the new files to the build
+       process, and rules to build them.
+       * libgfortran/Makefile.in: Regenerate.
+       * libgfortran/m4/misc_specifics.m4: New file.
+       * libgfortran/m4/specific.m4: Add new special cases for function
+       with complex argument and real result, like abs_c* and aimag_c*.
+       * libgfortran/intrinsics/f2c_specifics.F90: Add specifics for
+       AIMAG, ASINH, ACOSH and ATANH.
+       * libgfortran/generated/_aimag_c4.F90: New file.
+       * libgfortran/generated/_aimag_c8.F90: New file.
+       * libgfortran/generated/_asinh_r10.F90: New file.
+       * libgfortran/generated/_acosh_r16.F90: New file.
+       * libgfortran/generated/_aimag_c10.F90: New file.
+       * libgfortran/generated/_atanh_r16.F90: New file.
+       * libgfortran/generated/_acosh_r4.F90: New file.
+       * libgfortran/generated/_acosh_r8.F90: New file.
+       * libgfortran/generated/_asinh_r4.F90: New file.
+       * libgfortran/generated/_asinh_r8.F90: New file.
+       * libgfortran/generated/_asinh_r16.F90: New file.
+       * libgfortran/generated/_atanh_r4.F90: New file.
+       * libgfortran/generated/_atanh_r8.F90: New file.
+       * libgfortran/generated/_acosh_r10.F90: New file.
+       * libgfortran/generated/misc_specifics.F90: New file.
+       * libgfortran/generated/_aimag_c16.F90: New file.
+       * libgfortran/generated/_atanh_r10.F90: New file.
+
+2006-10-05  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * acinclude.m4 (HAVE_ATTRIBUTE_ALIAS): Remove __USER_LABEL_PREFIX__
+       from test.
+       * configure: Regenerate.
+
+2006-10-05  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * Makefile.am: Use $(M4) instead of m4.
+       * Makefile.in: Regenerated.
+
+2006-10-01  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * libgfortran.h: Add prototype for internal_unpack_c16.
+
+2006-09-29  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/18791
+       * m4/specific.m4: Special-case cabs so that its return type is
+       real. Special-case conjg so that their suffices are _4, _8, _10 and
+       _16 instead of _c4, _c8, _c10 and _c16.
+       * intrinsics/f2c_specifics.F90: Special-case conjg functions so
+       that their suffices are _4 and _8 instead of _c4 and _c8.
+       * generated/_conjg_c4.F90: Regenerate.
+       * generated/_conjg_c8.F90: Regenerate.
+       * generated/_conjg_c10.F90: Regenerate.
+       * generated/_conjg_c16.F90: Regenerate.
+       * generated/_abs_c4.F90: Regenerate.
+       * generated/_abs_c8.F90: Regenerate.
+       * generated/_abs_c10.F90: Regenerate.
+       * generated/_abs_c16.F90: Regenerate.
+
+2006-09-29  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * intrinsics/cpu_time.c:  Add cpu_time_10 and cpu_time_16 routines.
+
+2006-09-28  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+D
+       * Makefile.am: Install libgfortranbegin inside compiler libraries
+       directory instead of system libraries directory.
+       * Makefile.in: Regenerate.
+
+2006-09-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * Makefile.am: Remove dependency on gfortypes.h.
+       * Makefile.in: Regenerate.
+
+2006-09-22  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       PR libfortran/27964
+       * configure.ac: Check for setmode() function.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+       * io/unix.c (output_stream): Force stdout to binary mode. 
+       (error_stream): Force stderr to binary mode.
+
+2006-09-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/29099
+       * intrinsics/date_and_time.c (secnds): Fix case of zero time.
+
+2006-09-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/29053
+       * io.h (gfc_unit): Add variable, strm_pos, to track
+       STREAM I/O file position.
+       * file_pos.c (st_rewind): Set strm_pos to beginning.
+       * open.c (new_unit): Initialize strm_pos.
+       * read.c (read_x): Bump strm_pos.
+       * inquire.c (inquire_via_unit): Return strm_pos value.
+       * transfer.c (read_block),(read_block_direct),(write_block)
+       (write_buf): Seek to strm_pos - 1.  Update strm_pos when done.
+       (pre_position): Initialize strm_pos.
+       (data_transfer_init): Set strm_pos if DT_HAS_REC.
+       (finalize_transfer): Flush file, no need to update strm_pos.
+
+2006-09-10  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR libfortran/28947
+       * m4/matmul.m4: For the case where the second input argument is
+       transposed, ensure that the case with rank (a) == 1 is
+       correctly calculated.
+       * generated/matmul_r4.c: Regenerate.
+       * generated/matmul_r8.c: Regenerate.
+       * generated/matmul_r10.c: Regenerate.
+       * generated/matmul_r16.c: Regenerate.
+       * generated/matmul_c4.c: Regenerate.
+       * generated/matmul_c8.c: Regenerate.
+       * generated/matmul_c10.c: Regenerate.
+       * generated/matmul_c16.c: Regenerate.
+       * generated/matmul_i4.c: Regenerate.
+       * generated/matmul_i8.c: Regenerate.
+       * generated/matmul_i16.c: Regenerate.
+
+2006-08-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/28354
+       * io/write.c: Check for special case of zero precision in format
+       and pre-round the real value.
+
+2006-08-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25828
+       * libgfortran.h: Rename GFC_LARGE_IO_INT to GFC_IO_INT.
+       * io/file_pos.c (st_backspace): Ignore if access=STREAM.
+       (st_rewind): Handle case of access=STREAM.
+       * io/open.c (access_opt): Add STREAM_ACCESS.
+       (edit_modes): Set current_record to zero only if not STREAM.
+       (new_unit): Initialize maxrec, recl, and last_record for STREAM.
+       * io/read.c (read_x): Advance file position for STREAM.
+       * io/io.h (enum unit_access): Align IOPARM flags with frontend.
+       Add ACCESS_STREAM. Add prototype for is_stream_io () function.
+       Use GFC_IO_INT.
+       * io/inquire.c (inquire_via_unit): Add text for access = "STREAM".
+       * io/unit.c (is_stream_io): New function to return true if access =
+       STREAM.
+       * io/transfer.c (file_mode): Add modes for unformatted stream and
+       formatted stream. (current_mode): Return appropriate file mode based
+       on access flags.
+       (read_block): Handle formatted stream reads.
+       (read_block_direct): Handle unformatted stream reads.
+       (write_block): Handle formatted stream writes.
+       (write_buf): Handle unformatted stream writes.
+       (unformatted_read): Fix up, use temporary for size.
+       (pre_position): Position file for STREAM access.
+       (data_transfer_init): Initialize for stream access, skip irrelevent
+       error checks.
+       (next_record_r),(next_record_w), and (next_record): Do nothing for
+       stream I/O.
+       (finalize_transfer): Flush when all done if stream I/O.
+
+2006-08-12  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/bessel.c: Add prototypes for all functions.
+
+2006-08-05  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/access.c (access_func): Remove export directive.
+
+2006-08-02  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       * Makefile.in:  Regenerate using automake 1.9.6.
+       * aclocal.m4:  Revert to previous version.
+
+2006-08-01  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/28452
+       * Makefile.am:  Remove normalize.c.
+       * aclocal.m4:  Regenerate using aclocal 1.9.3.
+       * Makefile.in:  Regenerate using automake 1.9.3.
+       * libgfortran.h:  #include <float.h>.
+       Define GFC_REAL_*_DIGITS and GFC_REAL_*_RADIX.
+       Remove prototypes for normalize_r4_i4 and normalize_r8_i8.
+       * intrinsics/random.c (top level): Add prototypes for
+       random_r10, arandom_r10, random_r16 and arandom_r16.
+       (rnumber_4):  New static function.
+       (rnumber_8):  New static function.
+       (rnumber_10): New static function.
+       (rnumber_16): New static function.
+       (top level):  Set to kiss_size to 12 if we have
+       REAL(KIND=16), to 8 otherwise.
+       Define KISS_DEFAULT_SEED_1, KISS_DEFAULT_SEED_2 and
+       KISS_DEFAULT_SEED_3.
+       (kiss_random_kernel):  Take argument to differentiate
+       between different random number generators.
+       (random_r4):  Add argument to call to kiss_random_kernel,
+       use rnumber_*.
+       (random_r8):  Likewise.
+       (random_r10):  New function.
+       (random_r16):  New function.
+       (arandom_r4):  Add argument to call to kiss_random_kernel,
+       use_rnumber_*.
+       (arandom_r8):  Likewise.
+       (arandom_r10):  New function.
+       (arandom_r16):  New function.
+       * intrinsics/rand.c (rand):  Use shift and mask.
+       * runtime/normalize.c:  Remove.
+
+2006-07-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/28335
+       * file_position.c (st_flush): Add clearer error when UNIT does not
+       exist. Add reference to standard in comment.
+
+2006-07-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/28335
+       * close.c (st_close): Revert previous patch and add comment.
+       * file_position.c (st_flush): Revert previous patch and add comment.
+
+2006-07-30  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
+       * intrinsics/access.c: New file.
+       * intrinsics/chmod.c: New file.
+       * configure.ac: Add checks for <sys/wait.h>, access, fork,execl
+       and wait.
+       * Makefile.am: Add new files intrinsics/access.c and
+       intrinsics/chmod.c.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+       * Makefile.in: Regenerate.
+
+2006-07-30  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/transfer.c (transfer_array): Remove stride0 fix.
+       
+2006-07-26  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * configure.ac: Check for function clock.
+       * Makefile.am: Compile new file intrinsics/clock.c.
+       * intrinsics/clock.c: New file.
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+       * intrinsics/stat.c: Rename the old stat_i?_sub functions to
+       helper functions stat_i?_sub_0, and use them for both STAT and
+       LSTAT.
+
+2006-07-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/28335
+       * close.c (st_close): Add error when UNIT does not exist.
+       * file_position.c (st_flush): Add error when UNIT does not exist.
+
+2006-07-25  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR build/26188
+       * configure: Regenerate.
+
+2006-07-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25289
+       * libgfortran.h: Add conditional definition of GFC_LARGE_IO_INT type.
+       * io/io.h (st_parameter_dt): Define rec as type GFC_LARGE_IO_INT.
+
+2006-07-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/28339
+       * io/transfer.c (next_record_w): Use next_array_record result to set
+       END_FILE. (write_block): Test for END_FILE before the next write occurs.
+       * io/unit.c (get_internal_unit): Initialize iunit->endfile for internal
+       unit.
+
+2006-07-19  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR fortran/27919
+       * m4/dotprodc.m4: Remove.
+       * m4/dotprodl.m4: Remove.
+       * m4/dotprod.m4: Remove.
+       * generated/dotprod_*.c: Remove.
+       * Makefile.am: Remove any references to dot_product
+       implementation.
+       * Makefile.in: Regenerated.
+       
+2006-07-18  Paolo Bonzini  <bonzini@gnu.org>
+
+       * configure: Regenerate.
+
+2006-07-15  Steven G. Kargl  <kargls@comcast.net>
+
+       * intrinsics/etime.c: Remove etime_
+       * libtool-version: Bump from libgfortran.so.1 to libgfortran.so.2
+
+2006-07-12  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/28163
+       * intrinsics/string_intrinsics.c (copy_string): Remove function.
+
+2006-07-04  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/date_and_time.c (itime0,idate0,itime_i4,itime_i8,
+       idate_i4,idate_i8): New functions.
+
+2006-07-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/27704
+       * runtime/error.c (notify_std): Pass common flags into function. Use
+       flags to show locus of error or warning.
+       * libgfortran.h: Add enum try.  Add prototype for notify_std.
+       * io/open.c (edit_modes): Allow status="old" and add extension to
+       allow status="scratch"
+       *io/list_read.c (nml_read_obj): Update call to notify_std.
+       *io/io.h: Remove enum try and prototype for notify_std.
+       *io/transfer.c (read_sf): Update call to notify_std.
+       *io/format.c (parse_format_list): Update call to notify_std.
+
+2006-06-25  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * io/io.h: Move proto for unit_to_fd...
+       * libgfortran.h: ...here.
+
+2006-06-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/ierrno.c: Don't include "io/io.h".
+       * intrinsics/sleep.c: Likewise.
+       * intrinsics/perror.c: Likewise.
+       * intrinsics/stat.c: Likewise.
+       * intrinsics/kill.c: Likewise.
+       * intrinsics/time.c: Likewise.
+       * intrinsics/fnum.c: Likewise.
+       * intrinsics/rename.c: Likewise.
+       * intrinsics/symlnk.c: Likewise.
+       * intrinsics/chdir.c: Likewise.
+       * intrinsics/link.c: Likewise.
+       * intrinsics/random.c: Don't include "io/io.h". Include <gthr.h>.
+       * intrinsics/rand.c: Likewise.
+
+2006-06-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/28094
+       * Makefile.am: Add _mod_r10.F90 and _mod_r16.F90.
+       * Makefile.in: Regenerate.
+       * generated/_mod_r10.F90: New file.
+       * generated/_mod_r16.F90: New file.
+
+2006-06-22  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/26769
+       * Makefile.am: Add r4 and r8 versions of reshape and transpose.
+       * Makefile.in: Regenerate.
+       * generated/reshape_r4.c: New file.
+       * generated/reshape_r8.c: New file.
+       * generated/transpose_r4.c: New file.
+       * generated/transpose_r8.c: New file.
+
+2006-06-20  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR libfortran/28005
+       * m4/matmul.m4: aystride = 1 does not uniquely detect the
+       presence of a temporary transpose; an array element in the
+       first dimension produces the same signature.  Detect this
+       using the rank of a and add specific code.
+       * generated/matmul_r4.c: Regenerate.
+       * generated/matmul_r8.c: Regenerate.
+       * generated/matmul_r10.c: Regenerate.
+       * generated/matmul_r16.c: Regenerate.
+       * generated/matmul_c4.c: Regenerate.
+       * generated/matmul_c8.c: Regenerate.
+       * generated/matmul_c10.c: Regenerate.
+       * generated/matmul_c16.c: Regenerate.
+       * generated/matmul_i4.c: Regenerate.
+       * generated/matmul_i8.c: Regenerate.
+       * generated/matmul_i16.c: Regenerate.
+
+2006-06-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR libgomp/27254
+       * io/unit.c (get_internal_unit): Initialize and lock thread mutex
+       for internal units.
+
+2006-06-06  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * m4/in_pack.m4: Add TODO comment about detecting temporaries,
+       remove test for stride 0, update copyright year.
+       * m4/transpose.m4: Remove test for stride 0, update copyright
+       year.
+       * m4/iforeach.m4: Likewise.
+       * m4/shape.m4: Likewise.
+       * m4/in_unpack.m4: Likewise.
+       * m4/reshape.m4: Likewise.
+       * m4/ifunction.m4: Likewise.
+       * m4/matmul.m4: Likewise.
+       * m4/matmull.m4: Likewise.
+       * intrinsics/etime.c: Likewise.
+       * intrinsics/transpose_generic.c: Likewise.
+       * intrinsics/spread_generic.c: Likewise.
+       * intrinsics/stat.c: Likewise.
+       * intrinsics/reshape_generic.c: Likewise.
+       * intrinsics/random.c: Likewise.
+       * generated/*: Regenerated from above changed m4 files.
+       
+2006-05-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/27757
+       * io/unix.c (fd_seek): Set active to zero.
+
+2006-05-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/27634
+       * io/format.c (parse_format_list): Allow missing period in format only
+       if -std=legacy.
+
+2006-05-28  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       * intrinsics/string_intrinsics.c (compare_string):
+       Use memcmp instead of strncmp to avoid tripping over
+       CHAR(0) in a string.
+
+2006-05-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/io.h (find_or_create_unit): Correct export declaration.
+       
+2006-05-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * intrinsics/abort.c (abort_): Remove.
+
+2006-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * configure.ac: Remove AC_FUNC_MMAP.
+       * configure: Regenerated.
+       * Makefile.in: Regenerated.
+       * config.h.in: Regenerated.
+       * aclocal.m4: Regenerated.
+
+2006-05-25  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * intrinsics/associated.c (associated): Zero-sized arrays should
+       not be reported as ASSOCIATED.
+
+2006-05-24  Carlos O'Donell  <carlos@codesourcery.com>
+
+       * Makefile.am: Add install-html target. Add install-html to .PHONY
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+       
+2006-05-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/24459
+       * io/list_read.c (nml_parse_qualifier): Leave loop spec end value
+       at default value unless -std=f95 or if an array section
+       is specified in namelist input.  Warn if -pedantic.
+       * io/io.h (st_parameter_dt): Add expanded_read flag.
+
+2006-05-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/22423
+       * io/transfer.c (read_block): Return NULL instead of nothing.
+       
+2006-05-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/27575
+       * io/transfer.c (read_block):  Add check for end file condition.
+       (read_block_direct): Add check for end file condition.
+
+2006-05-05  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/26985
+       * m4/matmul.m4: Correct the condition for the memset call,
+       and remove the unneeded call to size0.
+       * generated/matmul_r4.c: Regenerate.
+       * generated/matmul_r8.c: Regenerate.
+       * generated/matmul_r10.c: Regenerate.
+       * generated/matmul_r16.c: Regenerate.
+       * generated/matmul_c4.c: Regenerate.
+       * generated/matmul_c8.c: Regenerate.
+       * generated/matmul_c10.c: Regenerate.
+       * generated/matmul_c16.c: Regenerate.
+       * generated/matmul_i4.c: Regenerate.
+       * generated/matmul_i8.c: Regenerate.
+       * generated/matmul_i16.c: Regenerate.
+
+2006-04-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/27360
+       * io/list_read.c (read_logical):  Free line_buffer and free saved.
+
+2006-04-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/27304
+       * io/transfer.c (formatted_transfer_scalar):  Generate error if data
+       descriptors are exhausted.
+       * io/format.c (next_format0): Fix comment.
+
+2006-04-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/20257
+       * io/io.h: Add prototypes for get_internal_unit and free_internal_unit.
+       * io/unit.c (get_internal_unit): Initialize unit number, not zero.
+       (free_internal_unit): New function to consolidate freeing memory.
+       (get_unit): Initialize internal_unit_desc to NULL when unit is
+       external.
+       * io/unix.c (mem_close): Check for not NULL before freeing memory.
+       * io/transfer.c (read_block): Reset bytes_left and skip error if unit
+       is preconnected and default record length is reached.
+       (read_block_direct): Ditto.
+       (write_block): Ditto.
+       (write_buf): Ditto.
+       (data_transfer_init): Only flush if not internal unit.
+       (finalize_transfer): Ditto and delete code to free memory used by
+       internal units.
+       (st_read_done): Use new function - free_internal_unit.
+       (st_write_done): Use new function - free_internal unit.
+
+2006-04-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/26769
+       * Makefile.am (i_transpose_c): Add generated/transpose_r16.c.
+       (i_reshape_c): Add generated/reshape_r16.c.
+       * Makefile.in: Regenerated.
+       * generated/transpose_r16.c: Generated new file.
+       * generated/redhape_r16.c: Generated new file.
+
+2006-04-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/27138
+       * io/list_read.c (eat_line): New function.
+       (parse_repeat): Use new function and free_saved.
+       (read_logical): Same.
+       (read_integer): Use new function.
+       (parse_real): Use nml_bad_return and new function.
+       (read_complex): Use new function and free_saved.
+       (read_real): Same.
+
+2006-04-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26766
+       * io/io.h: Add bit to identify associated unit as internal.
+       * io/unit.c (get_external_unit): Renamed the find_unit_1 function to
+       reflect the external unit functionality vs internal unit.
+       (get_internal_unit): New function to allocate and initialize an internal
+       unit structure.
+       (get_unit): Use get_internal_unit and get_external_unit.
+       (is_internal_unit): Revised to use new bit added in io.h.
+       * io/transfer.c (data_transfer_init): Fix line width.
+       (st_read_done): Free memory allocated for internal unit.
+       (st_write_done): Add test to only flush and truncate when not an
+       internal unit.  Free memory allocated for internal unit.
+
+2006-04-11  Jakub Jelinek  <jakub@redhat.com>
+
+       * io/io.h (st_parameter_dt): Revert 2005-12-10 change to
+       u.pad, fix comment.
+       (check_st_parameter_dt): New compile time assert.
+
+2006-04-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libfortran/24685
+       * io/write.c (MIN_FIELD_WIDTH, STR, STR1): Define.
+       (output_float): Increase buffer sizes for IEEE quad and IBM extended
+       long double.
+       (write_real): Output REAL(16) as 1PG43.34E4 rather than 1PG40.31E4.
+
+2006-04-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26890
+       * io/io.h: Revert change to pad size made on 2006-03-30.
+       Add comment explaining dependency with fortran/trans-io.c.
+       
+2006-04-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/write.c (output_float): Update condition to not error when
+       decimal precision in format specifier is zero.
+
+2006-04-01  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * config/fpu-387.h: Use previously added SSE code in all
+       cases, as it really is the right thing to do.
+
+2006-03-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26890
+       * io/io.h: Add size_used to st_parameter_dt, adjust pad size.
+       *io/transfer.c (data_transfer_init): Initialize size_used to zero.
+       (read_sf): Use size_used.
+       (read_block): Likewise.
+       (read_block_direct): Likewise.
+       (write_block): Likewise.
+       (write_buf): Likewise and eliminate erroneous FAILURE return.
+       (finalize_transfer): Assign value of size_used to *dtp->size.
+
+2006-03-30  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/26712
+       * config/fpu-387.h: Add special case for handling of SSE
+       control bit on i386-darwin.
+
+2006-03-30  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR fortran/25031
+       * runtime/memory.c (allocate_array):  If stat is present and
+       the variable is already allocated, free the variable, do
+       the allocation and set stat.
+       (allocate_array_64):  Likewise.  Whitespace fix.
+
+2006-03-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26880
+       * io/file_pos.c (st_rewind): Clear read_bad flag.
+
+2006-03-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26661
+       * io/io.h: Add read_sf so it can be used by read_x.
+       * io/transfer.c (read_sf): Pass no_error flag to read_sf.  Use it to
+       break out rather than error on EOF or EOR conditions.
+       (read_block): Update call to read_sf.
+       (read_block_direct): Ditto.
+       * io/read.c (read_x): Use the modified read_sf instead of read_block.
+
+2006-03-25  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/26735
+       * io/transfer.c (data_transfer_init):  Set u_flags.convert
+       on an unopened unit if specified by environment variable
+       (via get_unformatted_convert) or by compile-time option.
+
+2006-03-25  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR fortran/26769
+       * Makefile.am:  Add transpose_r10.c and reshape_r10.c.
+       * aclocal.m4:  Regenerate using aclocal 1.9.3.
+       * Makefile.in:  Regenerate using automake 1.9.3.
+       * m4/iparm.m4 (rtype_ccode):  If rtype_letter is `i',
+       evaluate to rtype_kind, otherwise to rtype_code.
+       * generated/transpose_r10.c:  Add.
+       * generated/reshape_r10.c:  Add.
+
+2006-03-22  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR fortran/19303
+       * libgfortran.h (compile_options_t):  Add record_marker.
+       * runtime/compile_options.c (set_record_marker):
+       New function.
+       * io/open.c:  If we have four-byte record markers, use
+       GFC_INTEGER_4_HUGE as default record length.
+       * io/file_pos.c (unformatted_backspace):  Handle
+       different size record markers.
+       * io/transfer.c (us_read):  Likewise.
+       (us_write):  Likewise.
+       (next_record_r):  Likewise.
+       (write_us_marker):  Likewise.
+       (next_record_w):  Likewise.
+
+2006-03-20  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR fortran/20935
+       * m4/iforeach.m4:  Add SCALAR_FOREACH_FUNCTION macro.
+       * m4/ifunction.m4:  Add SCALAR_ARRAY_FUNCTION macro.
+       * m4/minloc0.m4:  Use SCALAR_FOREACH_FUNCTION.
+       * m4/minloc1.m4:  Use SCALAR_ARRAY_FUNCTION.
+       * m4/maxloc0.m4:  Use SCALAR_FOREACH_FUNCTION.
+       * m4/maxloc1.m4:  Use SCALAR_ARRAY_FUNCTION.
+       * m4/minval.m4:  Likewise.
+       * m4/maxval.m4:  Likewise.
+       * m4/product.m4:  Likewise.
+       * m4/sum.m4:  Likewise.
+       * minloc0_16_i16.c : Regenerated.
+       * minloc0_16_i4.c : Regenerated.
+       * minloc0_16_i8.c : Regenerated.
+       * minloc0_16_r10.c : Regenerated.
+       * minloc0_16_r16.c : Regenerated.
+       * minloc0_16_r4.c : Regenerated.
+       * minloc0_16_r8.c : Regenerated.
+       * minloc0_4_i16.c : Regenerated.
+       * minloc0_4_i4.c : Regenerated.
+       * minloc0_4_i8.c : Regenerated.
+       * minloc0_4_r10.c : Regenerated.
+       * minloc0_4_r16.c : Regenerated.
+       * minloc0_4_r4.c : Regenerated.
+       * minloc0_4_r8.c : Regenerated.
+       * minloc0_8_i16.c : Regenerated.
+       * minloc0_8_i4.c : Regenerated.
+       * minloc0_8_i8.c : Regenerated.
+       * minloc0_8_r10.c : Regenerated.
+       * minloc0_8_r16.c : Regenerated.
+       * minloc0_8_r4.c : Regenerated.
+       * minloc0_8_r8.c : Regenerated.
+       * minloc1_16_i16.c : Regenerated.
+       * minloc1_16_i4.c : Regenerated.
+       * minloc1_16_i8.c : Regenerated.
+       * minloc1_16_r10.c : Regenerated.
+       * minloc1_16_r16.c : Regenerated.
+       * minloc1_16_r4.c : Regenerated.
+       * minloc1_16_r8.c : Regenerated.
+       * minloc1_4_i16.c : Regenerated.
+       * minloc1_4_i4.c : Regenerated.
+       * minloc1_4_i8.c : Regenerated.
+       * minloc1_4_r10.c : Regenerated.
+       * minloc1_4_r16.c : Regenerated.
+       * minloc1_4_r4.c : Regenerated.
+       * minloc1_4_r8.c : Regenerated.
+       * minloc1_8_i16.c : Regenerated.
+       * minloc1_8_i4.c : Regenerated.
+       * minloc1_8_i8.c : Regenerated.
+       * minloc1_8_r10.c : Regenerated.
+       * minloc1_8_r16.c : Regenerated.
+       * minloc1_8_r4.c : Regenerated.
+       * minloc1_8_r8.c : Regenerated.
+       * maxloc0_16_i16.c : Regenerated.
+       * maxloc0_16_i4.c : Regenerated.
+       * maxloc0_16_i8.c : Regenerated.
+       * maxloc0_16_r10.c : Regenerated.
+       * maxloc0_16_r16.c : Regenerated.
+       * maxloc0_16_r4.c : Regenerated.
+       * maxloc0_16_r8.c : Regenerated.
+       * maxloc0_4_i16.c : Regenerated.
+       * maxloc0_4_i4.c : Regenerated.
+       * maxloc0_4_i8.c : Regenerated.
+       * maxloc0_4_r10.c : Regenerated.
+       * maxloc0_4_r16.c : Regenerated.
+       * maxloc0_4_r4.c : Regenerated.
+       * maxloc0_4_r8.c : Regenerated.
+       * maxloc0_8_i16.c : Regenerated.
+       * maxloc0_8_i4.c : Regenerated.
+       * maxloc0_8_i8.c : Regenerated.
+       * maxloc0_8_r10.c : Regenerated.
+       * maxloc0_8_r16.c : Regenerated.
+       * maxloc0_8_r4.c : Regenerated.
+       * maxloc0_8_r8.c : Regenerated.
+       * maxloc1_16_i16.c : Regenerated.
+       * maxloc1_16_i4.c : Regenerated.
+       * maxloc1_16_i8.c : Regenerated.
+       * maxloc1_16_r10.c : Regenerated.
+       * maxloc1_16_r16.c : Regenerated.
+       * maxloc1_16_r4.c : Regenerated.
+       * maxloc1_16_r8.c : Regenerated.
+       * maxloc1_4_i16.c : Regenerated.
+       * maxloc1_4_i4.c : Regenerated.
+       * maxloc1_4_i8.c : Regenerated.
+       * maxloc1_4_r10.c : Regenerated.
+       * maxloc1_4_r16.c : Regenerated.
+       * maxloc1_4_r4.c : Regenerated.
+       * maxloc1_4_r8.c : Regenerated.
+       * maxloc1_8_i16.c : Regenerated.
+       * maxloc1_8_i4.c : Regenerated.
+       * maxloc1_8_i8.c : Regenerated.
+       * maxloc1_8_r10.c : Regenerated.
+       * maxloc1_8_r16.c : Regenerated.
+       * maxloc1_8_r4.c : Regenerated.
+       * maxloc1_8_r8.c : Regenerated.
+       * maxval_i16.c : Regenerated.
+       * maxval_i4.c : Regenerated.
+       * maxval_i8.c : Regenerated.
+       * maxval_r10.c : Regenerated.
+       * maxval_r16.c : Regenerated.
+       * maxval_r4.c : Regenerated.
+       * maxval_r8.c : Regenerated.
+       * minval_i16.c : Regenerated.
+       * minval_i4.c : Regenerated.
+       * minval_i8.c : Regenerated.
+       * minval_r10.c : Regenerated.
+       * minval_r16.c : Regenerated.
+       * minval_r4.c : Regenerated.
+       * minval_r8.c : Regenerated.
+       * sum_c10.c : Regenerated.
+       * sum_c16.c : Regenerated.
+       * sum_c4.c : Regenerated.
+       * sum_c8.c : Regenerated.
+       * sum_i16.c : Regenerated.
+       * sum_i4.c : Regenerated.
+       * sum_i8.c : Regenerated.
+       * sum_r10.c : Regenerated.
+       * sum_r16.c : Regenerated.
+       * sum_r4.c : Regenerated.
+       * sum_r8.c : Regenerated.
+       * product_c10.c : Regenerated.
+       * product_c16.c : Regenerated.
+       * product_c4.c : Regenerated.
+       * product_c8.c : Regenerated.
+       * product_i16.c : Regenerated.
+       * product_i4.c : Regenerated.
+       * product_i8.c : Regenerated.
+       * product_r10.c : Regenerated.
+       * product_r16.c : Regenerated.
+       * product_r4.c : Regenerated.
+       * product_r8.c : Regenerated.
+
+2006-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26509
+       * libgfortran.h: Add ERROR_DIRECT_EOR.
+       * runtime/error.c (translate_error): Add translation for new error.
+       * io/transfer.c (write_buf): Add check for EOR when mode is 
+       direct access.
+
+2006-03-13  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/25378
+       * libgfortran/m4/minloc1.m4: Set the initial position to zero and
+       modify the condition for updating it, to implement the F2003
+       requirement for all(mask).eq.false.
+       * libgfortran/m4/maxloc1.m4: The same.
+       * libgfortran/m4/iforeach.m4: The same.
+       * libgfortran/m4/minloc0.m4: The same.
+       * libgfortran/m4/maxloc0.m4: The same.
+       * libgfortran/generated/maxloc0_16_i16.c: Regenerated, together
+       with 41 others.
+       * libgfortran/generated/minloc0_16_i16.c: Regenerated, together
+       with 41 others.
+
+2006-03-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26499
+       * io/file_pos (st_rewind): Flush always.
+       * io/unix.c (fd_truncate): Return SUCCESS rather than FAILURE for
+       special files like /dev/null.
+       * io/transfer.c (st_write_done): Remove broken logic that
+       prevented calling fd_truncate.
+
+2006-03-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26554
+       * io/list_read.c (read_logical): Return the value if not in namelist
+       mode.
+
+2006-03-03  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR fortran/25031
+       * runtime/memory.c:  Adjust copyright years.
+       (allocate_array):  New function.
+       (allocate64_array):  New function.
+       * libgfortran.h (error_codes):  Add ERROR_ALLOCATION.
+
+2006-02-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26136
+       * io/io.h: Add flag for reading from line_buffer.
+       * io/list_read.c (l_push_char): New function to save namelist
+       input when reading logicals.
+       (free_line): New function to free line_buffer memory.
+       (next_char): Added feature to read from line_buffer.
+       (read_logical): Use new functions to test for '=' after reading a
+       logical value, checking for possible variable name.
+       (namelist_read): Use free_line when all done.
+
+2006-02-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26464
+       * io/file_pos.c (st_backspace): Flush and truncate file
+       when in AFTER_ENDFILE condition.
+       * io/transfer.c (st_read_done): Remove flush, no longer needed.
+
+2006-02-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/26423
+       * io/unix.c (fd_seek): Revert change from 25949.
+       (fd_read): Same.
+       (fd_write): Same.
+
+2006-02-19  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * io/open.c (edit_modes): Correct abusive copy-pasting.
+
+2006-02-16  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/24903
+       * m4/dotprodc.m4: Use __builtin_conj instead of assigning real
+       and imaginary parts separately.
+       * generated/dotprod_c4.c: Regenerated.
+       * generated/dotprod_c8.c: Regenerated.
+       * generated/dotprod_c10.c: Regenerated.
+       * generated/dotprod_c16.c: Regenerated.
+
+2006-02-12  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/25949
+       * io/io.h: Add set function pointer to struct stream.  
+       * io/unix.c (fd_seek): Only update offset, don't seek.
+       (fd_sset): New function.
+       (fd_read): Call lseek directly if necessary.
+       (fd_write): Likewise.
+       (fd_open): Set pointer to fd_sset.
+       (mem_set): New function.
+       (open_internal): Set pointer to mem_set.
+       * io/transfer.c (write_block_direct): Rename to write_buf, add
+       error return, non-pointer length argument.
+       (unformatted_write): Update to use write_buf.
+       (us_write): Simplify by using swrite instead of salloc_w.
+       (write_us_marker): New function.
+       (new_record_w): Use sset instead of memset, use write_us_marker,
+       simplify by using swrite instead of salloc_w.
+
+2006-02-08  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/25425
+       * libgfortran.h: Add pedantic field to compile_options struct.
+       * io/write.c (calculate_G_format): Depending on the standard,
+       choose E or F format for list-directed output of 0.0.
+       * runtime/error.c (notify_std): Make warning and error dependent
+       on pedanticity.
+       * runtime/compile_options.c (set_std): Use new pedantic argument.
+
+2006-02-07  Dale Ranta  <dir@lanl.gov>
+
+       PR fortran/25577
+       * intrinsics/mvbits.c: Shift '(TYPE)1' type when building 'lenmask'.
+
+2006-02-07  Rainer Emrich <r.emrich@de.tecosim.com>
+
+       * intrinsics/c99_functions.c: Work around incompatible
+       declarations of cabs{,f,l} on pre-C99 IRIX systems.
+
+2005-02-06  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/23815
+       * runtime/environ.c (init_unformatted):  Add GFORTRAN_CONVERT_UNIT
+       environment variable.
+       (top level):  Add defines, type and static variables for
+       GFORTRAN_CONVERT_UNIT handling.
+       (search_unit):  New function.
+       (match_word): New function.
+       (match_integer): New function.
+       (next_token): New function.
+       (push_token): New function.
+       (mark_single): New function.
+       (mark_range): New funciton.
+       (do_parse): New function.
+       (init_unformatted): New function.
+       (get_unformatted_convert): New function.
+       * runtime/compile_options.c:  Add set_convert().
+       * libgfortran.h:  Add convert to compile_options_t.
+       * io/open.c (st_open): Call get_unformatted_convert to get
+       unit default; if CONVERT_NONE is returned, check for
+       the presence of a CONVERT specifier and use it.
+       As default, use compile_options.convert.
+       * io/io.h (top level): Add CONVERT_NONE to unit_convert, to signal
+       "nothing has been set".
+       (top level): Add prototype for get_unformatted_convert.
+
+2006-02-06  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/24685
+       * io/write.c (write_real): Widen the default format for real(10)
+       variables output.
+
+2006-01-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25835
+       * io/transfer.c (st_read_done): Flush buffers when read is done.
+
+2006-01-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25697
+       * io/transfer.c (us_read): Detect end of file condition from previous
+       operations and bail out (no need to pre-position).
+
+2006-01-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25631
+       * io/transfer.c (formatted_transfer_scalar): Adjust pending_spaces and
+       skips so that TL works correctly when no bytes_used yet.  
+
+2006-01-16  Roger Sayle  <roger@eyesopen.com>
+
+       * configure.ac (CFLAGS): Update to include -std=gnu99 so that
+       the configure tests will be run with the same environment as
+       used to compile the libgfortran source code.
+       * configure: Regenerate.
+
+2006-01-12  Roger Sayle  <roger@eyesopen.com>
+
+       * intrinsics/c99_functions.c: Add function prototypes to avoid
+       warnings from -Wstrict-prototypes -Wmissing-prototypes.  On Tru64
+       work around a brain-dead libm by redirecting calls to cabs{,f,l}
+       to a local __gfc_cabs{,f,l}.
+
+2006-01-07  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * configure.ac: Remove check for sys/mman.h.
+       * configure: Regenerated.
+       * Makefile.in: Regenerated.
+       * config.h.in: Regenerated.
+       * aclocal.m4: Regenerated.
+       
+2006-01-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/25598
+       * io/file_pos.c (unformatted_backspace): Assure the new file position
+       to seek is not less than zero.
+       (st_backspace): Set unit bytes_left to zero.
+       * io/transfer.c (next_record_r): Fix line lengths, no functional change.
+
+2006-01-02  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR target/25259
+       * configure.ac: Use GCC_HEADER_STDINT.
+       * libgfortran.h: Include gstdint.h.
+       * aclocal.m4: Regenerate.
+       * configure: Regenerate.
+
+2006-01-01  Steven G. Kargl  <kargls@comcast.net>
+
+       * ChangeLog: Split into years ...
+       * ChangeLog-2002: here.
+       * ChangeLog-2003: here.
+       * ChangeLog-2004: here.
+       * ChangeLog-2005: here.
+
+\f
+Copyright (C) 2006 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2007 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2007
new file mode 100644 (file)
index 0000000..11f9df0
--- /dev/null
@@ -0,0 +1,2487 @@
+2007-12-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/22423
+       * intrinsics/pack_generic.c (pack): Change type of mask argument
+       to gfc_array_l1 * in prototype and function.
+       (pack_char):  Likewise.
+       * intrinsics/unpack_generic.c (unpack1):  Likewise.
+       (unpack1_char):  Likewise.
+       (unpack0):  Likewise.
+       (unpack0_char):  Likewise.
+
+2007-12-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34594
+       * runtime/error.c: If there was a previous error, don't
+       mask it with another error mesage, EOF or EOR condition.
+
+2007-12-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/34560
+       * io/transfer.c (read_sf): Check if readlen was less than the requested
+       number of bytes to read and if so, generate error.
+
+2007-12-25  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR fortran/34533
+       * intrinsics/cpu_time.c: Moved code commonly usable for CPU_TIME,
+       DTIME and ETIME to ...
+       * intrinsics/time_1.h: ... here.
+       * intrinsics/dtime.c: New file.
+       * intrinsics/etime.c: Newly implemented using the common 
+       time-aquisition function from time_1.h.
+       * gfortran.map (_gfortran_dtime, _gfortran_dtime_sub): New.
+       * Makefile.am: Added new file.
+       * Makefile.in: Regenerated.
+       * configure: Regenerated.
+
+2007-12-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34566
+       * m4/matmull.m4:  Multiply xstride and ystride by correct kind.
+       * generated/matmul_l4.c:  Regenerated.
+       * generated/matmul_l8.c:  Regenerated.
+       * generated/matmul_l16.c:  Regenerated.
+
+2007-12-19  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/34530
+       * io/list_read.c (eat_line): Move up in the file.
+       (eat_separator): In namelist mode, skip over comment lines.
+
+2007-12-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/34427
+       * io/list_read.c (read_real): Handle intervening line ends and spaces.
+       (get_name): Don't push separators to saved_string.
+       (eat_separator): If in namelist mode eat spaces and line ends as well.
+
+2007-12-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34370
+       PR libfortran/34323
+       PR libfortran/34405
+       * io/io.h:  Add previous_nonadvancing_write to gfc_unit.
+       Add prototype for finish_last_advance_record.
+       * io/file_pos.c (st_backspace):  Generate error if backspace is
+       attempted for direct access or unformatted stream.
+       If there are bytes left from a previous ADVANCE="no", write
+       them out before performing the backspace.
+       (st_endfile):  Generate error if endfile is attempted for
+       direct access.
+       If there are bytes left from a previous ADVANCE="no", write
+       them out before performing the endfile.
+       (st_rewind):  Generate error if rewind is attempted for
+       direct access.
+       * unit.c (close_unit_1):  Move functionality to write
+       previously written bytes to...
+       (finish_last_advance_record):  ... here.
+       * transfer.c (data_transfer_init):  If reading, reset
+       previous_nonadvancing_write.
+       (finalize_transfer):  Set the previous_noadvancing_write
+       flag if we are writing and ADVANCE="no" was specified.
+       Only call next_record() if advance="no" wasn't specified.
+
+2007-12-13  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/34427
+       * io/list_read.c (read_real): Fix unwinding for namelists.
+
+2007-12-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/34411
+       * io/read.c (convert_real, read_l, read_decimal, read_radix, read_f):
+       Call next_record after bad read or overflow error.
+
+2007-12-09  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/34404
+       * io/list_read.c (parse_real): Remove superfluous "goto bad;".
+
+2007-12-08  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/34319
+       * io/list_read.c (parse_real, read_real): Support NaN/Infinity.
+
+2007-12-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+           Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/33985
+       * io/transfer.c (read_block, read_block_direct, write_block, write_buf):
+       Don't seek if file position is already there for STREAM I/O.
+       (finalize_transfer): For STREAM I/O don't flush unless the file position
+       has moved past the start position before the transfer.
+
+2007-12-01  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * intrinsic/stat.c (stat_i4_sub_0, stat_i8_sub_0): Mark parameter
+       with unused attribute.
+       * intrinsics/system_clock.c (system_clock_4, system_clock_8):
+       Remove unused variable.
+       * intrinsics/umask.c: Include unistd.h.
+
+2007-11-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/34291
+       * io/list_read.c (read_character): When reading an unquoted string,
+       return if special characters that could signify the end of the namelist
+       read are encountered.
+
+2007-11-29  Steven G. Kargl  <kargls@comcast.net>
+
+       PR libfortran/33583
+       * libgfortran/gfortran.map: Add tgammaf, tgamma, lgamma, and lgammaf.
+       * gfortran.dg/gamma_5.f90: Remove xfail.
+
+2007-11-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/33583
+       PR libfortran/33698
+       * intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
+       New fallback functions.
+       * c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
+       * configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
+       lgammaf and lgammal.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2007-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * mk-kinds-h.sh: Change sed syntax.
+
+2007-11-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33985
+       * io/transfer.c (finalize_transfer): Revert previous patch.
+       
+2007-11-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33985
+       * io/transfer.c (finalize_transfer): Do not flush for
+       unformatted STREAM I/O.
+
+2007-10-27  Tobias Burnus  <burnus@net-b.de>
+
+       * mk-kinds-h.sh: Change LANG=C to LC_ALL=C.
+
+2007-10-26  Tobias Burnus  <burnus@net-b.de>
+
+       * mk-kinds-h.sh: Add "LANG=C".
+
+2007-10-26  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * libgfortran.h (GFC_REAL_*_HUGE, GFC_REAL_*_DIGITS,
+       GFC_REAL_*_RADIX): Remove.
+       * mk-kinds-h.sh: Define GFC_REAL_*_HUGE, GFC_REAL_*_DIGITS and
+       GFC_REAL_*_RADIX. Don't define GFC_REAL_LARGEST_FORMAT and
+       GFC_REAL_LARGEST.
+
+2007-10-19  Ben Elliston  <bje@au.ibm.com>
+
+       * intrinsics/signal.c (alarm_sub_i4): Mark conditionally unused
+       parameters with __attribute__ ((unused)).
+       (alarm_sub_i8): Likewise.
+       (alarm_sub_int_i4): Likewise.
+       (alarm_sub_int_i8): Likewise.
+
+2007-10-18  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+           Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33795
+       * libgfortran.h: Add unbuffered_preconnected.
+       * io/unix.c (output_stream): Set stream unbuffered flag if
+       options.unbuffered_preconnected has been set.
+       (error_stream): Ditto.
+       * runtime/environ.c (variable_table): Add to environment variable table
+       the entry: GFORTRAN_UNBUFFERED_PRECONNECTED. 
+       
+2007-10-18  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/32021
+       * runtime/backtrace.c (local_strcasestr): Protect by appropriate
+       macros.
+       * runtime/main.c (cleanup): Cast argument to free.
+       * intrinsics/spread_generic.c (spread_internal): Match runtime_error
+       arguments and format.
+       * intrinsics/signal.c (alarm_sub_int_i4, alarm_sub_int_i8): Cast
+       pointers to avoid warnings.
+
+2007-10-18  Ben Elliston  <bje@au.ibm.com>
+
+       * runtime/environ.c (init_choice): Remove unused function.
+       (show_choice): Likewise.
+       (choice): Remove.
+       (FP_ROUND_NEAREST, FP_ROUND_UP, FP_ROUND_DOWN, FP_ROUND_ZERO):
+       Remove.
+       (precision, signal_choices): Remove.
+
+2007-10-15 Christopher D. Rickett <crickett@lanl.gov>
+
+       PR fortran/32600
+       * libgfortran/intrinsics/iso_c_binding.c: Remove c_associated_1
+       and c_associated_2.
+       * libgfortran/intrinsics/iso_c_binding.h: Ditto.
+       * libgfortran/gfortran.map: Ditto.
+
+2007-10-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33055
+       * io/inquire.c (inquire_via_unit):  If inquiring by unit, check for
+       an error condition from the IOSTAT variable and set EXIST to false if
+       there was a bad unit number.
+
+2007-10-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33672
+       * io/list_read.c (nml_parse_qualifier): Add character specific error
+       messages.  Check for proper form of sub-string qualifiers.  Return the
+       parsed_rank flag indicating a non-zero rank qualifier.
+       (nml_get_obj_data):  Count the instances of non-zero rank qualifiers.
+       Issue an error if more that one non-zero rank qualifier is found.
+
+2007-10-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33253
+       * io/list_read.c (read_character): Use line_buffer to scan ahead for
+       object name or string when no delimiter is found.
+
+2007-10-04  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/32021
+       * runtime/environ.c (init_mem, show_mem, init_round, show_round,
+       init_precision, show_precision, init_signal, show_signal): Remove.
+       (variable_table): Remove GFORTRAN_MEM_INIT, GFORTRAN_MEM_CHECK,
+       GFORTRAN_SIGHUP, GFORTRAN_SIGINT, GFORTRAN_FPU_ROUND and
+       GFORTRAN_FPU_PRECISION.
+       * libgfortran.h (options_t): Remove mem_check, fpu_round,
+       fpu_precision, sighup, sigint, allocate_init_flag and
+       allocate_init_value.
+
+2007-10-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33253
+       * io/list_read.c (read_character): Use DELIM_APOSTROPHE and DELIM_QUOTE
+       and quote value in check of first character in string.
+
+2007-10-02  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/33469
+       * io/write.c (write_real): Widen the default formats.
+
+2007-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33400
+       * io/list_read.c (next_char): Interpret encountering the end of file the
+       first time as an end of line.  Subsequent reads give EOF error.
+
+2007-09-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33421
+       * io/list_read.c (read_character): Revert r128057.
+
+2007-09-21  Bernhard Fischer  <aldot>
+
+       PR fortran/31546
+       * (configure.ac): Add --enable-intermodule for onestep build.
+       * (Makefile.am): Handle onestep build.
+       * (configure, Makefile.in): Regenerate.
+
+2007-09-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/26253
+       * intrinsics/c99_functions.c (scalbn): Use ldexp if appopriate.
+
+2007-09-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/23272
+       * io/unix.c (id_from_handle, id_from_path, id_from_fd): New
+       functions.
+       (compare_file_filename, find_file, find_file0): Use the new
+       functions above.
+
+2007-09-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * acinclude.m4 (LIBGFOR_TARGET_ILP32): Remove test.
+       * configure.ac: Don't call LIBGFOR_TARGET_ILP32.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2007-09-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/21185
+       * runtime/compile_options.c (set_options): Fix typo.
+       * runtime/main.c (store_exe_path): If getcwd is not available,
+       don't use it.
+       * intrinsics/getcwd.c: Same thing here.
+       * io/unix.c (fallback_access): New fallback function for access.
+       (fix_fd): Don't use dup if it's not available.
+       * configure.ac: Check for dup and getcwd.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2007-09-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * io/io.h: Include libgfortran.h first.
+
+2007-09-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/33386
+       * runtime/select.c (select_string): Initialize default_jump.
+
+2007-09-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33307
+       * io/filepos.c (st_backspace): Don't truncate when already at the end
+       of the file.
+       
+2007-09-07  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/fpu-387.h: Include cpuid.h.
+       (set_fpu): Use __get_cpuid to check for SSE.
+
+2007-09-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/33298
+       * intrinsics/spread_generic.c(spread_internal): Enable
+       bounds checking by comparing extents if the bounds_check
+       option has been set.  If any extent is <=0, return early.
+
+2007-09-06  David Edelsohn  <edelsohn@gnu.org>
+
+       * libgfortran.h: Include config.h first.
+       * io/io.h (struct stream): Rename truncate to trunc.
+       * io/unix.c (fd_open): Same.
+       (open_internal): Same.
+
+2007-09-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33253
+       * io/write.c (nml_write_obj): Set the delimiter correctly before
+       calling write_character. (namelist_write): Clean up the code a little
+       and add comments to clarify what its doing.
+
+2007-09-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33225
+       * io/write.c (stdbool.h): Add include. (sign_t): Move typedef to
+       new file write_float.def. Include write_float.def.
+       (extract_real): Delete. (calculate_sign): Delete.
+       (calculate_exp): Delete. (calculate_G_format): Delete.
+       (output_float): Delete. (write_float): Delete.
+       * io/write_float.def (calculate_sign): Added.
+       (output_float): Refactored to be independent of kind and added to this
+       file for inclusion. (write_infnan): New function to write "Infinite"
+       or "NaN" depending on flags passed, independent of kind.
+       (CALCULATE_EXP): New macro to build kind specific functions. Use it.
+       (OUTPUT_FLOAT_FMT_G): New macro, likewise. Use it.
+       (DTOA, DTOAL): Macros to implement "decimal to ascii".
+       (WRITE_FLOAT): New macro for kind specific write_float functions.
+       (write_float): Revised function to determine kind and use WRITE_FLOAT
+       to implement kind specific output.
+
+2007-09-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33253
+       * io/list_read.c (read_character): Use DELIM_APOSTROPHE and
+       DELIM_QUOTE in check of first character in string. 
+
+2007-09-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/31675
+       * libgfortran.h: Include gcc/fortran/libgfortran.h.
+       Remove M_PI, GFC_MAX_DIMENSIONS, GFC_DTYPE_*, GFC_NUM_RANK_BITS,
+       error_codes, GFC_STD_*, GFC_FPE_* and unit_convert.
+       * runtime/environ.c (variable_table): Use GFC_*_UNIT_NUMBER instead
+       of hardcoded constants.
+       (do_parse, init_unformatted): Use GFC_CONVERT_* macros instead of
+       CONVERT_*.
+       * runtime/string.c (find_option): Use LIBERROR_BAD_OPTION instead
+       of ERROR_BAD_OPTION.
+       * runtime/error.c (translate_error, generate_error): Use
+       LIBERROR_* macros instead of ERROR_*.
+       * io/file_pos.c (formatted_backspace, unformatted_backspace,
+       st_backspace, st_rewind, st_flush): Rename macros.
+       * io/open.c (convert_opt, edit_modes, new_unit, already_open,
+       st_open): Likewise.
+       * io/close.c (st_close): Likewise.
+       * io/list_read.c (next_char, convert_integer, parse_repeat,
+       read_logical, read_integer, read_character, parse_real,
+       check_type, list_formatted_read_scalar, namelist_read,
+       nml_err_ret): Likewise.
+       * io/read.c (convert_real, read_l, read_decimal, read_radix,
+       read_f): Likewise.
+       * io/inquire.c (inquire_via_unit): Likewise.
+       * io/unit.c (get_internal_unit): Likewise.
+       * io/transfer.c (read_sf, read_block, read_block_direct,
+       write_block, write_buf, unformatted_read, unformatted_write,
+       formatted_transfer_scalar, us_read, us_write, data_transfer_init,
+       skip_record, next_record_r, write_us_marker, next_record_w_unf,
+       next_record_w, finalize_transfer, st_read, st_write_done):
+       Likewise.
+       * io/format.c (format_error): Likewise.
+
+2007-08-31  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * m4/minloc1.m4: Update copyright year and ajust headers order.
+       * m4/maxloc1.m4: Likewise.
+       * m4/in_pack.m4: Likewise.
+       * m4/sum.m4: Likewise.
+       * m4/fraction.m4: Likewise.
+       * m4/all.m4: Likewise.
+       * m4/set_exponent.m4: Likewise.
+       * m4/transpose.m4: Likewise.
+       * m4/eoshift1.m4: Likewise.
+       * m4/spacing.m4: Likewise.
+       * m4/eoshift3.m4: Likewise.
+       * m4/minval.m4: Likewise.
+       * m4/count.m4: Likewise.
+       * m4/maxval.m4: Likewise.
+       * m4/exponent.m4: Likewise.
+       * m4/shape.m4: Likewise.
+       * m4/head.m4: Likewise.
+       * m4/cshift1.m4: Likewise.
+       * m4/minloc0.m4: Likewise.
+       * m4/nearest.m4: Likewise.
+       * m4/maxloc0.m4: Likewise.
+       * m4/pow.m4: Likewise.
+       * m4/in_unpack.m4: Likewise.
+       * m4/matmull.m4: Likewise.
+       * m4/product.m4: Likewise.
+       * m4/reshape.m4: Likewise.
+       * m4/any.m4: Likewise.
+       * m4/rrspacing.m4: Likewise.
+       * m4/matmul.m4: Likewise.
+       * runtime/backtrace.c: Likewise.
+       * runtime/environ.c: Likewise.
+       * runtime/in_pack_generic.c: Likewise.
+       * runtime/compile_options.c: Likewise.
+       * runtime/in_unpack_generic.c: Likewise.
+       * runtime/main.c: Likewise.
+       * runtime/stop.c: Likewise.
+       * runtime/string.c: Likewise.
+       * runtime/memory.c: Likewise.
+       * runtime/error.c: Likewise.
+       * runtime/pause.c: Likewise.
+       * intrinsics/ierrno.c: Likewise.
+       * intrinsics/system_clock.c: Likewise.
+       * intrinsics/cshift0.c: Likewise.
+       * intrinsics/unlink.c: Likewise.
+       * intrinsics/ctime.c: Likewise.
+       * intrinsics/etime.c: Likewise.
+       * intrinsics/cpu_time.c: Likewise.
+       * intrinsics/malloc.c: Likewise.
+       * intrinsics/hostnm.c: Likewise.
+       * intrinsics/sleep.c: Likewise.
+       * intrinsics/exit.c: Likewise.
+       * intrinsics/perror.c: Likewise.
+       * intrinsics/transpose_generic.c: Likewise.
+       * intrinsics/pack_generic.c: Likewise.
+       * intrinsics/spread_generic.c: Likewise.
+       * intrinsics/stat.c: Likewise.
+       * intrinsics/string_intrinsics.c: Likewise.
+       * intrinsics/getcwd.c: Likewise.
+       * intrinsics/date_and_time.c: Likewise.
+       * intrinsics/unpack_generic.c: Likewise.
+       * intrinsics/move_alloc.c: Likewise.
+       * intrinsics/getlog.c: Likewise.
+       * intrinsics/eoshift0.c: Likewise.
+       * intrinsics/eoshift2.c: Likewise.
+       * intrinsics/reshape_generic.c: Likewise.
+       * intrinsics/system.c: Likewise.
+       * intrinsics/iso_c_binding.c: Likewise.
+       * intrinsics/env.c: Likewise.
+       * intrinsics/kill.c: Likewise.
+       * intrinsics/reshape_packed.c: Likewise.
+       * intrinsics/time.c: Likewise.
+       * intrinsics/gerror.c: Likewise.
+       * intrinsics/access.c: Likewise.
+       * intrinsics/fnum.c: Likewise.
+       * intrinsics/abort.c: Likewise.
+       * intrinsics/rename.c: Likewise.
+       * intrinsics/signal.c: Likewise.
+       * intrinsics/symlnk.c: Likewise.
+       * intrinsics/random.c: Likewise.
+       * intrinsics/umask.c: Likewise.
+       * intrinsics/getXid.c: Likewise.
+       * intrinsics/rand.c: Likewise.
+       * intrinsics/chdir.c: Likewise.
+       * intrinsics/chmod.c: Likewise.
+       * intrinsics/clock.c: Likewise.
+       * intrinsics/args.c: Likewise.
+       * intrinsics/link.c: Likewise.
+       * c99_protos.h: Likewise.
+       * config/fpu-387.h: Likewise.
+       * config/fpu-aix.h: Likewise.
+       * config/fpu-sysv.h: Likewise.
+       * config/fpu-generic.h: Likewise.
+       * config/fpu-glibc.h: Likewise.
+       * io/file_pos.c: Likewise.
+       * io/open.c: Likewise.
+       * io/size_from_kind.c: Likewise.
+       * io/close.c: Likewise.
+       * io/list_read.c: Likewise.
+       * io/read.c: Likewise.
+       * io/inquire.c: Likewise.
+       * io/unit.c: Likewise.
+       * io/unix.c: Likewise.
+       * io/transfer.c: Likewise.
+       * io/intrinsics.c: Likewise.
+       * io/format.c: Likewise.
+       * io/lock.c: Likewise.
+       * io/write.c: Likewise.
+       * io/write_float.def: Likewise.
+       * fmain.c: Likewise.
+       * generated/minval_r8.c: Regenerate.
+       * generated/minloc1_16_r16.c: Regenerate.
+       * generated/maxloc1_4_r8.c: Regenerate.
+       * generated/sum_i8.c: Regenerate.
+       * generated/eoshift3_4.c: Regenerate.
+       * generated/transpose_c8.c: Regenerate.
+       * generated/any_l16.c: Regenerate.
+       * generated/eoshift1_8.c: Regenerate.
+       * generated/pow_r8_i8.c: Regenerate.
+       * generated/reshape_r16.c: Regenerate.
+       * generated/pow_i4_i16.c: Regenerate.
+       * generated/maxval_i2.c: Regenerate.
+       * generated/product_r4.c: Regenerate.
+       * generated/maxloc1_8_i4.c: Regenerate.
+       * generated/exponent_r16.c: Regenerate.
+       * generated/maxloc0_4_r4.c: Regenerate.
+       * generated/fraction_r16.c: Regenerate.
+       * generated/in_unpack_i8.c: Regenerate.
+       * generated/matmul_r8.c: Regenerate.
+       * generated/product_i2.c: Regenerate.
+       * generated/fraction_r4.c: Regenerate.
+       * generated/minloc0_4_r16.c: Regenerate.
+       * generated/reshape_c4.c: Regenerate.
+       * generated/minloc0_4_i1.c: Regenerate.
+       * generated/maxloc0_4_r16.c: Regenerate.
+       * generated/maxloc0_4_i2.c: Regenerate.
+       * generated/minloc1_8_r16.c: Regenerate.
+       * generated/maxloc1_8_r16.c: Regenerate.
+       * generated/set_exponent_r8.c: Regenerate.
+       * generated/in_unpack_i16.c: Regenerate.
+       * generated/transpose_c16.c: Regenerate.
+       * generated/maxloc0_8_i8.c: Regenerate.
+       * generated/pow_c4_i8.c: Regenerate.
+       * generated/sum_r16.c: Regenerate.
+       * generated/sum_i1.c: Regenerate.
+       * generated/minloc1_4_r8.c: Regenerate.
+       * generated/transpose_r10.c: Regenerate.
+       * generated/pow_i8_i4.c: Regenerate.
+       * generated/maxloc1_16_r16.c: Regenerate.
+       * generated/minloc1_16_i4.c: Regenerate.
+       * generated/maxloc1_16_i4.c: Regenerate.
+       * generated/minloc0_16_i8.c: Regenerate.
+       * generated/maxloc0_16_i8.c: Regenerate.
+       * generated/nearest_r8.c: Regenerate.
+       * generated/spacing_r16.c: Regenerate.
+       * generated/transpose_i8.c: Regenerate.
+       * generated/count_16_l16.c: Regenerate.
+       * generated/maxval_r16.c: Regenerate.
+       * generated/count_8_l8.c: Regenerate.
+       * generated/product_c10.c: Regenerate.
+       * generated/minloc1_8_i4.c: Regenerate.
+       * generated/minloc0_16_i16.c: Regenerate.
+       * generated/matmul_r16.c: Regenerate.
+       * generated/eoshift1_16.c: Regenerate.
+       * generated/minloc0_4_r4.c: Regenerate.
+       * generated/pow_c16_i16.c: Regenerate.
+       * generated/set_exponent_r10.c: Regenerate.
+       * generated/pow_i16_i16.c: Regenerate.
+       * generated/product_c4.c: Regenerate.
+       * generated/sum_r4.c: Regenerate.
+       * generated/pow_c16_i4.c: Regenerate.
+       * generated/rrspacing_r10.c: Regenerate.
+       * generated/in_pack_c16.c: Regenerate.
+       * generated/minloc0_4_i2.c: Regenerate.
+       * generated/maxloc0_8_i1.c: Regenerate.
+       * generated/reshape_i4.c: Regenerate.
+       * generated/minloc0_8_i8.c: Regenerate.
+       * generated/matmul_c8.c: Regenerate.
+       * generated/spacing_r4.c: Regenerate.
+       * generated/in_pack_c4.c: Regenerate.
+       * generated/all_l16.c: Regenerate.
+       * generated/minloc1_16_r10.c: Regenerate.
+       * generated/sum_i2.c: Regenerate.
+       * generated/minloc0_16_i1.c: Regenerate.
+       * generated/reshape_c16.c: Regenerate.
+       * generated/maxloc0_16_i1.c: Regenerate.
+       * generated/maxloc1_8_r8.c: Regenerate.
+       * generated/minval_i16.c: Regenerate.
+       * generated/reshape_r10.c: Regenerate.
+       * generated/exponent_r10.c: Regenerate.
+       * generated/maxval_i4.c: Regenerate.
+       * generated/any_l4.c: Regenerate.
+       * generated/minval_i8.c: Regenerate.
+       * generated/maxloc1_4_i8.c: Regenerate.
+       * generated/fraction_r10.c: Regenerate.
+       * generated/maxloc0_16_i16.c: Regenerate.
+       * generated/shape_i4.c: Regenerate.
+       * generated/pow_r16_i8.c: Regenerate.
+       * generated/maxloc0_8_r4.c: Regenerate.
+       * generated/rrspacing_r8.c: Regenerate.
+       * generated/pow_c10_i4.c: Regenerate.
+       * generated/minloc1_4_i16.c: Regenerate.
+       * generated/minloc0_4_r10.c: Regenerate.
+       * generated/maxloc1_4_i16.c: Regenerate.
+       * generated/minloc0_8_i16.c: Regenerate.
+       * generated/maxloc0_4_r10.c: Regenerate.
+       * generated/maxloc0_8_i16.c: Regenerate.
+       * generated/minloc1_8_r10.c: Regenerate.
+       * generated/product_i4.c: Regenerate.
+       * generated/minloc0_16_r4.c: Regenerate.
+       * generated/sum_c16.c: Regenerate.
+       * generated/maxloc1_8_r10.c: Regenerate.
+       * generated/maxloc0_16_r4.c: Regenerate.
+       * generated/transpose_c10.c: Regenerate.
+       * generated/minloc1_16_r8.c: Regenerate.
+       * generated/minloc0_8_i1.c: Regenerate.
+       * generated/maxloc0_4_i4.c: Regenerate.
+       * generated/transpose_r4.c: Regenerate.
+       * generated/maxloc1_16_r8.c: Regenerate.
+       * generated/pow_i16_i8.c: Regenerate.
+       * generated/cshift1_4.c: Regenerate.
+       * generated/maxloc0_8_i2.c: Regenerate.
+       * generated/sum_r10.c: Regenerate.
+       * generated/nearest_r16.c: Regenerate.
+       * generated/sum_c4.c: Regenerate.
+       * generated/maxloc1_16_r10.c: Regenerate.
+       * generated/count_4_l16.c: Regenerate.
+       * generated/pow_c8_i8.c: Regenerate.
+       * generated/matmul_i8.c: Regenerate.
+       * generated/in_pack_i4.c: Regenerate.
+       * generated/pow_i4_i8.c: Regenerate.
+       * generated/minloc0_16_i2.c: Regenerate.
+       * generated/minloc1_8_r8.c: Regenerate.
+       * generated/maxloc0_16_i2.c: Regenerate.
+       * generated/exponent_r4.c: Regenerate.
+       * generated/spacing_r10.c: Regenerate.
+       * generated/matmul_c16.c: Regenerate.
+       * generated/pow_c4_i16.c: Regenerate.
+       * generated/maxval_r10.c: Regenerate.
+       * generated/count_4_l4.c: Regenerate.
+       * generated/shape_i16.c: Regenerate.
+       * generated/minval_i1.c: Regenerate.
+       * generated/maxloc1_4_i1.c: Regenerate.
+       * generated/matmul_r10.c: Regenerate.
+       * generated/minloc1_4_i8.c: Regenerate.
+       * generated/pow_r10_i8.c: Regenerate.
+       * generated/minloc0_8_r4.c: Regenerate.
+       * generated/in_unpack_c4.c: Regenerate.
+       * generated/matmul_l4.c: Regenerate.
+       * generated/product_i16.c: Regenerate.
+       * generated/minloc0_16_r16.c: Regenerate.
+       * generated/reshape_r8.c: Regenerate.
+       * generated/pow_r10_i16.c: Regenerate.
+       * generated/all_l4.c: Regenerate.
+       * generated/in_pack_c10.c: Regenerate.
+       * generated/minloc0_4_i4.c: Regenerate.
+       * generated/minloc0_8_i2.c: Regenerate.
+       * generated/matmul_i1.c: Regenerate.
+       * generated/reshape_c10.c: Regenerate.
+       * generated/minval_r4.c: Regenerate.
+       * generated/maxloc1_4_r4.c: Regenerate.
+       * generated/pow_r8_i16.c: Regenerate.
+       * generated/sum_i4.c: Regenerate.
+       * generated/maxval_r8.c: Regenerate.
+       * generated/count_16_l8.c: Regenerate.
+       * generated/transpose_c4.c: Regenerate.
+       * generated/eoshift1_4.c: Regenerate.
+       * generated/eoshift3_8.c: Regenerate.
+       * generated/minval_r16.c: Regenerate.
+       * generated/minloc1_4_i1.c: Regenerate.
+       * generated/minval_i2.c: Regenerate.
+       * generated/maxloc1_4_i2.c: Regenerate.
+       * generated/pow_i8_i16.c: Regenerate.
+       * generated/product_r8.c: Regenerate.
+       * generated/maxloc1_8_i8.c: Regenerate.
+       * generated/maxloc0_4_r8.c: Regenerate.
+       * generated/maxloc0_16_r16.c: Regenerate.
+       * generated/in_unpack_i4.c: Regenerate.
+       * generated/matmul_r4.c: Regenerate.
+       * generated/sum_c10.c: Regenerate.
+       * generated/minloc1_4_r16.c: Regenerate.
+       * generated/fraction_r8.c: Regenerate.
+       * generated/maxloc1_4_r16.c: Regenerate.
+       * generated/set_exponent_r4.c: Regenerate.
+       * generated/minloc0_8_r16.c: Regenerate.
+       * generated/in_unpack_c16.c: Regenerate.
+       * generated/reshape_c8.c: Regenerate.
+       * generated/maxloc0_8_r16.c: Regenerate.
+       * generated/nearest_r10.c: Regenerate.
+       * generated/maxloc0_8_i4.c: Regenerate.
+       * generated/pow_c4_i4.c: Regenerate.
+       * generated/matmul_i2.c: Regenerate.
+       * generated/minloc1_4_r4.c: Regenerate.
+       * generated/transpose_i16.c: Regenerate.
+       * generated/matmul_c10.c: Regenerate.
+       * generated/minloc0_16_i4.c: Regenerate.
+       * generated/maxloc0_16_i4.c: Regenerate.
+       * generated/pow_i8_i8.c: Regenerate.
+       * generated/nearest_r4.c: Regenerate.
+       * generated/minloc1_16_i8.c: Regenerate.
+       * generated/maxloc1_16_i8.c: Regenerate.
+       * generated/transpose_i4.c: Regenerate.
+       * generated/count_8_l4.c: Regenerate.
+       * generated/minloc1_4_i2.c: Regenerate.
+       * generated/matmul_l16.c: Regenerate.
+       * generated/maxloc1_8_i1.c: Regenerate.
+       * generated/minloc0_16_r10.c: Regenerate.
+       * generated/minloc1_8_i8.c: Regenerate.
+       * generated/minloc0_4_r8.c: Regenerate.
+       * generated/product_r16.c: Regenerate.
+       * generated/product_c8.c: Regenerate.
+       * generated/pow_r16_i16.c: Regenerate.
+       * generated/sum_r8.c: Regenerate.
+       * generated/pow_c16_i8.c: Regenerate.
+       * generated/in_pack_i16.c: Regenerate.
+       * generated/minloc0_8_i4.c: Regenerate.
+       * generated/matmul_c4.c: Regenerate.
+       * generated/minloc1_16_i16.c: Regenerate.
+       * generated/reshape_i8.c: Regenerate.
+       * generated/spacing_r8.c: Regenerate.
+       * generated/in_pack_c8.c: Regenerate.
+       * generated/maxloc1_8_r4.c: Regenerate.
+       * generated/minloc1_16_i1.c: Regenerate.
+       * generated/maxloc1_16_i1.c: Regenerate.
+       * generated/reshape_i16.c: Regenerate.
+       * generated/minval_r10.c: Regenerate.
+       * generated/pow_r4_i8.c: Regenerate.
+       * generated/minloc1_8_i1.c: Regenerate.
+       * generated/minval_i4.c: Regenerate.
+       * generated/maxloc1_4_i4.c: Regenerate.
+       * generated/maxloc1_8_i2.c: Regenerate.
+       * generated/maxval_i8.c: Regenerate.
+       * generated/eoshift3_16.c: Regenerate.
+       * generated/any_l8.c: Regenerate.
+       * generated/maxloc0_16_r10.c: Regenerate.
+       * generated/rrspacing_r4.c: Regenerate.
+       * generated/shape_i8.c: Regenerate.
+       * generated/maxloc0_8_r8.c: Regenerate.
+       * generated/minloc0_4_i16.c: Regenerate.
+       * generated/maxloc0_4_i16.c: Regenerate.
+       * generated/minloc1_4_r10.c: Regenerate.
+       * generated/minloc1_8_i16.c: Regenerate.
+       * generated/pow_c10_i8.c: Regenerate.
+       * generated/maxloc1_4_r10.c: Regenerate.
+       * generated/maxloc1_8_i16.c: Regenerate.
+       * generated/in_unpack_c10.c: Regenerate.
+       * generated/minloc0_8_r10.c: Regenerate.
+       * generated/maxloc0_8_r10.c: Regenerate.
+       * generated/minloc1_16_r4.c: Regenerate.
+       * generated/maxloc1_16_r4.c: Regenerate.
+       * generated/minloc0_16_r8.c: Regenerate.
+       * generated/pow_i16_i4.c: Regenerate.
+       * generated/product_i8.c: Regenerate.
+       * generated/maxloc0_16_r8.c: Regenerate.
+       * generated/sum_i16.c: Regenerate.
+       * generated/maxloc0_4_i8.c: Regenerate.
+       * generated/transpose_r8.c: Regenerate.
+       * generated/cshift1_8.c: Regenerate.
+       * generated/maxloc1_16_i16.c: Regenerate.
+       * generated/matmul_i4.c: Regenerate.
+       * generated/pow_c8_i4.c: Regenerate.
+       * generated/pow_i4_i4.c: Regenerate.
+       * generated/minloc1_8_r4.c: Regenerate.
+       * generated/sum_c8.c: Regenerate.
+       * generated/count_8_l16.c: Regenerate.
+       * generated/minloc1_16_i2.c: Regenerate.
+       * generated/maxloc1_16_i2.c: Regenerate.
+       * generated/in_pack_i8.c: Regenerate.
+       * generated/transpose_r16.c: Regenerate.
+       * generated/maxval_i16.c: Regenerate.
+       * generated/exponent_r8.c: Regenerate.
+       * generated/matmul_i16.c: Regenerate.
+       * generated/count_4_l8.c: Regenerate.
+       * generated/pow_c8_i16.c: Regenerate.
+       * generated/maxval_i1.c: Regenerate.
+       * generated/minloc1_4_i4.c: Regenerate.
+       * generated/minloc1_8_i2.c: Regenerate.
+       * generated/pow_c10_i16.c: Regenerate.
+       * generated/product_c16.c: Regenerate.
+       * generated/reshape_r4.c: Regenerate.
+       * generated/in_unpack_c8.c: Regenerate.
+       * generated/minloc0_8_r8.c: Regenerate.
+       * generated/matmul_l8.c: Regenerate.
+       * generated/product_r10.c: Regenerate.
+       * generated/set_exponent_r16.c: Regenerate.
+       * generated/cshift1_16.c: Regenerate.
+       * generated/product_i1.c: Regenerate.
+       * generated/all_l8.c: Regenerate.
+       * generated/maxloc0_4_i1.c: Regenerate.
+       * generated/rrspacing_r16.c: Regenerate.
+       * generated/minloc0_4_i8.c: Regenerate.
+       * generated/pow_r4_i16.c: Regenerate.
+       * generated/count_16_l4.c: Regenerate.
+       * generated/maxval_r4.c: Regenerate.
+
+2007-08-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33225
+       * io/write.c: Revert changes from patch of 2007-08-27.
+       * io/write_float.def: Remove file, reverting addition.
+
+2007-08-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * runtime/memory.c (internal_realloc, allocate, allocate_array,
+       deallocate): Remove functions.
+       * gfortran.map (_gfortran_allocate, _gfortran_allocate_array,
+       _gfortran_deallocate, _gfortran_internal_realloc): Remove symbols.
+       * libgfortran.h (error_codes): Add comment.
+
+2007-08-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33055
+       Revert previous patch.
+
+2007-08-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/write.c (stdbool.h): Add include. (sign_t): Move typedef to
+       new file write_float.def. Include write_float.def.
+       (extract_real): Delete. (calculate_sign): Delete.
+       (calculate_exp): Delete. (calculate_G_format): Delete.
+       (output_float): Delete. (write_float): Delete.
+       * io/write_float.def (calculate_sign): Added.
+       (output_float): Refactored to be independent of kind and added to this
+       file for inclusion. (write_infnan): New function to write "Infinite"
+       or "NaN" depending on flags passed, independent of kind.
+       (CALCULATE_EXP): New macro to build kind specific functions. Use it.
+       (OUTPUT_FLOAT_FMT_G): New macro, likewise. Use it.
+       (DTOA, DTOAL): Macros to implement "decimal to ascii".
+       (WRITE_FLOAT): New macro for kind specific write_float functions.
+       (write_float): Revised function to determine kind and use WRITE_FLOAT
+       to implement kind specific output.
+
+2007-08-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33055
+       * io/inquire.c (inquire_via_unit):  If inquiring by unit, check for 
+       an error condition from the IOSTAT variable and set EXIST to false if
+       there was a bad unit number.
+
+2007-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/32972
+       * libgfortran.h:  Remove GFOR_POINTER_L8_TO_L4 macro.
+       Add GFOR_POINTER_TO_L1 macro.
+       * m4/iforeach.m4(`m'name`'rtype_qual`_'atype_code):
+       Change argument 'mask' to gfc_array_l1.  Adjust prototype.
+       Change mask pointer to GFC_LOGICAL_1.  Multiply strides
+       by kind of mask
+       * m4/ifunction.m4:  Likewise.
+       * intrinsics/pack_generic.c(pack_internal):  Likewise.
+       * intrinsics/unpack_generic.c(unpack_internal):  Likewise.
+       * m4/matmull.m4:  Switch to GFC_LOGICAL_1.  Multiply strides by
+       kind of logical arguments a and b.
+       * generated/matmul_l16.c: Regenerated.
+       * generated/matmul_l4.c: Regenerated.
+       * generated/matmul_l8.c: Regenerated.
+       * generated/maxloc0_16_i1.c: Regenerated.
+       * generated/maxloc0_16_i16.c: Regenerated.
+       * generated/maxloc0_16_i2.c: Regenerated.
+       * generated/maxloc0_16_i4.c: Regenerated.
+       * generated/maxloc0_16_i8.c: Regenerated.
+       * generated/maxloc0_16_r10.c: Regenerated.
+       * generated/maxloc0_16_r16.c: Regenerated.
+       * generated/maxloc0_16_r4.c: Regenerated.
+       * generated/maxloc0_16_r8.c: Regenerated.
+       * generated/maxloc0_4_i1.c: Regenerated.
+       * generated/maxloc0_4_i16.c: Regenerated.
+       * generated/maxloc0_4_i2.c: Regenerated.
+       * generated/maxloc0_4_i4.c: Regenerated.
+       * generated/maxloc0_4_i8.c: Regenerated.
+       * generated/maxloc0_4_r10.c: Regenerated.
+       * generated/maxloc0_4_r16.c: Regenerated.
+       * generated/maxloc0_4_r4.c: Regenerated.
+       * generated/maxloc0_4_r8.c: Regenerated.
+       * generated/maxloc0_8_i1.c: Regenerated.
+       * generated/maxloc0_8_i16.c: Regenerated.
+       * generated/maxloc0_8_i2.c: Regenerated.
+       * generated/maxloc0_8_i4.c: Regenerated.
+       * generated/maxloc0_8_i8.c: Regenerated.
+       * generated/maxloc0_8_r10.c: Regenerated.
+       * generated/maxloc0_8_r16.c: Regenerated.
+       * generated/maxloc0_8_r4.c: Regenerated.
+       * generated/maxloc0_8_r8.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc0_16_i1.c: Regenerated.
+       * generated/minloc0_16_i16.c: Regenerated.
+       * generated/minloc0_16_i2.c: Regenerated.
+       * generated/minloc0_16_i4.c: Regenerated.
+       * generated/minloc0_16_i8.c: Regenerated.
+       * generated/minloc0_16_r10.c: Regenerated.
+       * generated/minloc0_16_r16.c: Regenerated.
+       * generated/minloc0_16_r4.c: Regenerated.
+       * generated/minloc0_16_r8.c: Regenerated.
+       * generated/minloc0_4_i1.c: Regenerated.
+       * generated/minloc0_4_i16.c: Regenerated.
+       * generated/minloc0_4_i2.c: Regenerated.
+       * generated/minloc0_4_i4.c: Regenerated.
+       * generated/minloc0_4_i8.c: Regenerated.
+       * generated/minloc0_4_r10.c: Regenerated.
+       * generated/minloc0_4_r16.c: Regenerated.
+       * generated/minloc0_4_r4.c: Regenerated.
+       * generated/minloc0_4_r8.c: Regenerated.
+       * generated/minloc0_8_i1.c: Regenerated.
+       * generated/minloc0_8_i16.c: Regenerated.
+       * generated/minloc0_8_i2.c: Regenerated.
+       * generated/minloc0_8_i4.c: Regenerated.
+       * generated/minloc0_8_i8.c: Regenerated.
+       * generated/minloc0_8_r10.c: Regenerated.
+       * generated/minloc0_8_r16.c: Regenerated.
+       * generated/minloc0_8_r4.c: Regenerated.
+       * generated/minloc0_8_r8.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+       
+2007-08-23  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/23138
+       * acinclude.m4 (LIBGFOR_CHECK_MINGW_SNPRINTF): New check.
+       * configure.ac: Use LIBGFOR_CHECK_MINGW_SNPRINTF.
+       * libgfortran.h: If HAVE_MINGW_SNPRINTF is true, use __mingw_snprintf
+       instead of snprintf.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2007-08-22  Bernhard Fischer  <rep.dot.nop@gmail.com>
+
+       * libgfortran/Makefile.am (AM_CPPFLAGS): Commentary typo fix.
+
+2007-08-17  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/33079
+       * intrinsics/string_intrinsics.c (string_trim, string_minmax): Fix
+       the zero-length result case.
+
+2007-08-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/33077
+       * intrinsics/random.c (random_seed_i8): Fix code logic.
+
+2007-08-13  Danny Smith  <dannysmit@users.sourceforge.net>
+
+       * acinclude.m4 (GTHREAD_USE_WEAK) Define to 0 for mingw32.
+       * configure: Regenerate.
+
+2007-08-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/30964
+       PR fortran/33054
+       * intrinsics/random.c (random_seed): Rename into random_seed_i4.
+       (random_seed_i8): New function.
+       * gfortran.map (GFORTRAN_1.0): Remove _gfortran_random_seed,
+       add _gfortran_random_seed_i4 and _gfortran_random_seed_i8.
+       * libgfortran.h (iexport_proto): Replace random_seed by
+       random_seed_i4 and random_seed_i8.
+       * runtime/main.c (init): Call the new random_seed_i4.
+
+2007-08-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+           Tobias Burnus  <burnus@gcc.gnu.org>
+
+       PR fortran/31189
+       * runtime/backtrace.c (show_backtrace): Skip _gfortrani_handler
+       when displaying backtrace.
+       * runtime/compile_options.c: Include <signal.h>.
+       (handler): New function.
+       (set_options): Set signal handlers for backtrace.
+       * libgfortran.h (handler): Add prototype.
+
+2007-08-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * intrinsics/string_intrinsics.c (compare_string): Return an int.
+       * libgfortran.h (compare_string): Likewise.
+
+2007-08-10  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/31270
+       * runtime/error.c (runtime_error_at): Add a variable number of
+       arguments.
+       * libgfortran.h (runtime_error_at): Update prototype.
+
+2007-08-10  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/32933
+       * intrinsics/associated.c: Change return type of associated into
+       a C int.
+
+2007-08-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33039
+       * io/list_read.c (find_nml_name): Check for a space after a namelist
+       name match.
+
+2007-08-09  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/32987
+       * io/format.c (next_char): Treat '\t' as ' ' in format specification.
+
+2007-08-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/30947
+       * intrinsics/signal.c: Create specific versions of alarm_sub and
+       alarm_sub_int according to the integer kind of the last argument.
+       * gfortran.map (GFORTRAN_1.0): Remove _gfortran_alarm_sub and
+       _gfortran_alarm_sub_int, add _gfortran_alarm_sub_i4,
+       _gfortran_alarm_sub_i8, _gfortran_alarm_sub_int_i4 and
+       _gfortran_alarm_sub_int_i8.
+
+2007-08-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/29828
+       * intrinsics/string_intrinsics.c (string_minmax): New function
+       and prototype.
+       * gfortran.map (GFORTRAN_1.0): Add _gfortran_string_minmax
+
+2007-08-05  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/31202
+       * intrinsics/c99_functions.c (roundl): Provide fallback
+       implementation for systems without ceill.
+       * c99_protos.h (roundl): Define prototype in all cases.
+
+2007-08-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32977
+       * io/unix.c:  If there is no vsnprintf, use vsprintf and issue
+       a fatal error when a buffer overrun occurs.
+
+2007-08-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/31202
+       * intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
+       llroundf,llround,llroundl): New functions.
+       * c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
+       llroundl): New prototypes.
+       * configure.ac: Check for lroundf, lround, lroundl, llroundf,
+       llround and llroundl.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+       * config.h.in: Regenerate.
+
+2007-07-30  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * libgfortran.h: Include <stdarg.h>.
+
+2007-07-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32858
+       PR libfortran/30814
+       * configure.ac:  Added checks for presence of stdio.h and
+       stdarg.h.  Test presence of vsnprintf().
+       * configure: Regenerated.
+       * config.h.in:  Regenerated.
+       * libgfortran.h:  Include <stdio.h>.  Add printf attribute to
+       prototype of runtime_error.  Remove prototype for st_sprintf.
+       Add prototype for st_vprintf.
+       * runtime/main.c (store_exec_path):  Replace st_sprintf by sprintf.
+       * runtime/error.c (st_sprintf):  Remove.
+       (runtime_error):  Rewrite as a variadic function.  Call
+       st_vprintf().
+       * intrinsics/pack_generic.c:  Output extents of LHS and RHS for
+       bounds error.
+       * io/open.c (new_unit):  Replace st_sprintf by sprintf.
+       * io/list_read.c (convert_integer):  Likewise.
+       (parse_repeat):  Likewise.
+       (read_logical):  Likewise.
+       (read_character):  Likewise.
+       (parse_real):  Likewise.
+       (read_real):  Likewise.
+       (check_type):  Likewise.
+       (nml_parse_qualifyer):  Likewise.
+       (nml_read_obj):  Likewise.
+       (nml_get_ojb_data):  Likewise.
+       * io/unix.c (init_error_stream):  Remove.
+       (tempfile):  Replace st_sprintf by sprintf.
+       (st_vprintf):  New function.
+       (st_printf):  Rewrite to call st_vprintf.
+       * io/transfer.c (require_type):  Replace st_sprintf by sprintf.
+       * io/format.c (format_error):  Likewise.
+       * io/write.c (nml_write_obj):  Likewise.
+
+2007-07-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/transfer.c (st_set_nml_var_dim): Use index_type instead of
+       GFC_INTEGER_4 for array descriptor triplets.
+
+2007-07-27  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * io/unix.c (stream_ttyname): Mark argument as potentialy unused.
+
+2007-07-27  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/32035
+       * runtime/select.c (select_string): Adjust prototype and function
+       so that the return value is an integer, not a pointer.
+
+2007-07-24  Tobias Burnus  <burnus@net-b.de>
+
+       * libgfortran.h:  Add bounds_check to compile_options_t.
+
+2007-07-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/30814
+       * libgfortran.h:  Add bounds_check to compile_options_t.
+       * runtime/compile_options.c (set_options):  Add handling
+       of compile_options.bounds_check.
+       * intrinsics/pack_generic.c (pack_internal):  Also determine
+       the number of elements if compile_options.bounds_check is
+       true.  Raise runtime error if a different array shape is
+       detected.
+
+2007-07-23  Christopher D. Rickett  <crickett@lanl.gov>
+
+       PR fortran/32600
+       * intrinsics/iso_c_binding.c (c_funloc): Remove.
+       * intrinsics/iso_c_binding.h: Remove c_funloc.
+       * gfortran.map: Ditto.
+
+2007-07-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/read.c (convert_real): Generate error only on EINVAL.
+
+2007-07-21  Christopher D. Rickett  <crickett@lanl.gov>
+
+       PR fortran/32627
+       * libgfortran/intrinsics/iso_c_generated_procs.c: Add c_f_pointer
+       for character/string arguments.
+       * libgfortran/intrinsic/iso_c_binding.c (c_f_pointer_u0): Allow
+       the optional SHAPE arg to be any valid integer kind.
+       * libgfortran/gfortran.map: Add c_f_pointer_s0.
+       * libgfortran/mk-kinds-h.sh: Save smallest integer kind as default
+       character kind.
+       * libgfortran/intrinsics/iso_c_generated_procs.c: Add versions of
+       c_f_pointer for complex and logical types.
+       * libgfortran/gfortran.map: Add c_f_pointer versions for logical
+       and complex types.
+
+2007-07-19  Christopher D. Rickett  <crickett@lanl.gov>
+
+       PR fortran/32600
+       * libgfortran/intrinsics/iso_c_binding.c: Remove C_LOC.
+       * libgfortran/intrinsics/iso_c_binding.h: Ditto.
+       * libgfortran/gfortran.map: Ditto.
+
+2007-07-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+           Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/32611
+       * runtime/compile_options.c (set_std): Remove.
+       (set_options): New function.
+       (init_compile_options): Add initialization for -fsign-zero option.
+       * gfortran.map (GFORTRAN_1.0): Rename _gfortran_set_std into
+       _gfortran_set_options.
+       * libgfortran.h (compile_options_t): Add sign_zero field.
+       * io/write.c (output_float): Use the sign bit of the value to determine
+       if a negative sign should be emitted for zero values.  Do not emit the
+       negative sign for zero if -fno-sign-zero was set during compile.
+       
+2007-07-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32752
+       * io/unix.c (unix_stream): Move buffer pointer adjacent to
+       small_buffer.
+       * io/transfer.c (formatted_transfer_scalar): If stream I/O, set
+       bytes_used to zero. Fix off by one error in calculation of pos and
+       skips. Eliminate duplicate pending_spaces check.
+
+2007-07-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/32357
+       * intrinsics/mvbits.c: Change prototype so that FROMPOS, LEN and
+       TOPOS arguments are C int.
+
+2007-07-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32702
+       * io/unix.c (unix_stream): Restore buffer pointer and small_buffer.
+       (fd_alloc): If the number of bytes needed is greater than the default
+       BUFFER_SIZE, allocate a new buffer large enough.  Free the old buffer
+       if necessary. (fd_sfree): Restore use of buffer pointer.
+       (fd_close): Likewise. (fd_open): Likewise.
+       (init_error_stream): Likewise.
+       
+2007-07-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32336
+       * m4/matmul.m4:  When the dimension of b is incorrect,
+       raise a runtime error instead of a failed assertion.
+       * generated/matmul_i1.c:  Regenerated.
+       * generated/matmul_i2.c:  Regenerated.
+       * generated/matmul_i4.c:  Regenerated.
+       * generated/matmul_i8.c:  Regenerated.
+       * generated/matmul_i16.c:  Regenerated.
+       * generated/matmul_r4.c:  Regenerated.
+       * generated/matmul_r8.c:  Regenerated.
+       * generated/matmul_r10.c:  Regenerated.
+       * generated/matmul_r16.c:  Regenerated.
+
+2007-07-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32678
+       * io/transfer.c (formatted_transfer_scalar): Don't allow
+       pending_spaces to go negative.
+
+2007-07-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32217
+       * intrinsics/unpack_generic.c:  If the destination array is
+       empty, return early.
+
+2007-07-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * aclocal.m4: Regenerated.
+
+2007-07-04  David Edelsohn  <edelsohn@gnu.org>
+
+       * configure.ac: SUBST CFLAGS.
+       * configure: Regenerate.
+
+2007-07-03  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * libgfortran.h: Mark internal_malloc_size as a malloc function.
+       * runtime/memory.c (internal_realloc_size): Remove.
+       (internal_realloc): Call realloc directly instead of
+       internal_realloc_size.
+       (allocate_size): Remove.
+       (allocate): Call malloc directly instead of allocate_size, mark as
+       malloc function.
+
+2007-07-02  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       Restore collateral damage from ISO C Binding merge.
+
+2007-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32456
+       * io/unit.c (filename_from_unit): Don't use find_unit, instead search
+       for unit directly.
+
+2007-07-02  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * Makefile.in:  Regenerated with automake 1.9.6.
+
+2007-07-02  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * Makefile.in:  Remove extraneous kill.lo rule.
+
+2007-07-02  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR fortran/32239
+       * generated/pow_r*_i4.c: Removed.
+
+2007-07-01  Christopher D. Rickett  <crickett@lanl.gov>
+
+       * Makefile.in: Add support for iso_c_generated_procs.c and
+       iso_c_binding.c.
+       * Makefile.am: Ditto.
+       * intrinsics/iso_c_generated_procs.c: New file containing helper
+       functions.
+       * intrinsics/iso_c_binding.c: Ditto.
+       * intrinsics/iso_c_binding.h: New file
+       * gfortran.map: Include the __iso_c_binding_c_* functions.
+       * libgfortran.h: define GFC_NUM_RANK_BITS.
+
+2007-07-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR fortran/32239
+       * Makefile.am: Don't generate real**int4 pow functions.
+       * gfortran.map: Remove real**int4 pow symbols.
+       * Makefile.in: Regenerated.
+
+2007-07-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32554
+       * io/write.c (output_float): Set edigits to a fixed size, avoiding
+       variation in field width calculation and eliminate buffer overrun.
+
+2007-07-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * runtime/memory.c (internal_realloc): Use index_type for size
+       argument instead of GFC_INTEGER_4.
+       (allocate_array): Likewise.
+       (allocate): Likewise, add ifdef around unnecessary check.
+       (internal_reallo64): Remove.
+       (allocate_array64): Remove.
+       (allocate64): Remove.
+       * gfortran.map: Remove symbols for 64-bit allocation functions.
+
+2007-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32456
+       * io/unit.c (filename_from_unit): Don't use find_unit, instead search
+       for unit directly.
+
+2007-06-24  Adam Nemet  <anemet@caviumnetworks.com>
+
+       PR libfortran/32495
+       * runtime/backtrace.c (local_strcasestr): Rename from strcasestr.
+       (show_backtrace): Rename strcasestr to local_strcasestr.
+
+2007-06-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32456
+       * runtime/error.c (show_locus): Update to emit the unit number
+       and file name involved with the error.  Use new function
+       filename_from_unit.
+       * libgfortran.h (filename_from_unit): Declare new function.
+       * io/unit.c (init_units): Set the unit file name for stdin, stdout,
+       and stderr for use later in error reporting.
+       (filename_from_unit): Add this new function.
+
+2007-06-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32446
+       * io/write.c (output_float): Calculate ndigits correctly for large
+       numbered formats that must pad zeros before the decimal point.
+
+2007-06-15  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+       PR libfortran/32345
+       * runtime/backtrace.c (show_backtrace): Only use snprintf if
+       available.
+
+2007-06-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32235
+       * io/transfer.c (st_read): Remove test for end of file condition.
+       (next_record_r): Add test for end of file condition.
+
+2007-06-02  Paolo Bonzini  <bonzini@gnu.org>
+
+       * configure: Regenerate.
+
+2007-05-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/32124
+       * runtime/memory.c (allocate_size): Use ERROR_ALLOCATION.
+       (allocate,allocate64): Use stat variable if present.
+
+2007-05-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * runtime/string.c (compare0): Use gfc_charlen_type instead of
+       int.
+       (fstrlen): Likewise.
+       (find_option): Likewise.
+       (fstrcpy): Use gfc_charlen_type instead of int, return length.
+       (cf_strcpy): Likewise.
+       * libgfortran.h: Change string prototypes to use gfc_charlen_type.
+       * io/open.c (new_unit): Use snprintf if available.
+       * io/list_read.c (nml_touch_nodes): Use memcpy instead of
+       strcpy/strcat.
+       (nml_read_obj): Likewise.
+       * io/transfer.c (st_set_nml_var): Likewise.
+       * io/write.c (output_float): Use snprintf if available.
+       (nml_write_obj) Use memcpy instead of strcpy/strcat.
+
+2007-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.c (unix_stream): Rearrange struct members, remove
+       small_buffer.
+       (int_stream): New struct.
+       (fd_alloc): Always use existing buffer, never reallocate.
+       (fd_sfree): Remove check for buffer != small_buffer.
+       (fd_close): Likewise.
+       (mem_alloc_r_at): Change to use int_stream.
+       (mem_alloc_w_at): Likewise.
+       (mem_read): Likewise.
+       (mem_write): Likewise.
+       (mem_set): Likewise.
+       (mem_truncate): Likewise.
+       (mem_close): Likewise.
+       (mem_sfree): Likewise.
+       (empty_internal_buffer): Likewise.
+       (open_internal): Likewise.
+       
+2007-05-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/transfer.c (unformatted_read): Use size from front end
+       eliminating use of size_from_real_kind.
+       (unformatted_write): Ditto.
+
+2007-05-23  Steve Ellcey  <sje@cup.hp.com>
+
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+       * aclocal.m4: Regenerate.
+
+2007-05-22  Tobias Burnus  <burnus@net-b.de>
+
+       * libgfortran.h: Mark stop_numeric as noreturn.
+
+2007-05-22  Tobias Burnus  <burnus@net-b.de>
+
+       PR libgfortran/31295
+       * intrinsics/eoshift0.c (eoshift0): Silence uninitialized warning.
+       * intrinsics/eoshift2.c (eoshift2): Ditto.
+
+2007-05-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31964
+       * intrinsics/ishftc.c (ishftc4, ishftc8, ishftc16): Fix mask to handle
+       shift of bit-size number of bits.
+
+2007-05-17  Tobias Burnus <burnus@net-b.de>
+
+       PR fortran/31917
+       * runtime/environ.c (mark_range): Fix setting default convert unit.
+
+2007-05-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31922
+       * intrinsics/string_intrinsics.c (string_trim): Set result to null if
+       string length is zero.
+
+2007-05-15  Tobias Burnus  <burnus@net-b.de>
+
+       PR libfortran/31915
+       * io/transfer.c (unformatted_read): Use proper size for real(10).
+         (unformatted_write): Ditto.
+
+2007-05-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/30723
+       * runtime/memory.c (internal_malloc, internal_malloc64,
+       internal_free): Remove.
+       * runtime/error.c (os_error): Export function.
+       * intrinsics/move_alloc.c: Include stdlib.h.
+       (move_alloc): Call free instead of internal_free.
+       (move_alloc_c): Wrap long lines.
+       * libgfortran.h (os_error): Export prototype.
+       (internal_free): Remove prototype.
+       * gfortran.map (GFORTRAN_1.0): Remove _gfortran_internal_free,
+       _gfortran_internal_malloc and _gfortran_internal_malloc64.
+       Add _gfortran_os_error.
+
+2007-05-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31880
+       * io/unix.c (fd_alloc_r_at): Fix calculation of physical offset.
+
+2007-05-07  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/31607
+       * intrinsics/system.c (system_sub): Call flush_all_units.
+       * io/io.h (flush_all_units): Move prototype to libgfortran.h.
+       * libgfortran.h (flush_all_units): Add prototype.
+
+2007-05-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31201
+       * runtime/error.c (runtime_error_at): New function.
+       (generate_error): Export this function.
+       * gfortran.map: Add _gfortran_generate_error and
+       _gfortran_runtime_error_at.
+       * libgfortran.h: Add comment to reference error codes in front end.
+       (library_start): Locate prototype with library_end macro and add
+       a new comment.  Add prototype for runtime_error_at. Export prototype
+       for generate_error.
+       * io/lock.c (library_start): Fix check for error condition.
+       * io/transfer.c (data_transfer_init): Add library check.
+
+2007-05-04  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR fortran/22359
+       * io/intrinsics.c (fseek_sub): New.
+       * io/unix.c (fd_fseek): Change logical and physical offsets only
+       if seek succeeds.
+       * gfortran.map (fseek_sub): New.
+
+2007-05-04  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/31210
+       * io/transfer.c (transfer_character): Avoid passing a NULL
+       pointer as source to the transfer routines, if the string length
+       is zero.
+
+2007-04-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31501
+       * io/list_read.c (next_char): Fix whitespace.
+       * io/io.h: Remove prototypes and define macros for is_array_io,
+       is_stream_io, and is_internal_unit.
+       * io/unit.c (is_array_io), (is_internal_unit), (is_stream_io): Delete
+       these functions.
+       * io/transfer.c (read_sf): Change handling of internal_unit to make a
+       single call to salloc_r and use memcpy to transfer the data. 
+
+2007-04-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31532
+       * io/file_pos.c (st_backspace): Set flags.position for end of file
+       condition and use new function update_position.
+       (st_endfile): Use new function update_position.
+       * io/io.h: Add prototype for new function.
+       * io/inquire.c (inquire_via_unit): If not direct access, set NEXTREC
+       to zero.
+       * io/unit.c (update_position): New function to update position info
+       used by inquire.
+       * io/transfer.c (next_record): Fix typo and use new function.
+
+2007-04-25  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/31299
+       * intrinsics/getlog.c: Use getpwuid and geteuid instead of
+       getlogin if they are available.
+       * configure.ac: Add checks for getpwuid and geteuid.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2007-04-25  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * configure: Regenerate using autoconf 2.59.
+       * Makefile.in: Likewise.  
+       * config.h.in: Likewise.
+
+2007-04-24  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/27740
+       * configure.ac: New test to determine if symbol versioning is
+       supported.
+       * Makefile.am: Use result of above test to add appropriate linker
+       flags.
+       * gfortran.map: New file.
+       * configure: Regenerated.
+       * Makefile.in: Regenerated.
+       * config.h.in: Regenerated.
+
+2007-04-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/31618
+       * io/transfer.c (read_block_direct):  Instead of calling us_read,
+       set dtp->u.p.current_unit->current_record = 0 so that pre_position
+       will read the record marker.
+       (data_transfer_init):  For different error conditions, call
+       generate_error, then return.
+
+2007-04-19  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * runtime/main.c (please_free_exe_path_when_done): New variable.
+       (store_exe_path): Initialize character buffer, and mark whether
+       exe_path should be free'd by the library destructor function.
+       (cleanup): Only free exe_path if needed.
+
+2007-04-18  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+           Tobias Burnus  <burnus@net-b.de>
+
+       PR libfortran/31286
+       PR libfortran/31296
+       * intrinsics/cshift0.c (cshift0): Initialize sstride[0] and rstride[0].
+       * intrinsics/unpack_generic.c (unpack0, unpack0_char): Zero the
+       array structures we pass to unpack_internal.
+
+2007-04-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/open.c (test_endfile): Revert changes for 31052, restoring this
+       function. 
+
+2007-04-14  Steve Ellcey  <sje@cup.hp.com>
+
+       * Makefile.am: Add -I .. to ACLOCAL_AMFLAGS.  Add libgfortran_la_LINK.
+       * Makefile.in: Regenerate.
+
+2007-04-11  Kai Tietz  <kai.tietz@onevision.com>
+
+       * configure: Regenerate.
+
+2007-04-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * intrinsics/cpu_time.c: Don't include headers already included
+       by libgfortran.h. Protect inclusion of sys/times.h.
+       * configure.ac: Remove unneeded checks for finit, stdio.h,
+       stddef.h, math.h and sys/params.h.
+       * config/fpu-aix.h: Don't include headers already included by
+       libgfortran.h.
+       * config/fpu-sysv.h: Likewise.
+       * io/write.c: Likewise.
+       * m4/minloc1.m4: Likewise.
+       * m4/maxloc1.m4: Likewise.
+       * m4/fraction.m4: Likewise.
+       * m4/set_exponent.m4: Likewise.
+       * m4/spacing.m4: Likewise.
+       * m4/minval.m4: Likewise.
+       * m4/maxval.m4: Likewise.
+       * m4/exponent.m4: Likewise.
+       * m4/nearest.m4: Likewise.
+       * m4/minloc0.m4: Likewise.
+       * m4/maxloc0.m4: Likewise.
+       * m4/rrspacing.m4: Likewise.
+       * runtime/main.c: Likewise.
+       * runtime/error.c: Likewise.
+       * intrinsics/system_clock.c: Likewise.
+       * intrinsics/etime.c: Likewise.
+       * intrinsics/stat.c: Likewise.
+       * intrinsics/date_and_time.c: Likewise.
+       * intrinsics/env.c: Likewise.
+       * intrinsics/kill.c: Likewise.
+       * intrinsics/getXid.c: Likewise.
+       * intrinsics/chmod.c: Likewise.
+       * intrinsics/args.c: Likewise.
+       * intrinsics/c99_functions.c: Likewise.
+       * generated/minval_r8.c: Regenerate.
+       * generated/maxloc1_4_r8.c: Regenerate.
+       * generated/minloc1_16_r16.c: Regenerate.
+       * generated/maxval_i2.c: Regenerate.
+       * generated/maxloc1_8_i4.c: Regenerate.
+       * generated/exponent_r16.c: Regenerate.
+       * generated/maxloc0_4_r4.c: Regenerate.
+       * generated/fraction_r16.c: Regenerate.
+       * generated/fraction_r4.c: Regenerate.
+       * generated/minloc0_4_r16.c: Regenerate.
+       * generated/minloc0_4_i1.c: Regenerate.
+       * generated/maxloc0_4_r16.c: Regenerate.
+       * generated/maxloc0_4_i2.c: Regenerate.
+       * generated/minloc1_8_r16.c: Regenerate.
+       * generated/maxloc1_8_r16.c: Regenerate.
+       * generated/set_exponent_r8.c: Regenerate.
+       * generated/maxloc0_8_i8.c: Regenerate.
+       * generated/minloc1_4_r8.c: Regenerate.
+       * generated/maxloc1_16_r16.c: Regenerate.
+       * generated/minloc1_16_i4.c: Regenerate.
+       * generated/maxloc1_16_i4.c: Regenerate.
+       * generated/minloc0_16_i8.c: Regenerate.
+       * generated/maxloc0_16_i8.c: Regenerate.
+       * generated/nearest_r8.c: Regenerate.
+       * generated/spacing_r16.c: Regenerate.
+       * generated/maxval_r16.c: Regenerate.
+       * generated/minloc1_8_i4.c: Regenerate.
+       * generated/minloc0_16_i16.c: Regenerate.
+       * generated/minloc0_4_r4.c: Regenerate.
+       * generated/set_exponent_r10.c: Regenerate.
+       * generated/rrspacing_r10.c: Regenerate.
+       * generated/minloc0_4_i2.c: Regenerate.
+       * generated/maxloc0_8_i1.c: Regenerate.
+       * generated/minloc0_8_i8.c: Regenerate.
+       * generated/spacing_r4.c: Regenerate.
+       * generated/minloc1_16_r10.c: Regenerate.
+       * generated/minloc0_16_i1.c: Regenerate.
+       * generated/maxloc0_16_i1.c: Regenerate.
+       * generated/maxloc1_8_r8.c: Regenerate.
+       * generated/minval_i16.c: Regenerate.
+       * generated/exponent_r10.c: Regenerate.
+       * generated/maxval_i4.c: Regenerate.
+       * generated/minval_i8.c: Regenerate.
+       * generated/maxloc1_4_i8.c: Regenerate.
+       * generated/fraction_r10.c: Regenerate.
+       * generated/maxloc0_16_i16.c: Regenerate.
+       * generated/maxloc0_8_r4.c: Regenerate.
+       * generated/rrspacing_r8.c: Regenerate.
+       * generated/minloc1_4_i16.c: Regenerate.
+       * generated/minloc0_4_r10.c: Regenerate.
+       * generated/maxloc1_4_i16.c: Regenerate.
+       * generated/minloc0_8_i16.c: Regenerate.
+       * generated/maxloc0_4_r10.c: Regenerate.
+       * generated/maxloc0_8_i16.c: Regenerate.
+       * generated/minloc1_8_r10.c: Regenerate.
+       * generated/minloc0_16_r4.c: Regenerate.
+       * generated/maxloc1_8_r10.c: Regenerate.
+       * generated/maxloc0_16_r4.c: Regenerate.
+       * generated/minloc1_16_r8.c: Regenerate.
+       * generated/minloc0_8_i1.c: Regenerate.
+       * generated/maxloc0_4_i4.c: Regenerate.
+       * generated/maxloc1_16_r8.c: Regenerate.
+       * generated/maxloc0_8_i2.c: Regenerate.
+       * generated/nearest_r16.c: Regenerate.
+       * generated/maxloc1_16_r10.c: Regenerate.
+       * generated/minloc0_16_i2.c: Regenerate.
+       * generated/minloc1_8_r8.c: Regenerate.
+       * generated/maxloc0_16_i2.c: Regenerate.
+       * generated/exponent_r4.c: Regenerate.
+       * generated/spacing_r10.c: Regenerate.
+       * generated/maxval_r10.c: Regenerate.
+       * generated/minval_i1.c: Regenerate.
+       * generated/maxloc1_4_i1.c: Regenerate.
+       * generated/minloc1_4_i8.c: Regenerate.
+       * generated/minloc0_8_r4.c: Regenerate.
+       * generated/minloc0_16_r16.c: Regenerate.
+       * generated/minloc0_4_i4.c: Regenerate.
+       * generated/minloc0_8_i2.c: Regenerate.
+       * generated/minval_r4.c: Regenerate.
+       * generated/maxloc1_4_r4.c: Regenerate.
+       * generated/maxval_r8.c: Regenerate.
+       * generated/minval_r16.c: Regenerate.
+       * generated/minloc1_4_i1.c: Regenerate.
+       * generated/minval_i2.c: Regenerate.
+       * generated/maxloc1_4_i2.c: Regenerate.
+       * generated/maxloc1_8_i8.c: Regenerate.
+       * generated/maxloc0_4_r8.c: Regenerate.
+       * generated/maxloc0_16_r16.c: Regenerate.
+       * generated/minloc1_4_r16.c: Regenerate.
+       * generated/fraction_r8.c: Regenerate.
+       * generated/maxloc1_4_r16.c: Regenerate.
+       * generated/set_exponent_r4.c: Regenerate.
+       * generated/minloc0_8_r16.c: Regenerate.
+       * generated/maxloc0_8_r16.c: Regenerate.
+       * generated/nearest_r10.c: Regenerate.
+       * generated/maxloc0_8_i4.c: Regenerate.
+       * generated/minloc1_4_r4.c: Regenerate.
+       * generated/minloc0_16_i4.c: Regenerate.
+       * generated/maxloc0_16_i4.c: Regenerate.
+       * generated/nearest_r4.c: Regenerate.
+       * generated/minloc1_16_i8.c: Regenerate.
+       * generated/maxloc1_16_i8.c: Regenerate.
+       * generated/minloc1_4_i2.c: Regenerate.
+       * generated/maxloc1_8_i1.c: Regenerate.
+       * generated/minloc0_16_r10.c: Regenerate.
+       * generated/minloc1_8_i8.c: Regenerate.
+       * generated/minloc0_4_r8.c: Regenerate.
+       * generated/minloc0_8_i4.c: Regenerate.
+       * generated/minloc1_16_i16.c: Regenerate.
+       * generated/spacing_r8.c: Regenerate.
+       * generated/maxloc1_8_r4.c: Regenerate.
+       * generated/minloc1_16_i1.c: Regenerate.
+       * generated/maxloc1_16_i1.c: Regenerate.
+       * generated/minval_r10.c: Regenerate.
+       * generated/minval_i4.c: Regenerate.
+       * generated/minloc1_8_i1.c: Regenerate.
+       * generated/maxloc1_4_i4.c: Regenerate.
+       * generated/maxloc1_8_i2.c: Regenerate.
+       * generated/maxval_i8.c: Regenerate.
+       * generated/maxloc0_16_r10.c: Regenerate.
+       * generated/rrspacing_r4.c: Regenerate.
+       * generated/minloc0_4_i16.c: Regenerate.
+       * generated/maxloc0_8_r8.c: Regenerate.
+       * generated/maxloc0_4_i16.c: Regenerate.
+       * generated/minloc1_4_r10.c: Regenerate.
+       * generated/minloc1_8_i16.c: Regenerate.
+       * generated/maxloc1_4_r10.c: Regenerate.
+       * generated/minloc0_8_r10.c: Regenerate.
+       * generated/maxloc1_8_i16.c: Regenerate.
+       * generated/maxloc0_8_r10.c: Regenerate.
+       * generated/minloc1_16_r4.c: Regenerate.
+       * generated/maxloc1_16_r4.c: Regenerate.
+       * generated/minloc0_16_r8.c: Regenerate.
+       * generated/maxloc0_16_r8.c: Regenerate.
+       * generated/maxloc0_4_i8.c: Regenerate.
+       * generated/maxloc1_16_i16.c: Regenerate.
+       * generated/minloc1_8_r4.c: Regenerate.
+       * generated/minloc1_16_i2.c: Regenerate.
+       * generated/maxloc1_16_i2.c: Regenerate.
+       * generated/maxval_i16.c: Regenerate.
+       * generated/exponent_r8.c: Regenerate.
+       * generated/minloc1_4_i4.c: Regenerate.
+       * generated/maxval_i1.c: Regenerate.
+       * generated/minloc1_8_i2.c: Regenerate.
+       * generated/minloc0_8_r8.c: Regenerate.
+       * generated/set_exponent_r16.c: Regenerate.
+       * generated/maxloc0_4_i1.c: Regenerate.
+       * generated/rrspacing_r16.c: Regenerate.
+       * generated/minloc0_4_i8.c: Regenerate.
+       * generated/maxval_r4.c: Regenerate.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2007-04-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31395
+       * io/format.c (parse_format_list): Fix parsing.
+
+2007-04-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/31304
+       intrinsics/string_intrinsics.c (string_repeat): Remove.
+
+2007-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31052
+       * io/open.c (test_endfile): Delete this function.
+       (edit_modes): Delete call to test_endfile.
+       (new_unit): Likewise.
+       * io/io.h: Delete prototype for test_endfile.
+       * io/transfer.c (next_record_r): Remove use of test_endfile.
+       (st_read):  Add test for end file condition and adjust status. 
+
+2007-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31366
+       * io/transfer.c (read_block_direct): Do not generate error when reading
+       past EOF on a short record that is less than the RECL= specified.
+       
+2007-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31207
+       * io/unit.c (close_unit_1): If there are bytes previously written from
+       ADVANCE="no", move to the end before closing.
+
+2007-03-31  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/31335
+       * intrinsics/stat.c: Only provide STAT and FSTAT library routines
+       if stat() and fstat() library functions are available. When lstat()
+       is not available, use stat() instead.
+       * configure.ac: Add checks for stat, fstat and lstat.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2007-03-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31052
+       * io/transfer.c (next_record_r): Do not call test_endfile if in
+       namelist mode.
+
+2007-03-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31199
+       * io/io.h: Add saved_pos to gfc_unit structure.
+       * io/open.c (new_unit): Initialize saved_pos.
+       * io/transfer.c (data_transfer_init): Set max_pos to value in
+       saved_pos.
+       (next_record_w): Fix whitespace.
+       (finalze_transfer): Calculate max_pos for ADVANCE="no" and save it for
+       later use.  If not ADVANCE="no" set saved_pos to zero.
+
+2007-03-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/31196
+       * intrinsics/reshape_generic.c (reshape_internal):  Increment
+       correct variable.
+
+2007-03-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31052
+       * file_pos.c: Update Copyright year.
+       * io/open.c (test_endfile): Restore test_endfile to fix SPEC
+       regression.  Update Copyright year.
+       * io/io.h: Same.
+       * io/unix.c (is_special): Add missing type for this function.
+       Update Copyright year.
+       * io/transfer.c (next_record_r): Restore test_endfile.
+       (st_read): Fix whitespace.  Update Copyright year
+
+2007-03-20  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * configure.ac: Add missing check for gettimeofday.
+       * config.h.in: Renegerate.
+       * configure: Regenerate.
+
+2007-03-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31052
+       * io/file_position (st_rewind): Fix comments. Remove use of
+       test_endfile. Don't seek if already at 0 position.  Use new is_special
+       function to set endfile state.
+       * io/open.c (test_endfile): Delete this function.
+       * io/io.h: Delete prototype for test_endfile.  Add prototype
+       for is_special.
+       * io/unix.c (is_special): New function. Fix whitespace.
+       * io/transfer.c (next_record_r): Remove use of test_endfile.
+
+2007-03-16  David Edelsohn  <edelsohn@gnu.org>
+
+       * runtime/main.c: Include "config.h" first.
+
+2007-03-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31099
+       * io/file_pos.c (st_rewind): Don't set bytes_left to zero.
+
+2007-03-15  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * runtime/backtrace.c: New file.
+       * runtime/environ.c (variable_table): New GFORTRAN_ERROR_BACKTRACE
+       environment variable.
+       * runtime/compile_options.c (set_std): Add new argument.
+       * runtime/main.c (store_exe_path, full_exe_path): New functions.
+       * runtime/error.c (sys_exit): Add call to show_backtrace.
+       * libgfortran.h (options_t): New backtrace field.
+       (store_exe_path, full_exe_path, show_backtrace): New prototypes.
+       * configure.ac: Add checks for execinfo.h, execvp, pipe, dup2,
+       close, fdopen, strcasestr, getrlimit, backtrace, backtrace_symbols
+       and getppid.
+       * Makefile.am: Add runtime/backtrace.c.
+       * fmain.c (main): Add call to store_exe_path.
+       * Makefile.in: Renegerate.
+       * config.h.in: Renegerate.
+       * configure: Regenerate.
+
+2007-03-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31051
+       * io/transfer.c (formatted_transfer_scalar): Adjust position for
+       pending spaces when in writing mode.  Clean up some formatting.
+
+2007-03-14  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/30690
+       * all.m4: Quote everything, except for m4 macros.
+       * any.m4: Likewise.
+       * count.m4: Likewise.
+       * cshift1.m4: Likewise.
+       * eoshift1.m4: Likewise.
+       * eoshift3.m4: Likewise.
+       * exponent.m4: Likewise.
+       * fraction.m4: Likewise.
+       * in_pack.m4: Likewise.
+       * in_unpack.m4: Likewise.
+       * matmul.m4: Likewise.
+       * matmull.m4: Likewise.
+       * nearest.m4: Likewise.
+       * pow.m4: Likewise.
+       * product.m4: Likewise.
+       * reshape.m4: Likewise.
+       * rrspacing.m4: Likewise.
+       * set_exponent.m4: Likewise.
+       * shape.m4: Likewise.
+       * spacing.m4: Likewise.
+       * transpose.m4: Likewise.
+
+2007-03-14  Jakub Jelinek  <jakub@redhat.com>
+
+       * io/unix.c (regular_file): For ACTION_UNSPECIFIED retry with
+       O_RDONLY even if errno is EROFS.
+
+2007-03-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/31099
+       * io/open.c (new_unit): Initialize bytes_left and recl_subrecord.
+       * io/transfer.c (next_record_w): Set bytes left to record length for
+       sequential unformatted I/O.
+       (next_record_r): Ditto.
+       (read_block_direct): Fix test for exceeding bytes_left.
+
+2007-03-08  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR fortran/30947
+       * intrinsics/signal.c (alarm_sub_int): Avoid SEGFAULT with 
+       integer arguments.
+
+2007-03-04  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/30981
+       * m4/pow_m4: Use appropriate unsigned int type for u.
+       * generated/pow_c10_i16.c: Regenerated.
+       * generated/pow_c10_i4.c: Regenerated.
+       * generated/pow_c10_i8.c: Regenerated.
+       * generated/pow_c16_i16.c: Regenerated.
+       * generated/pow_c16_i4.c: Regenerated.
+       * generated/pow_c16_i8.c: Regenerated.
+       * generated/pow_c4_i16.c: Regenerated.
+       * generated/pow_c4_i4.c: Regenerated.
+       * generated/pow_c4_i8.c: Regenerated.
+       * generated/pow_c8_i16.c: Regenerated.
+       * generated/pow_c8_i4.c: Regenerated.
+       * generated/pow_c8_i8.c: Regenerated.
+       * generated/pow_i16_i16.c: Regenerated.
+       * generated/pow_i16_i4.c: Regenerated.
+       * generated/pow_i16_i8.c: Regenerated.
+       * generated/pow_i4_i16.c: Regenerated.
+       * generated/pow_i4_i4.c: Regenerated.
+       * generated/pow_i4_i8.c: Regenerated.
+       * generated/pow_i8_i16.c: Regenerated.
+       * generated/pow_i8_i4.c: Regenerated.
+       * generated/pow_i8_i8.c: Regenerated.
+       * generated/pow_r10_i16.c: Regenerated.
+       * generated/pow_r10_i4.c: Regenerated.
+       * generated/pow_r10_i8.c: Regenerated.
+       * generated/pow_r16_i16.c: Regenerated.
+       * generated/pow_r16_i4.c: Regenerated.
+       * generated/pow_r16_i8.c: Regenerated.
+       * generated/pow_r4_i16.c: Regenerated.
+       * generated/pow_r4_i4.c: Regenerated.
+       * generated/pow_r4_i8.c: Regenerated.
+       * generated/pow_r8_i16.c: Regenerated.
+       * generated/pow_r8_i4.c: Regenerated.
+       * generated/pow_r8_i8.c: Regenerated.
+
+2007-03-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/31001
+       * intrinsics/pack_generic.c (pack_internal): Add special checks
+       for zero-sized arrays.
+
+2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
+
+       * Makefile.am: Add dummy install-pdf target.
+       * Makefile.in: Regenerate
+
+2007-02-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/30918
+       * io/listread.c (namelist_read): Eat comment line.
+
+2007-02-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/30910
+       * io/write.c (output_float): Add condition of format F only for
+       special case rounding with zero precision.
+
+2007-02-19  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/30533
+       PR libfortran/30765
+       * Makefile.am: Add $(srcdir) too all files in generated/.
+       (i_maxloc0_c): Add maxloc0_4_i1.c, maxloc0_8_i1.c,
+       maxloc0_16_i1.c, maxloc0_4_i2.c, maxloc0_8_i2.c and
+       maxloc0_16_i2.c.
+       (i_maxloc1_c): Add maxloc1_4_i1.c, maxloc1_8_i1.c,
+       maxloc1_16_i1.c, maxloc1_4_i2.c, maxloc1_8_i2.c and
+       maxloc1_16_i2.c.
+       (i_maxval_c): Add maxval_i1.c and maxval_i2.c.
+       (i_minloc0_c):  Add minloc0_4_i1.c, minloc0_8_i1.c,
+       minloc0_16_i1.c, minloc0_4_i2.c, minloc0_8_i2.c and
+       minloc0_16_i2.c.
+       (i_minloc_1.c): Add minloc1_4_i1.c, minloc1_8_i1.c,
+       minloc1_16_i1.c, minloc1_4_i2.c, minloc1_8_i2.c and
+       minloc1_16_i2.c.
+       (i_minval_c):  Add minval_i1.c and minval_i2.c.
+       (i_sum_c):  Add sum_i1.c and sum_i2.c.
+       (i_product_c):  Add product_i1.c and product_i2.c.
+       (i_matmul_c):  Add matmul_i1.c and matmul_i2.c.
+       (gfor_built_specific_src):  Remove $(srcdir) from target.
+       (gfor_bulit_specific2_src):  Likewise.
+       Makefile.in:  Regenerated.
+       libgfortran.h:  Add GFC_INTEGER_1_HUGE and GFC_INTEGER_2_HUGE.
+       Add gfc_array_i1 and gfc_array_i2.
+       * generated/matmul_i1.c: New file.
+       * generated/matmul_i2.c: New file.
+       * generated/maxloc0_16_i1.c: New file.
+       * generated/maxloc0_16_i2.c: New file.
+       * generated/maxloc0_4_i1.c: New file.
+       * generated/maxloc0_4_i2.c: New file.
+       * generated/maxloc0_8_i1.c: New file.
+       * generated/maxloc0_8_i2.c: New file.
+       * generated/maxloc1_16_i1.c: New file.
+       * generated/maxloc1_16_i2.c: New file.
+       * generated/maxloc1_4_i1.c: New file.
+       * generated/maxloc1_4_i2.c: New file.
+       * generated/maxloc1_8_i1.c: New file.
+       * generated/maxloc1_8_i2.c: New file.
+       * generated/maxval_i1.c: New file.
+       * generated/maxval_i2.c: New file.
+       * generated/minloc0_16_i1.c: New file.
+       * generated/minloc0_16_i2.c: New file.
+       * generated/minloc0_4_i1.c: New file.
+       * generated/minloc0_4_i2.c: New file.
+       * generated/minloc0_8_i1.c: New file.
+       * generated/minloc0_8_i2.c: New file.
+       * generated/minloc1_16_i1.c: New file.
+       * generated/minloc1_16_i2.c: New file.
+       * generated/minloc1_4_i1.c: New file.
+       * generated/minloc1_4_i2.c: New file.
+       * generated/minloc1_8_i1.c: New file.
+       * generated/minloc1_8_i2.c: New file.
+       * generated/minval_i1.c: New file.
+       * generated/minval_i2.c: New file.
+       * generated/product_i1.c: New file.
+       * generated/product_i2.c: New file.
+       * generated/sum_i1.c: New file.
+       * generated/sum_i2.c: New file.
+
+2007-02-16  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * runtime/memory.c (deallocate): Correct comment.
+
+2007-02-10  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       * Makefile.am:  Use $(M4) instead of m4.
+       * Makefile.in:  Regenerate.
+
+2007-02-10  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       * Makefile.am: Remove $(srcdir) from assorted targets
+       in maintainer mode.
+       * Makefile.in: Regenerate.
+
+2007-02-09  Thomas Koenig  <Thomas.Koenig@online.de>
+           Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/30512
+       * m4/iparm.m4: Use HUGE-1 for most negative integer.
+       * generated/maxloc1_8_i4.c: Regenerate.
+       * generated/maxloc0_8_i8.c: Regenerate.
+       * generated/maxloc1_16_i4.c: Regenerate.
+       * generated/maxloc0_16_i8.c: Regenerate.
+       * generated/maxval_i4.c: Regenerate.
+       * generated/maxloc1_4_i8.c: Regenerate.
+       * generated/maxloc0_16_i16.c: Regenerate.
+       * generated/maxloc1_4_i16.c: Regenerate.
+       * generated/maxloc0_8_i16.c: Regenerate.
+       * generated/maxloc0_4_i4.c: Regenerate.
+       * generated/maxloc1_8_i8.c: Regenerate.
+       * generated/maxloc0_8_i4.c: Regenerate.
+       * generated/maxloc0_16_i4.c: Regenerate.
+       * generated/maxloc1_16_i8.c: Regenerate.
+       * generated/maxloc1_4_i4.c: Regenerate.
+       * generated/maxval_i8.c: Regenerate.
+       * generated/maxloc0_4_i16.c: Regenerate.
+       * generated/maxloc1_8_i16.c: Regenerate.
+       * generated/maxloc0_4_i8.c: Regenerate.
+       * generated/maxloc1_16_i16.c: Regenerate.
+       * generated/maxval_i16.c: Regenerate.
+
+2007-02-04  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/30611
+       * intrinsics/string_intrinsics.c (string_repeat): Don't check
+       if ncopies is negative.
+
+2007-02-04  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/30007
+       * libgfortran.h: Do not prefix symbol name with
+       __USER_LABEL_PREFIX__ when used in __attribute__((__alias__(...))).
+
+2007-02-02  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/30284
+       PR fortran/30626
+       * io/transfer.c (init_loop_spec, next_array_record): Change to
+       lbound rather than unity base.
+
+2007-01-21  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * runtime/error.c: Include sys/time.h before sys/resource.h.
+
+2007-01-21  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/30525
+       * intrinsics/string_intrinsics.c(compare_string):  Make
+       sure that comparisons are done unsigned.
+
+2007-01-21  Tobias Burnus  <burnus@net-b.de>
+
+       PR libfortran/30015
+       * intrinsics/date_and_time.c (date_and_time): Fix case where time
+         can go backwards.
+       * configure.ac: Remove AC_TRY_RUN test for timezone in
+         gettimeofday.
+       * acinclude.m4: Ditto.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2007-01-20  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * m4/misc_specifics.m4: Add _gfortran prefix to specific names.
+       * m4/specific2.m4: Likewise.
+       * m4/specific.m4: Likewise.
+       * intrinsics/f2c_specifics.F90: Likewise.
+       * intrinsics/selected_int_kind.f90: Add _gfortran prefix.
+       * intrinsics/selected_real_kind.f90: Likewise.
+       * intrinsics/dprod_r8.f90: Likewise.
+       * Makefile.am: Add -fallow-leading-underscore to the
+       gfor_specific_src files, as well as selected_real_kind.F90
+       and selected_int_kind.F90
+       * Makefile.in: Regenerate.
+       * generated/_sqrt_c8.F90: Regenerate.
+       * generated/_sign_r16.F90: Regenerate.
+       * generated/_log_c16.F90: Regenerate.
+       * generated/_sin_c10.F90: Regenerate.
+       * generated/_tanh_r4.F90: Regenerate.
+       * generated/_tanh_r8.F90: Regenerate.
+       * generated/_log10_r10.F90: Regenerate.
+       * generated/_aimag_c4.F90: Regenerate.
+       * generated/_sign_r4.F90: Regenerate.
+       * generated/_aimag_c8.F90: Regenerate.
+       * generated/_sign_r8.F90: Regenerate.
+       * generated/_mod_i4.F90: Regenerate.
+       * generated/_cos_r16.F90: Regenerate.
+       * generated/_aint_r10.F90: Regenerate.
+       * generated/_mod_i8.F90: Regenerate.
+       * generated/_abs_i16.F90: Regenerate.
+       * generated/_sqrt_c10.F90: Regenerate.
+       * generated/_atan2_r4.F90: Regenerate.
+       * generated/_cos_c4.F90: Regenerate.
+       * generated/_atan_r16.F90: Regenerate.
+       * generated/_tanh_r10.F90: Regenerate.
+       * generated/_atan2_r8.F90: Regenerate.
+       * generated/_cos_c8.F90: Regenerate.
+       * generated/_exp_r4.F90: Regenerate.
+       * generated/_log_r10.F90: Regenerate.
+       * generated/_exp_r8.F90: Regenerate.
+       * generated/_abs_r4.F90: Regenerate.
+       * generated/_abs_r8.F90: Regenerate.
+       * generated/_sin_r16.F90: Regenerate.
+       * generated/_tan_r4.F90: Regenerate.
+       * generated/_tan_r8.F90: Regenerate.
+       * generated/_sign_i4.F90: Regenerate.
+       * generated/_sign_i8.F90: Regenerate.
+       * generated/_exp_c16.F90: Regenerate.
+       * generated/_sqrt_r16.F90: Regenerate.
+       * generated/_conjg_c4.F90: Regenerate.
+       * generated/_conjg_c8.F90: Regenerate.
+       * generated/_dim_r16.F90: Regenerate.
+       * generated/_mod_r10.F90: Regenerate.
+       * generated/_abs_c10.F90: Regenerate.
+       * generated/_conjg_c16.F90: Regenerate.
+       * generated/_tan_r16.F90: Regenerate.
+       * generated/_asinh_r10.F90: Regenerate.
+       * generated/_abs_i4.F90: Regenerate.
+       * generated/_abs_i8.F90: Regenerate.
+       * generated/_acos_r10.F90: Regenerate.
+       * generated/_exp_r10.F90: Regenerate.
+       * generated/_acosh_r16.F90: Regenerate.
+       * generated/_atan2_r16.F90: Regenerate.
+       * generated/_cos_c16.F90: Regenerate.
+       * generated/_mod_i16.F90: Regenerate.
+       * generated/_asin_r4.F90: Regenerate.
+       * generated/_anint_r16.F90: Regenerate.
+       * generated/_asin_r8.F90: Regenerate.
+       * generated/_aimag_c10.F90: Regenerate.
+       * generated/_exp_c4.F90: Regenerate.
+       * generated/_sinh_r10.F90: Regenerate.
+       * generated/_exp_c8.F90: Regenerate.
+       * generated/_log10_r4.F90: Regenerate.
+       * generated/_log10_r8.F90: Regenerate.
+       * generated/_abs_c4.F90: Regenerate.
+       * generated/_abs_r16.F90: Regenerate.
+       * generated/_abs_c8.F90: Regenerate.
+       * generated/_asin_r10.F90: Regenerate.
+       * generated/_sign_r10.F90: Regenerate.
+       * generated/_atanh_r16.F90: Regenerate.
+       * generated/_log_c10.F90: Regenerate.
+       * generated/_cosh_r16.F90: Regenerate.
+       * generated/_sin_c16.F90: Regenerate.
+       * generated/_cos_r10.F90: Regenerate.
+       * generated/_log10_r16.F90: Regenerate.
+       * generated/_aint_r16.F90: Regenerate.
+       * generated/_acos_r4.F90: Regenerate.
+       * generated/_acos_r8.F90: Regenerate.
+       * generated/_sqrt_c16.F90: Regenerate.
+       * generated/_acosh_r4.F90: Regenerate.
+       * generated/_atan_r10.F90: Regenerate.
+       * generated/_acosh_r8.F90: Regenerate.
+       * generated/_sign_i16.F90: Regenerate.
+       * generated/_tanh_r16.F90: Regenerate.
+       * generated/_log_r4.F90: Regenerate.
+       * generated/_log_r8.F90: Regenerate.
+       * generated/_sin_r4.F90: Regenerate.
+       * generated/_sin_r8.F90: Regenerate.
+       * generated/_log_r16.F90: Regenerate.
+       * generated/_sin_r10.F90: Regenerate.
+       * generated/_sqrt_r4.F90: Regenerate.
+       * generated/_exp_c10.F90: Regenerate.
+       * generated/_sqrt_r8.F90: Regenerate.
+       * generated/_asinh_r4.F90: Regenerate.
+       * generated/_sqrt_r10.F90: Regenerate.
+       * generated/_asinh_r8.F90: Regenerate.
+       * generated/_dim_r4.F90: Regenerate.
+       * generated/_dim_r8.F90: Regenerate.
+       * generated/_dim_r10.F90: Regenerate.
+       * generated/_cosh_r4.F90: Regenerate.
+       * generated/_conjg_c10.F90: Regenerate.
+       * generated/_tan_r10.F90: Regenerate.
+       * generated/_cosh_r8.F90: Regenerate.
+       * generated/_mod_r16.F90: Regenerate.
+       * generated/_abs_c16.F90: Regenerate.
+       * generated/_cos_r4.F90: Regenerate.
+       * generated/_asinh_r16.F90: Regenerate.
+       * generated/_cos_r8.F90: Regenerate.
+       * generated/_atanh_r4.F90: Regenerate.
+       * generated/_atanh_r8.F90: Regenerate.
+       * generated/_acos_r16.F90: Regenerate.
+       * generated/_anint_r4.F90: Regenerate.
+       * generated/_acosh_r10.F90: Regenerate.
+       * generated/_anint_r8.F90: Regenerate.
+       * generated/_exp_r16.F90: Regenerate.
+       * generated/_mod_r4.F90: Regenerate.
+       * generated/_cos_c10.F90: Regenerate.
+       * generated/_atan2_r10.F90: Regenerate.
+       * generated/_dim_i16.F90: Regenerate.
+       * generated/_mod_r8.F90: Regenerate.
+       * generated/_anint_r10.F90: Regenerate.
+       * generated/_aint_r4.F90: Regenerate.
+       * generated/_aint_r8.F90: Regenerate.
+       * generated/_dim_i4.F90: Regenerate.
+       * generated/_sinh_r4.F90: Regenerate.
+       * generated/_log_c4.F90: Regenerate.
+       * generated/_dim_i8.F90: Regenerate.
+       * generated/_sinh_r8.F90: Regenerate.
+       * generated/_log_c8.F90: Regenerate.
+       * generated/_sin_c4.F90: Regenerate.
+       * generated/_sin_c8.F90: Regenerate.
+       * generated/misc_specifics.F90: Regenerate.
+       * generated/_abs_r10.F90: Regenerate.
+       * generated/_aimag_c16.F90: Regenerate.
+       * generated/_atan_r4.F90: Regenerate.
+       * generated/_sinh_r16.F90: Regenerate.
+       * generated/_atan_r8.F90: Regenerate.
+       * generated/_atanh_r10.F90: Regenerate.
+       * generated/_cosh_r10.F90: Regenerate.
+       * generated/_sqrt_c4.F90: Regenerate.
+       * generated/_asin_r16.F90: Regenerate.
+
+2007-01-19  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/26893
+       * acinclude.m4 (LIBGFOR_WORKING_GFORTRAN): New check.
+       * configure.ac: Add call to LIBGFOR_WORKING_GFORTRAN.
+       * configure: Regenerate.
+       * config.h.in: Regenerate because it was forgottent in the last
+       commit.
+
+2007-01-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+           Tobias Burnus  <burnus@net-b.de>
+
+       PR libfortran/29649
+       * runtime/environ.c (variable_table): New GFORTRAN_ERROR_DUMPCORE
+       environment variable.
+       * runtime/compile_options.c (set_std): Add new argument.
+       * runtime/error.c (sys_exit): Move from io/unix.c. Add coredump
+       functionality.
+       * libgfortran.h (options_t): New dump_core and backtrace members.
+       (sys_exit): Move prototype.
+       * io/unix.c (sys_exit): Move to runtime/error.c.
+       * configure.ac: Add check for getrlimit.
+       * configure: Regenerate.
+
+2007-01-17  Tom Tromey  <tromey@redhat.com>
+
+       PR libfortran/27107:
+       * aclocal.m4, configure, Makefile.in: Rebuilt.
+       * configure.ac: Enable automake dependency tracking.  Update
+       minimum automake version.
+
+2007-01-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/27107
+       * runtime/environ.c: Don't include io/io.h.
+       * runtime/string.c: Don't include io/io.h.
+       (compare0): Add cast to avoid warning.
+       * runtime/error.c: Don't include io/io.h.
+       (st_printf): Move to io/unix.c.
+       * intrinsics/flush.c: Delete, contents moved to io/intrinsics.c.
+       * intrinsics/fget.c: Likewise.
+       * intrinsics/ftell.c: Likewise.
+       * intrinsics/tty.c: Likewise.
+       * libgfortran.h (DEFAULT_RECL, notification_std,
+       get_unformatted_convert, IOPARM_*, st_parameter_common, unit_convert,
+       DEFAULT_TEMPDIR): New declarations.
+       * io/io.h (DEFAULT_RECL, notification_std, get_unformatted_convert,
+       IOPARM_*, st_parameter_common, unit_convert, DEFAULT_TEMPDIR):
+       Move to libgfortran.h.
+       * io/unix.c: Add io/unix.h content.
+       (st_printf): New function.
+       * io/intrinsics.c: New file.
+       * io/unix.h: Remove, contents moved into unix.c.
+       * libtool-version: Update library version to 3.0.0.
+       * configure.ac: Update library version to 0.3.
+       * Makefile.am (intrinsics/fget.c, intrinsics/flush.c,
+       intrinsics/ftell.c, intrinsics/tty.c, libgfortran.h): Remove targets.
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+
+2007-01-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/30435
+       * io/list_read.c (finish_separator): Don't call next_record.
+       (list_formatted_read_scalar): Clean up some comments and whitespace.
+       (nml_read_obj): Whitespace fix.
+
+2007-01-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/30162
+       * io/unix.c (fd_flush): Don't seek if file is not seekable, defined as
+       s->file_length == -1.
+       (fd_alloc_w_at): Do not adjust file_length if file is not seekable.
+       (fd_seek): If not seekable, just return success.
+       (fd_truncate): If not seekable, no need to truncate.  Return failure
+       if seek fails and the stream is not a pipe.
+       (fd_to_stream): Make test for non-seekable file more robust.
+
+2007-01-01  Steven G. Kargl  <kargls@comcast.net>
+
+       * ChangeLog: Copied to ...
+       * ChangeLog-2006: here.
+
+\f
+Copyright (C) 2007 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2008 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2008
new file mode 100644 (file)
index 0000000..6b31399
--- /dev/null
@@ -0,0 +1,2532 @@
+2008-12-29  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR fortran/31832
+       * acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_POWF): New autoconf check for
+       broken powf.
+       * configure.ac (LIBGFOR_CHECK_FOR_BROKEN_POWF): Use it.
+       * intrinsics/c99_functions.c: Use internal powf implementation if
+       HAVE_BROKEN_POWF is defined.
+       * configure: Rebuilt.
+       * config.h.in: Rebuilt.
+
+2008-12-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37472
+       * io/write_float.def (output_float_FMT_G_): Modify calculation of temp
+       to avoid sensitivity to round-off.
+
+2008-12-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/38398
+       * io/io.h (st_parameter_dt): Add new bit to keep track of when to
+       suppress blanks for g0 formatting.
+       * io/transfer.c (formatted_transfer_scalar): Always call write_real_g0
+       for g0 formatting.
+       * io.c (write.c): Do not use ES formatting and use new bit to suppress
+       blanks.
+       * io/write_float.def (output_float): Adjust the location of setting the
+       width so that it can be adjusted when suppressing blanks.  Set number of
+       blanks to zero when dtp->u.p.g0_no_blanks is set. Do some minor code
+       clean-up and add some white space for readability.
+       
+2008-12-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure: Regenerate.
+
+2008-12-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/38504
+       io/write.c (write_decimal): Skip extra sign '-' at beginning of string
+       returned by gfc_itoa.
+
+2008-12-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/38430
+       * io/transfer.c (data_transfer_init): Move constraint check for REC=
+       and STREAM access into condition for other REC= constraints to simplify.
+       Comment out this constraint to avoid breaking compatibility with 4.3
+       until later.  Added a TODO for above comment and this one.
+       Fix test for max pos.
+
+2008-12-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/38291
+       * io/transfer.c (data_transfer_init): Add fbuf_flush inadvertently
+       ommitted.  Add check for invalid use of REC= with ACCESS="stream".  Fix
+       comment.
+
+2008-12-06  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * runtime/main.c (store_exe_path): Don't crash if argv0 is NULL.
+
+2008-12-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/38291
+       * io/transfer.c (data_transfer_init): Add checks for POS= valid range.
+       Add check for unit opened with ACCESS="stream". Flush and seek if
+       current stream position does not match. Check ENDFILE on read.
+
+2008-12-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/38285
+       * write_float.def (WRITE_FLOAT): Zero the float value for special case
+       only if scale_factor = 0.
+       
+2008-11-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/38234
+       * intrinsics/reshape_generic.c (reshape_internal):
+       Source can be larger than shape.
+       * m4/reshape.m4:  Likewise.
+       * generated/reshape_c10.c Regenerated.
+       * generated/reshape_c16.c Regenerated.
+       * generated/reshape_c4.c Regenerated.
+       * generated/reshape_c8.c Regenerated.
+       * generated/reshape_i16.c Regenerated.
+       * generated/reshape_i4.c Regenerated.
+       * generated/reshape_i8.c Regenerated.
+       * generated/reshape_r10.c Regenerated.
+       * generated/reshape_r16.c Regenerated.
+       * generated/reshape_r4.c Regenerated.
+       * generated/reshape_r8.c Regenerated.
+
+2008-11-22  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * libgfortran.h (__mingw_snprintf): Declare with gnu_printf
+       format attribute.
+
+
+2008-11-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/38225
+       * intrinsics/reshape_generic.c (reshape_internal):
+       Use all dimensions of source for bounds checking.
+       * m4/reshape.m4:  Likewise.
+       * generated/reshape_c10.c Regenerated.
+       * generated/reshape_c16.c Regenerated.
+       * generated/reshape_c4.c Regenerated.
+       * generated/reshape_c8.c Regenerated.
+       * generated/reshape_i16.c Regenerated.
+       * generated/reshape_i4.c Regenerated.
+       * generated/reshape_i8.c Regenerated.
+       * generated/reshape_r10.c Regenerated.
+       * generated/reshape_r16.c Regenerated.
+       * generated/reshape_r4.c Regenerated.
+       * generated/reshape_r8.c Regenerated.
+
+2008-11-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libfortran/37839
+       * io/io.h (IOPARM_INQUIRE_HAS_ROUND, IOPARM_INQUIRE_HAS_SIGN,
+       IOPARM_INQUIRE_HAS_PENDING): Adjust values.
+       (st_parameter_inquire): Reorder and fix types of round, sign and
+       pending fields.
+       (st_parameter_43, st_parameter_44): Removed.
+       (st_parameter_dt): Put back struct definition directly to u.p
+       declaration.  Change type of u.p.size_used from gfc_offset to
+       GFC_IO_INT.  Decrease back size of u.pad to 16 pointers and
+       32 ints.  Put id, pos, asynchronous, blank, decimal, delim,
+       pad, round and sign fields after the union.
+       * io/inquire.c (inquire_via_unit, inquire_via_filename): Only read
+       flags2 if it is defined.
+       * io/transfer.c (read_sf, read_block_form, write_block): Cast
+       additions to size_used to GFC_IO_INT instead of gfc_offset.
+       (data_transfer_init): Clear whole u.p struct.  Adjust
+       for moving id, pos, asynchronous, blank, decimal, delim, pad,
+       round and sign fields from u.p directly into st_parameter_dt.
+       (finalize_transfer): Don't cast size_used to GFC_IO_INT.
+       * io/file_pos.c (st_endfile): Clear whole u.p struct.
+
+2008-11-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37472
+       * io/write_float.def (output_float_FMT_G_): Adjust conversion of
+       G format specification to F format.
+
+2008-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/38135
+       * m4/reshape.m4:  Correct bounds checking when PAD is present.
+       Treat PAD as if it were SOURCE when SOURCE is empty.
+       * intrinsics/reshape_generic.c:  Likewise.
+       * generated/reshape_c10.c Regenerated.
+       * generated/reshape_c16.c Regenerated.
+       * generated/reshape_c4.c Regenerated.
+       * generated/reshape_c8.c Regenerated.
+       * generated/reshape_i16.c Regenerated.
+       * generated/reshape_i4.c Regenerated.
+       * generated/reshape_i8.c Regenerated.
+       * generated/reshape_r10.c Regenerated.
+       * generated/reshape_r16.c Regenerated.
+       * generated/reshape_r4.c Regenerated.
+       * generated/reshape_r8.c Regenerated.
+
+2008-11-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/38097
+       * io/read.c (read_f): Initialize exponent. Fix comment. Set loop
+       conditions for BZ/BN.
+       * io/unit.c (get_internal_unit): Initialize flags.blank.
+       * io/transfer.c (data_transfer_init): Fix whitespace.
+
+2008-11-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37294
+       * io/write.c (namelist_write_newline): Use array loop specification to
+       advance to next internal array unit record. (namelist_write): Adjust to
+       accomodate the internal array unit behavior.
+
+2008-11-01  Dennis Wassel  <dennis.wassel@gmail.com>
+
+       PR fortran/37159
+       * intrinsics/random.c: Added comment to adapt check.c, should
+       kiss_size change.
+       Few cosmetic changes to existing comments.
+
+2008-10-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37707
+       * io/list_read.c (read_character): Remove code to look ahead in namelist
+       reads to descriminate non-delimited strings from namelist objects.
+       * io/write.c (namelist_write): Delimit character strings with quote or
+       apostrophe, defaulting to quote.
+
+2008-10-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34670
+       * intrinsics/transpose_generic.c:  Implement bounds checking.
+       * m4/transpose.m4:  Likewise.
+       * generated/transpose_c8.c: Regenerated.
+       * generated/transpose_c16.c: Regenerated.
+       * generated/transpose_r10.c: Regenerated.
+       * generated/transpose_i8.c: Regenerated.
+       * generated/transpose_c10.c: Regenerated.
+       * generated/transpose_r4.c: Regenerated.
+       * generated/transpose_c4.c: Regenerated.
+       * generated/transpose_i16.c: Regenerated.
+       * generated/transpose_i4.c: Regenerated.
+       * generated/transpose_r8.c: Regenerated.
+       * generated/transpose_r16.c: Regenerated.
+
+2008-10-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org
+
+       PR libfortran/37834
+       * io/write_float.def (output_float): Emit '0.' for special case of
+       format specifier 'f0.0' and value of zero. Likewise emit '0' for 'f1.0'.
+
+2008-10-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org
+
+       PR libfortran/37863
+       * io/write_float.def (WRITE_FLOAT): Round to 1.0 correctly.
+       * io/io.h (st_parameter_44): Fix id type declaration.
+
+2008-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       * io/file_pos.c (unformatted_backspace): Normal case is
+       GFC_CONVERT_NATIVE.
+       * io/transfer.c (read_sf):  Mark paths leading to generate_error()
+       as unlikely.
+       (readl_block_form):  Likewise.
+       (read_block_direct):  Likewise.
+       (write_block):  Likewise.
+       (write_buf):  Likewise.
+       (us_read):  Likewise.  Normal case is GFC_CONVERT_NATIVE.
+       (next_record_w_unf):  Mark paths leading to generate_error()
+       as unlikely.
+
+2008-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34670
+       * generated/spread_r4.c: Regenerated.
+
+2008-10-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34670
+       * intrinsics/reshape_generic.c:  Add bounds checking.
+       * m4/reshape.m4:  Likewise.
+       * generated/reshape_c10.c: Regenerated.
+       * generated/reshape_c16.c: Regenerated.
+       * generated/reshape_c4.c: Regenerated.
+       * generated/reshape_c8.c: Regenerated.
+       * generated/reshape_i16.c: Regenerated.
+       * generated/reshape_i4.c: Regenerated.
+       * generated/reshape_i8.c: Regenerated.
+       * generated/reshape_r10.c: Regenerated.
+       * generated/reshape_r16.c: Regenerated.
+       * generated/reshape_r4.c: Regenerated.
+       * generated/reshape_r8.c: Regenerated.
+       * generated/spread_r4.c: Regenerated.
+
+2008-10-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org
+
+       PR libfortran/37083
+       * io/list_read.c (next_char): Simplify EOF tests and set endfile flag.
+       (finish_list_read): Add EOF check.
+
+2008-10-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/37753
+       * io/transfer.c (unformatted_read):  CONVERT_NATIVE
+       is the usual case.  Check for kind==1 for non-byte-reversing
+       operation.
+       (unformatted_write):  Likewise.
+
+2008-10-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org
+
+       PR libfortran/37707
+       * io/list_read.c (nml_get_obj_data): If the first namelist object rank
+       is greater than zero, call nml_object_read with the first object rather
+       than the sub-object.
+
+2008-09-26  Peter O'Gorman  <pogma@thewrittenword.com>
+           Steve Ellcey  <sje@cup.hp.com>
+
+       * configure: Regenerate for new libtool.
+       * Makefile.in: Ditto.
+
+2008-09-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org
+
+       PR libfortran/37498
+       * list_read.c (eat_separator): Revert previous patch and move
+       delim_status, decimal_status, and pad_status to gfc_unit.
+       (parse_real): Ditto. (read_real): Ditto.
+       * read.c (read_a): Likewise. (read_a_char4): Likewise.
+       (read_f): Likewise.
+       * inquire.c (inquire_via_unit): Add missing check for
+       IOPARM_INQUIRE_HAS_FLAGS2. (inquire_via_filename): Likewise.
+       * io.h (unit_sign_s): Move delim_status, decimal_status, and pad_status
+       to gfc_unit.
+       * transfer.c (read_sf): Ditto. (read_block_form): Ditto.
+       (formatted_transfer_scalar): Ditto. (data_transfer_init): Ditto.
+       * write.c (write_default_char4): Ditto. (write_utf8_char4): Ditto.
+       (write_character): Ditto. (write_real_g0): Ditto.
+       (list_formatted_write_scalar): Ditto. (nml_write_obj): Ditto.
+       (namelist_write): Ditto.
+       * write_float.def (calculate_sign): Ditto. (output_float): Ditto.
+
+2008-09-24  Tobias Burnus  <burnus@net-b.de>
+
+       * runtime/compile_options.c (init_compile_options):
+       Sync flags with front end.
+
+2008-09-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org
+
+       PR libfortran/37498
+       * file_pos (st_endfile): Clear memory only for libfortran 4.3 private
+       area.
+       * list_read.c (eat_separator): Only access F2003 I/O parameters if
+       IOPARM_DT_HAS_F2003 bit is set. (parse_real): Ditto.
+       (read_real): Ditto.
+       * read.c (read_a): Likewise. (read_a_char4): Likewise though not
+       strictly necessary. (read_f): Likewise.
+       * io.h (unit_sign_s): New enumerator to allow duplication of
+       st_parameter structures. (IOPARM_DT_HAS_F2003): New mask bit.
+       (st_parameter_43): New structure copied from 4.3 version of 
+       st_paramater_dt private section. (st_parameter_44): New structure with
+       F2003 items added. (st_parameter_dt): Modified to create union of new
+       and old structures to allow correct memory setting for 4.3 ABI
+       compatibility. Bumped the pad size.
+       * transfer.c (read_sf): Do not use F2003 I/O memory areas unless
+       IOPARM_DT_HAS_F2003 bit has been set. (read_block_form): Ditto.
+       (formatted_transfer_scalar): Ditto. (data_transfer_init): Ditto and
+       add comment, fix formatting.
+       * write.c (write_default_char4): Likewise though not strictly necessary.
+       (write_utf8_char4): Ditto. (write_character): Ditto.
+       (write_real_g0): Ditto. (list_formatted_write_scalar): Ditto.
+       (nml_write_obj): Ditto. (namelist_write): Ditto.
+       * write_float.def (calculate_sign): Eliminate warning by including all
+       cases in switch. (output_float): Output only decimal point of F2003 flag
+       is not set.
+
+2008-09-10  Tobias Burnus  <burnus@net-b.de>
+           H. J. Lu  <hongjiu.lu@intel.com>
+
+       * mk-sik-inc.sh: Make -Wunused-variable proof.
+       * mk-srk-inc.sh: Make -Wunused-variable proof.
+
+2008-09-10  Tobias Burnus  <burnus@net-b.de>
+
+       * mk-kinds-h.sh: Make -Wunused-variable proof.
+
+2008-09-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/37203
+       * intrinsics/reshape_generic.c:  Add checking on
+       out-of-bounds and duplicate values of order argument.
+       * m4/reshape.m4:  Likewise.
+       * generated/reshape_c10.c: Regenerated.
+       * generated/reshape_c16.c: Regenerated.
+       * generated/reshape_c4.c: Regenerated.
+       * generated/reshape_c8.c: Regenerated.
+       * generated/reshape_i16.c: Regenerated.
+       * generated/reshape_i4.c: Regenerated.
+       * generated/reshape_i8.c: Regenerated.
+       * generated/reshape_r10.c: Regenerated.
+       * generated/reshape_r16.c: Regenerated.
+       * generated/reshape_r4.c: Regenerated.
+       * generated/reshape_r8.c: Regenerated.
+
+2008-09-06  Tobias Burnus  <burnus@net-b.de>
+
+       * libgfortran.h (likely,unlikely): New makros.
+       (runtime_warning_at,__mingw_snprintf): Add __attribute__(format()).
+       * m4/spread.m4 (spread_'rtype_code`): Use unlikely for bounds_check.
+       * m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Ditto.
+       * m4/matmull.m4 (matmul_'rtype_code`): Ditto.
+       * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Ditto.
+       * m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Ditto.
+       * m4/matmul.m4 (matmul_'rtype_code`): Ditto.
+
+       * generated/minval_r8.c: Regenerated.
+       * generated/spread_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/any_l16.c: Regenerated.
+       * generated/spread_i8.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/any_l2.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc0_4_r4.c: Regenerated.
+       * generated/all_l1.c: Regenerated.
+       * generated/matmul_r8.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/minloc0_4_r16.c: Regenerated.
+       * generated/minloc0_4_i1.c: Regenerated.
+       * generated/maxloc0_4_r16.c: Regenerated.
+       * generated/maxloc0_4_i2.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc0_8_i8.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/minloc0_16_i8.c: Regenerated.
+       * generated/spread_i1.c: Regenerated.
+       * generated/maxloc0_16_i8.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc0_16_i16.c: Regenerated.
+       * generated/matmul_r16.c: Regenerated.
+       * generated/minloc0_4_r4.c: Regenerated.
+       * generated/all_l2.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/minloc0_4_i2.c: Regenerated.
+       * generated/spread_c10.c: Regenerated.
+       * generated/maxloc0_8_i1.c: Regenerated.
+       * generated/spread_r4.c: Regenerated.
+       * generated/minloc0_8_i8.c: Regenerated.
+       * generated/matmul_c8.c: Regenerated.
+       * generated/all_l16.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/minloc0_16_i1.c: Regenerated.
+       * generated/maxloc0_16_i1.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/spread_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc0_16_i16.c: Regenerated.
+       * generated/maxloc0_8_r4.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/minloc0_4_r10.c: Regenerated.
+       * generated/minloc0_8_i16.c: Regenerated.
+       * generated/maxloc0_4_r10.c: Regenerated.
+       * generated/maxloc0_8_i16.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/minloc0_16_r4.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc0_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc0_8_i1.c: Regenerated.
+       * generated/maxloc0_4_i4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc0_8_i2.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/count_4_l.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/count_8_l.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/matmul_i8.c: Regenerated.
+       * generated/minloc0_16_i2.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/maxloc0_16_i2.c: Regenerated.
+       * generated/spread_c4.c: Regenerated.
+       * generated/matmul_c16.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/matmul_r10.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc0_8_r4.c: Regenerated.
+       * generated/matmul_l4.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/minloc0_16_r16.c: Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/minloc0_4_i4.c: Regenerated.
+       * generated/minloc0_8_i2.c: Regenerated.
+       * generated/matmul_i1.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/spread_i16.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/spread_i4.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc0_4_r8.c: Regenerated.
+       * generated/maxloc0_16_r16.c: Regenerated.
+       * generated/matmul_r4.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/minloc0_8_r16.c: Regenerated.
+       * generated/maxloc0_8_r16.c: Regenerated.
+       * generated/count_1_l.c: Regenerated.
+       * generated/maxloc0_8_i4.c: Regenerated.
+       * generated/matmul_i2.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/matmul_c10.c: Regenerated.
+       * generated/minloc0_16_i4.c: Regenerated.
+       * generated/maxloc0_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/matmul_l16.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/minloc0_16_r10.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc0_4_r8.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+       * generated/minloc0_8_i4.c: Regenerated.
+       * generated/matmul_c4.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/spread_r8.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/spread_r16.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/count_16_l.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/maxloc0_16_r10.c: Regenerated.
+       * generated/minloc0_4_i16.c: Regenerated.
+       * generated/maxloc0_8_r8.c: Regenerated.
+       * generated/maxloc0_4_i16.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/minloc0_8_r10.c: Regenerated.
+       * generated/maxloc0_8_r10.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/minloc0_16_r8.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/maxloc0_16_r8.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/count_2_l.c: Regenerated.
+       * generated/maxloc0_4_i8.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/matmul_i4.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/spread_c8.c: Regenerated.
+       * generated/matmul_i16.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/any_l1.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/minloc0_8_r8.c: Regenerated.
+       * generated/matmul_l8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/maxloc0_4_i1.c: Regenerated.
+       * generated/minloc0_4_i8.c: Regenerated.
+       * generated/spread_c16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+
+2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37301
+       PR libfortran/37228
+       * io/io.h (write_real_g0): Declare new function to handle g0.d format.
+       * io/transfer.c (formatted_transfer_scalar): Use new function.
+       * io/format.c (parse_format_list): Enable g0.d.
+       * io/write.c (write_a_char4): Delete unused var.
+       (set_fnode_default): New function to set the default fnode w, d, and e
+       factored from write_real. (write_real): Use new factored function.
+       (write_real_g0): New function that sets d to that passed by g0.d format
+       specifier and set format to ES.  Default values for w and e are used
+       from the new function, set_fnode_default.
+
+2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * runtime/error.c: Fix cast for printf.
+
+2008-08-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/36895
+       * io/write.c (namelist_write_newline): New function to correctly mark
+       next records in both external and internal units.
+       (nml_write_obj): Use new function.
+       (namelist_write: Use new function.
+
+2008-08-19  Tobias Burnus  <burnus@net-b.de>
+
+       PR libfortran/35863
+       * io/write.c (write_a_char4): Add missing variable declaration
+       in HAVE_CRLF block.
+
+2008-08-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/35863
+       * intrinsics/selected_char_kind.c: Enable iso_10646.
+       * io/read.c (typedef uchar): New type.
+       (read_utf8): New function to read a single UTF-8 encoded character.
+       (read_utf8_char1): New function to read UTF-8 into a KIND=1 string.
+       (read_default_char1): New functio to read default into KIND=1 string.
+       (read_utf8_char4): New function to read UTF-8 into a KIND=4 string.
+       (read_default_char4): New function to read UTF-8 into a KIND=4 string.
+       (read_a): Modify to use the new functions.
+       (read_a_char4): Modify to use the new functions.
+       * io/write.c (error.h): Add include. (typedef uchar): New type.
+       (write_default_char4): New function to default write KIND=4 string.
+       (write_utf8_char4): New function to UTF-8 write KIND=4 string.
+       (write_a_char4): Modify to use new functions.
+       (write_character): Modify to use new functions.
+
+2008-08-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR libfortran/37123
+       * intrinsics/cshift0.c (cshift0): Fix 2 typos.
+
+2008-08-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/36886
+       * Makefile.am:  Added $(i_cshift0_c).
+       Added $(i_cshift0_c) to gfor_built_specific_src.
+       Add rule to build from cshift0.m4.
+       * Makefile.in:  Regenerated.
+       * libgfortran.h:  Addedd prototypes for cshift0_i1,
+       cshift0_i2, cshift0_i4, cshift0_i8, cshift0_i16,
+       cshift0_r4, cshift0_r8, cshift0_r10, cshift0_r16,
+       cshift0_c4, cshift0_c8, cshift0_c10, cshift0_c16.
+       Define Macros GFC_UNALIGNED_C4 and GFC_UNALIGNED_C8.
+       * intrinsics/cshift0.c:  Remove helper functions for
+       the innter shift loop.
+       (cshift0):  Call specific functions depending on type
+       of array argument.  Only call specific functions for
+       correct alignment for other types.
+       * m4/cshift0.m4:  New file.
+       * generated/cshift0_i1.c:  New file.
+       * generated/cshift0_i2.c:  New file.
+       * generated/cshift0_i4.c:  New file.
+       * generated/cshift0_i8:.c  New file.
+       * generated/cshift0_i16.c:  New file.
+       * generated/cshift0_r4.c:  New file.
+       * generated/cshift0_r8.c:  New file.
+       * generated/cshift0_r10.c:  New file.
+       * generated/cshift0_r16.c:  New file.
+       * generated/cshift0_c4.c:  New file.
+       * generated/cshift0_c8.c:  New file.
+       * generated/cshift0_c10.c:  New file.
+       * generated/cshift0_c16.c:  New file.
+
+2008-07-27  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/36132
+       PR fortran/29952
+       PR fortran/36909
+       * runtime/error.c: New function runtime_error_at.
+       * gfortran.map: Ditto.
+       * libgfortran.h: Ditto.
+
+2008-07-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/36582
+       * io/list_read.c: If variable rank is zero, do not adjust the found
+       namelist object pointer.
+
+2008-07-22  Daniel Kraft  <d@domob.eu>
+
+       PR fortran/29835
+       * io/format.c (struct format_data):  New member error_element.
+       (unexpected_element):  Added '%c' to message.
+       (next_char):  Keep track of last parsed character in fmt->error_element.
+       (format_error):  If the message is unexpected_element, output the
+       offending character, too.
+
+2008-07-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/36890
+       * io/file_pos.c:  Declare READ_CHUNK as signed to avoid
+       signed/unsigned comparison warning in formatted_backspace.
+
+2008-07-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/36773
+       * intrinsics/cshift0.c (cshift0):  Return early if size of array
+       is zero.
+       * intrinsics/eoshift0.c (eoshift0):  Return early if size of
+       return array is zero.
+       * intrinsics/eoshift2.c (eoshift2):  Likewise.
+       * m4/eoshift1.m4 (eoshift1):  Return early if size of array
+       is zero.
+       * m4/eoshift3.m4 (eoshift3):  Likewise.
+       * m4/eoshift2.m4 (eoshift2):  Return early if size of return
+       array is zero.
+       * m4/eoshift4.m4 (eoshift2):  Return early if size of return
+       array is zero.
+       * generated/cshift1_16.c: Regenerated.
+       * generated/cshift1_4.c: Regenerated.
+       * generated/cshift1_8.c: Regenerated.
+       * generated/eoshift1_16.c: Regenerated.
+       * generated/eoshift1_4.c: Regenerated.
+       * generated/eoshift1_8.c: Regenerated.
+       * generated/eoshift3_16.c: Regenerated.
+       * generated/eoshift3_4.c: Regenerated.
+       * generated/eoshift3_8.c: Regenerated.
+
+2008-07-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/36857
+       * io/write_float.def: Comment out locale dependent code and fix general
+       comments.
+       
+2008-07-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/36341
+       PR fortran/34670
+       * m4/matmul.m4:  Add bounds checking.
+       * m4/matmull.m4:  Likewise.
+       * generated/matmul_c10.c: Regenerated.
+       * generated/matmul_c16.c: Regenerated.
+       * generated/matmul_c4.c: Regenerated.
+       * generated/matmul_c8.c: Regenerated.
+       * generated/matmul_i1.c: Regenerated.
+       * generated/matmul_i16.c: Regenerated.
+       * generated/matmul_i2.c: Regenerated.
+       * generated/matmul_i4.c: Regenerated.
+       * generated/matmul_i8.c: Regenerated.
+       * generated/matmul_l16.c: Regenerated.
+       * generated/matmul_l4.c: Regenerated.
+       * generated/matmul_l8.c: Regenerated.
+       * generated/matmul_r10.c: Regenerated.
+       * generated/matmul_r16.c: Regenerated.
+       * generated/matmul_r4.c: Regenerated.
+       * generated/matmul_r8.c: Regenerated.
+
+2008-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * acinclude.m4 (LIBGFOR_CHECK_GTHR_DEFAULT): Fix configure cache
+       variable name.
+       * configure: Regenerate.
+
+2008-07-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/36676
+       * io/list_read.c (find_nml_name): Use eat_separator instead of eat_line.
+       
+2008-06-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/36657
+       * io/list_read.c (read_character): Check for '!' along with separators.
+       (find_nml_name): Likewise and eat the comment if found.
+
+2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure: Regenerate.
+
+2008-06-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/36546
+       * io/list_read.c (eat_separator): Add tab character to condition
+       for looping past whitespace.
+
+2008-06-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/36515
+       * libgfortran.h (compile_options_t): Add int range_check to structure.
+       * runtime/compile_options.c (set_options): Add range_check option.
+       (init_compile_options): Likewise.
+       *io/read.c (read_decimal): Change overflow checks to include
+       range_check.
+       
+2008-06-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/36538
+       * io/list_read.c (namelist_read): Add eat_separator to eliminate leading
+       tabs.
+
+2008-06-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/35863
+       * libgfortran.h: Change l8_to_l4_offset to big_endian and add endian_off.
+       * runtime/main.c: Fix error in comment. Change l8_to_l4_offset to
+       big_endian. (determine_endianness): Add endian_off and set its value
+       according to big_endian.
+       * gfortran.map: Add symbol for new _gfortran_transfer_character_wide.
+       * io/io.h: Add prototype declarations for new functions.
+       * io/list_read.c (list_formatted_read_scalar): Modify to handle kind=4.
+       (list_formatted_read): Calculate stride based on kind for character type
+       and use it when calling list_formatted_read_scalar.
+       * io/inquire.c (inquire_via_unit): Change l8_to_l4_offset to big_endian.
+       * io/open.c (st_open): Change l8_to_l4_offset to big_endian.
+       * io/read.c (read_a_char4): New function to handle formatted read.
+       * io/write.c: Define GFC_CHAR4(x) to improve readability of code.
+       (write_a_char4): New function to handle formatted write.
+       (write_character): Modify to accept the kind parameter and adjust for
+       endianess of the machine. (list_formatted_write): Calculate the stride
+       resulting from the kind and adjust the list_formatted_write_scalar call
+       accordingly. (nml_write_obj): Adjust calls to write_character.
+       (namelist_write): Likewise.
+       * io/transfer.c (formatted_transfer_scaler): Rename 'len' argument to
+       'kind' argument to better describe what it is. Add calls to new
+       functions for kind == 4. (formatted_transfer): Modify to handle the case
+       of type character and kind equals 4 to pass in the kind to the transfer
+       routines. (transfer_character_wide): Add this new function.
+       (transfer_array): Don't set kind to the character string length. Adjust
+       strides bases on character kind.
+       (unformatted_read): Adjust size based on kind for character types.
+       (unformatted_write): Likewise. (data_transfer_init): Change
+       l8_to_l4_offset to big_endian.
+       io/fbuf.c (fbuf_seek): Add cast to eliminate warning.
+
+2008-06-13  Tobias Burnus  <burnus@net-b.de>
+
+       * configure.ac (AM_CFLAGS): Remove -Werror again.
+       * configure: Regenerate.
+
+2008-06-13  Tobias Burnus  <burnus@net-b.de>
+
+       PR libgfortran/36518
+       * configure.ac (AM_CFLAGS): Add -Werror.
+       * configure: Regenerate.
+       * m4/ifunction_logical.m4: Cast "n" to "(int)".
+       * generated/any_l16.c: Regenerate.
+       * generated/any_l2.c: Regenerate.
+       * generated/all_l1.c: Regenerate.
+       * generated/all_l2.c: Regenerate.
+       * generated/all_l16.c: Regenerate.
+       * generated/any_l4.c: Regenerate.
+       * generated/count_4_l.c: Regenerate.
+       * generated/count_8_l.c: Regenerate.
+       * generated/all_l4.c: Regenerate.
+       * generated/count_1_l.c: Regenerate.
+       * generated/count_16_l.c: Regenerate.
+       * generated/any_l8.c: Regenerate.
+       * generated/count_2_l.c: Regenerate.
+       * generated/any_l1.c: Regenerate.
+       * generated/all_l8.c: Regenerate.
+
+2008-06-13  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/36495
+       * configure.ac (AM_FCFLAGS): Add "-Werror -fimplicit-none".
+       * configure: (generated) ditto.
+       * intrinsics/dprod_r8.f90: Add "implicit none".
+
+2008-06-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/36420
+       PR libfortran/36421
+       PR libfortran/36422
+       * io/io.h: Add prototype for write_real.
+       * io/transfer.c (formatted_transfer_scalar): For FMT_G and width zero,
+       use write_real.
+       * io/format.c: Add zero width error message. (parse_format_list): Use
+       error message for FMT_A if followed by FMT_ZERO. Use zero width error
+       message for FMT_G if mode is READ or if -std=f95 or f2003. (fmormat0):
+       Fix typo in comment.
+       * io/write.c(write_a): Set wlen to len if FMT_G and length is zero.
+       (write_l): Add wlen variable and use it if FMT_G and width is zero.
+       (write_decimal): If FMT_G, set m to -1 to flag processor dependent
+       formatting. (write_real): Remove static declaration.
+
+2008-05-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/36319
+       * intrinsics/string_intrinsics_inc.c (string_index): Return
+       correct value for zero-length substring.
+       * intrinsics/cshift0.c: Add _char4 variant.
+       * intrinsics/eoshift0.c (eoshift0): Allow filler to be a pattern
+       wider than a single byte. Add _char4 variant and use above
+       functionality.
+       * intrinsics/eoshift2.c (eoshift2): Likewise.
+       * m4/eoshift1.m4: Likewise.
+       * m4/eoshift3.m4: Likewise.
+       * m4/cshift1.m4: Add _char4 variants.
+       * gfortran.map (GFORTRAN_1.1): Add _gfortran_cshift0_1_char4,
+       _gfortran_cshift0_2_char4, _gfortran_cshift0_4_char4,
+       _gfortran_cshift0_8_char4, _gfortran_cshift1_16_char4,
+       _gfortran_cshift1_4_char4, _gfortran_cshift1_8_char4,
+       _gfortran_eoshift0_1_char4, _gfortran_eoshift0_2_char4,
+       _gfortran_eoshift0_4_char4, _gfortran_eoshift0_8_char4,
+       _gfortran_eoshift1_16_char4, _gfortran_eoshift1_4_char4,
+       _gfortran_eoshift1_8_char4, _gfortran_eoshift2_1_char4,
+       _gfortran_eoshift2_2_char4, _gfortran_eoshift2_4_char4,
+       _gfortran_eoshift2_8_char4, _gfortran_eoshift3_16_char4,
+       _gfortran_eoshift3_4_char4 and _gfortran_eoshift3_8_char4.
+       * generated/eoshift3_4.c: Regenerate.
+       * generated/eoshift1_8.c: Regenerate.
+       * generated/eoshift1_16.c: Regenerate.
+       * generated/cshift1_4.c: Regenerate.
+       * generated/eoshift1_4.c: Regenerate.
+       * generated/eoshift3_8.c: Regenerate.
+       * generated/eoshift3_16.c: Regenerate.
+       * generated/cshift1_8.c: Regenerate.
+       * generated/cshift1_16.c: Regenerate.
+
+2008-05-25  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/32600
+       * intrinsics/iso_c_binding.c (c_f_procpointer): Remove.
+       * intrinsics/iso_c_binding.h (c_f_procpointer): Remove.
+       * gfortran.map (c_f_procpointer): Remove.
+
+2008-05-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libgfortran/36302
+       * gfortran.map (GFORTRAN_1.1): Add _gfortran_eoshift0_16,
+       _gfortran_eoshift0_16_char, _gfortran_eoshift2_16,
+       _gfortran_eoshift2_16_char,_gfortran_cshift0_16,
+       _gfortran_cshift0_16_char.  Sort alphabetically.
+       * intrinsics/eoshift0.c:  Add function for kind=16 integer.
+       * intrinsics/eoshift2.c:  Likewise.
+       * intrinsics/cshift0.c:  Likewise.
+
+2008-05-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       * m4/in_pack.m4 (internal_pack_'rtype_code`):  Destination
+       pointer is restrict.
+       * m4/transpose.m4 (transpose_'rtype_code`):  Likewise.
+       * m4/pack.m4 (pack_'rtype_code`):  Likewise.
+       * m4/spread.m4 (spread_'rtype_code`):  Likewise.
+       (spread_scalar_'rtype_code`): Likewise.
+       * m4/iforeach.m4 (name`'rtype_qual`_'atype_code):  Likewise.
+       * m4/eoshift1.m4 (eoshift1):  Likewise.
+       * m4/eoshift3.m4 (eoshift3):  Likewise.
+       * m4/in_unpack.m4 (internal_unpack_'rtype_ccode`):  Likewise.
+       * m4/unpack.m4 (unpack0_'rtype_code`):  Likewise.
+       (unpack1_'rtype_code`):  Likewise.
+       * intrinsics/pack_generic.c (pack_generic.c):  Likewise.
+       * intrinsics/unpack_generic.c (unpack_internal):  Likewise.
+       * intrinsics/eoshift0.c (eoshift0):  Likewise.
+       * intrinsics/eoshift2.c (eoshift2):  Likewise.
+       * intrinsics/reshape_generic.c (reshape_internal):  Likewise.
+       * intrinsics/reshape_packed.c (reshape_packed):  Likewise.
+       * generated/eoshift1_16.c: Regenerated.
+       * generated/eoshift1_4.c: Regenerated.
+       * generated/eoshift1_8.c: Regenerated.
+       * generated/eoshift3_16.c: Regenerated.
+       * generated/eoshift3_4.c: Regenerated.
+       * generated/eoshift3_8.c: Regenerated.
+       * generated/in_pack_c10.c: Regenerated.
+       * generated/in_pack_c16.c: Regenerated.
+       * generated/in_pack_c4.c: Regenerated.
+       * generated/in_pack_c8.c: Regenerated.
+       * generated/in_pack_i1.c: Regenerated.
+       * generated/in_pack_i16.c: Regenerated.
+       * generated/in_pack_i2.c: Regenerated.
+       * generated/in_pack_i4.c: Regenerated.
+       * generated/in_pack_i8.c: Regenerated.
+       * generated/in_pack_r10.c: Regenerated.
+       * generated/in_pack_r16.c: Regenerated.
+       * generated/in_pack_r4.c: Regenerated.
+       * generated/in_pack_r8.c: Regenerated.
+       * generated/in_unpack_c10.c: Regenerated.
+       * generated/in_unpack_c16.c: Regenerated.
+       * generated/in_unpack_c4.c: Regenerated.
+       * generated/in_unpack_c8.c: Regenerated.
+       * generated/in_unpack_i1.c: Regenerated.
+       * generated/in_unpack_i16.c: Regenerated.
+       * generated/in_unpack_i2.c: Regenerated.
+       * generated/in_unpack_i4.c: Regenerated.
+       * generated/in_unpack_i8.c: Regenerated.
+       * generated/in_unpack_r10.c: Regenerated.
+       * generated/in_unpack_r16.c: Regenerated.
+       * generated/in_unpack_r4.c: Regenerated.
+       * generated/in_unpack_r8.c: Regenerated.
+       * generated/maxloc0_16_i1.c: Regenerated.
+       * generated/maxloc0_16_i16.c: Regenerated.
+       * generated/maxloc0_16_i2.c: Regenerated.
+       * generated/maxloc0_16_i4.c: Regenerated.
+       * generated/maxloc0_16_i8.c: Regenerated.
+       * generated/maxloc0_16_r10.c: Regenerated.
+       * generated/maxloc0_16_r16.c: Regenerated.
+       * generated/maxloc0_16_r4.c: Regenerated.
+       * generated/maxloc0_16_r8.c: Regenerated.
+       * generated/maxloc0_4_i1.c: Regenerated.
+       * generated/maxloc0_4_i16.c: Regenerated.
+       * generated/maxloc0_4_i2.c: Regenerated.
+       * generated/maxloc0_4_i4.c: Regenerated.
+       * generated/maxloc0_4_i8.c: Regenerated.
+       * generated/maxloc0_4_r10.c: Regenerated.
+       * generated/maxloc0_4_r16.c: Regenerated.
+       * generated/maxloc0_4_r4.c: Regenerated.
+       * generated/maxloc0_4_r8.c: Regenerated.
+       * generated/maxloc0_8_i1.c: Regenerated.
+       * generated/maxloc0_8_i16.c: Regenerated.
+       * generated/maxloc0_8_i2.c: Regenerated.
+       * generated/maxloc0_8_i4.c: Regenerated.
+       * generated/maxloc0_8_i8.c: Regenerated.
+       * generated/maxloc0_8_r10.c: Regenerated.
+       * generated/maxloc0_8_r16.c: Regenerated.
+       * generated/maxloc0_8_r4.c: Regenerated.
+       * generated/maxloc0_8_r8.c: Regenerated.
+       * generated/minloc0_16_i1.c: Regenerated.
+       * generated/minloc0_16_i16.c: Regenerated.
+       * generated/minloc0_16_i2.c: Regenerated.
+       * generated/minloc0_16_i4.c: Regenerated.
+       * generated/minloc0_16_i8.c: Regenerated.
+       * generated/minloc0_16_r10.c: Regenerated.
+       * generated/minloc0_16_r16.c: Regenerated.
+       * generated/minloc0_16_r4.c: Regenerated.
+       * generated/minloc0_16_r8.c: Regenerated.
+       * generated/minloc0_4_i1.c: Regenerated.
+       * generated/minloc0_4_i16.c: Regenerated.
+       * generated/minloc0_4_i2.c: Regenerated.
+       * generated/minloc0_4_i4.c: Regenerated.
+       * generated/minloc0_4_i8.c: Regenerated.
+       * generated/minloc0_4_r10.c: Regenerated.
+       * generated/minloc0_4_r16.c: Regenerated.
+       * generated/minloc0_4_r4.c: Regenerated.
+       * generated/minloc0_4_r8.c: Regenerated.
+       * generated/minloc0_8_i1.c: Regenerated.
+       * generated/minloc0_8_i16.c: Regenerated.
+       * generated/minloc0_8_i2.c: Regenerated.
+       * generated/minloc0_8_i4.c: Regenerated.
+       * generated/minloc0_8_i8.c: Regenerated.
+       * generated/minloc0_8_r10.c: Regenerated.
+       * generated/minloc0_8_r16.c: Regenerated.
+       * generated/minloc0_8_r4.c: Regenerated.
+       * generated/minloc0_8_r8.c: Regenerated.
+       * generated/pack_c10.c: Regenerated.
+       * generated/pack_c16.c: Regenerated.
+       * generated/pack_c4.c: Regenerated.
+       * generated/pack_c8.c: Regenerated.
+       * generated/pack_i1.c: Regenerated.
+       * generated/pack_i16.c: Regenerated.
+       * generated/pack_i2.c: Regenerated.
+       * generated/pack_i4.c: Regenerated.
+       * generated/pack_i8.c: Regenerated.
+       * generated/pack_r10.c: Regenerated.
+       * generated/pack_r16.c: Regenerated.
+       * generated/pack_r4.c: Regenerated.
+       * generated/pack_r8.c: Regenerated.
+       * generated/spread_c10.c: Regenerated.
+       * generated/spread_c16.c: Regenerated.
+       * generated/spread_c4.c: Regenerated.
+       * generated/spread_c8.c: Regenerated.
+       * generated/spread_i1.c: Regenerated.
+       * generated/spread_i16.c: Regenerated.
+       * generated/spread_i2.c: Regenerated.
+       * generated/spread_i4.c: Regenerated.
+       * generated/spread_i8.c: Regenerated.
+       * generated/spread_r10.c: Regenerated.
+       * generated/spread_r16.c: Regenerated.
+       * generated/spread_r4.c: Regenerated.
+       * generated/spread_r8.c: Regenerated.
+       * generated/transpose_c10.c: Regenerated.
+       * generated/transpose_c16.c: Regenerated.
+       * generated/transpose_c4.c: Regenerated.
+       * generated/transpose_c8.c: Regenerated.
+       * generated/transpose_i16.c: Regenerated.
+       * generated/transpose_i4.c: Regenerated.
+       * generated/transpose_i8.c: Regenerated.
+       * generated/transpose_r10.c: Regenerated.
+       * generated/transpose_r16.c: Regenerated.
+       * generated/transpose_r4.c: Regenerated.
+       * generated/transpose_r8.c: Regenerated.
+       * generated/unpack_c10.c: Regenerated.
+       * generated/unpack_c16.c: Regenerated.
+       * generated/unpack_c4.c: Regenerated.
+       * generated/unpack_c8.c: Regenerated.
+       * generated/unpack_i1.c: Regenerated.
+       * generated/unpack_i16.c: Regenerated.
+       * generated/unpack_i2.c: Regenerated.
+       * generated/unpack_i4.c: Regenerated.
+       * generated/unpack_i8.c: Regenerated.
+       * generated/unpack_r10.c: Regenerated.
+       * generated/unpack_r16.c: Regenerated.
+       * generated/unpack_r4.c: Regenerated.
+       * generated/unpack_r8.c: Regenerated.
+
+2008-05-18  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * runtime/select.c: Moved content to select_inc.c. Include it. 
+       Add macros for different character types.
+       * runtime/select_inc.c: New file.
+       * runtime/convert_char.c: New file.
+       * intrinsics/pack_generic.c (pack_char4, pack_s_char4): New
+       functions.
+       * intrinsics/transpose_generic.c (transpose_char4): New function.
+       * intrinsics/spread_generic.c (spread_char4, spread_char4_scalar):
+       New functions.
+       * intrinsics/unpack_generic.c (unpack1_char4, unpack0_char4): 
+       New functions.
+       * intrinsics/reshape_generic.c (reshape_char): Use
+       gfc_charlen_type as type for length variables.
+       (reshape_char4): New function.
+       * gfortran.map (GFORTRAN_1.1): Add _gfortran_select_string_char4,
+       _gfortran_convert_char1_to_char4, _gfortran_convert_char4_to_char1,
+       _gfortran_transpose_char4, _gfortran_spread_char4,
+       _gfortran_spread_char4_scalar, _gfortran_reshape_char4,
+       _gfortran_pack_char4, _gfortran_pack_s_char4,
+       _gfortran_unpack0_char4 and _gfortran_unpack1_char4.
+       * Makefile.am: Add runtime/convert_char.c.
+       * Makefile.in: Regenerate.
+
+2008-05-17  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       * io/list_read.c (list_formatted_read_scalar):  Declare
+       type as volatile to shut up compiler warning.
+
+2008-05-16  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/25561
+       * io/io.h (struct fbuf): Change pointer to position offset.
+       * io/fbuf.c (fbuf_init): Reduce default size of buffer, ptr=>pos
+       changes.
+       (fbuf_reset): ptr=>pos changes.
+       (fbuf_alloc): If the request doesn't fit, don't waste memory by
+       keeping flushed bytes. ptr=>pos changes.
+       (fbuf_flush): ptr=>pos changes.
+       (fbuf_seek): Don't seek past the left tab limit, don't update active
+       byte count.
+       * io/open.c (new_unit): If RECL has been specified, used that as
+       initial buffer size.
+
+2008-05-16  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/35632
+       * io/open.c (new_unit): Set stream position to correct value.
+
+2008-05-15  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/25561
+       * Makefile.am: Add fbuf.c to gfor_io_src.
+       * Makefile.in: Regenerate.
+       * io/io.h (read_block): Remove.
+       (struct stream): Remove alloc_r_at function pointer.
+       (salloc_r): Remove.
+       (salloc_r_at): Remove.
+       (salloc_w_at): Remove.
+       (salloc_w): Remove offset argument.
+       (struct fbuf): New struct for format buffer.
+       (struct gfc_unit): Add fbuf.
+       (read_block_form): New prototype.
+       (fbuf_init): Likewise.
+       (fbuf_destroy): Likewise.
+       (fbuf_reset): Likewise.
+       (fbuf_alloc): Likewise.
+       (fbuf_flush): Likewise.
+       (fbuf_seek): Likewise.
+       * io/file_pos.c (formatted_backspace): Change to use sread.
+       (unformatted_backspace): Likewise.
+       (st_backspace): Flush format buffer.
+       (st_rewind): Likewise.
+       * io/list_read.c (next_char): Likewise.
+       (nml_query): Tidying, flush format buffer.
+       * io/open.c (new_unit): Init format buffer.
+       * io/read.c (read_l): Change to use read_block_form.
+       (read_a): Likewise.
+       (read_decimal): Likewise.
+       (read_radix): Likewise.
+       (read_f): Likewise.
+       (read_x): Empty reads also for stream I/O.
+       * io/transfer.c (read_sf): Change to use sread.
+       (read_block): Rename to read_block_form, change prototype, use sread.
+       (read_block_direct): Don't seek stream files.
+       (write_block): Change to use fbuf if external file, don't seek stream
+       files.
+       (write_buf): Don't seek stream files.
+       (formatted_transfer_scalar): Use fbuf for external files.
+       (us_read): Change to use sread.
+       (pre_position): Do nothing for stream I/O.
+       (data_transfer_init): Flush fbuf when switching from write to read, if
+       POS is specified, seek stream file to correct offset.
+       (skip_record): Change to use sread.
+       (min_off): New function.
+       (next_record_r): Change to use sread.
+       (next_record_w): Change to use sset/sseek, flush fbuf.
+       (finalize_transfer): Flush fbuf.
+       * io/unit.c (init_units): Init fbuf for stdout, stderr.
+       (close_unit_1): Destroy fbuf.
+       (finish_last_advance_record): Flush fbuf, no need to seek.
+       * io/unix.c (fd_alloc_r_at): Remove unused where argument.
+       (fd_alloc_w_at): Likewise.
+       (fd_read): Remove third argument to fd_alloc_r_at.
+       (fd_write): Remove third argument to fd_alloc_w_at.
+       (fd_sset): Likewise.
+       (fd_open): Don't set alloc_r_at.
+       (mem_alloc_r_at): Remove unused where argument.
+       (mem_alloc_w_at): Likewise.
+       (mem_read): Don't incorrectly return previous errno, remove unused
+       third argument to alloc function.
+       (mem_write): Likewise.
+       (mem_set): Likewise.
+       (open_internal): Don't set alloc_r_at pointer.
+       * io/fbuf.c: New file.
+
+2008-05-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * libgfortran.h (gfc_char4_t): New type.
+       (GFC_SIZE_OF_CHAR_KIND): New macro.
+       (compare_string): Adjust prototype.
+       (compare_string_char4): New prototype.
+       * gfortran.map (GFORTRAN_1.1): Add _gfortran_adjustl_char4,
+       _gfortran_adjustr_char4, _gfortran_compare_string_char4,
+       _gfortran_concat_string_char4, _gfortran_string_index_char4,
+       _gfortran_string_len_trim_char4, _gfortran_string_minmax_char4,
+       _gfortran_string_scan_char4, _gfortran_string_trim_char4 and
+       _gfortran_string_verify_char4.
+       * intrinsics/string_intrinsics_inc.c: New file from content of
+       string_intrinsics.c with types replaced by macros.
+       * intrinsics/string_intrinsics.c: Move content to
+       string_intrinsics_inc.c.
+
+2008-05-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/36202
+       * io/list_read (eat_separator): Handle the CR-LF case correctly.
+
+2008-05-09  Julian Brown  <julian@codesourcery.com>
+
+       * Makefile.am (LTLDFLAGS): New.
+       (libgfortran_la_LDFLAGS): Use above.
+       * Makefile.in: Regenerate.
+
+2008-05-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/36131
+       * io/transfer.c (formatted_transfer_scalar): Revert patch for PR34974.
+       (next_record_w): Likewise.
+
+2008-05-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/35995
+       * m4/ifunction_logical.m4:  If the extent of "array"
+       is less than zero, set it to zero.  Use an explicit
+       flag for breaking out of the main loop to avoid, because
+       the data pointer for "array" may be NULL for an empty
+       array.
+       * m4/ifunction.m4:  Likewise.
+       * generated/all_l1.c: Regenerated.
+       * generated/all_l16.c: Regenerated.
+       * generated/all_l2.c: Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/any_l1.c: Regenerated.
+       * generated/any_l16.c: Regenerated.
+       * generated/any_l2.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/count_16_l.c: Regenerated.
+       * generated/count_1_l.c: Regenerated.
+       * generated/count_2_l.c: Regenerated.
+       * generated/count_4_l.c: Regenerated.
+       * generated/count_8_l.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2008-05-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/35990
+       * intrinsics/pack_generic.c:  Really commit.
+
+2008-05-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/35990
+       * intrinsics/pack_generic.c:  If an extent of the source
+       array is less then zero, set it to zero.  Set the source
+       pointer to NULL if the source size is zero.  Set the total
+       number of elements to zero if the vector has an extent
+       less or equal to zero.
+       * m4/pack.m4:  Set the source pointer to NULL if the
+       source array is zero-sized.  Set the total number of
+       elemements to zero if the vector has an extent less or
+       equal to zero.
+       * generated/pack_i1.c:  Regenerated.
+       * generated/pack_i2.c:  Regenerated.
+       * generated/pack_i4.c:  Regenerated.
+       * generated/pack_i8.c:  Regenerated.
+       * generated/pack_i16.c:  Regenerated.
+       * generated/pack_r4.c:  Regenerated.
+       * generated/pack_r8.c:  Regenerated.
+       * generated/pack_r10.c:  Regenerated.
+       * generated/pack_r16.c:  Regenerated.
+       * generated/pack_c4.c:  Regenerated.
+       * generated/pack_c8.c:  Regenerated.
+       * generated/pack_c10.c:  Regenerated.
+       * generated/pack_c16.c:  Regenerated.
+
+2008-05-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/36094
+       * runtime/error.c (show_locus): Provide modified error message when
+       filename has not yet been associated with a unit number.
+       * io/open.c (encoding_opt[]): Comment out "utf-8" option and add TODO.
+
+2008-04-30  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * intrinsics/selected_char_kind.c: New file.
+       * gfortran.map (GFORTRAN_1.1): Add _gfortran_selected_char_kind.
+       * Makefile.am: Add intrinsics/selected_char_kind.c.
+       * Makefile.in: Regenerate.
+
+2008-04-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/35993
+       * ifunction.m4 (SCALAR_ARRAY_FUNCTION):  Use correct
+       implementation for multi-dimensional return arrays when
+       the mask is .false.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2008-04-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/35960
+       * m4/reshape.m4:  Fix typo in last commit.
+       * generated/reshape_i4.c:  Regererated.
+       * generated/reshape_i8.c:  Regenerated.
+       * generated/reshape_i16.c:  Regenerated.
+       * generated/reshape_r4.c:  Regenerated.
+       * generated/reshape_r8.c:  Regenerated.
+       * generated/reshape_r10.c:  Regenerated.
+       * generated/reshape_r16.c:  Regenerated.
+       * generated/reshape_c4.c:  Regenerated.
+       * generated/reshape_c8.c:  Regenerated.
+       * generated/reshape_c10.c:  Regenerated.
+       * generated/reshape_c16.c:  Regenerated.
+
+2008-04-24  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * intrinsics/time_1.h (__time_1): Remove unused variable.
+
+2008-04-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/35988
+       * m4/matmul.m4:  Only issue a runtime error if extents are
+       non-zero.
+       * generated/matmul_i1.c:  Regenerated.
+       * generated/matmul_i2.c:  Regenerated.
+       * generated/matmul_i4.c:  Regenerated.
+       * generated/matmul_i8.c:  Regenerated.
+       * generated/matmul_i16.c:  Regenerated.
+       * generated/matmul_r4.c:  Regenerated.
+       * generated/matmul_r8.c:  Regenerated.
+       * generated/matmul_r10.c:  Regenerated.
+       * generated/matmul_r16.c:  Regenerated.
+       * generated/matmul_c4.c:  Regenerated.
+       * generated/matmul_c8.c:  Regenerated.
+       * generated/matmul_c10.c:  Regenerated.
+       * generated/matmul_c16.c:  Regenerated.
+
+2008-04-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY)
+       (LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT)
+       (LIBGFOR_CHECK_ATTRIBUTE_ALIAS, LIBGFOR_CHECK_SYNC_FETCH_AND_ADD)
+       (LIBGFOR_GTHREAD_WEAK, LIBGFOR_CHECK_UNLINK_OPEN_FILE)
+       (LIBGFOR_CHECK_CRLF, LIBGFOR_CHECK_FOR_BROKEN_ISFINITE)
+       (LIBGFOR_CHECK_FOR_BROKEN_ISNAN)
+       (LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY, LIBGFOR_CHECK_WORKING_STAT)
+       (LIBGFOR_CHECK_FPSETMASK, LIBGFOR_CHECK_MINGW_SNPRINTF):
+       Fix cache variable names.
+       * configure, Makefile.in: Regenerate.
+
+2008-04-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/35991
+       * intrinsics/cshift0.c (cshift0): Avoid divide by zero.
+
+2008-04-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/35960
+       * intrinsics/reshape_generic.c (reshape_internal): If the size
+       of the resized array is zero, as determined by the SHAPE
+       argument, return early.
+       * m4/reshape.m4:  Likewise.
+       * generated/reshape_i4.c:  Regererated.
+       * generated/reshape_i8.c:  Regenerated.
+       * generated/reshape_i16.c:  Regenerated.
+       * generated/reshape_r4.c:  Regenerated.
+       * generated/reshape_r8.c:  Regenerated.
+       * generated/reshape_r10.c:  Regenerated.
+       * generated/reshape_r16.c:  Regenerated.
+       * generated/reshape_c4.c:  Regenerated.
+       * generated/reshape_c8.c:  Regenerated.
+       * generated/reshape_c10.c:  Regenerated.
+       * generated/reshape_c16.c:  Regenerated.
+
+2008-04-18  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR bootstrap/35457
+       * aclocal.m4: Regenerate.
+       * configure: Regenerate.
+
+2008-04-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32972
+       * intrinsics/spread_generic.c (spread):  Use spread_i2()
+       for GFC_DTYPE_DERIVED_2 (fix typo from previous commit).
+
+2008-04-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
+       Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/32972
+       PR libfortran/32512
+       configure.ac:  Add test for uintptr_t.
+       configure:  Regenerated.
+       config.h.in:  Regenerated.
+       * libgfortran.h: GFC_DTYPE_DERIVED_1:  New macro.
+       GFC_DTYPE_DERIVED_2:  New macro.
+       GFC_DTYPE_DERIVED_4:  New macro.
+       GFC_DTYPE_DERIVED_8:  New macro.
+       GFC_DTYPE_DERIVED_16:  New macro.
+       GFC_UNALIGNED_2:  New macro.
+       GFC_UNALIGNED_4:  New macro.
+       GFC_UNALIGNED_8:  New macro.
+       GFC_UNALIGNED_16:  New macro.
+       intptr_t:  Define if we don't have it.
+       uintptr_t:  Likewise.
+       * runtime/backtrace.c (show_backtrace):  Use intptr_t.
+       * intrinsics/signal.c (signal_sub):  Likewise.
+       (signal_sub_int):  Likewise.
+       (alarm_sub_int_i4):  Likewise.
+       * intrinsics/spread_generic.c (spread):  Use the integer
+       routines for handling derived types of sizes 1, 2, 4, 8 and 16
+       if the alignment of all pointers is correct.
+       (spread_scalar):  Likewise.
+       * intrinsics/pack_generic.c (pack):  Likewise.
+       Use GFD_DTYPE_TYPE_SIZE to avoid nested switch statements.
+       * intrinsics/unpack_generic.c (unpack1):  Likewise.
+       (unpack0):  Likewise.
+       * runtime/in_pack_generic.c (internal_pack):  Likewise.
+       * runtime/in_unpack_generic.c (internal_unpack):  Likewise.
+
+2008-04-09  Jakub Jelinek  <jakub@redhat.com>
+
+       * io/list_read.c (snprintf): Define if HAVE_SNPRINTF isn't defined.
+       (nml_read_obj): Add nml_err_msg_size argument.  Pass it down to
+       recursive call.  Use snprintf instead of sprintf when %s nl->var_name
+       is used.
+       (nml_get_obj_data): Add nml_err_msg_size argument.  Pass it down to
+       nml_read_obj call.  Use snprintf instead of sprintf when %s
+       nl->var_name is used.  Pass nml_err_msg to nml_parse_qualifier instead
+       of parse_err_msg array.  Append " for namelist variable " and
+       nl->var_name to it.
+       (namelist_read): Increase size of nml_err_msg array to 200.  Pass
+       sizeof nml_err_msg as extra argument to nml_get_obj_data.
+
+2008-04-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/25829 28655
+       * io/open.c (edit_modes): Set flags.async. (new_unit) Set flags.async
+       and flags.status. (st_open): Initialize flags.async.
+       * io/list_read.c (read_charactor): Use delim_status instead of
+       flags.delim.
+       * io/read.c (read_x): Use pad_status instead of flags.pad.
+       * io/inquire.c (inquire_via_unit): Add new checks.
+       (inquire_via_filename): Likewise.
+       * io/io.h (st_parameter_inquire): Add new flags.
+       (st_parameter_dt): Likewise.
+       * io/unit.c (get_internal_unit): Set flags.async. (init_units): Set
+       flags.async.
+       * io/transfer.c: Add delim and pad option arrays. (read_sf): Use
+       pad_status instead of flags.pad. (read_block): Likewise.
+       (data_transfer_init): Set flags.async and add checks.
+       * io/write.c (write_character): Use delim_status.
+       (list_formatted_write_scalar): Likewise. (nml_write_obj): Likewise.
+       (namelist_write): Likewise.
+
+2008-04-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/25829 28655
+       * gfortran.map: Add new symbol, _gfortran_st_wait.
+       * libgfortran.h (st_paramter_common): Add new I/O parameters.
+       * open.c (st_option decimal_opt[], st_option encoding_opt[],
+       st_option round_opt[], st_option sign_opt[], st_option async_opt[]): New
+       parameter option arrays. (edit_modes): Add checks for new parameters.
+       (new_unit): Likewise. (st_open): Likewise.
+       * list_read.c (CASE_SEPERATORS): Add ';' as a valid separator.
+       (eat_separator): Handle deimal comma. (read_logical): Fix whitespace.
+       (parse_real): Handle decimal comma. (read_real): Handle decimal comma.
+       * read.c (read_a): Use decimal status flag to allow comma in place of a
+       decimal point. (read_f): Allow comma as acceptable character in float.
+       According to decimal flag, substitute a period for a comma.
+       (read_x): If decimal status flag is comma, disable the read_comma flag,
+       not allowing comma as a delimiter, an extension otherwise.
+       * io.h: (unit_decimal, unit_encoding, unit_round, unit_sign,
+       unit_async): New enumerators. Add all new I/O parameters.
+       * unix.c (unix_stream, int_stream): Add io_mode asychronous I/O control.
+       (move_pos_offset, fd_alloc_w_at): Fix some whitespace.
+       (fd_sfree): Use new enumerator. (fd_read): Likewise.
+       (fd_write): Likewise. (fd_close): Fix whitespace.
+       (fd_open): Use new enumertors. (tempfile, regular_file,
+       open_external): Fix whitespace. (output_stream, error_stream): Set
+       method. (stream_offset): Fix whitespace.
+       * transfer.c: (st_option decimal_opt[], sign_opt[], blank_opt[]): New
+       option arrays.  (formatted_transfer_scalar): Set sf_read_comma flag
+       based on new decimal_status flag. (data_transfer_init): Initialize new
+       parameters. Add checks for decimal, sign, and blank. (st_wait): New stub.
+       * format.c: (format_lex): Add format specifiers DP, DC, and D.
+       (parse_format_list): Parse the new specifiers.
+       * write.c (write_decimal): Use new sign enumerators to set the sign.
+       (write_complex): Handle decimal comma and semi-colon separator.
+       (nml_write_obj): Likewise.
+       * write_float.def: Revise sign enumerators. (calculate_sign): Use new
+       sign enumerators. (output_float): Likewise. Use new decimal_status flag
+       to set the decimal character to a point or a comma.
+       
+2008-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32972
+       PR libfortran/32512
+       * Makefile.am:  Add new variable, i_spread_c, containing
+       pack_i1.c, pack_i2.c, pack_i4.c, pack_i8.c, spread_i16.c,
+       spread_r4.c, spread_r8.c, spread_r10.c, spread_r16.c,
+       spread_c4.c, spread_c8.c, spread_c10.c, spread_c16.c.
+       * Makefile.in:  Regenerated.
+       * libgfortran.h:  Add prototypes for spread_i1, spread_i2,
+       spread_i4, spread_i8, spread_i16, spread_r4, spread_r8,
+       spread_c4, spread_c8, spread_c10, spread_c16,
+       spread_scalar_i1, spread_scalar_i2, spread_scalar_i4,
+       spread_scalar_i8, spread_scalar_i16, spread_scalar_r4
+       spread_scalar_r8, spread_scalar_c4, spread_scalar_c8,
+       spread_scalar_c10 and spread_scalar_c16.
+       Add macros to isolate both type and size information
+       from array descriptors with a single mask operation.
+       * intrinsics/spread_generic.c:  Add calls to specific
+       spread functions.
+       * m4/spread.m4:  New file.
+       * generated/spread_i1.c:  New file.
+       * generated/spread_i2.c:  New file.
+       * generated/spread_i4.c:  New file.
+       * generated/spread_i8.c:  New file.
+       * generated/spread_i16.c:  New file.
+       * generated/spread_r4.c:  New file.
+       * generated/spread_r8.c:  New file.
+       * generated/spread_r10.c:  New file.
+       * generated/spread_r16.c:  New file.
+       * generated/spread_c4.c:  New file.
+       * generated/spread_c8.c:  New file.
+       * generated/spread_c10.c:  New file.
+       * generated/spread_c16.c:  New file.
+
+2008-03-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/35699
+       * io/transfer.c (write_buf):  Don't pad the record, just return if the
+       data is NULL.  (next_record_w): If there are bytes left in the record
+       for unformatted direct I/O, pad out the record with zero bytes.
+
+2008-03-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/35721
+       * intrinsics/associated.c (associated): Ignore different
+       stride of pointer vs. target if only one element is referred.
+
+2008-03-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/unix.c (fd_close):  Do not close STDIN.
+
+2008-03-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32972
+       * Makefile.am:  Add new variable, i_unpack_c, containing
+       unpack_i1.c, unpack_i2.c, unpack_i4.c, unpack_i8.c,
+       unpack_i16.c, unpack_r4.c, unpack_r8.c, unpack_r10.c,
+       unpack_r16.c, unpack_c4.c, unpack_c8.c, unpack_c10.c
+       and unpack_c16.c
+       Add i_unpack_c to gfor_built_src.
+       Add rule to generate i_unpack_c from m4/unpack.m4.
+       * Makefile.in:  Regenerated.
+       * libgfortran.h: Add prototypes for unpack0_i1, unpack0_i2,
+       unpack0_i4, unpack0_i8, unpack0_i16, unpack0_r4, unpack0_r8,
+       unpack0_r10, unpack0_r16, unpack0_c4, unpack0_c8, unpack0_c10,
+       unpack0_c16, unpack1_i1, unpack1_i2, unpack1_i4, unpack1_i8,
+       unpack1_i16, unpack1_r4, unpack1_r8, unpack1_r10, unpack1_r16,
+       unpack1_c4, unpack1_c8, unpack1_c10 and unpack1_c16.
+       * intrinsics/pack_generic.c (unpack1):  Add calls to specific
+       unpack1 functions.
+       (unpack0):  Add calls to specific unpack0 functions.
+       * m4/unpack.m4:  New file.
+       * generated/unpack_i1.c:  New file.
+       * generated/unpack_i2.c:  New file.
+       * generated/unpack_i4.c:  New file.
+       * generated/unpack_i8.c:  New file.
+       * generated/unpack_i16.c:  New file.
+       * generated/unpack_r4.c:  New file.
+       * generated/unpack_r8.c:  New file.
+       * generated/unpack_r10.c:  New file.
+       * generated/unpack_r16.c:  New file.
+       * generated/unpack_c4.c:  New file.
+       * generated/unpack_c8.c:  New file.
+       * generated/unpack_c10.c:  New file.
+       * generated/unpack_c16.c:  New file.
+
+2008-03-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/35632
+       * io/transfer.c (data_transfer_init):  Fix whitespace.
+       (next_record_w): Truncate the file only if the stream
+       position is short of the file end.
+
+2008-03-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * intrinsics/pack_generic.c:  Fix typo.
+
+2008-03-21  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * gfortran.map: Move erfc_scaled symbols to new symbol node
+       GFORTRAN_1.1, thereby fixing ABI bug introduced in r132846.
+
+2008-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32972
+       * runtime/in_pack_generic.c (internal_pack):  Call correct
+       function, pack_i16, for GFC_INTEGER_16.
+
+2008-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32972
+       * Makefile.am:  Add new variable, i_pack_c, containing
+       pack_i1.c, pack_i2.c, pack_i4.c, pack_i8.c, pack_i16.c,
+       pack_r4.c, pack_r8.c, pack_r10.c, pack_r16.c, pack_c4.c,
+       pack_c8.c, pack_c10.c, pack_c16.c.
+       Add m4/pack.m4 to m4_files.
+       Add i_pack_c to gfor_built_src.
+       Add rule to generate i_pack_c from m4/pack.m4.
+       * Makefile.in:  Regenerated.
+       * libgfortran.h: Add prototypes for pack_i1, pack_i2, pack_i4,
+       pack_i8, pack_i16, pack_r4, pack_r8, pack_c4, pack_c8,
+       pack_c10, pack_c16.
+       * intrinsics/pack_generic.c:  Add calls to specific
+       pack functions.
+       * m4/pack.m4:  New file.
+       * generated/pack_i1.c:  New file.
+       * generated/pack_i2.c:  New file.
+       * generated/pack_i4.c:  New file.
+       * generated/pack_i8.c:  New file.
+       * generated/pack_i16.c:  New file.
+       * generated/pack_r4.c:  New file.
+       * generated/pack_r8.c:  New file.
+       * generated/pack_r10.c:  New file.
+       * generated/pack_r16.c:  New file.
+       * generated/pack_c4.c:  New file.
+       * generated/pack_c8.c:  New file.
+       * generated/pack_c10.c:  New file.
+       * generated/pack_c16.c:  New file.
+
+2008-03-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/35627
+       * io/list_read.c (free_line): Clear the line buffer enable flag and
+       reset the index into line_buffer, aka item_count.
+       (next_char): Cleanup whitespace.
+       (read_logical): Use unget_char to assure that the first character of the
+       bad logical is saved in case it is part of an object name. Remove the
+       clearing of index and flag that is now in free_line.
+       (read_real): Likewise.
+
+2008-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32972
+       * runtime/in_pack_generic.c (internal_pack):  Fix typo in
+       last commit.
+
+2008-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32972
+       * Makefile.am (in_pack_c): Add in_pack_i1.c, in_pack_i2.c,
+       in_pack_r4.c, in_pack_r8.c, in_pack_r10.c and in_pack_r16.c.
+       (in_unpack_c): Add in_unpack_i1.c, in_unpack_i2.c,
+       in_unpack_r4.c, in_unpack_r8.c, in_unpack_r10.c and
+       in_unpack_r16.c.
+       * Makefile.in: Regenerate.
+       * libgfortran.h:  Add prototypes for internal_pack_1,
+       internal_pack_2, internal_pack_16, internal_pack_r4,
+       internal_pack_r8, internal_pack_r10, internal_pack_r16,
+       internal_pack_c10 and internal_pack_c16.  Add prototypes for
+       internal_unpack_1, internal_unpack_2, internal_unpack_16,
+       internal_unpack_r4, internal_unpack_r8, internal_unpack_r10,
+       internal_unpack_r16, internal_unpack_c10 and
+       internal_unpack_c16.
+       * runtime/in_pack_generic.c (internal_pack): Use sizeof instead
+       of hardwired sizes.
+       Add calls to internal_pack_1, internal_pack_2,
+       internal_pack_16, internal_pack_r4, internal_pack_r8,
+       internal_pack_r10, internal_pack_r16, internal_pack_c10 and
+       internal_pack_c16.
+       * runtime/in_unpack_generic.c (internal_unpack):  Use sizeof
+       instead of hardwired sizes.
+       Add calls to internal_unpack_1, internal_unpack_2,
+       internal_unpack_16, internal_unpack_r4, internal_unpack_r8,
+       internal_unpack_r10, internal_unpack_r16, internal_unpack_c10
+       and internal_unpack_c16.
+       * generated/in_pack_r4.c:  New file.
+       * generated/in_pack_i2.c:  New file.
+       * generated/in_unpack_i1.c:  New file.
+       * generated/in_pack_r10.c:  New file.
+       * generated/in_unpack_r4.c:  New file.
+       * generated/in_unpack_i2.c:  New file.
+       * generated/in_unpack_r16.c:  New file.
+       * generated/in_pack_r8.c:  New file.
+       * generated/in_unpack_r10.c:  New file.
+       * generated/in_unpack_r8.c:  New file.
+       * generated/in_pack_r16.c:  New file.
+       * generated/in_pack_i1.c:  New file.
+
+2008-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/35617
+       * io/list_read.c (eat_separator): If next character after eatline is '!'
+       then eatline again. 
+
+2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * aclocal.m4: Regenerate.
+       * configure: Likewise.
+       * Makefile.in: Likewise.
+
+2008-03-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/35524
+       * intrinsics/erfc_scaled_inc.c: Only define the long double
+       variant of erfc_scaled if expl is available.
+
+2008-03-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/32812
+       * intrinsics/random.c (scramble_seed, unscramble_seed): New
+       functions.
+       (random_seed_i4): Scramble the seed the user gives us before
+       storing it, and unscramble it when we return it back later.
+
+2008-03-05  Hans-Peter Nilsson  <hp@axis.com>
+
+       PR libfortran/35293
+       * io/unix.c (fd_truncate): Fold s->special_file case into
+       success case of ftruncate/chsize call instead of the failure case.
+       Make failure case actually return failure.  Properly update stream
+       pointers on failure.  Call runtime_error for targets without
+       neither ftruncate nor chsize where such a call would be needed.
+
+2008-03-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/33197
+       * intrinsics/erfc_scaled_inc.c: New file.
+       * intrinsics/erfc_scaled.c: New file.
+       * gfortran.map (GFORTRAN_1.0): Add _gfortran_erfc_scaled_r*.
+       * Makefile.am: Add intrinsics/erfc_scaled.c.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+
+2008-03-01  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/35355
+       * intrinsics/time_1.h (__time_1): Fix calculation of user_usec
+       for mingw.
+
+2008-03-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/35063
+       * io/unit.c (destroy_unit_mutex): Call __gthread_mutex_destroy
+       instead of macro kludge.
+       
+2008-02-25  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR fortran/29549
+       * Makefile.am: Add -fcx-fortran-rules to AM_CFLAGS for all of
+       libgfortran.
+       * Makefile.in: Regenerated.
+
+2008-02-25  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * m4/ifunction_logical.m4: Add casts to get rid of warnings.
+       * generated/all_l1.c: Regenerate.
+       * generated/all_l2.c: Regenerate.
+       * generated/all_l4.c: Regenerate.
+       * generated/all_l8.c: Regenerate.
+       * generated/all_l16.c: Regenerate.
+       * generated/any_l1.c: Regenerate.
+       * generated/any_l2.c: Regenerate.
+       * generated/any_l4.c: Regenerate.
+       * generated/any_l8.c: Regenerate.
+       * generated/any_l16.c: Regenerate.
+       * generated/count_1_l.c: Regenerate.
+       * generated/count_2_l.c: Regenerate.
+       * generated/count_4_l.c: Regenerate.
+       * generated/count_8_l.c: Regenerate.
+       * generated/count_16_l.c: Regenerate.
+
+2008-02-24  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/32841
+       * acinclude.m4: Don't use HAVE_MATH_H.
+       * configure: Regenerate.
+
+2008-02-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/35132
+       * io/transfer.c (next_record_w): Truncate after the last record for
+       STREAM I/O.
+
+       PR libfortran/34954
+       * io/transfer.c (data_transfer_init): Initialize dtp->rec if writing.
+
+       PR libfortran/34974
+       * io/transfer.c (formatted_transfer_scalar): Flush the buffer if skips
+       is less than zero. (next_record_w): Use sseek to position the file to
+       the max position reached.
+
+2008-02-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/35036
+       * write_float.def (output_float):  Add error checks for zero digits
+       after decimal point in E and D format specifiers.
+       
+2008-02-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/35063
+       * io/unit.c (destroy_unit_mutex): New function that uses
+       __gthread_mutex_destroy_function or pthread_mutex_destroy after
+       unlocking and before free_mem for final closure of I/O unit.
+       (delete_root): Use new function.
+       (free_internal_unit): Likewise.
+       (close_unit_1): Likewise.
+
+2008-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/35001
+       * m4/shape.m4:  Return 0 for extents <= 0.
+       * generated/shape_i4.c:  Regenerated.
+       * generated/shape_i8.c:  Regenerated.
+       * generated/shape_i16.c:  Regenerated.
+
+2008-01-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34980
+       * m4/shape.m4:  If return array is empty, return early.
+       * generated/shape_i4.c:  Regenerated.
+       * generated/shape_i8.c:  Regenerated.
+       * generated/shape_i16.c:  Regenerated.
+
+2008-01-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfofortran/34887
+       * io/transfer.c (next_record_w): Always move to the farthest
+       position when completing the record (also when we are
+       processing a slash edit descriptor).
+
+2008-01-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/34876
+       * io/transfer.c (write_buf): Handle case of zero sized array.
+       (transfer_array): Set data pointer to NULL and size to zero.  Then
+       make a data transfer and return.
+       
+2008-01-24  David Edelsohn  <edelsohn@gnu.org>
+
+       * configure: Regenerate.
+
+2008-01-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/34795
+       * io/inquire.c (inquire_via_unit): If a unit is opened, return values
+       according to the open action for DIRECT, FORMATTED, and UNFORMATTED.
+       (inquire_via_filename): Return "UNKNOWN" for SEQUENTIAL, DIRECT,
+       FORAMATTED, and UNFORMATTED inquiries.
+       * io/unix.c (inquire_sequential): Return "UNKNOWN" when appropriate
+       for files that are not opened. (inquire_direct): Same.
+       (inquire_formatted): Same.
+       
+2008-01-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/34782
+       * io/transfer.c (formatted_transfer_scalar): Set max_pos to the greater
+       of the current max_pos or the newly calculated position.
+
+2008-01-18  Tobias Burnus  <burnus@net-b.de>
+
+       * io/write.c (write_real): Increase default precision
+       for REAL(16) by one.
+
+2008-01-16  Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR libfortran/34669
+       * mk-kinds-h.sh: Compile with -S to avoid calling the assembler,
+       to avoid piping the -fdump-parse-tree output to the assembler
+       when configuring with -pipe.
+       * mk-sik-inc.sh: Likewise.
+       * mk-srk-inc.sh: Likewise.
+
+2008-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34671
+       * gfortran.am: Added _gfortran_all_l1, _gfortran_all_l2,
+       _gfortran_any_l1, _gfortran_any_l2, -28,15 _gfortran_count_1_l,
+       _gfortran_count_16_l, _gfortran_count_2_l, _gfortran_count_4_l and
+       _gfortran_count_8_l Removed _gfortran_count_16_l16,
+       _gfortran_count_16_l4, _gfortran_count_16_l8,
+       _gfortran_count_4_l16, _gfortran_count_4_l4, _gfortran_count_4_l8,
+       _gfortran_count_8_l16, _gfortran_count_8_l4 and
+       _gfortran_count_8_l8.
+       * Makefile.am: Added generated/any_l1.c and generated/any_l2.c to
+       i_any_c.  Added generated/all_l1. and generated/all_l2.c to
+       i_all_c.  Removed generated/count_4_l4.c, generated/count_8_l4.c,
+       generated/count_16_l4.c, generated/count_4_l8.c,
+       generated/count_8_l8.c, generated/count_16_l8.c,
+       generated/count_4_l16.c, generated/count_8_l16.c, and
+       generated/count_16_l16.c from i_count_c.  Added count_1_l.c,
+       count_2_l.c, count_4_l.c, count_8_l.c and count_16_l.c to
+       i_count_c.  I_M4_DEPS2 depends on ifunction_logical.m4, for
+       any of the files generated from all.m4, any.m4 and count.m4.
+       * Makefile.in:  Regenerated.
+       * m4/ifunction_logical.m4:  New file.  Use
+       GFC_LOGICAL_1 pointer for access to source arrays.
+       * m4/any.m4:  Include ifunction_logical.m4 instead of
+       ifunction.m4.  Don't check atype_name.
+       * m4/all.m4:  Likewise.
+       * m4/count.m4:  Likewise.
+       * generated/any_l1.c:  New file.
+       * generated/any_l2.c:  New file.
+       * generated/all_l1.c:  New file.
+       * generated/count_1_l.c:  New file.
+       * generated/count_2_l.c:  New file.
+       * generated/count_4_l.c:  New file.
+       * generated/count_8_l.c:  New file.
+       * generated/count_16_l.c:  New file.
+       * generated/any_l4.c:  Regenerated.
+       * generated/any_l8.c:  Regenerated.
+       * generated/any_l16.c:  Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/all_l16.c: Regenerated.
+       * generated/count_4_l4.c:  Removed.
+       * generated/count_4_l8.c:  Removed.
+       * generated/count_4_l16.c:  Removed.
+       * generated/count_8_l4.c:  Removed.
+       * generated/count_8_l8.c:  Removed.
+       * generated/count_8_l16.c:  Removed.
+       * generated/count_16_l4.c:  Removed.
+       * generated/count_16_l8.c:  Removed.
+       * generated/count_16_l16.c:  Removed.
+
+2008-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34746
+       * m4/iforeach.m4 (name`'rtype_qual`_'atype_code):  Use %ld
+       in printf format for all bounds checking; cast all
+       integer-like arguments to runtime_error() to long int.
+       (`m'name`'rtype_qual`_'atype_code):  Likewise.
+       (`s'name`'rtype_qual`_'atype_code):  Likewise.
+       * m4/ifunction.m4 (name`'rtype_qual`_'atype_code):  Likewise.
+       (`m'name`'rtype_qual`_'atype_code):  Likewise.
+       (`s'name`'rtype_qual`_'atype_code):  Likewise.
+       * generated/all_l16.c: Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/any_l16.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/count_16_l16.c: Regenerated.
+       * generated/count_16_l4.c: Regenerated.
+       * generated/count_16_l8.c: Regenerated.
+       * generated/count_4_l16.c: Regenerated.
+       * generated/count_4_l4.c: Regenerated.
+       * generated/count_4_l8.c: Regenerated.
+       * generated/count_8_l16.c: Regenerated.
+       * generated/count_8_l4.c: Regenerated.
+       * generated/count_8_l8.c: Regenerated.
+       * generated/maxloc0_16_i1.c: Regenerated.
+       * generated/maxloc0_16_i16.c: Regenerated.
+       * generated/maxloc0_16_i2.c: Regenerated.
+       * generated/maxloc0_16_i4.c: Regenerated.
+       * generated/maxloc0_16_i8.c: Regenerated.
+       * generated/maxloc0_16_r10.c: Regenerated.
+       * generated/maxloc0_16_r16.c: Regenerated.
+       * generated/maxloc0_16_r4.c: Regenerated.
+       * generated/maxloc0_16_r8.c: Regenerated.
+       * generated/maxloc0_4_i1.c: Regenerated.
+       * generated/maxloc0_4_i16.c: Regenerated.
+       * generated/maxloc0_4_i2.c: Regenerated.
+       * generated/maxloc0_4_i4.c: Regenerated.
+       * generated/maxloc0_4_i8.c: Regenerated.
+       * generated/maxloc0_4_r10.c: Regenerated.
+       * generated/maxloc0_4_r16.c: Regenerated.
+       * generated/maxloc0_4_r4.c: Regenerated.
+       * generated/maxloc0_4_r8.c: Regenerated.
+       * generated/maxloc0_8_i1.c: Regenerated.
+       * generated/maxloc0_8_i16.c: Regenerated.
+       * generated/maxloc0_8_i2.c: Regenerated.
+       * generated/maxloc0_8_i4.c: Regenerated.
+       * generated/maxloc0_8_i8.c: Regenerated.
+       * generated/maxloc0_8_r10.c: Regenerated.
+       * generated/maxloc0_8_r16.c: Regenerated.
+       * generated/maxloc0_8_r4.c: Regenerated.
+       * generated/maxloc0_8_r8.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc0_16_i1.c: Regenerated.
+       * generated/minloc0_16_i16.c: Regenerated.
+       * generated/minloc0_16_i2.c: Regenerated.
+       * generated/minloc0_16_i4.c: Regenerated.
+       * generated/minloc0_16_i8.c: Regenerated.
+       * generated/minloc0_16_r10.c: Regenerated.
+       * generated/minloc0_16_r16.c: Regenerated.
+       * generated/minloc0_16_r4.c: Regenerated.
+       * generated/minloc0_16_r8.c: Regenerated.
+       * generated/minloc0_4_i1.c: Regenerated.
+       * generated/minloc0_4_i16.c: Regenerated.
+       * generated/minloc0_4_i2.c: Regenerated.
+       * generated/minloc0_4_i4.c: Regenerated.
+       * generated/minloc0_4_i8.c: Regenerated.
+       * generated/minloc0_4_r10.c: Regenerated.
+       * generated/minloc0_4_r16.c: Regenerated.
+       * generated/minloc0_4_r4.c: Regenerated.
+       * generated/minloc0_4_r8.c: Regenerated.
+       * generated/minloc0_8_i1.c: Regenerated.
+       * generated/minloc0_8_i16.c: Regenerated.
+       * generated/minloc0_8_i2.c: Regenerated.
+       * generated/minloc0_8_i4.c: Regenerated.
+       * generated/minloc0_8_i8.c: Regenerated.
+       * generated/minloc0_8_r10.c: Regenerated.
+       * generated/minloc0_8_r16.c: Regenerated.
+       * generated/minloc0_8_r4.c: Regenerated.
+       * generated/minloc0_8_r8.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2008-01-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34670
+       * m4/iparm.m4 (upcase):  New macro (copied from the m4 manual).
+       (u_name):  New macro for the upper case name of the intrinsic.
+       * m4/iforeach.m4 (name`'rtype_qual`_'atype_code):  Add
+       bounds checking and rank check, depending on
+       compile_options.bounds_check.
+       (`m'name`'rtype_qual`_'atype_code):  Likewise.
+       (`s'name`'rtype_qual`_'atype_code):  Likewise.
+       * m4/ifunction.m4 (name`'rtype_qual`_'atype_code):  Add
+       bounds checking and rank check, depending on
+       compile_options.bounds_check.
+       (`m'name`'rtype_qual`_'atype_code):  Likewise.
+       (`s'name`'rtype_qual`_'atype_code):  Likewise.
+       * generated/all_l16.c: Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/any_l16.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/count_16_l16.c: Regenerated.
+       * generated/count_16_l4.c: Regenerated.
+       * generated/count_16_l8.c: Regenerated.
+       * generated/count_4_l16.c: Regenerated.
+       * generated/count_4_l4.c: Regenerated.
+       * generated/count_4_l8.c: Regenerated.
+       * generated/count_8_l16.c: Regenerated.
+       * generated/count_8_l4.c: Regenerated.
+       * generated/count_8_l8.c: Regenerated.
+       * generated/maxloc0_16_i1.c: Regenerated.
+       * generated/maxloc0_16_i16.c: Regenerated.
+       * generated/maxloc0_16_i2.c: Regenerated.
+       * generated/maxloc0_16_i4.c: Regenerated.
+       * generated/maxloc0_16_i8.c: Regenerated.
+       * generated/maxloc0_16_r10.c: Regenerated.
+       * generated/maxloc0_16_r16.c: Regenerated.
+       * generated/maxloc0_16_r4.c: Regenerated.
+       * generated/maxloc0_16_r8.c: Regenerated.
+       * generated/maxloc0_4_i1.c: Regenerated.
+       * generated/maxloc0_4_i16.c: Regenerated.
+       * generated/maxloc0_4_i2.c: Regenerated.
+       * generated/maxloc0_4_i4.c: Regenerated.
+       * generated/maxloc0_4_i8.c: Regenerated.
+       * generated/maxloc0_4_r10.c: Regenerated.
+       * generated/maxloc0_4_r16.c: Regenerated.
+       * generated/maxloc0_4_r4.c: Regenerated.
+       * generated/maxloc0_4_r8.c: Regenerated.
+       * generated/maxloc0_8_i1.c: Regenerated.
+       * generated/maxloc0_8_i16.c: Regenerated.
+       * generated/maxloc0_8_i2.c: Regenerated.
+       * generated/maxloc0_8_i4.c: Regenerated.
+       * generated/maxloc0_8_i8.c: Regenerated.
+       * generated/maxloc0_8_r10.c: Regenerated.
+       * generated/maxloc0_8_r16.c: Regenerated.
+       * generated/maxloc0_8_r4.c: Regenerated.
+       * generated/maxloc0_8_r8.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc0_16_i1.c: Regenerated.
+       * generated/minloc0_16_i16.c: Regenerated.
+       * generated/minloc0_16_i2.c: Regenerated.
+       * generated/minloc0_16_i4.c: Regenerated.
+       * generated/minloc0_16_i8.c: Regenerated.
+       * generated/minloc0_16_r10.c: Regenerated.
+       * generated/minloc0_16_r16.c: Regenerated.
+       * generated/minloc0_16_r4.c: Regenerated.
+       * generated/minloc0_16_r8.c: Regenerated.
+       * generated/minloc0_4_i1.c: Regenerated.
+       * generated/minloc0_4_i16.c: Regenerated.
+       * generated/minloc0_4_i2.c: Regenerated.
+       * generated/minloc0_4_i4.c: Regenerated.
+       * generated/minloc0_4_i8.c: Regenerated.
+       * generated/minloc0_4_r10.c: Regenerated.
+       * generated/minloc0_4_r16.c: Regenerated.
+       * generated/minloc0_4_r4.c: Regenerated.
+       * generated/minloc0_4_r8.c: Regenerated.
+       * generated/minloc0_8_i1.c: Regenerated.
+       * generated/minloc0_8_i16.c: Regenerated.
+       * generated/minloc0_8_i2.c: Regenerated.
+       * generated/minloc0_8_i4.c: Regenerated.
+       * generated/minloc0_8_i8.c: Regenerated.
+       * generated/minloc0_8_r10.c: Regenerated.
+       * generated/minloc0_8_r16.c: Regenerated.
+       * generated/minloc0_8_r4.c: Regenerated.
+       * generated/minloc0_8_r8.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2008-01-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/34676
+       * io/list_read.c (next_char): Only save the EOF condition for later if
+       advance="no".
+
+2008-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34565
+       * io/io.h:  Adjust protoypes for open_internal(),
+       next_array_record() and init_loop_spec().
+       * io/list_read.c (next_char):  Use argument "finished"
+       of next_array_record to check for end on internal file.
+       * io/unit.c:  Calculate the offset for an array
+       internal file and supply this informatin to open_internal().
+       * io/unix.c (open_internal):  Set the offset for the internal
+       file on open.
+       * io/transfer.c (init_loop_spec):  Calculate the starting
+       record in case of negative strides.  Return size of 0 for
+       an empty array.
+       (next_array_record):  Use an extra flag to signal that the
+       array is finished.
+       (next_record_r):  Use the new flag to next_array_record().
+       (next_record_w):  Likewise.
+
+\f
+Copyright (C) 2008 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2009 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2009
new file mode 100644 (file)
index 0000000..2611ef1
--- /dev/null
@@ -0,0 +1,2502 @@
+2009-12-19  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * intrinsics/system_clock.c: Fix library name in comment, move TCK
+       definition into functions.
+       (system_clock_4): Remove unused struct timezone.
+       (system_clock_8): Remove unused struct timezone, increase TCK.
+
+2009-12-08  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/41711
+       * io/read.c (set_integer): Support kind=10 for reading
+       real/complex BOZ.
+
+2009-12-06  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/41478
+       PR fortran/42268
+       * intrinsics/pack_generic.c (pack): Add safety checks for the case that
+       'vector' is NULL.
+
+2009-12-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+
+2009-12-04  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/40812
+       * libgfortran.h: typedef gfc_offset differently for MinGW.
+       * io/unix.h (struct stream): Change function pointers to use
+       gfc_offset instead of off_t.
+       (sseek): Change prototype to use gfc_offset instead of off_t.
+       (stell): Likewise.
+       (struncate): Likewise.
+       * io/unix.c: Redefine lseek() for mingw.
+       (raw_seek): Use gfc_offset instead of off_t.
+       (raw_tell): Likewise.
+       (buf_seek): Likewise.
+       (buf_tell): Likewise.
+       (buf_truncate): Likewise.
+       (mem_seek): Likewise.
+       (mem_tell): Likewise.
+       (mem_truncate): Likewise.
+       (fd_to_stream): Likewise.
+       (file_length): Likewise.
+       (raw_truncate): Use gfc_offset instead of off_t, add large file
+       capable implementation for MinGW.
+
+2009-11-30  Janus Weil  <janus@gcc.gnu.org>
+
+       * gfortran.map: Add _gfortran_is_extension_of.
+       * Makefile.am: Add intrinsics/extends_type_of.c.
+       * Makefile.in: Regenerated.
+       * intrinsics/extends_type_of.c: New file. 
+
+2009-11-30  Kai Tietz  <Kai.Tietz@onevision.com>
+
+       * io/unix.c (find_file): Add variable id conditionally for
+       mingw targets.
+
+2009-11-28  Jakub Jelinek  <jakub@redhat.com>
+
+       * intrinsics/pack_generic.c (pack_internal): Remove unused
+       zero_sized variable.
+       * intrinsics/unpack_generic.c (unpack0): Remove unused size
+       variable.
+       * io/write.c (namelist_write_newline): Remove unused length
+       variable.
+       * io/unix.c (find_file): Remove unused id variable.
+       * m4/ifunction.m4 (SCALAR_ARRAY_FUNCTION): Remove unused sstride
+       variable.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2009-11-19  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/fbuf.h: Move includes after include guard.
+       * io/format.h: Likewise.
+       * io/unix.h: Likewise.
+
+2009-11-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/42090
+       * io/transfer.c (skip_record): Set bytes_left_subrecord to zero after
+       skipping the remaining bytes in the record.
+       (next_record_r): Call skip_record with the number of bytes_left to be
+       skipped.
+
+2009-11-02  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * Makefile.am (gfor_io_headers): Add fbuf.h, format.h, unix.h.
+       * Makefile.in: Regenerated.
+       * io/fbuf.h: New file.
+       * io/format.h: New file.
+       * io/unix.h: New file.
+       * io/io.h (struct stream): Move to unix.h, add forward declaration.
+       (sread): Likewise.
+       (swrite): Likewise.
+       (sseek): Likewise.
+       (stell): Likewise.
+       (struncate): Likewise.
+       (sflush): Likewise.
+       (sflush): Likewise.
+       (sclose): Likewise.
+       (compared_files): Move prototype to unix.h.
+       (open_external): Likewise.
+       (open_internal): Likewise.
+       (mem_alloc_w): Likewise.
+       (mem_alloc_r): Likewise.
+       (input_stream): Likewise.
+       (output_stream): Likewise.
+       (error_stream): Likewise.
+       (compare_file_filename): Likewise.
+       (find_file): Likewise.
+       (delete_file): Likewise.
+       (file_exists): Likewise.
+       (inquire_sequential): Likewise.
+       (inquire_direct): Likewise.
+       (inquire_formatted): Likewise.
+       (inquire_unformatted): Likewise.
+       (inquire_read): Likewise.
+       (inquire_write): Likewise.
+       (inquire_readwrite): Likewise.
+       (file_length): Likewise.
+       (is_seekable): Likewise.
+       (is_special): Likewise.
+       (flush_if_preconnected): Likewise.
+       (empty_internal_buffer): Likewise.
+       (stream_isatty): Likewise.
+       (stream_ttyname): Likewise.
+       (unpack_filename): Likewise.
+       (struct fbuf): Move to fbuf.h, add forward declaration.
+       (fbuf_init): Move prototype to fbuf.h.
+       (fbuf_destroy): Likewise.
+       (fbuf_reset): Likewise.
+       (fbuf_alloc): Likewise.
+       (fbuf_flush): Likewise.
+       (fbuf_seek): Likewise.
+       (fbuf_read): Likewise.
+       (fbuf_getc_refill): Likewise.
+       (fbuf_getc): Move inline function to fbuf.h.
+       (enum format_token): Move to format.h.
+       (struct fnode): Move to format.h, add forward declaration.
+       (parse_format): Move prototype to format.h.
+       (next_format): Likewise.
+       (unget_format): Likewise.
+       (format_error): Likewise.
+       (free_format_data): Likewise.
+       (free_format_hash_table): Likewise.
+       (init_format_hash): Likewise.
+       (free_format_hash): Likewise.
+       * io/close.c: Include unix.h.
+       * io/fbuf.c: Include fbuf.h and unix.h.
+       * io/file_pos.c: Include fbuf.h and unix.h.
+       * io/format.c: Include format.h.
+       * io/inquire.c: Include unix.h.
+       * io/intrinsics.c: Include fbuf.h and unix.h.
+       * io/list_read.c: Include fbuf.h and unix.h.
+       * io/open.c: Include fbuf.h and unix.h.
+       * io/read.c: Include format.h.
+       * io/transfer.c: Include fbuf.h, format.h, and unix.h.
+       * io/unit.c: Likewise.
+       * io/unix.c: Include unix.h.
+       * io/write.c: Include format.h and unix.h.
+
+2009-10-31  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/41219
+       * intrinsics/unpack_generic.c (unpack_internal): Remove unused
+       argument from prototype.
+       (unpack1): Update unpack_internal call.
+       (unpack1_char): Likewise.
+       (unpack1_char4): Likewise.
+       (unpack0): Likewise.
+       (unpack0_char): Likewise.
+       (unpack0_char4): Likewise.
+       * intrinsics/iso_c_binding.c (c_f_pointer_u0): Get rid of
+       uninitialized variable warning.
+
+2009-10-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/41711
+       * libgfortran.h: Define larger sizes for BOZ conversion buffers.
+       * io/write.c (extract_uint): Include case where size is 10 if integer
+       is large enough. (write_int): Rename to write_boz. (write_boz): Factor
+       out extract_uint and delete the conversion function.
+       (btoa_big): New binary conversion function.
+       (otoa_big): New octal conversion function.
+       (ztoa_big): New hexidecimal conversion function.
+       (write_b): Modify to use new function.
+       (write_o): Likewise.
+       (write_z): Likewise.
+
+2009-10-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/41683
+       * io/format.c (parse_format_list): Allow a repeat specifier immediately
+       after a P specifier.
+       
+2009-10-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/38439
+       * io/format.c (parse_format_list): Correct logic for FMT_F reading vs
+       writing. Code clean-up.
+
+2009-10-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/38439
+       * io/format.c (parse_format_list): Add check for tokens not allowed
+       after P specifier. Fix comments.  Remove un-needed code. Fix the
+       default exponent list. Correct pointer assignment error.
+
+2009-10-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/35862
+       * write_float.def (outout_float): Fix handling of special case where no
+       digits after the decimal point and values less than 1.0. Adjust index
+       into digits string. (WRITE_FLOAT): Remove special case code from macro.
+
+2009-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/35862
+       * io.h (gfc_unit): Add round_status.
+       (format_token): Add enumerators for rounding format specifiers.
+       * transfer.c (round_opt): New options table.
+       (formatted_transfer_scalar_read): Add set round_status for each rounding
+       format token. (formatted_transfer_scalar_write): Likewise.
+       * format.c (format_lex): Tokenize the rounding format specifiers.
+       (parse_format_list): Parse the rounding format specifiers.
+       * write_float.def (outout_float): Modify rounding code to use new
+       variable rchar to set the appropriate rounding. Fix some whitespace.
+       * unit.c (get_internal_unit): Initialize rounding mode for internal
+       units. (init_units): Likewise.
+
+2009-09-19  Iain Sandoe  <iain.sandoe@sandoe-acoustics.co.uk>
+
+       * configure.ac: Check for GFORTRAN_C99_1.1 funcs in OS libm.
+        * configure: Regenerate.
+        * config.h.in: Ditto.
+
+2009-09-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/41328
+       * io/transfer.c (read_sf): Set at_eof flag on short read if any
+       characters were successfully read so that EOF condition with no EOR
+       marker succeeds.
+
+2009-09-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/41328
+       * io/transfer.c (read_sf): Adjust fbuf position and do proper
+       fbuf reads to traverse CR, CR-LF, and LF style line ends.
+
+2009-09-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/41219
+       * io/write.c (write_a_char4): Use correct type for crlf constant.
+
+2009-09-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.am (libgfortranbegin_la_LINK): New.
+       * Makefile.in: Regenerate.
+
+2009-09-09  Paolo Bonzini  <bonzini@gnu.org>
+
+       * configure: Regenerate.
+
+2009-09-08  Paolo Bonzini  <bonzini@gnu.org>
+
+       * configure: Regenerate.
+
+2009-09-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/41192
+       * io/list_read.c (eat_line): Enable eat_line to function on
+       internal units.
+
+       PR libgfortran/41219
+       * io/list_read.c (nml_read_obj): Replace GFC_DTYPE_UNKNOWN with
+       BT_NULL to get rid of warning.
+       
+2009-09-04  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/41219
+       * intrinsics/getlog.c: Define _POSIX for MINGW32.
+
+2009-09-03  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/41219
+       * intrinsics/iso_c_binding.c (c_f_pointer_u0): Move variable
+       declaration out of the loop.
+
+2009-08-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       * m4/pack.m4 (pack_'rtype_code`): Use count_0 for counting true
+       values in a logical array.  Mark bounds checking tests as
+       unlikely.
+       * intrinsics/pack_generic.c (pack_internal): Likewise.
+       * runtime/bounds.c (count_0):  Fix off-by-one error in detecting
+       empty arrays.
+       * generated/pack_c4.c: Regenerated.
+       * generated/pack_c8.c: Regenerated.
+       * generated/pack_c10.c: Regenerated.
+       * generated/pack_c16.c: Regenerated.
+       * generated/pack_i1.c: Regenerated.
+       * generated/pack_i16.c: Regenerated.
+       * generated/pack_i2.c: Regenerated.
+       * generated/pack_i4.c: Regenerated.
+       * generated/pack_i8.c: Regenerated.
+       * generated/pack_r4.c: Regenerated.
+       * generated/pack_r8.c: Regenerated.
+       * generated/pack_r10.c: Regenerated.
+       * generated/pack_r16.c: Regenerated.
+
+2009-08-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34670
+       * runtime/bounds.c (count_0):  New function.
+       * intrinsics/unpack_generic (unpack_bounds):  New function.
+       (unpack_internal):  Remove zero stride checks.
+       (unpack1):  Use unpack_bounds.
+       (unpack1_char):  Likeweise.
+       (unpack1_char4):  Likewise
+       (unpack0):  Likewise.
+       (unpack0_char):  Likewise.
+       (unpack0_char4):  Likewise.
+
+2009-08-24  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/41157
+       * dtime.c (dtime_sub): Fix computing time increment.
+       * time_1.h: Add <sys/types.h> header.  Use RUSAGE_SELF macro instead
+       of a hardcoded 0.
+
+2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure.ac (AC_PREREQ): Bump to 2.64.
+
+2009-08-23  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * intrinsics/cshift0.c: Update license to GPL3+exception.
+       * runtime/fpu.c: Add a GPL3+exception statement.
+
+2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.am (install-html, install-pdf): Remove.
+       * Makefile.in: Regenerate.
+
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.am (libgfortran_la_LINK): Add $(libgfortran_la_LDFLAGS).
+       * Makefile.in: Regenerate.
+
+2009-08-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/40962
+       * iso_c_binding.c (c_f_pointer_u0):  Multiply stride by
+       previous stride.
+
+2009-08-20  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       * Makefile.am (LTLDFLAGS): Add -bindir flag.
+       * Makefile.in: Regenerate.
+
+2009-08-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/41075
+       * io/io.h (enum format_token): Add FMT_STAR.
+       * io/format.c (format_lex): Add case for FMT_STAR.
+       (parse_format_list): Parse FMT_STAR and check for left paren
+       after. (next_format0): Modify helper function to check for
+       unimited format and return the repeated format node.  Update
+       comments to clarify.
+       
+2009-08-15  Kai Tietz  <kai.tietz@onevision.com>
+
+       * intrinsics/string_intrinsics_inc.c (string_len_trim): Use
+       __INTPTR_TYPE__ to cast from pointer to scalar integer, if
+       __INTPTR_TYPE is defined.
+
+2009-08-14  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * fmain.c: Add comment saying file is deprecated.
+
+2009-08-14  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/40863
+       * gfortran.map: Move new symbols to GFORTRAN_C99_1.1 version node.
+
+2009-08-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/40549
+       * Makefile.in (LTLDFLAGS): Add -no-undefined.
+       * Makefile.am: Regenerate.
+       * libgfortran.h: Remove unused block of code.
+
+2009-08-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/40853
+       * io/list_read.c (nml_get_obj_data): Do not set nl
+       pointer to first_nl if nl->next is NULL.
+
+2009-07-31  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       * Makefile.am: Don't set SECTION_FLAGS with @SECTION_FLAGS@.
+       Don't set IEEE_FLAGS with @IEEE_FLAGS@.
+       * Makefile.in: Regenerate.
+
+2009-07-30  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       * configure.host: Define ieee_flags and set it to -mieee for sh.
+       * configure.ac: Set IEEE_FLAGS with ieee_flags.
+       * Makefile.am: Add IEEE_FLAGS to AM_CFLAGS.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
+2009-07-27  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/40863
+       * c99_functions.c: Define complex I, if not defined.
+       Create prototypes for C99 functions to silence warnings.
+       * gfortran.map: Add missing functions to GFORTRAN_C99_1.0
+       and new GFORTRAN_C99_1.1.
+
+2009-07-25  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/33197
+       * intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
+       casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
+       casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
+       * c99_protos.h: Add prototypes for those.
+
+2009-07-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/40643
+       PR fortran/31067
+       * libgfortran.h (GFC_REAL_4_INFINITY, GFC_REAL_8_INFINITY,
+       GFC_REAL_10_INFINITY, GFC_REAL_16_INFINITY, GFC_REAL_4_QUIET_NAN,
+       GFC_REAL_8_QUIET_NAN, GFC_REAL_10_QUIET_NAN, GFC_REAL_16_QUIET_NAN):
+       Define.
+       * m4/iparm.m4 (atype_inf, atype_nan): Define.
+       * m4/ifunction.m4: Formatting.
+       * m4/iforeach.m4: Likewise.
+       (START_FOREACH_FUNCTION): Initialize dest to all 1s, not all 0s.
+       (START_FOREACH_BLOCK, FINISH_FOREACH_FUNCTION,
+       FINISH_MASKED_FOREACH_FUNCTION): Run foreach block inside a loop
+       until count[0] == extent[0].
+       * m4/minval.m4: Formatting.  Handle NaNs and infinities.  Optimize.
+       * m4/maxval.m4: Likewise.
+       * m4/minloc0.m4: Likewise.
+       * m4/maxloc0.m4: Likewise.
+       * m4/minloc1.m4: Likewise.
+       * m4/maxloc1.m4: Likewise.
+       * generated/maxloc0_16_i16.c: Regenerated.
+       * generated/maxloc0_16_i1.c: Likewise.
+       * generated/maxloc0_16_i2.c: Likewise.
+       * generated/maxloc0_16_i4.c: Likewise.
+       * generated/maxloc0_16_i8.c: Likewise.
+       * generated/maxloc0_16_r10.c: Likewise.
+       * generated/maxloc0_16_r16.c: Likewise.
+       * generated/maxloc0_16_r4.c: Likewise.
+       * generated/maxloc0_16_r8.c: Likewise.
+       * generated/maxloc0_4_i16.c: Likewise.
+       * generated/maxloc0_4_i1.c: Likewise.
+       * generated/maxloc0_4_i2.c: Likewise.
+       * generated/maxloc0_4_i4.c: Likewise.
+       * generated/maxloc0_4_i8.c: Likewise.
+       * generated/maxloc0_4_r10.c: Likewise.
+       * generated/maxloc0_4_r16.c: Likewise.
+       * generated/maxloc0_4_r4.c: Likewise.
+       * generated/maxloc0_4_r8.c: Likewise.
+       * generated/maxloc0_8_i16.c: Likewise.
+       * generated/maxloc0_8_i1.c: Likewise.
+       * generated/maxloc0_8_i2.c: Likewise.
+       * generated/maxloc0_8_i4.c: Likewise.
+       * generated/maxloc0_8_i8.c: Likewise.
+       * generated/maxloc0_8_r10.c: Likewise.
+       * generated/maxloc0_8_r16.c: Likewise.
+       * generated/maxloc0_8_r4.c: Likewise.
+       * generated/maxloc0_8_r8.c: Likewise.
+       * generated/maxloc1_16_i16.c: Likewise.
+       * generated/maxloc1_16_i1.c: Likewise.
+       * generated/maxloc1_16_i2.c: Likewise.
+       * generated/maxloc1_16_i4.c: Likewise.
+       * generated/maxloc1_16_i8.c: Likewise.
+       * generated/maxloc1_16_r10.c: Likewise.
+       * generated/maxloc1_16_r16.c: Likewise.
+       * generated/maxloc1_16_r4.c: Likewise.
+       * generated/maxloc1_16_r8.c: Likewise.
+       * generated/maxloc1_4_i16.c: Likewise.
+       * generated/maxloc1_4_i1.c: Likewise.
+       * generated/maxloc1_4_i2.c: Likewise.
+       * generated/maxloc1_4_i4.c: Likewise.
+       * generated/maxloc1_4_i8.c: Likewise.
+       * generated/maxloc1_4_r10.c: Likewise.
+       * generated/maxloc1_4_r16.c: Likewise.
+       * generated/maxloc1_4_r4.c: Likewise.
+       * generated/maxloc1_4_r8.c: Likewise.
+       * generated/maxloc1_8_i16.c: Likewise.
+       * generated/maxloc1_8_i1.c: Likewise.
+       * generated/maxloc1_8_i2.c: Likewise.
+       * generated/maxloc1_8_i4.c: Likewise.
+       * generated/maxloc1_8_i8.c: Likewise.
+       * generated/maxloc1_8_r10.c: Likewise.
+       * generated/maxloc1_8_r16.c: Likewise.
+       * generated/maxloc1_8_r4.c: Likewise.
+       * generated/maxloc1_8_r8.c: Likewise.
+       * generated/maxval_i16.c: Likewise.
+       * generated/maxval_i1.c: Likewise.
+       * generated/maxval_i2.c: Likewise.
+       * generated/maxval_i4.c: Likewise.
+       * generated/maxval_i8.c: Likewise.
+       * generated/maxval_r10.c: Likewise.
+       * generated/maxval_r16.c: Likewise.
+       * generated/maxval_r4.c: Likewise.
+       * generated/maxval_r8.c: Likewise.
+       * generated/minloc0_16_i16.c: Likewise.
+       * generated/minloc0_16_i1.c: Likewise.
+       * generated/minloc0_16_i2.c: Likewise.
+       * generated/minloc0_16_i4.c: Likewise.
+       * generated/minloc0_16_i8.c: Likewise.
+       * generated/minloc0_16_r10.c: Likewise.
+       * generated/minloc0_16_r16.c: Likewise.
+       * generated/minloc0_16_r4.c: Likewise.
+       * generated/minloc0_16_r8.c: Likewise.
+       * generated/minloc0_4_i16.c: Likewise.
+       * generated/minloc0_4_i1.c: Likewise.
+       * generated/minloc0_4_i2.c: Likewise.
+       * generated/minloc0_4_i4.c: Likewise.
+       * generated/minloc0_4_i8.c: Likewise.
+       * generated/minloc0_4_r10.c: Likewise.
+       * generated/minloc0_4_r16.c: Likewise.
+       * generated/minloc0_4_r4.c: Likewise.
+       * generated/minloc0_4_r8.c: Likewise.
+       * generated/minloc0_8_i16.c: Likewise.
+       * generated/minloc0_8_i1.c: Likewise.
+       * generated/minloc0_8_i2.c: Likewise.
+       * generated/minloc0_8_i4.c: Likewise.
+       * generated/minloc0_8_i8.c: Likewise.
+       * generated/minloc0_8_r10.c: Likewise.
+       * generated/minloc0_8_r16.c: Likewise.
+       * generated/minloc0_8_r4.c: Likewise.
+       * generated/minloc0_8_r8.c: Likewise.
+       * generated/minloc1_16_i16.c: Likewise.
+       * generated/minloc1_16_i1.c: Likewise.
+       * generated/minloc1_16_i2.c: Likewise.
+       * generated/minloc1_16_i4.c: Likewise.
+       * generated/minloc1_16_i8.c: Likewise.
+       * generated/minloc1_16_r10.c: Likewise.
+       * generated/minloc1_16_r16.c: Likewise.
+       * generated/minloc1_16_r4.c: Likewise.
+       * generated/minloc1_16_r8.c: Likewise.
+       * generated/minloc1_4_i16.c: Likewise.
+       * generated/minloc1_4_i1.c: Likewise.
+       * generated/minloc1_4_i2.c: Likewise.
+       * generated/minloc1_4_i4.c: Likewise.
+       * generated/minloc1_4_i8.c: Likewise.
+       * generated/minloc1_4_r10.c: Likewise.
+       * generated/minloc1_4_r16.c: Likewise.
+       * generated/minloc1_4_r4.c: Likewise.
+       * generated/minloc1_4_r8.c: Likewise.
+       * generated/minloc1_8_i16.c: Likewise.
+       * generated/minloc1_8_i1.c: Likewise.
+       * generated/minloc1_8_i2.c: Likewise.
+       * generated/minloc1_8_i4.c: Likewise.
+       * generated/minloc1_8_i8.c: Likewise.
+       * generated/minloc1_8_r10.c: Likewise.
+       * generated/minloc1_8_r16.c: Likewise.
+       * generated/minloc1_8_r4.c: Likewise.
+       * generated/minloc1_8_r8.c: Likewise.
+       * generated/minval_i16.c: Likewise.
+       * generated/minval_i1.c: Likewise.
+       * generated/minval_i2.c: Likewise.
+       * generated/minval_i4.c: Likewise.
+       * generated/minval_i8.c: Likewise.
+       * generated/minval_r10.c: Likewise.
+       * generated/minval_r16.c: Likewise.
+       * generated/minval_r4.c: Likewise.
+       * generated/minval_r8.c: Likewise.
+       * generated/product_c10.c: Likewise.
+       * generated/product_c16.c: Likewise.
+       * generated/product_c4.c: Likewise.
+       * generated/product_c8.c: Likewise.
+       * generated/product_i16.c: Likewise.
+       * generated/product_i1.c: Likewise.
+       * generated/product_i2.c: Likewise.
+       * generated/product_i4.c: Likewise.
+       * generated/product_i8.c: Likewise.
+       * generated/product_r10.c: Likewise.
+       * generated/product_r16.c: Likewise.
+       * generated/product_r4.c: Likewise.
+       * generated/product_r8.c: Likewise.
+       * generated/sum_c10.c: Likewise.
+       * generated/sum_c16.c: Likewise.
+       * generated/sum_c4.c: Likewise.
+       * generated/sum_c8.c: Likewise.
+       * generated/sum_i16.c: Likewise.
+       * generated/sum_i1.c: Likewise.
+       * generated/sum_i2.c: Likewise.
+       * generated/sum_i4.c: Likewise.
+       * generated/sum_i8.c: Likewise.
+       * generated/sum_r10.c: Likewise.
+       * generated/sum_r16.c: Likewise.
+       * generated/sum_r4.c: Likewise.
+       * generated/sum_r8.c: Likewise.
+
+2009-07-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/32784
+       * unix.c (regular_file): Check for CONIN$ CONOUT$, and CONERR$ and open
+       the respective /dev/conin or /dev/conout devices.  This is Cygwin
+       specific.
+
+2009-07-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34670
+       PR libfortran/36874
+       * Makefile.am:  Add bounds.c
+       * libgfortran.h (bounds_equal_extents):  Add prototype.
+       (bounds_iforeach_return):  Likewise.
+       (bounds_ifunction_return):  Likewise.
+       (bounds_reduced_extents):  Likewise.
+       * runtime/bounds.c:  New file.
+       (bounds_iforeach_return):  New function; correct typo in
+       error message.
+       (bounds_ifunction_return):  New function.
+       (bounds_equal_extents):  New function.
+       (bounds_reduced_extents):  Likewise.
+       * intrinsics/cshift0.c (cshift0):  Use new functions
+       for bounds checking.
+       * intrinsics/eoshift0.c (eoshift0):  Likewise.
+       * intrinsics/eoshift2.c (eoshift2):  Likewise.
+       * m4/iforeach.m4:  Likewise.
+       * m4/eoshift1.m4:  Likewise.
+       * m4/eoshift3.m4:  Likewise.
+       * m4/cshift1.m4:  Likewise.
+       * m4/ifunction.m4:  Likewise.
+       * Makefile.in:  Regenerated.
+       * generated/cshift1_16.c: Regenerated.
+       * generated/cshift1_4.c: Regenerated.
+       * generated/cshift1_8.c: Regenerated.
+       * generated/eoshift1_16.c: Regenerated.
+       * generated/eoshift1_4.c: Regenerated.
+       * generated/eoshift1_8.c: Regenerated.
+       * generated/eoshift3_16.c: Regenerated.
+       * generated/eoshift3_4.c: Regenerated.
+       * generated/eoshift3_8.c: Regenerated.
+       * generated/maxloc0_16_i1.c: Regenerated.
+       * generated/maxloc0_16_i16.c: Regenerated.
+       * generated/maxloc0_16_i2.c: Regenerated.
+       * generated/maxloc0_16_i4.c: Regenerated.
+       * generated/maxloc0_16_i8.c: Regenerated.
+       * generated/maxloc0_16_r10.c: Regenerated.
+       * generated/maxloc0_16_r16.c: Regenerated.
+       * generated/maxloc0_16_r4.c: Regenerated.
+       * generated/maxloc0_16_r8.c: Regenerated.
+       * generated/maxloc0_4_i1.c: Regenerated.
+       * generated/maxloc0_4_i16.c: Regenerated.
+       * generated/maxloc0_4_i2.c: Regenerated.
+       * generated/maxloc0_4_i4.c: Regenerated.
+       * generated/maxloc0_4_i8.c: Regenerated.
+       * generated/maxloc0_4_r10.c: Regenerated.
+       * generated/maxloc0_4_r16.c: Regenerated.
+       * generated/maxloc0_4_r4.c: Regenerated.
+       * generated/maxloc0_4_r8.c: Regenerated.
+       * generated/maxloc0_8_i1.c: Regenerated.
+       * generated/maxloc0_8_i16.c: Regenerated.
+       * generated/maxloc0_8_i2.c: Regenerated.
+       * generated/maxloc0_8_i4.c: Regenerated.
+       * generated/maxloc0_8_i8.c: Regenerated.
+       * generated/maxloc0_8_r10.c: Regenerated.
+       * generated/maxloc0_8_r16.c: Regenerated.
+       * generated/maxloc0_8_r4.c: Regenerated.
+       * generated/maxloc0_8_r8.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc0_16_i1.c: Regenerated.
+       * generated/minloc0_16_i16.c: Regenerated.
+       * generated/minloc0_16_i2.c: Regenerated.
+       * generated/minloc0_16_i4.c: Regenerated.
+       * generated/minloc0_16_i8.c: Regenerated.
+       * generated/minloc0_16_r10.c: Regenerated.
+       * generated/minloc0_16_r16.c: Regenerated.
+       * generated/minloc0_16_r4.c: Regenerated.
+       * generated/minloc0_16_r8.c: Regenerated.
+       * generated/minloc0_4_i1.c: Regenerated.
+       * generated/minloc0_4_i16.c: Regenerated.
+       * generated/minloc0_4_i2.c: Regenerated.
+       * generated/minloc0_4_i4.c: Regenerated.
+       * generated/minloc0_4_i8.c: Regenerated.
+       * generated/minloc0_4_r10.c: Regenerated.
+       * generated/minloc0_4_r16.c: Regenerated.
+       * generated/minloc0_4_r4.c: Regenerated.
+       * generated/minloc0_4_r8.c: Regenerated.
+       * generated/minloc0_8_i1.c: Regenerated.
+       * generated/minloc0_8_i16.c: Regenerated.
+       * generated/minloc0_8_i2.c: Regenerated.
+       * generated/minloc0_8_i4.c: Regenerated.
+       * generated/minloc0_8_i8.c: Regenerated.
+       * generated/minloc0_8_r10.c: Regenerated.
+       * generated/minloc0_8_r16.c: Regenerated.
+       * generated/minloc0_8_r4.c: Regenerated.
+       * generated/minloc0_8_r8.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2009-07-17  Janne Blomqvist  <jb@gcc.gnu.org>
+           Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+               
+       PR libfortran/40714
+       * io/transfer.c (finalize_transfer): Set current_record to 0
+       before returning in case of error.
+
+2009-07-12  Tobias Burnus  <burnus@net-b.de>
+
+       PR libfortran/22423
+       * io/io.h (namelist_type): Use the proper enum for GFC_DTYPE_*.
+       * intrinsics/iso_c_binding.c (c_f_pointer_u0): Make sure
+       variable is initialized to silence warning.
+
+2009-07-10  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * c99_functions.c (ccoshf, ccosh, ccoshl, ctanhf, ctanh, ctanl):
+       Fix errant minus.
+
+2009-07-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/40330
+       PR libfortran/40662
+       * io/io.h (st_parameter_dt): Define format_not_saved bit used to signal
+       whether the parsed format data was previously saved. Used to determine
+       if the current format data should be freed or not.
+       * io/transfer.c (st_read_done): Use the format_not_saved bit.
+       (st_write_done): Likewise.
+       * io/format.c (parse_format_list): Add boolean pointer to arg list. This
+       pointer is used to return status to the caller regarding whether it is
+       safe to cache the parsed format data.  Currently, if a FMT_STRING token
+       is encounetered, it is not safe to cache. Also, added a local boolean
+       variable to hold this information as recursive calls to
+       parse_format_list are made.  Remove previous save_format logic.
+       (parse_format): Do not use the format caching facility if the current
+       unit is an internal unit or if it is not safe to save parsed format
+       data.
+       
+2009-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/40576
+       * io/transfer.c (sset): Adjust exit condition for loop.
+
+2009-06-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/40508
+       * io/format.c: Don't save parsed format data for internal units.
+
+2009-06-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/37577
+       Port from fortran-dev
+       * runtime/in_pack_generic (internal_pack):  Remove unnecessary
+       test for stride == 0.
+       * runtime/in_unpack_generic.c (internal_unpack):  Likewise.
+       * intrinsics/iso_c_binding.c (c_f_pointer_u0):  Take care
+       of stride in "shape" argument.  Use array access macros for
+       accessing array descriptors.
+       * libgfortran.h (struct descriptor_dimension):  Change stride
+       to _stride, lbound to _lbound and ubound to _ubound.
+       (GFC_DIMENSION_LBOUND):  Use new name(s) in struct
+       descriptor_dimension.
+       (GFC_DIMENSION_UBOUND):  Likewise.
+       (GFC_DIMENSION_STRIDE):  Likewise.
+       (GFC_DIMENSION_EXTENT):  Likewise.
+       (GFC_DIMENSION_SET):  Likewise.
+       (GFC_DESCRIPTOR_LBOUND):  Likewise.
+       (GFC_DESCRIPTOR_UBOUND):  Likewise.
+       (GFC_DESCRIPTOR_EXTENT):  Likewise.
+       (GFC_DESCRIPTOR_STRIDE):  Likewise.
+       * io/transfer.c (transfer_array):  Use array access macros.
+       Use byte-sized strides.
+       * intrinsics/eoshift0.c (eoshift0):  Use array access
+       macros everywhere.
+       * m4/in_pack.m4 (internal_pack_'rtype_ccode`):  Use
+       array access macros for accessing array descriptors.
+       * m4/in_unpack.m4 (internal_unpack_'rtype_ccode`):
+       Likewise.
+       * m4/matmull.m4 (matmul_'rtype_code`):  Likewise.
+       * m4/matmul.m4 (matmul_'rtype_code`):  Likewise.
+       * m4/unpack.m4 (unpack0_'rtype_code`):  Likewise.
+       (unpack1_'rtype_code`):  Likewise.
+       * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Likewise.
+       * m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Use array access
+       macros everywhere.
+               * intrinsics/dtime.c (dtime_sub):  Use array access macros
+       for accessing array descriptors.
+       * intrinsics/cshift0 (cshift0):  Likewise.
+       * intrinsics/etime.c:  Likewise.  Remove redundant calculation
+       of rdim.
+       * m4/cshift0.m4 (cshift0_'rtype_code`):  Use array access macros
+       for accessing array descriptors.
+       * m4/pack.m4 (pack_'rtype_code`):  Likewise.
+       * m4/spread.m4 (spread_'rtype_code`):  Likewise.
+       (spread_scalar_'rtype_code`):  Likewise.
+       * m4/transpose.m4 (transpose_'rtype_code`):  Likewise.
+       * m4/iforeach.m4 (name`'rtype_qual`_'atype_code):  Likewise.
+       * m4/eoshift1.m4 (eoshift1):  Likewise.  Remove size argument,
+       calculate within function.
+       (eoshift1_'atype_kind`):  Remove size argument from call
+       to eoshift1.
+       (eoshift1_'atype_kind`_char):  Likewise.
+       (eoshift1_'atype_kind`_char4):  Likewise.
+       * m4/eoshift3.m4 (eoshift3):  Remove size argument, calculate
+       within function. Use array access macros for accessing array
+       descriptors.
+       (eoshift3_'atype_kind`):  Remove size argument from call
+       to eoshift1.
+       (eoshift3_'atype_kind`_char):  Likewise.
+       (eoshift3_'atype_kind`_char4):  Likewise.
+       * m4/shape.m4 (shape_'rtype_kind`):  Use array access macros
+       for accessing array descriptors.
+       * m4/cshift1.m4 (cshift1): Remove size argument, calculate
+       within function. Use array access macros for accessing array
+       descriptors.
+       (cshift1_'atype_kind`):  Remove size argument from call to
+       cshift1.
+       (cshift1_'atype_kind`_char):  Remove size argument from call to
+       cshift1.
+       (cshift1_'atype_kind`_char4):  Remove size argument from call to
+       cshift1.
+       * m4/reshape.m4 (reshape_'rtype_ccode`):  Use array access macros
+       for accessing array descriptors.
+       * m4/ifunction.m4 (name`'rtype_qual`_'atype_code):  Likewise.
+       * intrinsics/pack_generic.c (pack_internal):  Use array access
+       macros for accessing array descriptors.
+       (pack_s_internal):  Likewise.
+       * intrinsics/transpose_generic.c (transpose_internal):  Remove
+       size argument, calculate from array descriptor. Use array
+       access macros for accessing array descriptors.
+       (transpose):  Remove size argument from call.
+       (transpoe_char):  Likewise.
+       (transpose_char4):  Likewise.
+       * intrinsics/move_alloc.c (move_alloc):  Use array access macros
+       for accessing array descriptors.
+       * intrinsics/spread_generic.c (spread_internal):  Remove size
+       argument, calculate from array descriptor.  Use array access
+       macros for accessing array descriptors.
+       (spread_internal_scalar):  Likewise.
+       (spread):  Remove size argument from call to spread_internal.
+       (spread_char):  Mark argument source_length as unused.
+       Remove size argument from call to spread_internal.
+       (spread_char4):  Likewise.
+       (spread_char_scalar):  Likewise.
+       (spread_char4_scalar):  Likewise.
+       * intrinsics/unpack_generic.c (unpack_internal):  Use array access
+       macros for accessing array descriptors.
+       * intrinsics/eoshift2.c (eoshift2):  Remove size argument, calculate
+       from array descriptor instead.  Use array access macros for
+       accessing array descriptors.
+       (eoshift2_##N):  Remove size argument from call to eoshift2.
+       (eoshift2_##N_##char):  Likewise.
+       (eoshift2_##N_##char4):  Likewise.
+       * intrinsics/reshape_generic.c (reshape_internal):  Use array
+       access macross for accessing array descriptors.
+       * libgfortran.h:  Introduce new macros GFC_DIMENSION_LBOUND,
+       GFC_DIMENSION_UBOUND,GFC_DIMENSION_STRIDE, GFC_DIMENSION_EXTENT,
+       GFC_DIMENSION_SET, GFC_DESCRIPTOR_LBOUND, GFC_DESCRIPTOR_UBOUND,
+       GFC_DESCRIPTOR_EXTENT, GFC_DESCRIPTOR_EXTENT_BYTES,
+       GFC_DESCRIPTOR_STRIDE, GFC_DESCRIPTOR_STRIDE_BYTES
+       * runtime/in_pack_generic.c (internal_pack):  Use new macros
+       for array descriptor access.
+       * runtime/in_unpack_generic.c (internal_unpack):  Likewise.
+       * intrinsics/dtime.c (dtime_sub):  Likewise.
+       * intrinsics/cshift0 (cshift0):  Remove argument size,
+       calculate directly from the array descriptor.  Use new macros
+       for array descriptor access.
+       * cshift0_##N:  Remove shift argument in call to cshift0.
+       * cshift0_##N_char:  Mark array_length as unused.  Remove
+       array_length in call to cshift0.
+       * cshift0_##N_char4:  Likewise.
+       * intrisics/etime.c:  Use new macros for array descriptor access.
+       * intrinsics/stat.c (stat_i4_sub_0):  Likewise.
+       (stat_i8_sub_0):  Likewise.
+       (fstat_i4_sub):  Likewise.
+       (fstat_i8_sub):  Likewise.
+       * intrinsics/date_and_time.c (date_and_time):  Likewise.
+       (secnds):  Likewise.
+       (itime_i4):  Likewise.
+       (itime_i8):  Likewise.
+       (idate_i4):  Likewise.
+       (idate_i8):  Likewise.
+       (gmtime_i4):  Likewise.
+       (gmtime_i8):  Likewise.
+       (ltime_i4):  Likewise.
+       (litme_i8):  Likewise.
+       * intrinsics/associated.c (associated):  Likewise.
+       * intrinsics/eoshift0.c (eoshift0):  Likewise.
+       * intriniscs/size.c (size0):  Likewise.
+       * intrinsics/random.c (arandom_r4):  Likewise.
+       (arandom_r8):  Likewise.
+       (arandom_r10):  Likewise.
+       (arandom_r16):  Likewise.
+       (random_seed_i4):  Likewise.
+       (random_seed_i8):  Likewise.
+       * io/list_read.c (nml_parse_qualifier):  Likewise.
+       (nml_touch_nodes):  Likewise.
+       (nml_read_obj):  Likewise.
+       (get_name):  Likewise.
+       * io/transfer.c (transfer_array):  Likewise.
+       (init_loop_spec):  Likewise.
+       (st_set_nml_var_dim):  Likewise.
+       * io/write.c (nml_write_obj):  Likewise.
+       (obj_loop):  Likewise.
+       * generated/all_l1.c: Regenerated.
+       * generated/all_l16.c: Regenerated.
+       * generated/all_l2.c: Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/any_l1.c: Regenerated.
+       * generated/any_l16.c: Regenerated.
+       * generated/any_l2.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/count_16_l.c: Regenerated.
+       * generated/count_1_l.c: Regenerated.
+       * generated/count_2_l.c: Regenerated.
+       * generated/count_4_l.c: Regenerated.
+       * generated/count_8_l.c: Regenerated.
+       * generated/cshift0_c10.c: Regenerated.
+       * generated/cshift0_c16.c: Regenerated.
+       * generated/cshift0_c4.c: Regenerated.
+       * generated/cshift0_c8.c: Regenerated.
+       * generated/cshift0_i1.c: Regenerated.
+       * generated/cshift0_i16.c: Regenerated.
+       * generated/cshift0_i2.c: Regenerated.
+       * generated/cshift0_i4.c: Regenerated.
+       * generated/cshift0_i8.c: Regenerated.
+       * generated/cshift0_r10.c: Regenerated.
+       * generated/cshift0_r16.c: Regenerated.
+       * generated/cshift0_r4.c: Regenerated.
+       * generated/cshift0_r8.c: Regenerated.
+       * generated/cshift1_16.c: Regenerated.
+       * generated/cshift1_4.c: Regenerated.
+       * generated/cshift1_8.c: Regenerated.
+       * generated/eoshift1_16.c: Regenerated.
+       * generated/eoshift1_4.c: Regenerated.
+       * generated/eoshift1_8.c: Regenerated.
+       * generated/eoshift3_16.c: Regenerated.
+       * generated/eoshift3_4.c: Regenerated.
+       * generated/eoshift3_8.c: Regenerated.
+       * generated/in_pack_c10.c: Regenerated.
+       * generated/in_pack_c16.c: Regenerated.
+       * generated/in_pack_c4.c: Regenerated.
+       * generated/in_pack_c8.c: Regenerated.
+       * generated/in_pack_i1.c: Regenerated.
+       * generated/in_pack_i16.c: Regenerated.
+       * generated/in_pack_i2.c: Regenerated.
+       * generated/in_pack_i4.c: Regenerated.
+       * generated/in_pack_i8.c: Regenerated.
+       * generated/in_pack_r10.c: Regenerated.
+       * generated/in_pack_r16.c: Regenerated.
+       * generated/in_pack_r4.c: Regenerated.
+       * generated/in_pack_r8.c: Regenerated.
+       * generated/in_unpack_c10.c: Regenerated.
+       * generated/in_unpack_c16.c: Regenerated.
+       * generated/in_unpack_c4.c: Regenerated.
+       * generated/in_unpack_c8.c: Regenerated.
+       * generated/in_unpack_i1.c: Regenerated.
+       * generated/in_unpack_i16.c: Regenerated.
+       * generated/in_unpack_i2.c: Regenerated.
+       * generated/in_unpack_i4.c: Regenerated.
+       * generated/in_unpack_i8.c: Regenerated.
+       * generated/in_unpack_r10.c: Regenerated.
+       * generated/in_unpack_r16.c: Regenerated.
+       * generated/in_unpack_r4.c: Regenerated.
+       * generated/in_unpack_r8.c: Regenerated.
+       * generated/matmul_c10.c: Regenerated.
+       * generated/matmul_c16.c: Regenerated.
+       * generated/matmul_c4.c: Regenerated.
+       * generated/matmul_c8.c: Regenerated.
+       * generated/matmul_i1.c: Regenerated.
+       * generated/matmul_i16.c: Regenerated.
+       * generated/matmul_i2.c: Regenerated.
+       * generated/matmul_i4.c: Regenerated.
+       * generated/matmul_i8.c: Regenerated.
+       * generated/matmul_l16.c: Regenerated.
+       * generated/matmul_l4.c: Regenerated.
+       * generated/matmul_l8.c: Regenerated.
+       * generated/matmul_r10.c: Regenerated.
+       * generated/matmul_r16.c: Regenerated.
+       * generated/matmul_r4.c: Regenerated.
+       * generated/matmul_r8.c: Regenerated.
+       * generated/maxloc0_16_i1.c: Regenerated.
+       * generated/maxloc0_16_i16.c: Regenerated.
+       * generated/maxloc0_16_i2.c: Regenerated.
+       * generated/maxloc0_16_i4.c: Regenerated.
+       * generated/maxloc0_16_i8.c: Regenerated.
+       * generated/maxloc0_16_r10.c: Regenerated.
+       * generated/maxloc0_16_r16.c: Regenerated.
+       * generated/maxloc0_16_r4.c: Regenerated.
+       * generated/maxloc0_16_r8.c: Regenerated.
+       * generated/maxloc0_4_i1.c: Regenerated.
+       * generated/maxloc0_4_i16.c: Regenerated.
+       * generated/maxloc0_4_i2.c: Regenerated.
+       * generated/maxloc0_4_i4.c: Regenerated.
+       * generated/maxloc0_4_i8.c: Regenerated.
+       * generated/maxloc0_4_r10.c: Regenerated.
+       * generated/maxloc0_4_r16.c: Regenerated.
+       * generated/maxloc0_4_r4.c: Regenerated.
+       * generated/maxloc0_4_r8.c: Regenerated.
+       * generated/maxloc0_8_i1.c: Regenerated.
+       * generated/maxloc0_8_i16.c: Regenerated.
+       * generated/maxloc0_8_i2.c: Regenerated.
+       * generated/maxloc0_8_i4.c: Regenerated.
+       * generated/maxloc0_8_i8.c: Regenerated.
+       * generated/maxloc0_8_r10.c: Regenerated.
+       * generated/maxloc0_8_r16.c: Regenerated.
+       * generated/maxloc0_8_r4.c: Regenerated.
+       * generated/maxloc0_8_r8.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc0_16_i1.c: Regenerated.
+       * generated/minloc0_16_i16.c: Regenerated.
+       * generated/minloc0_16_i2.c: Regenerated.
+       * generated/minloc0_16_i4.c: Regenerated.
+       * generated/minloc0_16_i8.c: Regenerated.
+       * generated/minloc0_16_r10.c: Regenerated.
+       * generated/minloc0_16_r16.c: Regenerated.
+       * generated/minloc0_16_r4.c: Regenerated.
+       * generated/minloc0_16_r8.c: Regenerated.
+       * generated/minloc0_4_i1.c: Regenerated.
+       * generated/minloc0_4_i16.c: Regenerated.
+       * generated/minloc0_4_i2.c: Regenerated.
+       * generated/minloc0_4_i4.c: Regenerated.
+       * generated/minloc0_4_i8.c: Regenerated.
+       * generated/minloc0_4_r10.c: Regenerated.
+       * generated/minloc0_4_r16.c: Regenerated.
+       * generated/minloc0_4_r4.c: Regenerated.
+       * generated/minloc0_4_r8.c: Regenerated.
+       * generated/minloc0_8_i1.c: Regenerated.
+       * generated/minloc0_8_i16.c: Regenerated.
+       * generated/minloc0_8_i2.c: Regenerated.
+       * generated/minloc0_8_i4.c: Regenerated.
+       * generated/minloc0_8_i8.c: Regenerated.
+       * generated/minloc0_8_r10.c: Regenerated.
+       * generated/minloc0_8_r16.c: Regenerated.
+       * generated/minloc0_8_r4.c: Regenerated.
+       * generated/minloc0_8_r8.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/pack_c10.c: Regenerated.
+       * generated/pack_c16.c: Regenerated.
+       * generated/pack_c4.c: Regenerated.
+       * generated/pack_c8.c: Regenerated.
+       * generated/pack_i1.c: Regenerated.
+       * generated/pack_i16.c: Regenerated.
+       * generated/pack_i2.c: Regenerated.
+       * generated/pack_i4.c: Regenerated.
+       * generated/pack_i8.c: Regenerated.
+       * generated/pack_r10.c: Regenerated.
+       * generated/pack_r16.c: Regenerated.
+       * generated/pack_r4.c: Regenerated.
+       * generated/pack_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/reshape_c10.c: Regenerated.
+       * generated/reshape_c16.c: Regenerated.
+       * generated/reshape_c4.c: Regenerated.
+       * generated/reshape_c8.c: Regenerated.
+       * generated/reshape_i16.c: Regenerated.
+       * generated/reshape_i4.c: Regenerated.
+       * generated/reshape_i8.c: Regenerated.
+       * generated/reshape_r10.c: Regenerated.
+       * generated/reshape_r16.c: Regenerated.
+       * generated/reshape_r4.c: Regenerated.
+       * generated/reshape_r8.c: Regenerated.
+       * generated/shape_i16.c: Regenerated.
+       * generated/shape_i4.c: Regenerated.
+       * generated/shape_i8.c: Regenerated.
+       * generated/spread_c10.c: Regenerated.
+       * generated/spread_c16.c: Regenerated.
+       * generated/spread_c4.c: Regenerated.
+       * generated/spread_c8.c: Regenerated.
+       * generated/spread_i1.c: Regenerated.
+       * generated/spread_i16.c: Regenerated.
+       * generated/spread_i2.c: Regenerated.
+       * generated/spread_i4.c: Regenerated.
+       * generated/spread_i8.c: Regenerated.
+       * generated/spread_r10.c: Regenerated.
+       * generated/spread_r16.c: Regenerated.
+       * generated/spread_r4.c: Regenerated.
+       * generated/spread_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+       * generated/transpose_c10.c: Regenerated.
+       * generated/transpose_c16.c: Regenerated.
+       * generated/transpose_c4.c: Regenerated.
+       * generated/transpose_c8.c: Regenerated.
+       * generated/transpose_i16.c: Regenerated.
+       * generated/transpose_i4.c: Regenerated.
+       * generated/transpose_i8.c: Regenerated.
+       * generated/transpose_r10.c: Regenerated.
+       * generated/transpose_r16.c: Regenerated.
+       * generated/transpose_r4.c: Regenerated.
+       * generated/transpose_r8.c: Regenerated.
+       * generated/unpack_c10.c: Regenerated.
+       * generated/unpack_c16.c: Regenerated.
+       * generated/unpack_c4.c: Regenerated.
+       * generated/unpack_c8.c: Regenerated.
+       * generated/unpack_i1.c: Regenerated.
+       * generated/unpack_i16.c: Regenerated.
+       * generated/unpack_i2.c: Regenerated.
+       * generated/unpack_i4.c: Regenerated.
+       * generated/unpack_i8.c: Regenerated.
+       * generated/unpack_r10.c: Regenerated.
+       * generated/unpack_r16.c: Regenerated.
+       * generated/unpack_r4.c: Regenerated.
+       * generated/unpack_r8.c: Regenerated.
+
+2009-06-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+       * fmain.c (main): Don't PREFIX set_args.
+       * libgfortran.h (set_args): Use iexport_proto.
+       * runtime/main.c (set_args): Use iexport.
+
+2009-06-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/40008
+       * libgfortran.h: Define IOPARM_OPEN_HAS_NEWUNIT.
+       * io/open.c (st_open): Don't error on negative unit number if NEWUNIT
+       was specified. If NEWUNIT is specified, call new function to get the
+       unique unit number and assign it.
+       * io/io.h (st_parameter_open): Add pointer to newunit.  Add prototype for
+       next_available_newunit. Add prototype for new function,
+       get_unique_unit_number.
+       * io/unit.c: Declare next_available_newunit. Define the first newunit
+       number. (init_units): Initialize next_available_unit.
+       (get_unique_unit_number): New function. Fix whitespace and comments.
+       * io/transfer.c (data_transfer_init): Update error message to not be
+       specific to OPEN statements.
+
+2009-06-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/40334
+       * io/list_read.c (list_formatted_read_scalar): Set the end file
+       conditions after a return from EOF error.
+
+2009-06-04  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/40330
+       * io/format.c (free_format_hash_table): Also free and nullify hash key.
+       (save_parsed_format): Copy string rather than pointer copy.
+       
+2009-05-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/40019
+       * intrinsics/bit_intrinsics.c: New file.
+       * gfortran.map (GFORTRAN_1.2): New list.
+       * Makefile.am: Add intrinsics/bit_intrinsics.c.
+       * Makefile.in: Regenerate.
+
+2009-05-29  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/40190
+       * configure.ac: Check for localtime_r and gmtime_r.
+       * intrinsics/date_and_time.c: Add fallback implementations for
+       localtime_r and gmtime_r.
+       (date_and_time): Change to use localtime_r and gmtime_r instead of
+       localtime and gmtime, respectively.
+       (itime0): Use localtime_r instead of localtime.
+       (ltime_0): Likewise.
+       (gmtime_0): Use gmtime_r instead of gmtime.
+       * config.h.in: Regenerated
+       * configure: Regenerated.
+
+2009-05-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR fortran/39178
+       * runtime/main.c (store_exe_path): Remove static attribute.
+       * libgfortran.h: Add back store_exe_path prototype.
+
+2009-05-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/40187
+       * intrinsics/iso_c_binding.c (c_f_pointer_u0):  Take care
+       of stride in "shape" argument.
+
+2009-05-26  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/39178
+       * runtime/main.c (store_exe_path): Make static
+       and multiple-times callable.
+       (set_args): Call store_exe_path.
+       * libgfortran.h: Remove store_exe_path prototype.
+       * fmain.c (main): Remove store_exe_path call.
+
+2009-05-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37754
+       * io/write_float.def: Simplify format calculation.
+       
+2009-05-07  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/22423
+       * io/transfer.c (read_block_direct): Avoid warning.
+       * runtime/string.c (compare0): Avoid warning.
+
+2009-04-30  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/39667
+       * io/file_pos.c (st_rewind): Don't truncate or flush.
+       * io/intrinsics.c (fgetc): Flush if switching mode.
+       (fputc): Likewise.
+
+2009-04-18  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/39782
+       * io/transfer.c (data_transfer_init): Don't flush before seek.
+       (finalize_transfer): Remove extra flush.
+
+2009-04-17  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/io.h (is_preconnected): Remove prototype.
+       * io/unix.c (is_preconnected): Remove function.
+
+2009-04-17  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * configure.ac: Test for -ffunction-sections -fdata-sections and
+       set SECTION_FLAGS accordingly.
+       * configure: Regenerate.
+
+       * Makefile.am: Add SECTION_FLAGS to AM_CFLAGS.
+       * Makefile.in: Regenerate.
+
+2009-04-15  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/38668
+       * io/transfer.c (finalize_transfer): Don't flush for advance='no'.
+
+2009-04-15 Danny Smith  <dannysmith@clear.net.nz>
+
+       * io/write.c (itoa) : Rename back to gfc_itoa.
+       (write_i): Adjust call to write_decimal.
+       (write_integer):  Use gfc_itoa.
+
+2009-04-10  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/io.h (move_pos_offset): Remove prototype.
+       * io/transfer.c (formatted_transfer_scalar_read): Use sseek
+       instead of move_pos_offset.
+       * io/unix.c (move_pos_offset): Remove.
+
+2009-04-10  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/39665 libfortran/39702 libfortran/39709
+       * io/io.h (st_parameter_dt): Revert aligned attribute from u.p.value.
+       * io/list_read.c (read_complex): Read directly into user pointer.
+       (read_real): Likewise.
+       (list_formatted_read_scalar): Update read_complex and read_real calls.
+       (nml_read_obj): Read directly into user pointer.
+
+2009-04-09  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/39665
+       * io/io.h (st_parameter_dt): Add aligned attribute to u.p.value.
+       * io/read.c (convert_real): Add note about alignment requirements.
+
+2009-04-09  Nick Clifton  <nickc@redhat.com>
+
+       * m4/cshift0.m4: Change copyright header to refer to version 3
+       of the GNU General Public License with version 3.1 of the GCC
+       Runtime Library Exception and to point readers at the COPYING3
+       and COPYING3.RUNTIME files and the FSF's license web page.
+       * c99_protos.h: Likewise.
+       * config/fpu-387.h: Likewise.
+       * config/fpu-aix.h: Likewise.
+       * config/fpu-generic.h: Likewise.
+       * config/fpu-glibc.h: Likewise.
+       * config/fpu-sysv.h: Likewise.
+       * intrinsics/abort.c: Likewise.
+       * intrinsics/access.c: Likewise.
+       * intrinsics/args.c: Likewise.
+       * intrinsics/associated.c: Likewise.
+       * intrinsics/c99_functions.c: Likewise.
+       * intrinsics/chdir.c: Likewise.
+       * intrinsics/chmod.c: Likewise.
+       * intrinsics/clock.c: Likewise.
+       * intrinsics/cpu_time.c: Likewise.
+       * intrinsics/cshift0.c: Likewise.
+       * intrinsics/ctime.c: Likewise.
+       * intrinsics/date_and_time.c: Likewise.
+       * intrinsics/dprod_r8.f90: Likewise.
+       * intrinsics/dtime.c: Likewise.
+       * intrinsics/env.c: Likewise.
+       * intrinsics/eoshift0.c: Likewise.
+       * intrinsics/eoshift2.c: Likewise.
+       * intrinsics/erfc_scaled.c: Likewise.
+       * intrinsics/erfc_scaled_inc.c: Likewise.
+       * intrinsics/etime.c: Likewise.
+       * intrinsics/exit.c: Likewise.
+       * intrinsics/f2c_specifics.F90: Likewise.
+       * intrinsics/fnum.c: Likewise.
+       * intrinsics/gerror.c: Likewise.
+       * intrinsics/getXid.c: Likewise.
+       * intrinsics/getcwd.c: Likewise.
+       * intrinsics/getlog.c: Likewise.
+       * intrinsics/hostnm.c: Likewise.
+       * intrinsics/ierrno.c: Likewise.
+       * intrinsics/ishftc.c: Likewise.
+       * intrinsics/iso_c_binding.c: Likewise.
+       * intrinsics/iso_c_binding.h: Likewise.
+       * intrinsics/iso_c_generated_procs.c: Likewise.
+       * intrinsics/kill.c: Likewise.
+       * intrinsics/link.c: Likewise.
+       * intrinsics/malloc.c: Likewise.
+       * intrinsics/move_alloc.c: Likewise.
+       * intrinsics/mvbits.c: Likewise.
+       * intrinsics/pack_generic.c: Likewise.
+       * intrinsics/perror.c: Likewise.
+       * intrinsics/rand.c: Likewise.
+       * intrinsics/random.c: Likewise.
+       * intrinsics/rename.c: Likewise.
+       * intrinsics/reshape_generic.c: Likewise.
+       * intrinsics/reshape_packed.c: Likewise.
+       * intrinsics/selected_char_kind.c: Likewise.
+       * intrinsics/selected_int_kind.f90: Likewise.
+       * intrinsics/selected_real_kind.f90: Likewise.
+       * intrinsics/signal.c: Likewise.
+       * intrinsics/size.c: Likewise.
+       * intrinsics/sleep.c: Likewise.
+       * intrinsics/spread_generic.c: Likewise.
+       * intrinsics/stat.c: Likewise.
+       * intrinsics/string_intrinsics.c: Likewise.
+       * intrinsics/string_intrinsics_inc.c: Likewise.
+       * intrinsics/symlnk.c: Likewise.
+       * intrinsics/system.c: Likewise.
+       * intrinsics/system_clock.c: Likewise.
+       * intrinsics/time.c: Likewise.
+       * intrinsics/time_1.h: Likewise.
+       * intrinsics/transpose_generic.c: Likewise.
+       * intrinsics/umask.c: Likewise.
+       * intrinsics/unlink.c: Likewise.
+       * intrinsics/unpack_generic.c: Likewise.
+       * io/close.c: Likewise.
+       * io/fbuf.c: Likewise.
+       * io/file_pos.c: Likewise.
+       * io/format.c: Likewise.
+       * io/inquire.c: Likewise.
+       * io/intrinsics.c: Likewise.
+       * io/io.h: Likewise.
+       * io/list_read.c: Likewise.
+       * io/lock.c: Likewise.
+       * io/open.c: Likewise.
+       * io/read.c: Likewise.
+       * io/size_from_kind.c: Likewise.
+       * io/transfer.c: Likewise.
+       * io/unit.c: Likewise.
+       * io/unix.c: Likewise.
+       * io/write.c: Likewise.
+       * io/write_float.def: Likewise.
+       * libgfortran.h: Likewise.
+       * m4/all.m4: Likewise.
+       * m4/any.m4: Likewise.
+       * m4/count.m4: Likewise.
+       * m4/cshift1.m4: Likewise.
+       * m4/eoshift1.m4: Likewise.
+       * m4/eoshift3.m4: Likewise.
+       * m4/exponent.m4: Likewise.
+       * m4/fraction.m4: Likewise.
+       * m4/head.m4: Likewise.
+       * m4/in_pack.m4: Likewise.
+       * m4/in_unpack.m4: Likewise.
+       * m4/matmul.m4: Likewise.
+       * m4/matmull.m4: Likewise.
+       * m4/maxloc0.m4: Likewise.
+       * m4/maxloc1.m4: Likewise.
+       * m4/maxval.m4: Likewise.
+       * m4/minloc0.m4: Likewise.
+       * m4/minloc1.m4: Likewise.
+       * m4/minval.m4: Likewise.
+       * m4/nearest.m4: Likewise.
+       * m4/pack.m4: Likewise.
+       * m4/pow.m4: Likewise.
+       * m4/product.m4: Likewise.
+       * m4/reshape.m4: Likewise.
+       * m4/rrspacing.m4: Likewise.
+       * m4/set_exponent.m4: Likewise.
+       * m4/shape.m4: Likewise.
+       * m4/spacing.m4: Likewise.
+       * m4/spread.m4: Likewise.
+       * m4/sum.m4: Likewise.
+       * m4/transpose.m4: Likewise.
+       * m4/unpack.m4: Likewise.
+       * runtime/backtrace.c: Likewise.
+       * runtime/compile_options.c: Likewise.
+       * runtime/convert_char.c: Likewise.
+       * runtime/environ.c: Likewise.
+       * runtime/error.c: Likewise.
+       * runtime/in_pack_generic.c: Likewise.
+       * runtime/in_unpack_generic.c: Likewise.
+       * runtime/main.c: Likewise.
+       * runtime/memory.c: Likewise.
+       * runtime/pause.c: Likewise.
+       * runtime/select.c: Likewise.
+       * runtime/select_inc.c: Likewise.
+       * runtime/stop.c: Likewise.
+       * runtime/string.c: Likewise.
+       * generated/_abs_c10.F90: Regenerate.
+       * generated/_abs_c16.F90: Regenerate.
+       * generated/_abs_c4.F90: Regenerate.
+       * generated/_abs_c8.F90: Regenerate.
+       * generated/_abs_i16.F90: Regenerate.
+       * generated/_abs_i4.F90: Regenerate.
+       * generated/_abs_i8.F90: Regenerate.
+       * generated/_abs_r10.F90: Regenerate.
+       * generated/_abs_r16.F90: Regenerate.
+       * generated/_abs_r4.F90: Regenerate.
+       * generated/_abs_r8.F90: Regenerate.
+       * generated/_acos_r10.F90: Regenerate.
+       * generated/_acos_r16.F90: Regenerate.
+       * generated/_acos_r4.F90: Regenerate.
+       * generated/_acos_r8.F90: Regenerate.
+       * generated/_acosh_r10.F90: Regenerate.
+       * generated/_acosh_r16.F90: Regenerate.
+       * generated/_acosh_r4.F90: Regenerate.
+       * generated/_acosh_r8.F90: Regenerate.
+       * generated/_aimag_c10.F90: Regenerate.
+       * generated/_aimag_c16.F90: Regenerate.
+       * generated/_aimag_c4.F90: Regenerate.
+       * generated/_aimag_c8.F90: Regenerate.
+       * generated/_aint_r10.F90: Regenerate.
+       * generated/_aint_r16.F90: Regenerate.
+       * generated/_aint_r4.F90: Regenerate.
+       * generated/_aint_r8.F90: Regenerate.
+       * generated/_anint_r10.F90: Regenerate.
+       * generated/_anint_r16.F90: Regenerate.
+       * generated/_anint_r4.F90: Regenerate.
+       * generated/_anint_r8.F90: Regenerate.
+       * generated/_asin_r10.F90: Regenerate.
+       * generated/_asin_r16.F90: Regenerate.
+       * generated/_asin_r4.F90: Regenerate.
+       * generated/_asin_r8.F90: Regenerate.
+       * generated/_asinh_r10.F90: Regenerate.
+       * generated/_asinh_r16.F90: Regenerate.
+       * generated/_asinh_r4.F90: Regenerate.
+       * generated/_asinh_r8.F90: Regenerate.
+       * generated/_atan2_r10.F90: Regenerate.
+       * generated/_atan2_r16.F90: Regenerate.
+       * generated/_atan2_r4.F90: Regenerate.
+       * generated/_atan2_r8.F90: Regenerate.
+       * generated/_atan_r10.F90: Regenerate.
+       * generated/_atan_r16.F90: Regenerate.
+       * generated/_atan_r4.F90: Regenerate.
+       * generated/_atan_r8.F90: Regenerate.
+       * generated/_atanh_r10.F90: Regenerate.
+       * generated/_atanh_r16.F90: Regenerate.
+       * generated/_atanh_r4.F90: Regenerate.
+       * generated/_atanh_r8.F90: Regenerate.
+       * generated/_conjg_c10.F90: Regenerate.
+       * generated/_conjg_c16.F90: Regenerate.
+       * generated/_conjg_c4.F90: Regenerate.
+       * generated/_conjg_c8.F90: Regenerate.
+       * generated/_cos_c10.F90: Regenerate.
+       * generated/_cos_c16.F90: Regenerate.
+       * generated/_cos_c4.F90: Regenerate.
+       * generated/_cos_c8.F90: Regenerate.
+       * generated/_cos_r10.F90: Regenerate.
+       * generated/_cos_r16.F90: Regenerate.
+       * generated/_cos_r4.F90: Regenerate.
+       * generated/_cos_r8.F90: Regenerate.
+       * generated/_cosh_r10.F90: Regenerate.
+       * generated/_cosh_r16.F90: Regenerate.
+       * generated/_cosh_r4.F90: Regenerate.
+       * generated/_cosh_r8.F90: Regenerate.
+       * generated/_dim_i16.F90: Regenerate.
+       * generated/_dim_i4.F90: Regenerate.
+       * generated/_dim_i8.F90: Regenerate.
+       * generated/_dim_r10.F90: Regenerate.
+       * generated/_dim_r16.F90: Regenerate.
+       * generated/_dim_r4.F90: Regenerate.
+       * generated/_dim_r8.F90: Regenerate.
+       * generated/_exp_c10.F90: Regenerate.
+       * generated/_exp_c16.F90: Regenerate.
+       * generated/_exp_c4.F90: Regenerate.
+       * generated/_exp_c8.F90: Regenerate.
+       * generated/_exp_r10.F90: Regenerate.
+       * generated/_exp_r16.F90: Regenerate.
+       * generated/_exp_r4.F90: Regenerate.
+       * generated/_exp_r8.F90: Regenerate.
+       * generated/_log10_r10.F90: Regenerate.
+       * generated/_log10_r16.F90: Regenerate.
+       * generated/_log10_r4.F90: Regenerate.
+       * generated/_log10_r8.F90: Regenerate.
+       * generated/_log_c10.F90: Regenerate.
+       * generated/_log_c16.F90: Regenerate.
+       * generated/_log_c4.F90: Regenerate.
+       * generated/_log_c8.F90: Regenerate.
+       * generated/_log_r10.F90: Regenerate.
+       * generated/_log_r16.F90: Regenerate.
+       * generated/_log_r4.F90: Regenerate.
+       * generated/_log_r8.F90: Regenerate.
+       * generated/_mod_i16.F90: Regenerate.
+       * generated/_mod_i4.F90: Regenerate.
+       * generated/_mod_i8.F90: Regenerate.
+       * generated/_mod_r10.F90: Regenerate.
+       * generated/_mod_r16.F90: Regenerate.
+       * generated/_mod_r4.F90: Regenerate.
+       * generated/_mod_r8.F90: Regenerate.
+       * generated/_sign_i16.F90: Regenerate.
+       * generated/_sign_i4.F90: Regenerate.
+       * generated/_sign_i8.F90: Regenerate.
+       * generated/_sign_r10.F90: Regenerate.
+       * generated/_sign_r16.F90: Regenerate.
+       * generated/_sign_r4.F90: Regenerate.
+       * generated/_sign_r8.F90: Regenerate.
+       * generated/_sin_c10.F90: Regenerate.
+       * generated/_sin_c16.F90: Regenerate.
+       * generated/_sin_c4.F90: Regenerate.
+       * generated/_sin_c8.F90: Regenerate.
+       * generated/_sin_r10.F90: Regenerate.
+       * generated/_sin_r16.F90: Regenerate.
+       * generated/_sin_r4.F90: Regenerate.
+       * generated/_sin_r8.F90: Regenerate.
+       * generated/_sinh_r10.F90: Regenerate.
+       * generated/_sinh_r16.F90: Regenerate.
+       * generated/_sinh_r4.F90: Regenerate.
+       * generated/_sinh_r8.F90: Regenerate.
+       * generated/_sqrt_c10.F90: Regenerate.
+       * generated/_sqrt_c16.F90: Regenerate.
+       * generated/_sqrt_c4.F90: Regenerate.
+       * generated/_sqrt_c8.F90: Regenerate.
+       * generated/_sqrt_r10.F90: Regenerate.
+       * generated/_sqrt_r16.F90: Regenerate.
+       * generated/_sqrt_r4.F90: Regenerate.
+       * generated/_sqrt_r8.F90: Regenerate.
+       * generated/_tan_r10.F90: Regenerate.
+       * generated/_tan_r16.F90: Regenerate.
+       * generated/_tan_r4.F90: Regenerate.
+       * generated/_tan_r8.F90: Regenerate.
+       * generated/_tanh_r10.F90: Regenerate.
+       * generated/_tanh_r16.F90: Regenerate.
+       * generated/_tanh_r4.F90: Regenerate.
+       * generated/_tanh_r8.F90: Regenerate.
+       * generated/all_l1.c: Regenerate.
+       * generated/all_l16.c: Regenerate.
+       * generated/all_l2.c: Regenerate.
+       * generated/all_l4.c: Regenerate.
+       * generated/all_l8.c: Regenerate.
+       * generated/any_l1.c: Regenerate.
+       * generated/any_l16.c: Regenerate.
+       * generated/any_l2.c: Regenerate.
+       * generated/any_l4.c: Regenerate.
+       * generated/any_l8.c: Regenerate.
+       * generated/count_16_l.c: Regenerate.
+       * generated/count_1_l.c: Regenerate.
+       * generated/count_2_l.c: Regenerate.
+       * generated/count_4_l.c: Regenerate.
+       * generated/count_8_l.c: Regenerate.
+       * generated/cshift0_c10.c: Regenerate.
+       * generated/cshift0_c16.c: Regenerate.
+       * generated/cshift0_c4.c: Regenerate.
+       * generated/cshift0_c8.c: Regenerate.
+       * generated/cshift0_i1.c: Regenerate.
+       * generated/cshift0_i16.c: Regenerate.
+       * generated/cshift0_i2.c: Regenerate.
+       * generated/cshift0_i4.c: Regenerate.
+       * generated/cshift0_i8.c: Regenerate.
+       * generated/cshift0_r10.c: Regenerate.
+       * generated/cshift0_r16.c: Regenerate.
+       * generated/cshift0_r4.c: Regenerate.
+       * generated/cshift0_r8.c: Regenerate.
+       * generated/cshift1_16.c: Regenerate.
+       * generated/cshift1_4.c: Regenerate.
+       * generated/cshift1_8.c: Regenerate.
+       * generated/eoshift1_16.c: Regenerate.
+       * generated/eoshift1_4.c: Regenerate.
+       * generated/eoshift1_8.c: Regenerate.
+       * generated/eoshift3_16.c: Regenerate.
+       * generated/eoshift3_4.c: Regenerate.
+       * generated/eoshift3_8.c: Regenerate.
+       * generated/exponent_r10.c: Regenerate.
+       * generated/exponent_r16.c: Regenerate.
+       * generated/exponent_r4.c: Regenerate.
+       * generated/exponent_r8.c: Regenerate.
+       * generated/fraction_r10.c: Regenerate.
+       * generated/fraction_r16.c: Regenerate.
+       * generated/fraction_r4.c: Regenerate.
+       * generated/fraction_r8.c: Regenerate.
+       * generated/in_pack_c10.c: Regenerate.
+       * generated/in_pack_c16.c: Regenerate.
+       * generated/in_pack_c4.c: Regenerate.
+       * generated/in_pack_c8.c: Regenerate.
+       * generated/in_pack_i1.c: Regenerate.
+       * generated/in_pack_i16.c: Regenerate.
+       * generated/in_pack_i2.c: Regenerate.
+       * generated/in_pack_i4.c: Regenerate.
+       * generated/in_pack_i8.c: Regenerate.
+       * generated/in_pack_r10.c: Regenerate.
+       * generated/in_pack_r16.c: Regenerate.
+       * generated/in_pack_r4.c: Regenerate.
+       * generated/in_pack_r8.c: Regenerate.
+       * generated/in_unpack_c10.c: Regenerate.
+       * generated/in_unpack_c16.c: Regenerate.
+       * generated/in_unpack_c4.c: Regenerate.
+       * generated/in_unpack_c8.c: Regenerate.
+       * generated/in_unpack_i1.c: Regenerate.
+       * generated/in_unpack_i16.c: Regenerate.
+       * generated/in_unpack_i2.c: Regenerate.
+       * generated/in_unpack_i4.c: Regenerate.
+       * generated/in_unpack_i8.c: Regenerate.
+       * generated/in_unpack_r10.c: Regenerate.
+       * generated/in_unpack_r16.c: Regenerate.
+       * generated/in_unpack_r4.c: Regenerate.
+       * generated/in_unpack_r8.c: Regenerate.
+       * generated/matmul_c10.c: Regenerate.
+       * generated/matmul_c16.c: Regenerate.
+       * generated/matmul_c4.c: Regenerate.
+       * generated/matmul_c8.c: Regenerate.
+       * generated/matmul_i1.c: Regenerate.
+       * generated/matmul_i16.c: Regenerate.
+       * generated/matmul_i2.c: Regenerate.
+       * generated/matmul_i4.c: Regenerate.
+       * generated/matmul_i8.c: Regenerate.
+       * generated/matmul_l16.c: Regenerate.
+       * generated/matmul_l4.c: Regenerate.
+       * generated/matmul_l8.c: Regenerate.
+       * generated/matmul_r10.c: Regenerate.
+       * generated/matmul_r16.c: Regenerate.
+       * generated/matmul_r4.c: Regenerate.
+       * generated/matmul_r8.c: Regenerate.
+       * generated/maxloc0_16_i1.c: Regenerate.
+       * generated/maxloc0_16_i16.c: Regenerate.
+       * generated/maxloc0_16_i2.c: Regenerate.
+       * generated/maxloc0_16_i4.c: Regenerate.
+       * generated/maxloc0_16_i8.c: Regenerate.
+       * generated/maxloc0_16_r10.c: Regenerate.
+       * generated/maxloc0_16_r16.c: Regenerate.
+       * generated/maxloc0_16_r4.c: Regenerate.
+       * generated/maxloc0_16_r8.c: Regenerate.
+       * generated/maxloc0_4_i1.c: Regenerate.
+       * generated/maxloc0_4_i16.c: Regenerate.
+       * generated/maxloc0_4_i2.c: Regenerate.
+       * generated/maxloc0_4_i4.c: Regenerate.
+       * generated/maxloc0_4_i8.c: Regenerate.
+       * generated/maxloc0_4_r10.c: Regenerate.
+       * generated/maxloc0_4_r16.c: Regenerate.
+       * generated/maxloc0_4_r4.c: Regenerate.
+       * generated/maxloc0_4_r8.c: Regenerate.
+       * generated/maxloc0_8_i1.c: Regenerate.
+       * generated/maxloc0_8_i16.c: Regenerate.
+       * generated/maxloc0_8_i2.c: Regenerate.
+       * generated/maxloc0_8_i4.c: Regenerate.
+       * generated/maxloc0_8_i8.c: Regenerate.
+       * generated/maxloc0_8_r10.c: Regenerate.
+       * generated/maxloc0_8_r16.c: Regenerate.
+       * generated/maxloc0_8_r4.c: Regenerate.
+       * generated/maxloc0_8_r8.c: Regenerate.
+       * generated/maxloc1_16_i1.c: Regenerate.
+       * generated/maxloc1_16_i16.c: Regenerate.
+       * generated/maxloc1_16_i2.c: Regenerate.
+       * generated/maxloc1_16_i4.c: Regenerate.
+       * generated/maxloc1_16_i8.c: Regenerate.
+       * generated/maxloc1_16_r10.c: Regenerate.
+       * generated/maxloc1_16_r16.c: Regenerate.
+       * generated/maxloc1_16_r4.c: Regenerate.
+       * generated/maxloc1_16_r8.c: Regenerate.
+       * generated/maxloc1_4_i1.c: Regenerate.
+       * generated/maxloc1_4_i16.c: Regenerate.
+       * generated/maxloc1_4_i2.c: Regenerate.
+       * generated/maxloc1_4_i4.c: Regenerate.
+       * generated/maxloc1_4_i8.c: Regenerate.
+       * generated/maxloc1_4_r10.c: Regenerate.
+       * generated/maxloc1_4_r16.c: Regenerate.
+       * generated/maxloc1_4_r4.c: Regenerate.
+       * generated/maxloc1_4_r8.c: Regenerate.
+       * generated/maxloc1_8_i1.c: Regenerate.
+       * generated/maxloc1_8_i16.c: Regenerate.
+       * generated/maxloc1_8_i2.c: Regenerate.
+       * generated/maxloc1_8_i4.c: Regenerate.
+       * generated/maxloc1_8_i8.c: Regenerate.
+       * generated/maxloc1_8_r10.c: Regenerate.
+       * generated/maxloc1_8_r16.c: Regenerate.
+       * generated/maxloc1_8_r4.c: Regenerate.
+       * generated/maxloc1_8_r8.c: Regenerate.
+       * generated/maxval_i1.c: Regenerate.
+       * generated/maxval_i16.c: Regenerate.
+       * generated/maxval_i2.c: Regenerate.
+       * generated/maxval_i4.c: Regenerate.
+       * generated/maxval_i8.c: Regenerate.
+       * generated/maxval_r10.c: Regenerate.
+       * generated/maxval_r16.c: Regenerate.
+       * generated/maxval_r4.c: Regenerate.
+       * generated/maxval_r8.c: Regenerate.
+       * generated/minloc0_16_i1.c: Regenerate.
+       * generated/minloc0_16_i16.c: Regenerate.
+       * generated/minloc0_16_i2.c: Regenerate.
+       * generated/minloc0_16_i4.c: Regenerate.
+       * generated/minloc0_16_i8.c: Regenerate.
+       * generated/minloc0_16_r10.c: Regenerate.
+       * generated/minloc0_16_r16.c: Regenerate.
+       * generated/minloc0_16_r4.c: Regenerate.
+       * generated/minloc0_16_r8.c: Regenerate.
+       * generated/minloc0_4_i1.c: Regenerate.
+       * generated/minloc0_4_i16.c: Regenerate.
+       * generated/minloc0_4_i2.c: Regenerate.
+       * generated/minloc0_4_i4.c: Regenerate.
+       * generated/minloc0_4_i8.c: Regenerate.
+       * generated/minloc0_4_r10.c: Regenerate.
+       * generated/minloc0_4_r16.c: Regenerate.
+       * generated/minloc0_4_r4.c: Regenerate.
+       * generated/minloc0_4_r8.c: Regenerate.
+       * generated/minloc0_8_i1.c: Regenerate.
+       * generated/minloc0_8_i16.c: Regenerate.
+       * generated/minloc0_8_i2.c: Regenerate.
+       * generated/minloc0_8_i4.c: Regenerate.
+       * generated/minloc0_8_i8.c: Regenerate.
+       * generated/minloc0_8_r10.c: Regenerate.
+       * generated/minloc0_8_r16.c: Regenerate.
+       * generated/minloc0_8_r4.c: Regenerate.
+       * generated/minloc0_8_r8.c: Regenerate.
+       * generated/minloc1_16_i1.c: Regenerate.
+       * generated/minloc1_16_i16.c: Regenerate.
+       * generated/minloc1_16_i2.c: Regenerate.
+       * generated/minloc1_16_i4.c: Regenerate.
+       * generated/minloc1_16_i8.c: Regenerate.
+       * generated/minloc1_16_r10.c: Regenerate.
+       * generated/minloc1_16_r16.c: Regenerate.
+       * generated/minloc1_16_r4.c: Regenerate.
+       * generated/minloc1_16_r8.c: Regenerate.
+       * generated/minloc1_4_i1.c: Regenerate.
+       * generated/minloc1_4_i16.c: Regenerate.
+       * generated/minloc1_4_i2.c: Regenerate.
+       * generated/minloc1_4_i4.c: Regenerate.
+       * generated/minloc1_4_i8.c: Regenerate.
+       * generated/minloc1_4_r10.c: Regenerate.
+       * generated/minloc1_4_r16.c: Regenerate.
+       * generated/minloc1_4_r4.c: Regenerate.
+       * generated/minloc1_4_r8.c: Regenerate.
+       * generated/minloc1_8_i1.c: Regenerate.
+       * generated/minloc1_8_i16.c: Regenerate.
+       * generated/minloc1_8_i2.c: Regenerate.
+       * generated/minloc1_8_i4.c: Regenerate.
+       * generated/minloc1_8_i8.c: Regenerate.
+       * generated/minloc1_8_r10.c: Regenerate.
+       * generated/minloc1_8_r16.c: Regenerate.
+       * generated/minloc1_8_r4.c: Regenerate.
+       * generated/minloc1_8_r8.c: Regenerate.
+       * generated/minval_i1.c: Regenerate.
+       * generated/minval_i16.c: Regenerate.
+       * generated/minval_i2.c: Regenerate.
+       * generated/minval_i4.c: Regenerate.
+       * generated/minval_i8.c: Regenerate.
+       * generated/minval_r10.c: Regenerate.
+       * generated/minval_r16.c: Regenerate.
+       * generated/minval_r4.c: Regenerate.
+       * generated/minval_r8.c: Regenerate.
+       * generated/misc_specifics.F90: Regenerate.
+       * generated/nearest_r10.c: Regenerate.
+       * generated/nearest_r16.c: Regenerate.
+       * generated/nearest_r4.c: Regenerate.
+       * generated/nearest_r8.c: Regenerate.
+       * generated/pack_c10.c: Regenerate.
+       * generated/pack_c16.c: Regenerate.
+       * generated/pack_c4.c: Regenerate.
+       * generated/pack_c8.c: Regenerate.
+       * generated/pack_i1.c: Regenerate.
+       * generated/pack_i16.c: Regenerate.
+       * generated/pack_i2.c: Regenerate.
+       * generated/pack_i4.c: Regenerate.
+       * generated/pack_i8.c: Regenerate.
+       * generated/pack_r10.c: Regenerate.
+       * generated/pack_r16.c: Regenerate.
+       * generated/pack_r4.c: Regenerate.
+       * generated/pack_r8.c: Regenerate.
+       * generated/pow_c10_i16.c: Regenerate.
+       * generated/pow_c10_i4.c: Regenerate.
+       * generated/pow_c10_i8.c: Regenerate.
+       * generated/pow_c16_i16.c: Regenerate.
+       * generated/pow_c16_i4.c: Regenerate.
+       * generated/pow_c16_i8.c: Regenerate.
+       * generated/pow_c4_i16.c: Regenerate.
+       * generated/pow_c4_i4.c: Regenerate.
+       * generated/pow_c4_i8.c: Regenerate.
+       * generated/pow_c8_i16.c: Regenerate.
+       * generated/pow_c8_i4.c: Regenerate.
+       * generated/pow_c8_i8.c: Regenerate.
+       * generated/pow_i16_i16.c: Regenerate.
+       * generated/pow_i16_i4.c: Regenerate.
+       * generated/pow_i16_i8.c: Regenerate.
+       * generated/pow_i4_i16.c: Regenerate.
+       * generated/pow_i4_i4.c: Regenerate.
+       * generated/pow_i4_i8.c: Regenerate.
+       * generated/pow_i8_i16.c: Regenerate.
+       * generated/pow_i8_i4.c: Regenerate.
+       * generated/pow_i8_i8.c: Regenerate.
+       * generated/pow_r10_i16.c: Regenerate.
+       * generated/pow_r10_i8.c: Regenerate.
+       * generated/pow_r16_i16.c: Regenerate.
+       * generated/pow_r16_i8.c: Regenerate.
+       * generated/pow_r4_i16.c: Regenerate.
+       * generated/pow_r4_i8.c: Regenerate.
+       * generated/pow_r8_i16.c: Regenerate.
+       * generated/pow_r8_i8.c: Regenerate.
+       * generated/product_c10.c: Regenerate.
+       * generated/product_c16.c: Regenerate.
+       * generated/product_c4.c: Regenerate.
+       * generated/product_c8.c: Regenerate.
+       * generated/product_i1.c: Regenerate.
+       * generated/product_i16.c: Regenerate.
+       * generated/product_i2.c: Regenerate.
+       * generated/product_i4.c: Regenerate.
+       * generated/product_i8.c: Regenerate.
+       * generated/product_r10.c: Regenerate.
+       * generated/product_r16.c: Regenerate.
+       * generated/product_r4.c: Regenerate.
+       * generated/product_r8.c: Regenerate.
+       * generated/reshape_c10.c: Regenerate.
+       * generated/reshape_c16.c: Regenerate.
+       * generated/reshape_c4.c: Regenerate.
+       * generated/reshape_c8.c: Regenerate.
+       * generated/reshape_i16.c: Regenerate.
+       * generated/reshape_i4.c: Regenerate.
+       * generated/reshape_i8.c: Regenerate.
+       * generated/reshape_r10.c: Regenerate.
+       * generated/reshape_r16.c: Regenerate.
+       * generated/reshape_r4.c: Regenerate.
+       * generated/reshape_r8.c: Regenerate.
+       * generated/rrspacing_r10.c: Regenerate.
+       * generated/rrspacing_r16.c: Regenerate.
+       * generated/rrspacing_r4.c: Regenerate.
+       * generated/rrspacing_r8.c: Regenerate.
+       * generated/set_exponent_r10.c: Regenerate.
+       * generated/set_exponent_r16.c: Regenerate.
+       * generated/set_exponent_r4.c: Regenerate.
+       * generated/set_exponent_r8.c: Regenerate.
+       * generated/shape_i16.c: Regenerate.
+       * generated/shape_i4.c: Regenerate.
+       * generated/shape_i8.c: Regenerate.
+       * generated/spacing_r10.c: Regenerate.
+       * generated/spacing_r16.c: Regenerate.
+       * generated/spacing_r4.c: Regenerate.
+       * generated/spacing_r8.c: Regenerate.
+       * generated/spread_c10.c: Regenerate.
+       * generated/spread_c16.c: Regenerate.
+       * generated/spread_c4.c: Regenerate.
+       * generated/spread_c8.c: Regenerate.
+       * generated/spread_i1.c: Regenerate.
+       * generated/spread_i16.c: Regenerate.
+       * generated/spread_i2.c: Regenerate.
+       * generated/spread_i4.c: Regenerate.
+       * generated/spread_i8.c: Regenerate.
+       * generated/spread_r10.c: Regenerate.
+       * generated/spread_r16.c: Regenerate.
+       * generated/spread_r4.c: Regenerate.
+       * generated/spread_r8.c: Regenerate.
+       * generated/sum_c10.c: Regenerate.
+       * generated/sum_c16.c: Regenerate.
+       * generated/sum_c4.c: Regenerate.
+       * generated/sum_c8.c: Regenerate.
+       * generated/sum_i1.c: Regenerate.
+       * generated/sum_i16.c: Regenerate.
+       * generated/sum_i2.c: Regenerate.
+       * generated/sum_i4.c: Regenerate.
+       * generated/sum_i8.c: Regenerate.
+       * generated/sum_r10.c: Regenerate.
+       * generated/sum_r16.c: Regenerate.
+       * generated/sum_r4.c: Regenerate.
+       * generated/sum_r8.c: Regenerate.
+       * generated/transpose_c10.c: Regenerate.
+       * generated/transpose_c16.c: Regenerate.
+       * generated/transpose_c4.c: Regenerate.
+       * generated/transpose_c8.c: Regenerate.
+       * generated/transpose_i16.c: Regenerate.
+       * generated/transpose_i4.c: Regenerate.
+       * generated/transpose_i8.c: Regenerate.
+       * generated/transpose_r10.c: Regenerate.
+       * generated/transpose_r16.c: Regenerate.
+       * generated/transpose_r4.c: Regenerate.
+       * generated/transpose_r8.c: Regenerate.
+       * generated/unpack_c10.c: Regenerate.
+       * generated/unpack_c16.c: Regenerate.
+       * generated/unpack_c4.c: Regenerate.
+       * generated/unpack_c8.c: Regenerate.
+       * generated/unpack_i1.c: Regenerate.
+       * generated/unpack_i16.c: Regenerate.
+       * generated/unpack_i2.c: Regenerate.
+       * generated/unpack_i4.c: Regenerate.
+       * generated/unpack_i8.c: Regenerate.
+       * generated/unpack_r10.c: Regenerate.
+       * generated/unpack_r16.c: Regenerate.
+       * generated/unpack_r4.c: Regenerate.
+       * generated/unpack_r8.c: Regenerate.
+
+2009-04-08  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/open.c (already_open): Test for POSIX close return value.
+       * io/unit.c (close_unit_1): Likewise.
+       * io/unix.c (raw_close): Return 0 for success for preconnected units.
+
+2009-04-08  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * runtime/string.c (compare0): Use gfc_charlen_type.
+       * runtime/error.c (gfc_itoa): Move to io/write.c
+       (xtoa): Rename to gfc_xtoa.
+       * runtime/backtrace.c (show_backtrace): Call gfc_xtoa.
+       * intrinsics/cshift0.c (cshift0): Use index_type for shift arg.
+       * intrinsics/date_and_time.c (date_and_time): Use index_type.
+       (itime_i4): Likewise.
+       (itime_i8): Likewise.
+       (idate_i4): Likewise.
+       (idate_i8): Likewise.
+       (gmtime_i4): Likewise.
+       (gmtime_i8): Likewise.
+       (ltime_i4): Likewise.
+       (ltime_i8): Likewise.
+       * libgfortran.h (gfc_itoa): Remove prototype.
+       (xtoa): Rename prototype to gfc_xtoa.
+       * io/list_read.c (nml_read_obj): Use size_t for string length.
+       * io/transfer.c (read_block_direct): Change nbytes arg from
+       pointer to value.
+       (unformatted_read): Minor cleanup, call read_block_directly properly.
+       (skip_record): Use ssize_t.
+       (next_record_w_unf): Avoid stell() call by calling sseek with SEEK_CUR.
+       (iolength_transfer): Make sure to multiply before cast.
+       * io/intrinsics.c (fgetc): Remove unnecessary variable.
+       * io/format.c (format_hash): Use gfc_charlen_type.
+       * io/write.c (itoa): Move from runtime/error.c:gfc_itoa, rename,
+       make static.
+       (write_i): Call with pointer to itoa.
+       (write_z): Call with pointer to gfc_xtoa.
+       (write_integer): Pointer to itoa.
+       (nml_write_obj): Type cleanup, don't call strlen in loop.
+       
+2009-04-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR libgfortran/39664
+       * io/unix.c (raw_close): Don't close STDOUT_FILENO,
+       STDERR_FILENO nor STDIN_FILENO.
+
+2009-04-06  David Edelsohn  <edelsohn@gnu.org>
+       
+       * io/io.h (struct stream): Rename truncate to trunc.
+       (struncate): Same.
+       * io/unix.c (raw_init): Rename truncate to trunc.
+       (buf_init): Same.
+       (open_internal): Same.
+       
+2009-04-05  Daniel Kraft  <d@domob.eu>
+
+       PR fortran/38654
+       * io/read.c (read_f): Reworked to speed up floating point parsing.
+       (convert_real): Use pointer-casting instead of memcpy and temporaries.
+
+2009-04-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37754
+       * io/io.h (format_hash_entry): New structure for hash table.
+       (format_hash_table): The hash table itself.
+       (free_format_data): Revise function prototype.
+       (free_format_hash_table, init_format_hash,
+       free_format_hash): New function prototypes.
+       * io/unit.c (close_unit_1): Use free_format_hash_table.
+       * io/transfer.c (st_read_done, st_write_done): Free format data if
+       internal unit.
+       * io/format.c (free_format_hash_table): New function that frees any
+       memory allocated previously for cached format data.
+       (reset_node): New static helper function to reset the format counters
+       for a format node.
+       (reset_fnode_counters): New static function recursively calls reset_node
+       to traverse the fnode tree.
+       (format_hash): New simple hash function based on XOR, probabalistic,
+       tosses collisions.
+       (save_parsed_format): New static function to save the parsed format
+       data to use again.
+       (find_parsed_format): New static function searches the hash table
+       looking for a match.
+       (free_format_data): Revised to accept pointer to format data rather than
+       the dtp pointer so that the function can be used in more places.
+       (format_lex): Editorial.
+       (parse_format_list): Set flag used to determine of format data hashing
+       is to be used.  Internal units are not persistent enough for this.
+       (revert): Move to ne location in file.
+       (parse_format): Use new functions to look for previously parsed
+       format strings and use them rather than re-parse.  If not found, saves
+       the parsed format data for later use.
+       
+2009-04-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37754
+       * io/transfer.c (formatted_transfer_scalar): Remove this function by
+       factoring it into two new functions, one for read and one for write,
+       eliminating all the conditionals for read or write mode.
+       (formatted transfer_scalar_read): New function.
+       (formatted transfer_scalar_write): New function.
+       (formatted_transfer): Use new functions.
+
+2009-04-05  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/25561 libfortran/37754
+       * io/io.h (struct stream): Define new stream interface function
+       pointers, and inline functions for accessing it.
+       (struct fbuf): Use int instead of size_t, remove flushed element.
+       (mem_alloc_w): New prototype.
+       (mem_alloc_r): New prototype.
+       (stream_at_bof): Remove prototype.
+       (stream_at_eof): Remove prototype.
+       (file_position): Remove prototype.
+       (flush): Remove prototype.
+       (stream_offset): Remove prototype.
+       (unit_truncate): New prototype.
+       (read_block_form): Change to return pointer, int* argument.
+       (hit_eof): New prototype.
+       (fbuf_init): Change prototype.
+       (fbuf_reset): Change prototype.
+       (fbuf_alloc): Change prototype.
+       (fbuf_flush): Change prototype.
+       (fbuf_seek): Change prototype.
+       (fbuf_read): New prototype.
+       (fbuf_getc_refill): New prototype.
+       (fbuf_getc): New inline function.
+       * io/fbuf.c (fbuf_init): Use int, get rid of flushed.
+       (fbuf_debug): New function.
+       (fbuf_reset): Flush, and return position offset.
+       (fbuf_alloc): Simplify, don't flush, just realloc.
+       (fbuf_flush): Make usable for read mode, salvage remaining bytes.
+       (fbuf_seek): New whence argument.
+       (fbuf_read): New function.
+       (fbuf_getc_refill): New function.
+       * io/file_pos.c (formatted_backspace): Use new stream interface.
+       (unformatted_backspace): Likewise.
+       (st_backspace): Make sure format buffer is reset, use new stream
+       interface, use unit_truncate.
+       (st_endfile): Likewise.
+       (st_rewind): Likewise.
+       * io/intrinsics.c: Use new stream interface.
+       * io/list_read.c (push_char): Don't use u.p.scratch, use realloc
+       to resize.
+       (free_saved): Don't check u.p.scratch.
+       (next_char): Use new stream interface, use fbuf_getc() for external files.
+       (finish_list_read): flush format buffer.
+       (nml_query): Update to use modified interface:s
+       * io/open.c (test_endfile): Use new stream interface.
+       (edit_modes): Likewise.
+       (new_unit): Likewise, set bytes_left to 1 for stream files.
+       * io/read.c (read_l): Use new read_block_form interface.
+       (read_utf8): Likewise.
+       (read_utf8_char1): Likewise.
+       (read_default_char1): Likewise.
+       (read_utf8_char4): Likewise.
+       (read_default_char4): Likewise.
+       (read_a): Likewise.
+       (read_a_char4): Likewise.
+       (read_decimal): Likewise.
+       (read_radix): Likewise.
+       (read_f): Likewise.
+       * io/transfer.c (read_sf): Use fbuf_read and mem_alloc_r, remove
+       usage of u.p.line_buffer.
+       (read_block_form): Update interface to return pointer, use
+       fbuf_read for direct access.
+       (read_block_direct): Update to new stream interface.
+       (write_block): Use mem_alloc_w for internal I/O.
+       (write_buf): Update to new stream interface.
+       (formatted_transfer_scalar): Don't use u.p.line_buffer, use
+       fbuf_seek for external files.
+       (us_read): Update to new stream interface.
+       (us_write): Likewise.
+       (data_transfer_init): Always check if we switch modes and flush.
+       (skip_record): Use new stream interface, fix comparison.
+       (next_record_r): Check for and reset u.p.at_eof, use new stream
+       interface, use fbuf_getc for spacing.
+       (write_us_marker): Update to new stream interface, don't inline.
+       (next_record_w_unf): Likewise.
+       (sset): New function.
+       (next_record_w): Use new stream interface, use fbuf for printing
+       newline.
+       (next_record): Use new stream interface.
+       (finalize_transfer): Remove sfree call, use new stream interface.
+       (st_iolength_done): Don't use u.p.scratch.
+       (st_read): Don't check for end of file.
+       (st_read_done): Don't use u.p.scratch, use unit_truncate.
+       (hit_eof): New function.
+       * io/unit.c (init_units): Always init fbuf for formatted units.
+       (update_position): Use new stream interface.
+       (unit_truncate): New function.
+       (finish_last_advance_record): Use fbuf to print newline.
+       * io/unix.c: Remove unused SSIZE_MAX macro.
+       (BUFFER_SIZE): Make static const variable rather than macro.
+       (struct unix_stream): Remove dirty_offset, len, method,
+       small_buffer. Order elements by decreasing size.
+       (struct int_stream): Remove.
+       (move_pos_offset): Remove usage of dirty_offset.
+       (reset_stream): Remove.
+       (do_read): Rename to raw_read, update to match new stream
+       interface.
+       (do_write): Rename to raw_write, update to new stream interface.
+       (raw_seek): New function.
+       (raw_tell): New function.
+       (raw_truncate): New function.
+       (raw_close): New function.
+       (raw_flush): New function.
+       (raw_init): New function.
+       (fd_alloc): Remove.
+       (fd_alloc_r_at): Remove.
+       (fd_alloc_w_at): Remove.
+       (fd_sfree): Remove.
+       (fd_seek): Remove.
+       (fd_truncate): Remove.
+       (fd_sset): Remove.
+       (fd_read): Remove.
+       (fd_write): Remove.
+       (fd_close): Remove.
+       (fd_open): Remove.
+       (fd_flush): Rename to buf_flush, update to new stream interface
+       and unix_stream.
+       (buf_read): New function.
+       (buf_write): New function.
+       (buf_seek): New function.
+       (buf_tell): New function.
+       (buf_truncate): New function.
+       (buf_close): New function.
+       (buf_init): New function.
+       (mem_alloc_r_at): Rename to mem_alloc_r, change prototype.
+       (mem_alloc_w_at): Rename to mem_alloc_w, change prototype.
+       (mem_read): Change to match new stream interface.
+       (mem_write): Likewise.
+       (mem_seek): Likewise.
+       (mem_tell): Likewise.
+       (mem_truncate): Likewise.
+       (mem_close): Likewise.
+       (mem_flush): New function.
+       (mem_sfree): Remove.
+       (empty_internal_buffer): Cast to correct type.
+       (open_internal): Use correct type, init function pointers.
+       (fd_to_stream): Test whether to open file as buffered or raw.
+       (output_stream): Remove mode set.
+       (error_stream): Likewise.
+       (flush_all_units_1): Use new stream interface.
+       (flush_all_units): Likewise.
+       (stream_at_bof): Remove.
+       (stream_at_eof): Remove.
+       (file_position): Remove.
+       (file_length): Update logic to use stream interface.
+       (flush): Remove.
+       (stream_offset): Remove.
+       * io/write.c (write_utf8_char4): Use int instead of size_t.
+       (write_x): Extra safety check.
+       (namelist_write_newline): Use new stream interface.
+
+2009-03-29  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR fortran/33595
+       * intrinsics/c99_functions.c (round): Use floor instead of ceil.
+       Revise checks to round up.
+       (roundf): Likewise.
+
+2009-03-28  Daniel Kraft  <d@domob.eu>
+
+       * intrinsics/string_intrinsics.c: #include <assert.h>
+       * intrinsics/string_intrinsics_inc.c (string_trim): Use string_len_trim
+       instead of calculating the length directly.
+       (string_len_trim): For KIND=1, speed search up.
+
+2009-03-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/39528
+       * io/list_read.c (list_formatted_read_scalar): Move check for read
+       completion to just after the check for a repeated value.
+
+2009-03-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/39402
+       * io/write_float.def (output_float): Handle F0.d formatting correctly
+       for any d when value is 0.0.
+
+2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure: Regenerate.
+
+2009-01-21  Daniel Kraft  <d@domob.eu>
+
+       PR fortran/38887
+       * runtime/in_unpack_generic.c (internal_unpack):  Return instead of
+       abort when called with empty array.
+       * m4/in_unpack.m4:  Ditto.
+       * generated/in_unpack_i1.c:  Regenerated.
+       * generated/in_unpack_i2.c:  Regenerated.
+       * generated/in_unpack_i4.c:  Regenerated.
+       * generated/in_unpack_i8.c:  Regenerated.
+       * generated/in_unpack_i16.c: Regenerated.
+       * generated/in_unpack_r4.c:  Regenerated.
+       * generated/in_unpack_r8.c:  Regenerated.
+       * generated/in_unpack_r10.c: Regenerated.
+       * generated/in_unpack_r16.c: Regenerated.
+       * generated/in_unpack_c4.c:  Regenerated.
+       * generated/in_unpack_c8.c:  Regenerated.
+       * generated/in_unpack_c10.c: Regenerated.
+       * generated/in_unpack_c16.c: Regenerated.
+
+2009-01-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/38772
+       * io/read.c (read_f): Clean up loop conditions for BZ/BN,
+       allowing proper digit testing. White space fix.
+
+2009-01-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/38735
+       * io/unit.c (get_internal_unit): Set default BLANK= status to NULL for
+       internal units.
+
+\f
+Copyright (C) 2009 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2010 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2010
new file mode 100644 (file)
index 0000000..4b8b486
--- /dev/null
@@ -0,0 +1,1013 @@
+2010-12-10  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/46540
+       * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Honour
+       --disable-libquadmath-support.
+       * configure.ac: Handle --disable-libquadmath-support.
+       * configure: Regenerate.
+
+2010-12-06  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       PR target/40125
+       PR lto/46695
+       * configure.ac: Invoke ACX_LT_HOST_FLAGS.
+       * Makefile.am (LTLDFLAGS): Use lt_host_flags.
+       * aclocal.m4: Regenerate.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+
+2010-11-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+           Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/32049
+       * Makefile.am: Add missing pow_r16_i4.c, add transfer128.c,
+       link libquadmath, if used.
+       * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Add.
+       * configure.ac: Use it, touch spec file.
+       * gfortran.map: Add pow_r16_i4 and
+       transfer_(real,complex)128(,write) functions.
+       * intrinsics/cshift0.c (cshift0): Handle __float128 type.
+       * intrinsics/erfc_scaled_inc.c: Ditto.
+       * intrinsics/pack_generic.c (pack): Ditto
+       * intrinsics/spread_generic.c (spread): Ditto.
+       * intrinsics/unpack_generic.c (unpack1): Ditto.
+       * io/read.c (convert_real): Ditto.
+       * io/transfer.c: Update comments.
+       * io/transfer128.c: New file.
+       * io/write_float.def (write_float): Handle __float128 type.
+       * libgfortran.h: #include quadmath_weak.h, define __builtin_infq
+       and nanq.
+       * m4/mtype.m4: Handle __float128 type.
+       * runtime/in_pack_generic.c (internal_pack): Ditto.
+       * runtime/in_unpack_generic.c (internal_unpack): Ditto.
+       * kinds-override.h: New file.
+       * libgfortran.spec.in: Ditto.
+       * generated/pow_r16_i4.c: Generated.
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+       * config.h: Regenerate.
+       * bessel_r10.c: Regenerate.
+       * bessel_r16.c: Regenerate.
+       * bessel_r4.c: Regenerate.
+       * bessel_r8.c: Regenerate.
+       * exponent_r16.c: Regenerate.
+       * fraction_r16.c: Regenerate.
+       * nearest_r16.c: Regenerate.
+       * norm2_r10.c: Regenerate.
+       * norm2_r16.c: Regenerate.
+       * norm2_r4.c: Regenerate.
+       * norm2_r8.c: Regenerate.
+       * rrspacing_r16.c: Regenerate.
+       * set_exponent_r16.c: Regenerate.
+       * spacing_r16.c: Regenerate.
+
+2010-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.c (struct unix_stream): Add st_dev and st_ino members.
+       (fd_to_stream): Avoid unnecessary lseek() call, test isatty()
+       last. Make a token effort to support block devices.
+       (compare_file_filename): Use cached stat values.
+       (find_file0): Likewise.
+       (find_file): Likewise.
+
+2010-11-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/46373
+       * io/transfer.c (data_transfer_init): Do not call flush_if_preconnected
+       if this is an internal unit.
+
+2010-11-04  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/44931
+       * io/inquire.c (inquire_via_unit): Use stream_ttyname() instead of
+       calling ttyname() directly.
+       * io/unix.h (unix_stream): Move struct to unix.c.
+       * io/unix.c: Move struct unix_stream here.
+       (stream_ttyname): Don't mark the argument as unused if it is used.
+
+2010-11-04  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.h (struct unix_stream): Remove prot member.
+       * io/unix.c: Remove PROT_READ and PROT_WRITE constants.
+       (fd_to_stream): Remove prot from argument list, don't set prot.
+       (open_external): Don't set prot flag.
+       (input_stream): Remove prot from argument list.
+       (output_stream): Likewise.
+       (error_stream): Likewise.
+
+2010-11-03  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.h: Remove empty_internal_buffer prototype.
+       * io/unix.c (empty_internal_buffer): Remove unused function.
+
+2010-11-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/43899
+       * runtime/error.c (generate_warning): New function to generate a run
+       time warning message. Fix some whitespace.
+       * libgfortran.h: Add prototype for new function.
+       * io/list_read.c (nml_read_obj): Use new function to warn when a
+       character namelist object is truncated.  Only warn if compiled
+       with -fbounds-check.
+
+2010-11-02  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/45629
+       * io/io.h: Remove setjmp.h include.
+       (st_parameter_dt): Change last_char to int, remove eof_jump.
+       * io/list_read.c (next_char): Return EOF instead of jumping.
+       (unget_char): Use int to be able to handle EOF.
+       (eat_spaces): Handle EOF return from next_char.
+       (eat_line): Likewise.
+       (eat_separator): Handle EOF return from next_char, eat_spaces,
+       eat_line.
+       (finish_separator): Likewise.
+       (convert_integer): Likewise.
+       (read_logical): Likewise.
+       (read_integer): Likewise.
+       (read_character): Likewise.
+       (parse_real): Likewise.
+       (read_complex): Likewise.
+       (read_real): Likewise.
+       (list_formatted_read_scalar): Likewise.
+       (list_formatted_read): Likewise.
+       (finish_list_read): Likewise.
+       (nml_parse_qualifier): Likewise.
+       (nml_match_name): Likewise.
+       (nml_get_obj_data): Likewise.
+       (namelist_read): Likewise.
+       * io/transfer.c (data_transfer_init): Initialize last_char.
+       (finalize_transfer): Remove jmp_buf setup.
+
+2010-10-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/46010
+       * io/list_read.c (nml_parse_qualifier): Add additional conditions for
+       setting the end index for loop specification. Fix some whitespace.
+       * io/write.c (write_default_char4): Const-ify the source argument.
+
+2010-10-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/46007
+       * m4/shape.m4 (shape_'rtype_kind`):  Use variable for rank.
+       Allocate return array if unallocated.
+       * generated/shape_i4.c:  Regenerated.
+       * generated/shape_i8.c:  Regenerated.
+       * generated/shape_i16.c:  Regenerated.
+
+2010-10-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/46079
+       * runtime/stop.c (stop_numeric_f08): New function.
+       (stop_numeric): Restore to previous behavior.
+       * gfortran.map: Add symbol _gfortran_stop_numeric_f08.
+
+2010-10-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/io.h: Remove definition of the BT enumerator.
+       * libgfortran.h: Replace GFC_DTYPE enumerator with BT.
+       * intrinsics/iso_c_generated_procs.c: Likewise
+       * intrinsics/date_and_time.c: Likewise.
+       * intrinsics/iso_c_binding.c: Likewise.
+       * io/list_read.c: Likewise.
+       * io/transfer.c: Likewise.
+       * io/write.c: Likewise.
+
+2010-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/20165
+       PR fortran/31593
+       PR fortran/43665
+       * gfortran.map:  Add _gfortran_transfer_array_write,
+       _gfortran_transfer_array_write, _gfortran_transfer_character_write,
+       _gfortran_transfer_character_wide_write,
+       _gfortran_transfer_complex_write,
+       _gfortran_transfer_integer_write,
+       _gfortran_transfer_logical_write and
+       _gfortran_transfer_real_write.
+       * io/transfer.c (transfer_integer_write):  Add prototype and
+       function body as call to the original function, without the
+       _write.
+       (transfer_real_write):  Likewise.
+       (transfer_logical_write):  Likewise.
+       (transfer_character_write):  Likewise.
+       (transfer_character_wide_write):  Likewise.
+       (transfer_complex_write):  Likewise.
+       (transfer_array_write):  Likewise.
+
+2010-09-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/45710
+       * io/write.c (namelist_write_newline): Pad character array internal
+       unit records with spaces.
+
+2010-09-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/45723
+       * io/open.c (new_unit): On POSITION_APPEND don't seek if file length is
+       zero.
+
+2010-09-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/45532
+       * io/list_read.c (nml_get_obj_data): Set first_nl if the previous
+       is NULL.
+
+2010-09-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * intrinsics/pack_generic.c (pack): Add missing return and fix
+       whitespace.
+       * intrinsics/cshift0.c (cshift0): Fix whitespace.
+       * intrinsics/unpack_generic.c (unpack1, unpack0): Fix whitespace.
+
+2010-09-10  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * runtime/string.c (compare0): Remove.
+       (find_option): Inline string comparison
+
+2010-09-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE,
+       LIBGFOR_CHECK_FOR_BROKEN_ISNAN,
+       LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY): Remove.
+       * configure.ac: Remove above checks.
+       * libgfortran.h: Define isnan, isinf, isfinite, isnormal and
+       signbit in terms of the respective built-ins.
+       * io/write_float.def (WRITE_FLOAT): Use signbit() instead of
+       __builtin_signbit().
+       * intrinsics/c99_functions.c (tgamma): Use isnan() instead of
+       __builtin_isnan().
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2010-09-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/38282
+       * gfortran.map: Add new iany, iall and iparity intrinsics.
+       * Makefile.am: Ditto.
+       * m4/iany.m4: New.
+       * m4/iall.m4: New.
+       * m4/iparity.m4: New.
+       * Makefile.in: Regenerate.
+       * generated/iall_i1.c: Generate.
+       * generated/iall_i2.c: Generate.
+       * generated/iall_i4.c: Generate.
+       * generated/iall_i8.c: Generate.
+       * generated/iall_i16.c: Generate.
+       * generated/iany_i1.c: Generate.
+       * generated/iany_i2.c: Generate.
+       * generated/iany_i4.c: Generate.
+       * generated/iany_i8.c: Generate.
+       * generated/iany_i16.c: Generate.
+       * generated/iparity_i1.c: Generate.
+       * generated/iparity_i2.c: Generate.
+       * generated/iparity_i4.c: Generate.
+       * generated/iparity_i8.c: Generate.
+       * generated/iparity_i16.c: Generate.
+
+2010-09-05  Tobias Burnus  <burnus@net-b.de>
+
+       * m4/bessel.m4: Fix printf warning by casting to (long int).
+       * generated/bessel_r4.c:Regenerated.
+       * generated/bessel_r8.c: Regenerated.
+       * generated/bessel_r10.c: Regenerated.
+       * generated/bessel_r16.c: Regenerated.
+
+2010-09-01  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * intrinsics/execute_command_line.c: New file.
+       * gfortran.map (_gfortran_execute_command_line_i4,
+       _gfortran_execute_command_line_i8): New symbols.
+       * Makefile.am: Add new file intrinsics/execute_command_line.c.
+       * Makefile.in: Regenerated.
+
+2010-08-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * m4/mtype.m4 (upcase, hasmathfunc, mathfunc_macro): New macros.
+       * m4/fraction.m4: Use new macros to support quad-float types.
+       * m4/set_exponent.m4: Likewise.
+       * m4/spacing.m4: Likewise.
+       * m4/exponent.m4: Likewise.
+       * m4/nearest.m4: Likewise.
+       * m4/norm2.m4: Likewise.
+       * m4/bessel.m4: Likewise.
+       * m4/rrspacing.m4: Likewise.
+       * generated/bessel_r4.c:Regenerated.
+       * generated/bessel_r8.c: Regenerated.
+       * generated/bessel_r10.c: Regenerated.
+       * generated/bessel_r16.c: Regenerated.
+       * generated/exponent_r4.c: Regenerated.
+       * generated/exponent_r8.c: Regenerated.
+       * generated/exponent_r10.c: Regenerated.
+       * generated/exponent_r16.c: Regenerated.
+       * generated/fraction_r4.c: Regenerated.
+       * generated/fraction_r8.c: Regenerated.
+       * generated/fraction_r10.c: Regenerated.
+       * generated/fraction_r16.c: Regenerated.
+       * generated/nearest_r4.c: Regenerated.
+       * generated/nearest_r8.c: Regenerated.
+       * generated/nearest_r10.c: Regenerated.
+       * generated/nearest_r16.c: Regenerated.
+       * generated/norm2_r4.c: Regenerated.
+       * generated/norm2_r8.c: Regenerated.
+       * generated/norm2_r10.c: Regenerated.
+       * generated/norm2_r16.c: Regenerated.
+       * generated/rrspacing_r4.c: Regenerated.
+       * generated/rrspacing_r8.c: Regenerated.
+       * generated/rrspacing_r10.c: Regenerated.
+       * generated/rrspacing_r16.c: Regenerated.
+       * generated/set_exponent_r4.c: Regenerated.
+       * generated/set_exponent_r8.c: Regenerated.
+       * generated/set_exponent_r10.c: Regenerated.
+       * generated/set_exponent_r16.c: Regenerated.
+       * generated/spacing_r4.c: Regenerated.
+       * generated/spacing_r8.c: Regenerated.
+       * generated/spacing_r10.c: Regenerated.
+       * generated/spacing_r16.c: Regenerated.
+
+2010-08-28  Tobias Burnus  <burnus@net-b.de>
+
+       * mk-kinds-h.sh: Disable REAL(16) if REAL(10) is available.
+
+2010-08-27  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/33197
+       * libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
+       ARRAY_FUNCTION): Allow expression after loop.
+       * libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
+       * libgfortran/m4/parity.m4: New for _gfortran_parity_l{1,2,4,8,16}.
+       * libgfortran/gfortran.map: Add new functions.
+       * libgfortran/Makefile.am: Ditto.
+       * libgfortran/m4/minloc1.m4: Add empty argument for ARRAY_FUNCTION.
+       * libgfortran/m4/maxloc1.m4: Ditto.
+       * libgfortran/m4/all.m4: Ditto.
+       * libgfortran/m4/minval.m4: Ditto.
+       * libgfortran/m4/maxval.m4: Ditto.
+       * libgfortran/m4/count.m4: Ditto.
+       * libgfortran/m4/product.m4: Ditto.
+       * libgfortran/m4/any.m4: Ditto.
+       * Makefile.in: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/norm2_r4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/parity_l2.c: Regenerated.
+       * generated/any_l16.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/any_l2.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/parity_l16.c: Regenerated.
+       * generated/all_l1.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/all_l2.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/all_l16.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/parity_l4.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/count_4_l.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/count_8_l.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/norm2_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/norm2_r8.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/count_1_l.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+       * generated/norm2_r10.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/count_16_l.c: Regenerated.
+       * generated/parity_l8.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/count_2_l.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/parity_l1.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/any_l1.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+
+2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * config/fpu-387.h (has_sse): Remove cw_sse, unused.
+       Use fixed-length asm.
+
+2010-08-23  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/45323
+       * io/write.c (nml_write_obj, namelist_write): Cast argument
+       of toupper to int.
+
+2010-08-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure: Regenerate.
+
+2010-08-19  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/36158
+       PR fortran/33197
+       * m4/bessel.m4: Implement bessel_jn and bessel_yn.
+       * gfortran.map: Add the generated bessel_jn_r{4,8,10,16}
+       and bessel_yn_r{4,8,10,16}.
+       * Makefile.am: Add bessel.m4.
+       * Makefile.in: Regenerated.
+       * generated/bessel_r4.c: Generated.
+       * generated/bessel_r16.c: Generated.
+       * generated/bessel_r8.c: Generated.
+       * generated/bessel_r10.c: Generated.
+
+2010-08-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/45108
+       * io/list_read.c (namelist_read): If namelist reading fails, use
+       generate_error and then continue the read loop.
+
+2010-08-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/45308
+       * intrinsics/date_and_time.c (date_and_time): Pass __{zone,time,date}_len
+       instead of {ZONE,TIME,DATE}_LEN as second argument to fstrcpy.  Drop
+       asserts.  Adjust comment to the F2003 wording from the F95 wording.
+
+2010-08-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/44931
+       * io/inquire.c (inquire_via_unit): Add special case for __MINGW32__ to
+       return special file names CONIN$, CONOUT$, and CONERR$.
+
+2010-08-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/45143
+       * io/format.c: Remove fnode storage structure definitions, moving these
+       to format.h. (parse_format_list): Add check for data descriptors,
+       taking care of nested formats. Adjust calling parameters to pass a
+       check flag. (parse_format): Likewise.
+       * io/format.h: Add structures moved from format.c.
+       
+2010-08-02  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unit.c (update_position): Don't update the position flag for
+       non-seekable files, check for stell() error.
+
+2010-08-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.c (file_exists): Use access(2) instead of stat(2) to
+       test file existence.
+       (fallback_access): Move up in file, implement F_OK.
+
+2010-07-31  David Edelsohn  <edelsohn@gnu.org>
+
+       * io/inquire.c: Include io.h before string.h.
+
+2010-07-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/44931
+       * io/inquire.c (inquire_via_unit): Use ttyname to return actual device
+       file name for stdin, stdout, and stderr.  If ttyname does not succeed
+       fall back to default names for these units. Include string.h to allow
+       using strlen function.
+       * unix.c: Remove typedef of unix_stream structure, move to unix.h.
+       * unix.h: Add typedef of unix_stream structure so that it is
+       accessible to inquire.c.
+
+2010-07-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/44953
+       * io/unix.c (mem_alloc_w4): Return gfc_char4_t instead of char type
+       pointer. (mem_write4): Remove cast to gfc_char4_t.
+       * io/transfer.c (write_block): Use a gfc_char4_t pointer.
+       (memset4): New helper function. (next_record_w): Use new helper
+       function rather than sset for internal units.  Don't attempt to pad
+       with spaces if it is not needed.
+       * io/unix.h: Update prototype for mem_alloc_w4.
+       * io/write.c (memset4): Use gfc_char4_t pointer and chracter type.
+       Don't use multiply by 4 to compute offset. (memcpy4): Likewise.
+       (write_default_char4): Use a gfc_char4_t pointer and update memset4
+       and memcpy calls. (write_a): Likewise. (write_l): Likewise.
+       (write_boz): Likewise. (write_decimal): Likewise. (write_x): Likewise.
+       (write_char): Add support for character(kind=4) internal units that
+       was previously missed. (write_integer): Use a gfc_char4_t pointer and
+       update memset4 and memcpy calls. (write_character): Likewise.
+       (write_separator): Add support for character(kind=4) internal units
+       that was previously missed.
+       * write_float.def (output_float): Use a gfc_char4_t pointer and
+       update memset4 and memcpy calls. (write_infnan): Likewise.
+       (output_float_FMT_G_): Likewise.
+
+2010-07-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37077
+       * io/read.c (read_default_char4): Add support for reading into a
+       kind-4 character variable from a character(kind=4) internal unit.
+       * io/io.h (read_block_form4): Add prototype.
+       * io/unit.c (get_internal_unit): Add call to fbuf_init.
+       (free_internal_unit): Add call to fbuf_destroy. (get_unit): Fix
+       whitespace.
+       * io/transfer.c (read_sf_internal): Use fbuf_alloc to allocate a string
+       to recieve the wide characters translated to single byte chracters.
+       (read_block_form): Fix whitespace. (read_block_form4): New function to
+       read from a character(kind=4) internal unit into a character(kind=4)
+       variable. (read_block_direct): Fix whitespace. (write_block): Fix
+       whitespace. (formatted_transfer_scalar_read): Likewise.
+       (formatted_transfer_scalar_write): Likewise.
+       * io/write.c (write_character): Add support for list directed write of
+       a kind=1 character string to a character(kind=4) internal unit.
+
+2010-07-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/44934
+       * io/file_pos.c (st_endfile): Correctly set unit flags for form.
+       * io/transfer.c (data_transfer_init): Fix indentation of whitespace.
+
+2010-07-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37077
+       * io/read.c: Fix comment.
+       * io/io.h (is_char4_unit): New macro.
+       * io/unit.c (get_internal_unit): Call new function open_internal4.
+       * io/unix.c (mem_alloc_r4): New function. (mem_alloc_w4): New function.
+       (mem_read4): New function, temporary stub. (mem_write4): New function.
+       (open_internal4): New function to set stream pointers to use the new
+       mem functions.
+       * io/transfer.c (write_block): Use new mem_alloc_w4 to access internal
+       units of kind=4.
+       * io/unix.h: Add prototypes for open_internal4, mem_alloc_w4, and
+       mem_alloc_r4.
+       * io/write.c (memset4): New helper function. (memcpy4): New helper
+       function. (write_default_char4): Use new helper functions.
+       (write_a): Likewise. (write_l): Likewise. (write_boz): Likewise.
+       (write_decimal): Likewise. (write_x): Likewise.
+       (write_integer): Likewise.
+       * io/write_float.def (output_float): Add code blocks to handle internal
+       unit kind=4 output utilizing gfc_char4_t pointers. (write_infnan): Use
+       new helper functions. (OUTPUT_FLOAT_FMT_G): Update this macro likewise.
+
+2010-07-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * config/fpu-387.h [__sun__ && __svr4__] Include <signal.h>,
+       <ucontext.h>.
+       (sigill_caught): New.
+       (sigill_hdlr): New function
+       (has_sse) [__sun__ && __svr4__]: Check if SSE instruction causes
+       SIGILL.
+
+2010-07-11  Kai Tietz  <kai.tietz@onevision.com>
+
+       PR libfortran/44698
+       * io/unix.c (flush_buf): Add _commit for WIN32.
+
+2010-06-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/43298
+       * list_read.c (parse_real): Do not pass (..) on for NAN(..).
+       * read.c (convert_real): Fix comment about NAN/INF.
+
+2010-07-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure.ac (gfortran_use_symver): Only check for Sun-style symbol
+       versioning on Solaris 2.
+       * configure: Regenerate.
+
+2010-07-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure.ac: Check for Sun symbol versioning.
+       * configure: Regenerate.
+
+       * Makefile.am [LIBGFOR_USE_SYMVER]: Protect version_arg with
+       LIBGFOR_USE_SYMVER_GNU.
+       Add version_dep.
+       [LIBGFOR_USE_SYMVER_SUN]: Handle Sun symbol versioning.
+       [!LIBGFOR_USE_SYMVER]: Add version_dep.
+       (libgfortran_la_DEPENDENCIES): Set to $(version_dep).
+       * Makefile.in: Regenerate.
+
+2010-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/43298
+       * io/read.c: Add code to parse and read Inf, Infinity, NaN, and Nan with
+       optional parenthesis.
+
+2010-06-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/43298
+       * list_read.c (parse_real, read_real): Support NAN(alphanum).
+
+2010-06-25  Tobias Burnus  <burnus@net-b.de>
+
+       * intrinsics/selected_real_kind.f90
+       (_gfortran_selected_real_kind2008): Add function.
+       (_gfortran_selected_real_kind): Stub which calls
+       _gfortran_selected_real_kind2008.
+       * gfortran.map (GFORTRAN_1.4): Add
+       _gfortran_selected_real_kind2008.
+       * mk-srk-inc.sh: Save also RADIX.
+
+2010-06-25  Tobias Burnus  <burnus@net-b.de>
+
+       * runtime/compile_options.c (init_compile_options): Update
+       compile_options.allow_std for GFC_STD_F2008_OBS.
+       * io/transfer.c (formatted_transfer_scalar_read,
+       formatted_transfer_scalar_write): Fix allow_std check.
+       * io/list_read.c (nml_parse_qualifier): Ditto.
+
+2010-06-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/44477
+       * io/file_pos.c (st_endfile): Add check for ENDFILE when file is
+       already positioned after the EOF marker. Use find_or_create_unit
+       instead of find_unit. If unit is not connected, connect it and create 
+       the file with default settings.
+       * io/transfer.c (data_transfer_init):  Add check for attempted READ or
+       WRITE when file is already positioned after the EOF marker.
+
+2010-06-10  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * intrinsics/selected_char_kind.c (selected_char_kind): Fix
+       return value for ISO_10646.
+
+2010-06-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * mk-kinds-h.sh: Define GFC_REAL_*_LITERAL_SUFFIX and
+       GFC_REAL_*_LITERAL macros for each kind.
+       * intrinsics/cpu_time.c (cpu_time_4, cpu_time_8, cpu_time_10,
+       cpu_time_16): Use them.
+       * intrinsics/random.c (rnumber_4, rnumber_8, rnumber_10,
+       rnumber_16): Likewise.
+
+2010-06-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * intrinsics/system_clock.c (system_clock_4, system_clock_8):
+       Undefine TCK.
+
+2010-06-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34670
+       * intrinsics/date_and_time.c:  Replace assert with runtime_error
+       when VALUE is too small.
+
+2010-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+       PR fortran/43851
+       * runtime/stop.c (stop_string): Make sure nothing is emitted for
+       blank stop.
+
+2010-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+       PR fortran/43851
+       * runtime/stop.c (error_stop_numeric): New function and updated comment.
+       Add declaration for stop_numeric and remove declaration for stop_string.
+       (stop_string): Use for blank STOP.
+       (stop_numeric): Remove use of special -1 stop code.
+       * runtime/pause.c (do_pause): Use stop_string for blank stop.
+       (pause_numeric): Remove use of special -1 pause code.
+       * gfortran.map: Add new symbol to run-time library.
+       * libgfortran.h: Move declaration for stop_string to here to make
+       function visible for do_pause. Remove declaration for stop_numeric.
+
+2010-05-08  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.h (mem_alloc_r): Fix typo to reduce visibility.
+
+2010-05-07  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * libgfortran.h (free_mem): Remove prototype.
+       * runtime/memory.c (free_mem): Remove function.
+       * intrinsics/date_and_time.c (secnds): Replace free_mem() with
+       free().
+       * io/fbuf.c (fbuf_destroy): Likewise.
+       * io/format.c (free_format_hash_table): Likewise.
+       (save_parsed_format): Likewise.
+       (free_format_data): Likewise.
+       * io/list_read.c (free_saved): Likewise.
+       (free_line): Likewise.
+       (nml_touch_nodes): Likewise.
+       (nml_read_obj): Likewise
+       * io/lock.c (free_ionml): Likewise.
+       * io/open.c (new_unit): Likewise.
+       (already_open): Likewise.
+       * io/unit.c (destroy_unit_mutex): Likewise.
+       (free_internal_unit): Likewise.
+       (close_unit_1): Likewise.
+       * io/unix.c (raw_close): Likewise.
+       (buf_close): Likewise.
+       (mem_close): Likewise.
+       (tempfile): Likewise.
+       * io/write.c (nml_write_obj): Likewise.
+       * io/write_float.def (output_float_FMT_G_##): Likewise.
+       * runtime/error.c (show_locus): Likewise.
+
+2010-05-04  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       PR other/43620
+       * configure.ac (AM_INIT_AUTOMAKE): Add no-dist.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+
+2010-04-30  Kai Tietz  <kai.tietz@onevision.com>
+
+       PR/43844
+       * io/unix.c (raw_truncate): Explicit cast from integer-scalar
+       to pointer.
+       (tempfile): Use for mingw GetTempPath and avoid double slash
+       for path.
+
+2010-04-24  Kai Tietz  <kai.tietz@onevision.com>
+
+       PR/43844
+       * io/unix.c (tempfile): Correct logic for mktemp case.
+
+2010-04-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/39997
+       * runtime/stop.c (error_stop_string): New function.
+       * gfortran.map (_gfortran_error_stop_string): Add.
+
+2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+
+2010-04-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/43605
+       * io/intrinsics.c (gf_ftell): New function, seek to correct offset.
+       (ftell): Call gf_ftell.
+       (FTELL_SUB): Likewise.
+
+2010-04-01  Paul Thomas  <pault@gcc.gnu.org>
+
+       * io/transfer.c : Update copyright.
+       * io/unix.c : ditto
+       * io/read.c : ditto
+       * io/io.h : ditto
+       * io/unix.h : ditto
+       * io/inquire.c : ditto
+       * io/format.c : ditto
+       * io/list_read.c : ditto
+       * runtime/error.c : ditto
+       * libgfortran.h : ditto
+       * intrinsics/date_and_time.c: ditto
+       * intrinsics/args.c : ditto
+
+2010-04-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/43605
+       * io/intrinsics.c (ftell): Reset fbuf, correct offset.
+       (FTELL_SUB): Likewise.
+
+2010-03-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/43265
+       * io/transfer.c (next_record_r): Only call hit_eof for specific
+       conditions when an EOF is encountered.
+
+2010-03-29  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/43551
+       * io/unix.c (buf_write): Set physical_offset after lseek.
+
+2010-03-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/43517
+       * io/read.c (read_x): Return if seen EOR condition.
+
+2010-03-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/43409
+       * io/io.h: Fix type of size in st_parameter_inquire structure.
+
+2010-03-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/43409
+       * io/unix.h: Add prototype for new function to return file size.
+       * io/unix.c (file_size): New function.
+       * io/inquire.c (inquire_via_unit): Use new function.
+       (inquire_via_filename): Use new function.
+
+2010-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/transfer.c (read_sf_internal): Remove stray function declaration
+       used during debugging.
+
+2010-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/43265
+       * io/io.h: Delete prototype for read_sf, making it static.
+       * io/read.c (read_x): Modify to call hit_eof if PAD="no".
+       * io/transfer.c (read_sf_internal): New static function extracted from
+       read_sf for use on internal units only. Handle empty string case.
+       (read_sf): New factoring of this function, make it static.  Add special
+       conditions for EOF based on ADVANCE="no", PAD="no", and whether any
+       bytes have been previously read from the record.
+       (read_block_form): Modify to call read_sf or read_sf_internal.
+       (next_record_r): Add a done flag similar to next_record_w. Call hit_eof
+       if internal array unit next record returns finished, meaning an EOF was
+       found and not done, ie not the last record expected.  For external
+       units call hit_eof if item_count is 1 or there are no pending spaces.
+       (next_record): Update call to next_record_r.
+
+2010-03-12  Kai Tietz  <kai.tietz@onevision.com>
+
+       PR/42950
+       * io/format.c (parse_format_list): Add to ERROR, WARNING,
+       SILENT enumerators NOTIFICATION_ prefix.
+       * runtime/error.c (notification_std): Likewise.
+       * libgfortran.h (notification): Likewise.
+       (GFC_LARGEST_BUF): Check for HAVE_GFC_INTEGER_16.
+
+2010-03-11  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/43228
+       * io/list_read.c (nml_parse_qualifier): Disable expanded_read
+       for array sections.
+
+2010-03-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/43320
+       * io/transfer.c (next_record_r): Add hit_eof based on item_count
+       condition.
+
+2010-03-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/43265
+       * io/read.c: Include fbuf.h and unix.h to enable lower level I/O for
+       read_x. (read_x): Replace the use of read_sf with equivalent lower level
+       I/O, eliminating unneeded code and handling EOF and EOR conditions.
+       * io/io.h: Revise prototype for read_sf.
+       * io/transfer.c (read_sf): Delete no_error parameter and all uses of it.
+       (read_block_form): Likewise.
+       (next_record_r): Delete wrong code call to hit_eof.
+
+2010-03-08  Kai TIetz  <kai.tietz@onevision.com>
+
+       PR/42950
+       * libgfortran.h (_POSIX): Define if __MINGW32__ is defined.
+       (gfc_printf): Define to gnu_printf for __MINGW32__ case,
+       otherwise to __printf__.
+       (gfc_strtof,gfc_strtod,gfc_strtold): Define for mingw case
+       to POSIX compatible converter functions.
+       (runtime_error): Use instead gfc_printf as formatter
+       attribute name.
+       (runtime_error_at): Likewise.
+       (runtime_warning_at): Likewise.
+       (st_printf): Likewise.
+       * intrinsics/date_and_time.c (localtime_r): Undefine
+       possible defined macro.
+       (gmtime_r): Likewise.
+       * io/read.c (convert_real): Use gfc_strtof, gfc_strtod,
+       and gfc_strtold.
+
+2010-02-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/43155
+       * io/transfer.c (require_type): Subtract one from item_count for output
+       of error message.  Add comment before formatted_transfer function
+       explaining why the item_count is off by one.
+
+2010-02-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * io/write_float.def (WRITE_FLOAT): Use __builtin_signbit.
+
+2010-02-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/list_read.c (list_formatted_read_scalar): Remove duplicate code.
+
+2010-02-09  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/42996
+       * intrinsics/args.c (get_command_argument_i4): Always return
+       commandline-argument length for length parameter.
+
+2010-02-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/42742
+       * io/format.c (reset_fnode_counters): Use the correct pointer to the
+       head of the fnode list. (parse_format): Remove previous hack that set
+       limit on size of format string for caching.
+
+2010-02-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran
+       * io/transfer.c (read_sf): Handle EOR and EOF conditions for
+       ADVANCE="no" with PAD="yes" or PAD="no".
+
+2010-02-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/42901
+       * io/list_read.c (nml_get_obj_data): Add new qualifier flag, clean up
+       code, and adjust logic to set namelist info pointer correctly for array
+       qualifiers of derived type components.
+
+2010-01-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/42742
+       * io/format.c (parse_format): Set limit on size of format strings that
+       will be cached.
+
+2010-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure: Regenerate.
+
+2010-01-03  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/42420
+       * io/unix.c: Defines for MINGW stat and fstat.
+       (gfstat_t): New typedef.
+       (id_from_fd): Use gfstat_t instead of struct stat.
+       (fd_to_stream): Likewise.
+       (compare_file_filename): Likewise.
+       (find_file): Likewise.
+       (file_exists): Likewise.
+       (inquire_sequential): Likewise.
+       (inquire_direct): Likewise.
+       (inquire_formatted): Likewise.
+
+\f
+Copyright (C) 2010 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/ChangeLog-2011 b/l4/pkg/libgfortran/lib/contrib/ChangeLog-2011
new file mode 100644 (file)
index 0000000..f516bad
--- /dev/null
@@ -0,0 +1,1485 @@
+2011-12-22  Janne Blomqvist  <jb@gcc.gnu.org>
+       Tobias Burnus  <burnus@net-b.de>
+
+       PR libfortran/51646
+       * acinclude.m4 (LIBGFOR_CHECK_UNLINK_OPEN_FILE): Use POSIX mode
+       flags, omit mode argument when flags argument does not have
+       O_CREAT.
+       * io/unix.c (tempfile): Use POSIX mode flags.
+       * configure: Regenerate.
+
+2011-11-21  Andreas Tobler  <andreast@fgznet.ch>
+
+       * configure: Regenerate.
+
+2011-11-11  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/51090
+       * runtime/main.c (find_addr2line): NULL check before proceeding.
+
+2011-11-10  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * intrinsics/cpu_time.c (__cpu_time_1): Don't force inlining.
+       * intrinsics/random.c (rnumber_4): Remove inline attribute.
+       (rnumber_8, rnumber_10, rnumber_16): Likewise.
+       * intrinsics/system_clock.c (gf_gettime_mono): Likewise.
+       * intrinsics/time_1.h (ATTRIBUTE_ALWAYS_INLINE): Remove macro.
+       (gf_cputime): Add inline attribute for MingW version.
+       * io/format.c (format_hash): Remove inline attribute.
+       * io/io.h (memset4): Inline function from transfer.c and write.c
+       moved here.
+       * io/transfer.c (min_off): Remove inline attribute.
+       (memset4): Move to io.h.
+       * io/write.c (memset4): Likewise.
+       (memcpy4): Remove inline attribute.
+       * io/write_float.def (calculate_exp): Likewise.
+
+2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * intrinsics/time_1.h (gf_gettime): Simplify time() usage.
+
+2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * configure.ac (AC_STDC_HEADERS): Remove.
+       (AC_HEADER_TIME): Remove.
+       (AC_HAVE_HEADERS, AC_CHECK_HEADERS): Move into a single invocation
+       of AC_CHECK_HEADERS_ONCE, don't check for presence of C89 headers.
+       (AC_CHECK_MEMBERS): Use single invocation.
+       (AC_CHECK_FUNCS): Move into single invocation of
+       AC_CHEC_FUNCS_ONCE, don't check for presence of C89 functions.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * intrinsics/clock.c: Include time.h.
+       (mclock): Assume clock() is present.
+       (mclock8): Likewise.
+       * intrinsics/ctime.c (strctime): Assume strftime is present.
+       (fdate): Assume time() is present.
+       (fdate_sub): Likewise.
+       (ctime): Likewise.
+       * intrinsics/date_and_time.c: Don't provide abs macro.
+       (HAVE_NO_DATE_TIME): Remove code related to macro which is never
+       set.
+       * intrinsics/execute_command_line.c: Assume stdlib.h is present.
+       * intrinsics/exit.c: Likewise.
+       * intrinsics/extends_type_of.c: Likewise.
+       * intrinsics/gerror.c: Assume strerror() is present.
+       * intrinsics/kill.c: Assume signal.h is present.
+       * intrinsics/malloc.c: Assume stdlib.h is present.
+       * intrinsics/move_alloc.c: Likewise.
+       * intrinsics/perror.c: Assume perror() is present.
+       * intrinsics/signal.c: Assume signal.h is present.
+       * intrinsics/stat.c: Assume stdlib.h is present.
+       * intrinsics/system.c: Likewise.
+       * intrinsics/time.c: Include time.h, assume time() is present.
+       * intrinsics/time_1.h: Conditionally include sys/time.h,
+       unconditionally time.h.
+       (gf_cputime): Do division in double, fallback using clock().
+       (gf_gettime): Assume time() is present.
+       * intrinsics/umask.c: Assume stdlib.h is present.
+       * runtime/backtrace.c: Likewise.
+       * runtime/compile_options.c: Assume signal.h is present, assume
+       C89 signals are present.
+       * runtime/error.c: Assume signal.h and stdlib.h are present.
+
+2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR fortran/46686
+       * runtime/backtrace.c (show_backtrace): Fix incorrect comment.
+
+2011-11-09  Tobias Burnus  <burnus@net-b.de>
+
+       * configure.ac: Make more cross-compile friendly.
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR fortran/46686
+       * configure.ac: Don't check execinfo.h, backtrace,
+       backtrace_symbols_fd. Check execve instead of execvp. Call
+       GCC_CHECK_UNWIND_GETIPINFO.
+       * runtime/backtrace.c: Don't include unused headers, include
+       limits.h and unwind.h.
+       (CAN_FORK): Check execve instead of execvp.
+       (GLIBC_BACKTRACE): Remove.
+       (bt_header): Conform to gdb backtrace format.
+       (struct bt_state): New struct.
+       (trace_function): New function.
+       (show_backtrace): Use _Unwind_Backtrace from libgcc instead of
+       glibc backtrace functions.
+       * Makefile.in: Regenerated.
+       * aclocal.m4: Regenerated.
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+
+2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/50016
+       * io/inquire.c (inquire_via_unit): Flush the unit and use ssize.
+       * io/unix.c (buf_flush): Don't call _commit.
+
+2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/47972
+       * runtime/error.c (gf_strerror): Silence warning.
+
+2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/47972
+       * runtime/error.c (gf_strerror): Silence warning.
+
+2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/47970
+       * intrinsics/c99_functions.c (round): Move higher in the file.
+
+2011-11-07  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/45723
+       * io/open.c (new_unit): Don't check file size before attempting
+       seek.
+
+2011-11-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * Makefile.am (AM_CPPFLAGS): Add
+       -I$(srcdir)/$(MULTISRCTOP)../libgcc, -I$(MULTIBUILDTOP)../libgcc.
+       * Makefile.in: Regenerate.
+       * acinclude.m4 (LIBGFOR_CHECK_GTHR_DEFAULT): Remove.
+       * configure.ac (LIBGFOR_CHECK_GTHR_DEFAULT): Likewise.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2011-11-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/io.h (next_available_newunit): Remove prototype.
+       * io/unit.h (next_available_newunit): Make variable static,
+       initialize it.
+       (init_units): Don't initialize next_available_newunit.
+       (get_unique_unit_number): Use atomic builtin if available.
+
+2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/inquire.c (inquire_via_unit): Check whether we're at the
+       beginning or end if the position is unspecified. If the position
+       is not one of the 3 standard ones, return unspecified.
+       * io/io.h (update_position): Remove prototype.
+       * io/transfer.c (next_record): Set the position to unspecified,
+       letting inquire figure it out more exactly when needed.
+       * io/unit.c (update_position): Remove function.
+
+2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.h (struct stream): Add size function pointer.
+       (ssize): New inline function.
+       (file_length): Remove prototype.
+       * io/unix.c (raw_size): New function.
+       (raw_init): Initialize st.size pointer.
+       (buf_size): New function.
+       (buf_init): Initialize st.size pointer.
+       (open_internal): Likewise.
+       (open_internal4): Likewise.
+       (file_length): Remove function.
+       * io/file_pos.c (st_rewind): Use ssize instead of file_length.
+       * io/open.c (test_endfile): Likewise.
+       * io/transfer.c (data_transfer_init): Likewise.
+       (next_record_r): Likewise.
+       (next_record_w): Likewise.
+       * io/unit.c (update_position): Likewise.
+
+2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/file_pos.c (st_rewind): Handle regular and special files
+       identically.
+       * io/intrinsics.c (fseek_sub): Don't check whether we think the
+       file is seekable, just do what the caller says.
+       * io/transfer.c (skip_record): First try to seek, then fallback to
+       reading and throwing away what we read.
+       * io/unit.c (update_position): Don't check whether file is
+       seekable, just try to do what we're told.
+       (unit_truncate): Likewise.
+       * io/unix.c (struct unix_stream): Remove special_file flag.
+       (buf_flush): Remove code for handling unseekable files.
+       (buf_seek): Likewise.
+       (fd_to_stream): Use buffered IO only for regular files.
+       (file_length): Remove is_seekable() call.
+       (is_seekable): Remove function.
+       (is_special): Likewise.
+       * io/unix.h: Remove prototypes for is_seekable and is_special.
+
+2011-09-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/49479
+       * generated/m4/ifunction.m4:  Always call internal_malloc_size
+       even when there is a zero-sized return array.
+       * generated/generated/maxloc1_16_i16.c: Regenerated.
+       * generated/generated/maxloc1_16_i1.c: Regenerated.
+       * generated/generated/maxloc1_16_i2.c: Regenerated.
+       * generated/generated/maxloc1_16_i4.c: Regenerated.
+       * generated/generated/maxloc1_16_i8.c: Regenerated.
+       * generated/generated/maxloc1_16_r10.c: Regenerated.
+       * generated/generated/maxloc1_16_r16.c: Regenerated.
+       * generated/generated/maxloc1_16_r4.c: Regenerated.
+       * generated/generated/maxloc1_16_r8.c: Regenerated.
+       * generated/generated/maxloc1_4_i16.c: Regenerated.
+       * generated/generated/maxloc1_4_i1.c: Regenerated.
+       * generated/generated/maxloc1_4_i2.c: Regenerated.
+       * generated/generated/maxloc1_4_i4.c: Regenerated.
+       * generated/generated/maxloc1_4_i8.c: Regenerated.
+       * generated/generated/maxloc1_4_r10.c: Regenerated.
+       * generated/generated/maxloc1_4_r16.c: Regenerated.
+       * generated/generated/maxloc1_4_r4.c: Regenerated.
+       * generated/generated/maxloc1_4_r8.c: Regenerated.
+       * generated/generated/maxloc1_8_i16.c: Regenerated.
+       * generated/generated/maxloc1_8_i1.c: Regenerated.
+       * generated/generated/maxloc1_8_i2.c: Regenerated.
+       * generated/generated/maxloc1_8_i4.c: Regenerated.
+       * generated/generated/maxloc1_8_i8.c: Regenerated.
+       * generated/generated/maxloc1_8_r10.c: Regenerated.
+       * generated/generated/maxloc1_8_r16.c: Regenerated.
+       * generated/generated/maxloc1_8_r4.c: Regenerated.
+       * generated/generated/maxloc1_8_r8.c: Regenerated.
+       * generated/generated/maxval_i16.c: Regenerated.
+       * generated/generated/maxval_i1.c: Regenerated.
+       * generated/generated/maxval_i2.c: Regenerated.
+       * generated/generated/maxval_i4.c: Regenerated.
+       * generated/generated/maxval_i8.c: Regenerated.
+       * generated/generated/maxval_r10.c: Regenerated.
+       * generated/generated/maxval_r16.c: Regenerated.
+       * generated/generated/maxval_r4.c: Regenerated.
+       * generated/generated/maxval_r8.c: Regenerated.
+       * generated/generated/minloc1_16_i16.c: Regenerated.
+       * generated/generated/minloc1_16_i1.c: Regenerated.
+       * generated/generated/minloc1_16_i2.c: Regenerated.
+       * generated/generated/minloc1_16_i4.c: Regenerated.
+       * generated/generated/minloc1_16_i8.c: Regenerated.
+       * generated/generated/minloc1_16_r10.c: Regenerated.
+       * generated/generated/minloc1_16_r16.c: Regenerated.
+       * generated/generated/minloc1_16_r4.c: Regenerated.
+       * generated/generated/minloc1_16_r8.c: Regenerated.
+       * generated/generated/minloc1_4_i16.c: Regenerated.
+       * generated/generated/minloc1_4_i1.c: Regenerated.
+       * generated/generated/minloc1_4_i2.c: Regenerated.
+       * generated/generated/minloc1_4_i4.c: Regenerated.
+       * generated/generated/minloc1_4_i8.c: Regenerated.
+       * generated/generated/minloc1_4_r10.c: Regenerated.
+       * generated/generated/minloc1_4_r16.c: Regenerated.
+       * generated/generated/minloc1_4_r4.c: Regenerated.
+       * generated/generated/minloc1_4_r8.c: Regenerated.
+       * generated/generated/minloc1_8_i16.c: Regenerated.
+       * generated/generated/minloc1_8_i1.c: Regenerated.
+       * generated/generated/minloc1_8_i2.c: Regenerated.
+       * generated/generated/minloc1_8_i4.c: Regenerated.
+       * generated/generated/minloc1_8_i8.c: Regenerated.
+       * generated/generated/minloc1_8_r10.c: Regenerated.
+       * generated/generated/minloc1_8_r16.c: Regenerated.
+       * generated/generated/minloc1_8_r4.c: Regenerated.
+       * generated/generated/minloc1_8_r8.c: Regenerated.
+       * generated/generated/minval_i16.c: Regenerated.
+       * generated/generated/minval_i1.c: Regenerated.
+       * generated/generated/minval_i2.c: Regenerated.
+       * generated/generated/minval_i4.c: Regenerated.
+       * generated/generated/minval_i8.c: Regenerated.
+       * generated/generated/minval_r10.c: Regenerated.
+       * generated/generated/minval_r16.c: Regenerated.
+       * generated/generated/minval_r4.c: Regenerated.
+       * generated/generated/minval_r8.c: Regenerated.
+       * generated/generated/product_c10.c: Regenerated.
+       * generated/generated/product_c16.c: Regenerated.
+       * generated/generated/product_c4.c: Regenerated.
+       * generated/generated/product_c8.c: Regenerated.
+       * generated/generated/product_i16.c: Regenerated.
+       * generated/generated/product_i1.c: Regenerated.
+       * generated/generated/product_i2.c: Regenerated.
+       * generated/generated/product_i4.c: Regenerated.
+       * generated/generated/product_i8.c: Regenerated.
+       * generated/generated/product_r10.c: Regenerated.
+       * generated/generated/product_r16.c: Regenerated.
+       * generated/generated/product_r4.c: Regenerated.
+       * generated/generated/product_r8.c: Regenerated.
+       * generated/generated/sum_c10.c: Regenerated.
+       * generated/generated/sum_c16.c: Regenerated.
+       * generated/generated/sum_c4.c: Regenerated.
+       * generated/generated/sum_c8.c: Regenerated.
+       * generated/generated/sum_i16.c: Regenerated.
+       * generated/generated/sum_i1.c: Regenerated.
+       * generated/generated/sum_i2.c: Regenerated.
+       * generated/generated/sum_i4.c: Regenerated.
+       * generated/generated/sum_i8.c: Regenerated.
+       * generated/generated/sum_r10.c: Regenerated.
+       * generated/generated/sum_r16.c: Regenerated.
+       * generated/generated/sum_r4.c: Regenerated.
+       * generated/generated/sum_r8.c: Regenerated.
+
+2011-09-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       * generated/bessel_r4.c: Regenerated.
+       * generated/bessel_r8.c: Regenerated.
+       * generated/bessel_r10.c: Regenerated.
+       * generated/bessel_r16.c: Regenerated.
+
+2011-08-29  Tobias Burnus  <burnus@net-b.de>
+
+       * caf/libcaf.h (_gfortran_caf_deregister): Update prototype.
+       * caf/mpi.c (_gfortran_caf_deregister): Modify prototype,
+       actually free memory and add error diagnostic.
+       (_gfortran_caf_finalize): Add additional free calls.
+       * caf/single.c (_gfortran_caf_deregister): Modify prototype,
+       actually free memory and add error diagnostic.
+       (_gfortran_caf_finalize): Add additional free calls.
+
+2011-08-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/50192
+       * intrinsics/string_intrinsics.c (memcmp_char4):  New function.
+       * intrinsics/string_intrinsics_inc.c:  New macro MEMCMP, either
+       set to memcmp or memcmp_char4.
+       (compare_string):  Use MEMCMP, with correct size for it.
+       * libgfortran.h:  Add prototype for memcmp_char4.
+
+2011-08-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/40866
+       * generated/iall_i1.c: Regenerated.
+       * generated/iall_i16.c: Regenerated.
+       * generated/iall_i2.c: Regenerated.
+       * generated/iall_i4.c: Regenerated.
+       * generated/iall_i8.c: Regenerated.
+       * generated/iany_i1.c: Regenerated.
+       * generated/iany_i16.c: Regenerated.
+       * generated/iany_i2.c: Regenerated.
+       * generated/iany_i4.c: Regenerated.
+       * generated/iany_i8.c: Regenerated.
+       * generated/iparity_i1.c: Regenerated.
+       * generated/iparity_i16.c: Regenerated.
+       * generated/iparity_i2.c: Regenerated.
+       * generated/iparity_i4.c: Regenerated.
+       * generated/iparity_i8.c: Regenerated.
+       * generated/norm2_r10.c: Regenerated.
+       * generated/norm2_r16.c: Regenerated.
+       * generated/norm2_r4.c: Regenerated.
+       * generated/norm2_r8.c: Regenerated.
+       * generated/parity_l1.c: Regenerated.
+       * generated/parity_l16.c: Regenerated.
+       * generated/parity_l2.c: Regenerated.
+       * generated/parity_l4.c: Regenerated.
+       * generated/parity_l8.c: Regenerated.
+       * generated/misc_specifics.F90: Regenerated (comment change).
+       * generated/_abs_c10.F90: Regenerated (comment change).
+       * generated/_abs_c16.F90: Regenerated (comment change).
+       * generated/_abs_c4.F90: Regenerated (comment change).
+       * generated/_abs_c8.F90: Regenerated (comment change).
+       * generated/_abs_i16.F90: Regenerated (comment change).
+       * generated/_abs_i4.F90: Regenerated (comment change).
+       * generated/_abs_i8.F90: Regenerated (comment change).
+       * generated/_abs_r10.F90: Regenerated (comment change).
+       * generated/_abs_r16.F90: Regenerated (comment change).
+       * generated/_abs_r4.F90: Regenerated (comment change).
+       * generated/_abs_r8.F90: Regenerated (comment change).
+       * generated/_acosh_r10.F90: Regenerated (comment change).
+       * generated/_acosh_r16.F90: Regenerated (comment change).
+       * generated/_acosh_r4.F90: Regenerated (comment change).
+       * generated/_acosh_r8.F90: Regenerated (comment change).
+       * generated/_acos_r10.F90: Regenerated (comment change).
+       * generated/_acos_r16.F90: Regenerated (comment change).
+       * generated/_acos_r4.F90: Regenerated (comment change).
+       * generated/_acos_r8.F90: Regenerated (comment change).
+       * generated/_aimag_c10.F90: Regenerated (comment change).
+       * generated/_aimag_c16.F90: Regenerated (comment change).
+       * generated/_aimag_c4.F90: Regenerated (comment change).
+       * generated/_aimag_c8.F90: Regenerated (comment change).
+       * generated/_aint_r10.F90: Regenerated (comment change).
+       * generated/_aint_r16.F90: Regenerated (comment change).
+       * generated/_aint_r4.F90: Regenerated (comment change).
+       * generated/_aint_r8.F90: Regenerated (comment change).
+       * generated/_anint_r10.F90: Regenerated (comment change).
+       * generated/_anint_r16.F90: Regenerated (comment change).
+       * generated/_anint_r4.F90: Regenerated (comment change).
+       * generated/_anint_r8.F90: Regenerated (comment change).
+       * generated/_asinh_r10.F90: Regenerated (comment change).
+       * generated/_asinh_r16.F90: Regenerated (comment change).
+       * generated/_asinh_r4.F90: Regenerated (comment change).
+       * generated/_asinh_r8.F90: Regenerated (comment change).
+       * generated/_asin_r10.F90: Regenerated (comment change).
+       * generated/_asin_r16.F90: Regenerated (comment change).
+       * generated/_asin_r4.F90: Regenerated (comment change).
+       * generated/_asin_r8.F90: Regenerated (comment change).
+       * generated/_atan2_r10.F90: Regenerated (comment change).
+       * generated/_atan2_r16.F90: Regenerated (comment change).
+       * generated/_atan2_r4.F90: Regenerated (comment change).
+       * generated/_atan2_r8.F90: Regenerated (comment change).
+       * generated/_atanh_r10.F90: Regenerated (comment change).
+       * generated/_atanh_r16.F90: Regenerated (comment change).
+       * generated/_atanh_r4.F90: Regenerated (comment change).
+       * generated/_atanh_r8.F90: Regenerated (comment change).
+       * generated/_atan_r10.F90: Regenerated (comment change).
+       * generated/_atan_r16.F90: Regenerated (comment change).
+       * generated/_atan_r4.F90: Regenerated (comment change).
+       * generated/_atan_r8.F90: Regenerated (comment change).
+       * generated/_conjg_c10.F90: Regenerated (comment change).
+       * generated/_conjg_c16.F90: Regenerated (comment change).
+       * generated/_conjg_c4.F90: Regenerated (comment change).
+       * generated/_conjg_c8.F90: Regenerated (comment change).
+       * generated/_cosh_r10.F90: Regenerated (comment change).
+       * generated/_cosh_r16.F90: Regenerated (comment change).
+       * generated/_cosh_r4.F90: Regenerated (comment change).
+       * generated/_cosh_r8.F90: Regenerated (comment change).
+       * generated/_cos_c10.F90: Regenerated (comment change).
+       * generated/_cos_c16.F90: Regenerated (comment change).
+       * generated/_cos_c4.F90: Regenerated (comment change).
+       * generated/_cos_c8.F90: Regenerated (comment change).
+       * generated/_cos_r10.F90: Regenerated (comment change).
+       * generated/_cos_r16.F90: Regenerated (comment change).
+       * generated/_cos_r4.F90: Regenerated (comment change).
+       * generated/_cos_r8.F90: Regenerated (comment change).
+       * generated/_dim_i16.F90: Regenerated (comment change).
+       * generated/_dim_i4.F90: Regenerated (comment change).
+       * generated/_dim_i8.F90: Regenerated (comment change).
+       * generated/_dim_r10.F90: Regenerated (comment change).
+       * generated/_dim_r16.F90: Regenerated (comment change).
+       * generated/_dim_r4.F90: Regenerated (comment change).
+       * generated/_dim_r8.F90: Regenerated (comment change).
+       * generated/_exp_c10.F90: Regenerated (comment change).
+       * generated/_exp_c16.F90: Regenerated (comment change).
+       * generated/_exp_c4.F90: Regenerated (comment change).
+       * generated/_exp_c8.F90: Regenerated (comment change).
+       * generated/_exp_r10.F90: Regenerated (comment change).
+       * generated/_exp_r16.F90: Regenerated (comment change).
+       * generated/_exp_r4.F90: Regenerated (comment change).
+       * generated/_exp_r8.F90: Regenerated (comment change).
+       * generated/_log10_r10.F90: Regenerated (comment change).
+       * generated/_log10_r16.F90: Regenerated (comment change).
+       * generated/_log10_r4.F90: Regenerated (comment change).
+       * generated/_log10_r8.F90: Regenerated (comment change).
+       * generated/_log_c10.F90: Regenerated (comment change).
+       * generated/_log_c16.F90: Regenerated (comment change).
+       * generated/_log_c4.F90: Regenerated (comment change).
+       * generated/_log_c8.F90: Regenerated (comment change).
+       * generated/_log_r10.F90: Regenerated (comment change).
+       * generated/_log_r16.F90: Regenerated (comment change).
+       * generated/_log_r4.F90: Regenerated (comment change).
+       * generated/_log_r8.F90: Regenerated (comment change).
+       * generated/_mod_i16.F90: Regenerated (comment change).
+       * generated/_mod_i4.F90: Regenerated (comment change).
+       * generated/_mod_i8.F90: Regenerated (comment change).
+       * generated/_mod_r10.F90: Regenerated (comment change).
+       * generated/_mod_r16.F90: Regenerated (comment change).
+       * generated/_mod_r4.F90: Regenerated (comment change).
+       * generated/_mod_r8.F90: Regenerated (comment change).
+       * generated/_sign_i16.F90: Regenerated (comment change).
+       * generated/_sign_i4.F90: Regenerated (comment change).
+       * generated/_sign_i8.F90: Regenerated (comment change).
+       * generated/_sign_r10.F90: Regenerated (comment change).
+       * generated/_sign_r16.F90: Regenerated (comment change).
+       * generated/_sign_r4.F90: Regenerated (comment change).
+       * generated/_sign_r8.F90: Regenerated (comment change).
+       * generated/_sinh_r10.F90: Regenerated (comment change).
+       * generated/_sinh_r16.F90: Regenerated (comment change).
+       * generated/_sinh_r4.F90: Regenerated (comment change).
+       * generated/_sinh_r8.F90: Regenerated (comment change).
+       * generated/_sin_c10.F90: Regenerated (comment change).
+       * generated/_sin_c16.F90: Regenerated (comment change).
+       * generated/_sin_c4.F90: Regenerated (comment change).
+       * generated/_sin_c8.F90: Regenerated (comment change).
+       * generated/_sin_r10.F90: Regenerated (comment change).
+       * generated/_sin_r16.F90: Regenerated (comment change).
+       * generated/_sin_r4.F90: Regenerated (comment change).
+       * generated/_sin_r8.F90: Regenerated (comment change).
+       * generated/_sqrt_c10.F90: Regenerated (comment change).
+       * generated/_sqrt_c16.F90: Regenerated (comment change).
+       * generated/_sqrt_c4.F90: Regenerated (comment change).
+       * generated/_sqrt_c8.F90: Regenerated (comment change).
+       * generated/_sqrt_r10.F90: Regenerated (comment change).
+       * generated/_sqrt_r16.F90: Regenerated (comment change).
+       * generated/_sqrt_r4.F90: Regenerated (comment change).
+       * generated/_sqrt_r8.F90: Regenerated (comment change).
+       * generated/_tanh_r10.F90: Regenerated (comment change).
+       * generated/_tanh_r16.F90: Regenerated (comment change).
+       * generated/_tanh_r4.F90: Regenerated (comment change).
+       * generated/_tanh_r8.F90: Regenerated (comment change).
+       * generated/_tan_r10.F90: Regenerated (comment change).
+       * generated/_tan_r16.F90: Regenerated (comment change).
+       * generated/_tan_r4.F90: Regenerated (comment change).
+       * generated/_tan_r8.F90: Regenerated (comment change).
+
+2011-08-18  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/50109
+       * io/list_read.c (eat_separator): Fix skipping over "!" lines.
+
+2011-07-23  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * intrinsics/ctime.c: Include <stdlib.h>.
+       * intrinsics/getlog.c: Likewise.
+       * runtime/stop.c: Likewise.
+
+2011-07-23  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/49791
+       * io/list_read.c (nml_parse_qualifier): Remove check to
+       enabled extended read for another case.
+
+2011-07-15  Daniel Carrera  <dcarrera@gmail.com>
+
+       * caf/mpi.c (caf_runtime_error): Change fprintf to vfprintf.
+       * caf/single.c (caf_runtime_error): Ditto.
+
+2011-07-14  Daniel Carrera  <dcarrera@gmail.com>
+
+       * caf/single.c:  Include stdarg.h header.
+       (caf_runtime_error): New function. Use "exit(EXIT_FAILURE)".
+       (_gfortran_caf_register): Use caf_runtime_error.
+       (_gfortran_caf_sync_images): Use "exit(EXIT_FAILURE)".
+       * caf/mpi.c (caf_runtime_error): Remove "error" parameter.
+       Return EXIT_FAILURE instead.
+       (_gfortran_caf_register): Update call to caf_runtime_error.
+       (_gfortran_caf_sync_all): Ditto.
+       (_gfortran_caf_sync_images): Ditto.
+       (_gfortran_caf_error_stop_str): Use "exit(EXIT_FAILURE)".
+
+2011-07-13  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/49296
+       * io/list_read.c (read_logical): Don't error out if a valid value
+       is followed by EOF instead of a normal separator.
+       (read_integer): Likewise.
+
+2011-07-09  Tobias Burnus  <burnus@net-b.de>
+
+       * runtime/error.c (sys_abort): Change argument list
+       from "()" to "(void)".
+
+2011-07-09  Tobias Burnus  <burnus@net-b.de>
+           Daniel Carrera  <dcarrera@gmail.com>
+
+       * caf/mpi.c (runtime_error): New function.
+       (_gfortran_caf_register): Use it.
+       (_gfortran_caf_sync_all): Use it, add STAT_STOPPED_IMAGE
+       as possible status value.
+       (_gfortran_caf_sync_images): Ditto.
+
+2011-07-07  Tobias Burnus  <burnus@net-b.de>
+
+       * libcaf.h (__attribute__, unlikely, likely): New macros.
+       (caf_register_t): Update comment.
+       (_gfortran_caf_register): Add stat, errmsg, errmsg_len arguments.
+       * single.c (_gfortran_caf_register): Ditto; add error diagnostics.
+       * mpi.c (_gfortran_caf_register): Ditto.
+       (caf_is_finalized): New global variable.
+       (_gfortran_caf_finalize): Use it.
+
+2011-07-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       * runtime/memory.c (internal_malloc_size):  If size is zero,
+       allocate a single byte.
+       * m4/pack.m4 (pack_'rtype_code`):  Don't check for zero size
+       for the argument of internal_malloc_size.
+       * m4/spread.m4 (spread_'rtype_code`):  Likewise.
+       * m4/eoshift1.m4 (eoshift1):  Don't allocate twice.  Don't check
+       for zero size for the argument of internal_malloc_size.
+       * m4/eoshift3.m4: Don't check for zero size for the argument of
+       internal_malloc_size.
+       * intrinsics/pack_generic.c (pack_internal):  Likewise.
+       (pack_s_internal):  Likewise.
+       * intrinsics/cshift0.c (cshift0):  Likewise.
+       * intrinsics/spread_generic.c (spread_internal):  Likewise.
+       * intrinsics/eoshift0.c (eoshift0):  Likewise.
+       * intrinsics/eoshift2.c (eoshift2):  Likewise.
+       * generated/eoshift1_16.c: Regenerated.
+       * generated/eoshift1_4.c: Regenerated.
+       * generated/eoshift1_8.c: Regenerated.
+       * generated/eoshift3_16.c: Regenerated.
+       * generated/eoshift3_4.c: Regenerated.
+       * generated/eoshift3_8.c: Regenerated.
+       * generated/pack_c10.c: Regenerated.
+       * generated/pack_c16.c: Regenerated.
+       * generated/pack_c4.c: Regenerated.
+       * generated/pack_c8.c: Regenerated.
+       * generated/pack_i16.c: Regenerated.
+       * generated/pack_i1.c: Regenerated.
+       * generated/pack_i2.c: Regenerated.
+       * generated/pack_i4.c: Regenerated.
+       * generated/pack_i8.c: Regenerated.
+       * generated/pack_r10.c: Regenerated.
+       * generated/pack_r16.c: Regenerated.
+       * generated/pack_r4.c: Regenerated.
+       * generated/pack_r8.c: Regenerated.
+       * generated/spread_c10.c: Regenerated.
+       * generated/spread_c16.c: Regenerated.
+       * generated/spread_c4.c: Regenerated.
+       * generated/spread_c8.c: Regenerated.
+       * generated/spread_i16.c: Regenerated.
+       * generated/spread_i1.c: Regenerated.
+       * generated/spread_i2.c: Regenerated.
+       * generated/spread_i4.c: Regenerated.
+       * generated/spread_i8.c: Regenerated.
+       * generated/spread_r10.c: Regenerated.
+       * generated/spread_r16.c: Regenerated.
+       * generated/spread_r4.c: Regenerated.
+       * generated/spread_r8.c: Regenerated.
+
+2011-06-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/49479
+       * m4/reshape.m4: If source allocation is smaller than one, set it
+       to one.
+       * intrinsics/reshape_generic.c:  Likewise.
+       * generated/reshape_r16.c: Regenerated.
+       * generated/reshape_c4.c: Regenerated.
+       * generated/reshape_c16.c: Regenerated.
+       * generated/reshape_c8.c: Regenerated.
+       * generated/reshape_r4.c: Regenerated.
+       * generated/reshape_i4.c: Regenerated.
+       * generated/reshape_r10.c: Regenerated.
+       * generated/reshape_r8.c: Regenerated.
+       * generated/reshape_c10.c: Regenerated.
+       * generated/reshape_i8.c: Regenerated.
+       * generated/reshape_i16.c: Regenerated.
+
+2011-06-18  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/49296
+       * io/list_read.c (read_character): Accept EOF as a separator when
+       reading string.
+
+2011-06-17  Daniel Carrera  <dcarrera@gmail.com>
+
+       * caf/single.c (_gfortran_caf_register): Store the address
+       of all static coarrays in a linked list.
+       (_gfortran_caf_finalize): Free memory of staic coarrays.
+       * caf/mpi.c (_gfortran_caf_register): Store the address
+       of all static coarrays in a linked list. Initialize MPI
+       if necessary.
+       (_gfortran_caf_finalize): Free memory of staic coarrays.
+       (_gfortran_caf_init): Check if MPI is already initialized
+       before initializing again.
+       * caf/libcaf.h: Add a type to caf_register_t to distinguish
+       static coarrays and add the type caf_static_t to make the
+       linked list of static coarrays.
+
+2011-06-11  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.c (buf_seek): Return error if file is not seekable.
+       (buf_tell): Call buf_seek.
+
+2011-06-11  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.c (fd_to_stream): Figure out if a fd is seekable by
+       trying lseek().
+
+2011-06-10  Daniel Carrera  <dcarrera@gmail.com>
+
+       * caf/mpi.c (_gfortran_caf_sync_all,
+       _gfortran_caf_sync_images): Functions have void return type
+       and move status into parameter list.
+       * caf/single.c (_gfortran_caf_sync_all,
+       _gfortran_caf_sync_images): Functions have void return type
+       and move status into parameter list.
+       * caf/libcaf.h (_gfortran_caf_sync_all,
+       _gfortran_caf_sync_images): Functions have void return type
+       and move status into parameter list.
+
+2011-06-03  Richard Henderson  <rth@redhat.com>
+           Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * config/fpu-387.h [__sun__ && __svr4__] (sigill_hdlr): Correct
+       insn, insn size.
+       (has_sse) [!__x86_64__ && __sun__ && __svr4__]: Use movaps.
+
+2011-05-29  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/48931
+       * libgfortran.h (find_addr2line): New prototype.
+       * runtime/backtrace.c (show_backtrace): Use async-signal-safe
+       execve and stored path of addr2line.
+       * runtime/compile_options.c (maybe_find_addr2line): New function.
+       (set_options): Call maybe_find_addr2line if backtracing is enabled.
+       * runtime/main.c (find_addr2line): New function.
+       (init): Call find_addr2line if backtracing is enabled.
+       (cleanup): Free addr2line_path.
+
+2011-05-29  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/49214
+       * runtime/backtrace.c (fd_gets): Return NULL if nothing was read.
+
+2011-05-29  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/19155
+       * io/read.c (convert_real): Check for invalid input by comparing
+       endptr instead of EINVAL.
+       (read_f): Fixup floating point input without significand.
+
+2011-05-22  Tobias Burnus  <burnus@net-b.de>
+
+       * runtime/stop.c (stop_string,error_stop_string): Minor cleanup.
+
+2011-05-22  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/48931
+       * configure.ac: Check for backtrace_symbols_fd instead of
+       backtrace_symbols, check for readlink.
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+       * runtime/backtrace.c (local_strcasestr): Remove.
+       (bt_header): New function.
+       (dump_glibc_backtrace): Remove.
+       (fd_gets): New function.
+       (show_backtrace): Rework to use backtrace_symbols_fd and pipes
+       avoiding functions that are not async-signal-safe, reformat
+       output.
+       * runtime/main.c (store_exe_path): Try to check /proc/self/exe
+       first.
+
+2011-05-20  Janne Blomqvist  <jb@gcc.gnu.org>
+           Uros Bizjak  <ubizjak@gmail.com>
+
+       PR libfortran/48977
+       * configure.host: Swap order of glibc and x86 tests.
+
+2011-05-20  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * config/fpu-387.h (set_fpu): Use renamed inexact macro.
+       * config/fpu-aix.h (set_fpu): Clarify error messages, use renamed
+       inexact macro, set TRP_INEXACT for inexact exception instead of
+       TRP_UNDERFLOW.
+       * config/fpu-generic.h (set_fpu): Clarify error messages, use
+       renamed inexact macro.
+       * config/fpu-glibc.h (set_fpu): Likewise.
+       * config/fpu-sysv.h (set_fpu): Likewise.
+
+2011-05-14  Tobias Burnus  <burnus@net-b.de>
+
+       * runtime/stop.c (error_stop_string, error_stop_numeric):
+       Do not backtrace for ERROR STOP.
+
+2011-05-14  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/48915
+       * intrinsics/abort.c (abort): Call sys_abort().
+       * io/unix.c (st_vprintf): Call sys_abort().
+       * libgfortran.h (options_t): Remove dump_core member.
+       (handler): Rename to backtrace_handler.
+       (compile_options_t): Remove dump_core member.
+       (sys_exit): Remove.
+       (sys_abort): New function.
+       * runtime/backtrace.c (show_backtrace): Print a message if
+       backtrace is not available on target, update filter symbol name
+       due to backtrace_handler renaming.
+       * runtime/compile_options.c (backtrace_handler): New
+       implementation based on example in Glibc manual.
+       (set_options): Remove dump_core handling, make signal handler
+       handle more signals.
+       (init_compile_options): Remove dump_core.
+       * runtime/environ.c (variable_table[]): Remove
+       GFORTRAN_ERROR_DUMPCORE element.
+       (show_variables): Update name, call exit().
+       * runtime/error.c (sys_exit): Remove.
+       (sys_abort): New function.
+       (recursion_check): Call sys_abort().
+       (os_error): Call exit().
+       (runtime_error): Likewise.
+       (runtime_error_at): Likewise.
+       (internal_error): Likewise.
+       (generate_error): Likewise.
+       (notify_std): Likewise.
+       * runtime/stop.c (stop_numeric): Call exit().
+       (stop_numeric_f08): Likewise.
+       (stop_string): Likewise.
+       (error_stop_string): Call sys_abort().
+       (error_stop_numeric): Print backtrace, exit with provided code.
+
+2011-05-14  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.c (st_vprintf,st_printf): Move to runtime/error.c.
+       * libgfortran.h (struct options_t): Remove use_stderr field.
+       (st_vprintf,st_printf): Move prototypes.
+       (estr_write): New prototype.
+       * runtime/error.c (sys_exit): Use estr_write instead of st_printf.
+       (estr_write): New function.
+       (st_vprintf): Move from io/unix.c, use stack allocated buffer,
+       always output to stderr.
+       (st_printf): Move from io/unix.c.
+       (show_locus): Use a local variable instead of static.
+       (os_error): Use estr_write instead of st_printf.
+       (runtime_error): Likewise.
+       (runtime_error_at): Likewise.
+       (runtime_warning_at): Likewise.
+       (internal_error): Likewise.
+       (generate_error): Likewise.
+       (generate_warning): Likewise.
+       (notify_std): Likewise.
+       * runtime/pause.c (do_pause): Likewise.
+       (pause_string): Likewise.
+       * runtime/stop.c (stop_string): Likewise.
+       (error_stop_string): Likewise.
+       * config/fpu_aix.h (set_fpu): Likewise.
+       * config/fpu_generic.h (set_fpu): Likewise.
+       * config/fpu_glibc.h (set_fpu): Likewise.
+       * config/fpu-sysv.h (set_fpu): Likewise.
+       * runtime/backtrace.c (dump_glibc_backtrace): Likewise.
+       (show_backtrace): Likewise.
+       * runtime/environ.c (print_spaces): Likewise.
+       (show_string): Likewise.
+       (show_variables): Likewise.
+       (variable_table[]): Remove GFORTRAN_USE_STDERR entry.
+
+2011-05-14  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/48961
+       * intrinsics/execute_command_line.c (set_cmdstat): Don't abort if
+       synchronously executing with WAIT=.false.
+       (execute_command_line): Fix setting of cmdstat and exitstat.
+
+2011-05-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/18918
+       * caf/libcaf.h: Cleanup headers.
+       (_gfortran_caf_critical, _gfortran_caf_end_critical): Make stub.
+       (caf_register_t): New enum.
+       (_gfortran_caf_register, _gfortran_caf_deregister): New prototype.
+       * caf/single.c (_gfortran_caf_critical,
+       _gfortran_caf_end_critical): Remove.
+       (_gfortran_caf_register, _gfortran_caf_deregister): New functions.
+       * caf/mpi.c (_gfortran_caf_critical,
+       _gfortran_caf_end_critical): Remove.
+       (_gfortran_caf_register, _gfortran_caf_deregister): New functions.
+       (caf_world_window): Remove global variable.
+       (_gfortran_caf_init): Fix off-by-one error of this_image.
+
+2011-05-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/48787
+       * io/write_float.def (output_float): Adjust up and down rounding for
+       cases where 'd' = 0. Gather common code to one location.
+
+2011-05-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/48787
+       * io/write_float.def (output_float): Gather up integer declarations and
+       add new 'p' for scale factor. Use 'p' in place of the 'dtp' reference
+       everywhere. For ROUND_UP scan the digit string and only perform
+       rounding if something other than '0' is found.
+
+2011-04-29  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * io/unix.c (min): New macro.
+       (unpack_filename): Return errno number for errors.
+       (regular_file): Use appropriately sized buffer for path.
+       (compare_file_filename): Likewise.
+       (find_file): Likewise.
+       (delete_file): Likewise.
+       (file_exists): Likewise.
+       (file_size): Likewise.
+       (inquire_sequential): Likewise.
+       (inquire_direct): Likewise.
+       (inquire_formatted): Likewise.
+       (inquire_access): Likewise.
+
+2011-04-29  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/48488
+       * io/write.c (write_real, write_real_g0): Update comments.
+
+2011-04-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+           Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libgfortran/48488
+       PR libgfortran/48602
+       PR libgfortran/48615
+       PR libgfortran/48684
+       PR libgfortran/48787
+       * io/write.c (write_d, write_e, write_f, write_en,
+       write_es): Add precision compemsation parameter to call.
+       (set_fnode_default): Adjust default widths to assure
+       round trip on write and read. (write_real): Adjust call to write_float.
+       (write_real_g0): Calculate compensation for extra precision and adjust
+       call to write_float.
+       * io/write_float.def (output_float_FMT_G_): Use volatile rather than
+       asm volatile to avoid optimization issue. Correctly calculate the
+       number of blanks (nb) to be appended and simplify calculation logic.
+       (write_float): Increase MIN_FIELD_WIDTH by one to accomodate the new
+       default widths. Eliminate the code that attempted to reduce the
+       the precision used in later sprintf functions.  Add call parameter to
+       compensate for extra precision.
+
+2011-04-20  Jim Meyering  <meyering@redhat.com>
+
+       * intrinsics/move_alloc.c (move_alloc): Remove useless
+       if-before-free test.
+       * io/fbuf.c (fbuf_destroy): Likewise.
+       * io/format.c (save_parsed_format): Likewise.
+       * io/open.c (already_open): Likewise.
+       * io/unit.c (free_internal_unit, close_unit_1): Likewise.
+       * io/unix.c (mem_close): Likewise.
+
+2011-04-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/48602
+       * io/write_float.def (output_float_FMT_G): Fix reversal in conditional.
+       Use asm volatile to mark temp variable, avoiding optimization errors.
+
+2011-04-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/48602
+       * io/write_float.def (output_float_FMT_G): Use current rounding mode
+       to set the rounding parameters. (output_float): Skip rounding
+       if value is zero.
+
+2011-04-16  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * intrinsics/date_and_time.c (date_and_time): Remove sprintf CPP
+       branch.
+       * io/format.c (format_error): Use snprintf instead of sprintf.
+       * io/list_read.c: Move snprintf fallback macro to libgfortran.h.
+       (convert_integer): Use snprintf instead of sprintf.
+       (parse_repeat): Likewise.
+       (read_logical): Likewise.
+       (read_integer): Likewise.
+       (read_character): Likewise.
+       (parse_real): Likewise.
+       (read_complex): Likewise.
+       (read_real): Likewise.
+       (check_type): Likewise.
+       (nml_parse_qualifier): Add string length argument, use snprintf
+       instead of sprintf.
+       (nml_get_obj_data): Use snprintf instead of sprintf.
+       * io/open.c (new_unit): Remove sprintf CPP branch, use snprintf
+       instead of sprintf.
+       * io/transfer.c (require_type): Use snprintf instead of sprintf.
+       * io/unix.c (tempfile): Likewise.
+       * io/write.c (nml_write_obj): Likewise.
+       * io/write_float.def (output_float): Remove sprintf CPP branch,
+       use snprintf instead of sprintf.
+       * libgfortran.h: Add fallback snprintf macro from io/list_read.c.
+       * runtime/backtrace.c (show_backtrace): Remove sprintf CPP branch.
+       * runtime/main.c (store_exe_path): Use snprintf instead of
+       sprintf.
+
+2011-04-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/48589
+       * io/write_float.def (write_infnan): Set width properly for G0.
+
+2011-04-15  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/18918
+       * Makefile.am: Build and install caf/single.c as
+       libcaf_single.a.
+       * Makefile.in: Regenerate.
+
+2011-04-15  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47571
+       * configure: Regenerated.
+       * config.h.in: Regenerated.
+       * acinclude.m4: Add alpha*-dec-osf* to gthread blacklist.
+       * configure.ac: Use separate symbol for clock_gettime in librt.
+       * intrinsics/system_clock.c: Use weakrefs only when needed and
+       supported.
+
+2011-04-12  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * configure.ac: Use AC_TYPE_* to make sure we have (u)intptr_t,
+       check for ptrdiff_t.
+       * libgfortran.h: Remove (u)intptr_t definitions, use ptrdiff_t for
+       index_type, change cshift0* prototypes.
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+       * intrinsics/cshift0.c (cshift0): Use ptrdiff_t instead of ssize_t.
+       * io/io.h (array_loop_spec): Use index_type instead of ssize_t.
+       * io/list_read.c (nml_parse_qualifier): Likewise.
+       * io/write.c (nml_write_obj): Likewise.
+       * m4/cshift0.c (cshift0_'rtype_code`): Likewise.
+       * generated/cshift0_*.c: Regenerated.
+
+2011-04-12  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * Makefile.am: Remove _GNU_SOURCE from AM_CPPFLAGS.
+       * Makefile.in: Regenerated.
+
+2011-04-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/18918
+       * caf/mpi.c (_gfortran_caf_init, _gfortran_caf_finalize):
+       Add global variable caf_mpi_initialized and use it for when
+       finalizing.
+
+2011-04-04  Tobias Burnus  <burnus@net-b.de>
+
+       * unix.c: Adapt stat DEFINEs since MinGW64 supports LFS.
+       (fallback_access, open_internal4, compare_file_filename,
+       find_file, file_size, inquire_sequential, inquire_direct,
+       inquire_formatted): Use "struct stat" instead of gfstat_t.
+
+2011-03-27  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/18918
+       * caf/libcaf.h: New - coarray communication library.
+       * caf/mpi.c: New.
+       * caf/single.c: New.
+
+2011-03-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/48030
+       * io/read.c (read_x): Re-implement using fbuf_getc.
+
+2011-03-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR bootstrap/48135
+       * configure.ac (gfortran_use_symver): Handle --disable-symvers.
+       * configure: Regenerate.
+
+2011-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR fortran/35667
+       * io/io.h (convert_infnan): Declare.
+       * io/read.c (convert_infnan): New.
+       (read_f): Use convert_infnan to convert INFs and NANs.
+       * list_read.c (parse_real, read_real): Likewise.
+
+2011-03-19  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/47439
+       * io/unix.c (tempfile): Work around poor mktemp() implementations.
+
+2011-03-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/47883
+       * acinclude.m4: Don't use AC_TRY_ macros.
+       * configure.ac: Likewise.
+       * configure: Regenerate.
+
+2011-03-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/48066
+       * m4/ifunction.m4:  If return array is empty, return.
+       * m4/ifunction_logical.m4:  Likewise.
+       * generated/all_l16.c: Regenerated.
+       * generated/all_l1.c: Regenerated.
+       * generated/all_l2.c: Regenerated.
+       * generated/all_l4.c: Regenerated.
+       * generated/all_l8.c: Regenerated.
+       * generated/any_l16.c: Regenerated.
+       * generated/any_l1.c: Regenerated.
+       * generated/any_l2.c: Regenerated.
+       * generated/any_l4.c: Regenerated.
+       * generated/any_l8.c: Regenerated.
+       * generated/count_16_l.c: Regenerated.
+       * generated/count_1_l.c: Regenerated.
+       * generated/count_2_l.c: Regenerated.
+       * generated/count_4_l.c: Regenerated.
+       * generated/count_8_l.c: Regenerated.
+       * generated/maxloc1_16_i16.c: Regenerated.
+       * generated/maxloc1_16_i1.c: Regenerated.
+       * generated/maxloc1_16_i2.c: Regenerated.
+       * generated/maxloc1_16_i4.c: Regenerated.
+       * generated/maxloc1_16_i8.c: Regenerated.
+       * generated/maxloc1_16_r10.c: Regenerated.
+       * generated/maxloc1_16_r16.c: Regenerated.
+       * generated/maxloc1_16_r4.c: Regenerated.
+       * generated/maxloc1_16_r8.c: Regenerated.
+       * generated/maxloc1_4_i16.c: Regenerated.
+       * generated/maxloc1_4_i1.c: Regenerated.
+       * generated/maxloc1_4_i2.c: Regenerated.
+       * generated/maxloc1_4_i4.c: Regenerated.
+       * generated/maxloc1_4_i8.c: Regenerated.
+       * generated/maxloc1_4_r10.c: Regenerated.
+       * generated/maxloc1_4_r16.c: Regenerated.
+       * generated/maxloc1_4_r4.c: Regenerated.
+       * generated/maxloc1_4_r8.c: Regenerated.
+       * generated/maxloc1_8_i16.c: Regenerated.
+       * generated/maxloc1_8_i1.c: Regenerated.
+       * generated/maxloc1_8_i2.c: Regenerated.
+       * generated/maxloc1_8_i4.c: Regenerated.
+       * generated/maxloc1_8_i8.c: Regenerated.
+       * generated/maxloc1_8_r10.c: Regenerated.
+       * generated/maxloc1_8_r16.c: Regenerated.
+       * generated/maxloc1_8_r4.c: Regenerated.
+       * generated/maxloc1_8_r8.c: Regenerated.
+       * generated/maxval_i16.c: Regenerated.
+       * generated/maxval_i1.c: Regenerated.
+       * generated/maxval_i2.c: Regenerated.
+       * generated/maxval_i4.c: Regenerated.
+       * generated/maxval_i8.c: Regenerated.
+       * generated/maxval_r10.c: Regenerated.
+       * generated/maxval_r16.c: Regenerated.
+       * generated/maxval_r4.c: Regenerated.
+       * generated/maxval_r8.c: Regenerated.
+       * generated/minloc1_16_i16.c: Regenerated.
+       * generated/minloc1_16_i1.c: Regenerated.
+       * generated/minloc1_16_i2.c: Regenerated.
+       * generated/minloc1_16_i4.c: Regenerated.
+       * generated/minloc1_16_i8.c: Regenerated.
+       * generated/minloc1_16_r10.c: Regenerated.
+       * generated/minloc1_16_r16.c: Regenerated.
+       * generated/minloc1_16_r4.c: Regenerated.
+       * generated/minloc1_16_r8.c: Regenerated.
+       * generated/minloc1_4_i16.c: Regenerated.
+       * generated/minloc1_4_i1.c: Regenerated.
+       * generated/minloc1_4_i2.c: Regenerated.
+       * generated/minloc1_4_i4.c: Regenerated.
+       * generated/minloc1_4_i8.c: Regenerated.
+       * generated/minloc1_4_r10.c: Regenerated.
+       * generated/minloc1_4_r16.c: Regenerated.
+       * generated/minloc1_4_r4.c: Regenerated.
+       * generated/minloc1_4_r8.c: Regenerated.
+       * generated/minloc1_8_i16.c: Regenerated.
+       * generated/minloc1_8_i1.c: Regenerated.
+       * generated/minloc1_8_i2.c: Regenerated.
+       * generated/minloc1_8_i4.c: Regenerated.
+       * generated/minloc1_8_i8.c: Regenerated.
+       * generated/minloc1_8_r10.c: Regenerated.
+       * generated/minloc1_8_r16.c: Regenerated.
+       * generated/minloc1_8_r4.c: Regenerated.
+       * generated/minloc1_8_r8.c: Regenerated.
+       * generated/minval_i16.c: Regenerated.
+       * generated/minval_i1.c: Regenerated.
+       * generated/minval_i2.c: Regenerated.
+       * generated/minval_i4.c: Regenerated.
+       * generated/minval_i8.c: Regenerated.
+       * generated/minval_r10.c: Regenerated.
+       * generated/minval_r16.c: Regenerated.
+       * generated/minval_r4.c: Regenerated.
+       * generated/minval_r8.c: Regenerated.
+       * generated/product_c10.c: Regenerated.
+       * generated/product_c16.c: Regenerated.
+       * generated/product_c4.c: Regenerated.
+       * generated/product_c8.c: Regenerated.
+       * generated/product_i16.c: Regenerated.
+       * generated/product_i1.c: Regenerated.
+       * generated/product_i2.c: Regenerated.
+       * generated/product_i4.c: Regenerated.
+       * generated/product_i8.c: Regenerated.
+       * generated/product_r10.c: Regenerated.
+       * generated/product_r16.c: Regenerated.
+       * generated/product_r4.c: Regenerated.
+       * generated/product_r8.c: Regenerated.
+       * generated/sum_c10.c: Regenerated.
+       * generated/sum_c16.c: Regenerated.
+       * generated/sum_c4.c: Regenerated.
+       * generated/sum_c8.c: Regenerated.
+       * generated/sum_i16.c: Regenerated.
+       * generated/sum_i1.c: Regenerated.
+       * generated/sum_i2.c: Regenerated.
+       * generated/sum_i4.c: Regenerated.
+       * generated/sum_i8.c: Regenerated.
+       * generated/sum_r10.c: Regenerated.
+       * generated/sum_r16.c: Regenerated.
+       * generated/sum_r4.c: Regenerated.
+       * generated/sum_r8.c: Regenerated.
+
+2011-03-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/48047
+       * io/write_float.def (write_float): Change MIN_FIELD_WIDTH to 48.
+
+2011-03-04  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47802
+       * intrinsics/ctime.c (strctime): Use builtins to check localtime_r
+       return type.
+
+2011-03-04  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47802
+       * intrinsics/ctime.c (strctime): Don't use return value of
+       localtime_r.
+
+2011-02-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47567
+       * io/write_float.def (output_float): Move handling of w = 0 to after
+       output rounding. Check for zero and set zero_flag accordingly. Set
+       width according to zero_flag. Add better comments.
+
+2011-02-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47778
+       * io/list_read.c (namelist_read): Intialize the error string buffere.
+       If pprev_nl was used during the previous namelist read and the rank
+       was zero, reset the pointer to NULL for the next namelist read.
+
+2011-02-26  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/45165
+       * unix.c (fallback_access): Fix file descriptor leaks.
+
+2011-02-25  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * acinclude.m4 (LIBGFOR_CHECK_FPSETMASK): Set shell variable
+       tested in configure.host.
+       * configure: Regenerate.
+
+2011-02-24  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47802
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+       * configure.ac: Remove checks for ctime and ctime_r, add check for
+       strftime.
+       * intrinsics/date_and_time.c (localtime_r): Move fallback
+       implementation to time_1.h.
+       * intrinsics/time_1.h (localtime_r): Fallback implementation.
+       * intrinsics/ctime.c: Include time_1.h.
+       (ctime_r): Remove fallback implementation.
+       (strctime): New function.
+       (fdate): Use strctime instead of ctime_r.
+       (fdate_sub): Likewise.
+       (ctime): Likewise.
+       (ctime_sub): Likewise.
+
+2011-02-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/47878
+       * io/transfer.c (read_sf): Call fbuf_getptr only at the end,
+       and subtract n, dtp->u.p.sf_seen_eor and seen_comma from it.
+
+2011-02-24  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47802
+       * configure.ac: Add test for POSIX getpwuid_r.
+       * intrinsics/getlog.c (getlog): CPP test for
+       HAVE_POSIX_GETPWUID_R.
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+
+2011-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47567
+       * io/write_float.def (output_float): Remove special case handling of
+       zero with width 1.
+
+2011-02-23  Janne Blomqvist  <jb@gcc.gnu.org>
+           Jerry DeLisle    <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/47694
+       * io/fbuf.h (fbuf_getptr): New inline function.
+       * io/transfer.c (read_sf): Use fbuf_getptr and fbuf_getc to scan
+       through the string instead of fbuf_read.
+
+2011-02-22  Tobias Burnus  <burnus@net-b.de>
+           Kai-Uwe Eckhardt  <kuehro@gmx.de>
+
+       PR libfortran/47830
+       * intrinsics/c99_functions.c (roundl): Make C valid for
+       HAVE_NEXTAFTERL.
+
+2011-02-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47567
+       * io/write_float.def (output_float): Adjust width for F0.d to
+       allow space for negative signs on zero.
+
+2011-02-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47667
+       * io/list_read.c (read_logical): Check for end of line before calling
+       eat_line. (read_integer): Likewise. (parse_real): Don't unget the
+       separator. Check for end of line before calling eat_line.
+       (read_complex): Allow line-end before and after parenthesis and comma.
+       Check for end of line before calling eat_line. (read_real): Check for
+       end of line before calling eat_line.
+
+2011-02-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libfortran/47757
+       * gfortran.map (GFORTRAN_1.4): Export
+       _gfortran_{m,s}i{all,any,parity}_i{1,2,4,8,16} and
+       _gfortran_{cshift0,eoshift{0,2}}_16_char4.
+
+2011-02-15  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/47716
+       PR fortran/47648
+       * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Use check from
+       libquadmath, which uses more features.
+       * configure: Regenerate.
+
+2011-02-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/47642
+       * io/write_float.def (DTOAQ): Use quadmath_snprintf instead of
+       quadmath_flt128tostr.
+       * io/transfer128.c (tmp2): Initialize to quadmath_snprintf instead
+       of quadmath_flt128tostr.
+
+2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Likewise.
+       * configure: Likewise.
+
+2011-02-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47567
+       * io/write_float.def (output_float): Eliminate some redundant code.
+       Adjust width for case of F0.X for values of zero and all other values.
+       Expand cases where '*' is set to give cleaner results.
+
+2011-02-05  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47571
+       * intrinsics/time_1.h (GF_CLOCK_MONOTONIC): Move to system_clock.c.
+       (weak_gettime): Likewise.
+       (gf_gettime): Change API, move weak_gettime() usage to
+       system_clock.c
+       * intrinsics/system_clock.c (GTHREAD_USE_WEAK): Define.
+       (gf_gettime_mono): New function.
+       (system_clock_4): Use gf_gettime_mono().
+       (system_clock_8): Likewise.
+       * intrinsics/date_and_time.c (date_and_time): Update gf_gettime()
+       usage.
+
+2011-02-02  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47571
+       * configure: Regenerated.
+       * configure.ac: Don't add librt to LIBS.
+       * intrinsics/time_1.h (weak_gettime): Weakref trickery for
+       clock_gettime().
+       (gf_gettime): Use weak_gettime() instead of clock_gettime().
+
+2011-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * intrinsics/time_1.h: Include errno.h needed by fallbacks.
+
+2011-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * intrinsics/time_1.h: Fix definition of GF_CLOCK_MONOTONIC macro.
+
+2011-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * configure.ac: Check for clock_gettime().
+       * configure: Regenerated.
+       * config.h.in: Regenerated.
+       * intrinsics/time_1.h (__time_1): Rename to gf_cputime, add
+       times() fallback.
+       (gf_gettime): New function.
+       * intrinsics/cpu_time.c (__cpu_time_1): Update to call gf_cputime.
+       * intrinsics/date_and_time.c (date_and_time): Use gf_gettime.
+       * intrinsics/dtime.c (dtime_sub): Use gf_cputime.
+       * intrinsics/etime.c (etime_sub): Use gf_cputime.
+       * intrinsics/system_clock.c (system_clock_4): Use gf_gettime.
+       (system_clock_8): Use gf_gettime, increase count rate to allow
+       nanosecond precision, remove overflow prone branch.
+
+2011-01-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47434
+       * io/write_float.def (write_infnan): Use calculate_sign to determine
+       if the sign should be given and check field widths accordingly.
+
+2011-01-29  Kai Tietz  <kai.tietz@onevision.com>
+
+       * intrinsics/ctime.c (ctime_r): Improve implementation.
+
+2011-01-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47431
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+       * configure.ac: Add check for ctime_r().
+       * intrinsics/ctime.c (ctime_r): Fallback implementation.
+       (fdate): Use ctime_r() instead of ctime().
+       (fdate_sub): Likewise.
+       (ctime): Likewise.
+       (ctime_sub): Likewise.
+
+2011-01-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47432
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+       * configure.ac: Add check for ttyname_r.
+       * io/unix.h: Add TTY_NAME_MAX, change stream_ttyname prototype.
+       * io/unix.c (stream_ttyname): Use ttyname_r if available, conform
+       to new prototype.
+       * io/inquire.c (inquire_via_unit): Use changed stream_ttyname.
+       * io/intrinsics.c (ttynam_sub): Likewise.
+       (ttynam): Likewise.
+
+2011-01-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47491
+       * configure.ac: Call AC_USE_SYSTEM_EXTENSIONS to enable common
+       extensions.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+
+2011-01-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47285
+       * io/write_float.def (write_infnan): Adjust processor selected width
+       to 3 if NaN.
+
+2011-01-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47285
+       * io/write_float.def (output_float): Return SUCCESS or FAILURE and use
+       the result to set the padding.
+
+2011-01-26  Kai Tietz  <kai.tietz@onevision.com>
+
+       * intrinsics/getlog.c (getlog): Fix label/statement issue.
+
+2011-01-25  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47375
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+       * configure.ac: Add check for getpwuid_r.
+       * intrinsics/getlog.c (getlog): Use getpwuid_r() if available.
+
+2011-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/46267
+       * config.h.in: Regenerated.
+       * configure: Regenerated.
+       * configure.ac: Check presence of strerror_r.
+       * intrinsics/gerror.c (gerror): Use gf_strerror, modify logic.
+       * io/unix.c (get_oserror): Remove.
+       * libgfortran.h (gf_strerror): Add prototype.
+       (get_oserror): Remove prototype.
+       * runtime/error.c (gf_strerror): New function.
+       (os_error): Use gf_strerror instead of get_oserror.
+       (generate_errror): Likewise.
+
+2011-01-17  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/47296
+       * io/unix.c (tempfile): Set opp->file and opp->file_len also if an
+       error occurs.
+
+2011-01-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/46625
+       * io/write_float.def (DTOAQ): Use quadmath_flt128tostr
+       instead of quadmath_dtoa.
+       * io/transfer128.c (tmp1, tmp2): New variables, bring in
+       strtoflt128 and quadmath_flt128tostr.
+       (transfer_real128, transfer_real128_write, transfer_complex128,
+       transfer_complex128_write): Remove tmp1/tmp2 variables.
+       * io/read.c (convert_real): Use strtoflt128 instead of
+       quadmath_strtopQ, adjust for the changed arguments and return
+       value.
+
+2011-01-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47296
+       * io/unix.c (unpack_filename): Return non-zero if the filename passed
+       in is NULL.
+
+2011-01-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/47154
+       * io/list_read.c (namelist_read): Remove calls to hit_eof to avoid the
+       duplicate calls via next_record.
+
+\f
+Copyright (C) 2011 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/l4/pkg/libgfortran/lib/contrib/Makefile.am b/l4/pkg/libgfortran/lib/contrib/Makefile.am
new file mode 100644 (file)
index 0000000..2ff29a8
--- /dev/null
@@ -0,0 +1,1003 @@
+## Process this file with automake to produce Makefile.in
+
+
+ACLOCAL_AMFLAGS = -I .. -I ../config
+
+## May be used by toolexeclibdir.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
+## Symbol versioning (copied from libssp).
+if LIBGFOR_USE_SYMVER
+if LIBGFOR_USE_SYMVER_GNU
+version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
+version_dep = $(srcdir)/gfortran.map
+endif
+if LIBGFOR_USE_SYMVER_SUN
+version_arg = -Wl,-M,gfortran.map-sun
+version_dep = gfortran.map-sun
+gfortran.map-sun : $(srcdir)/gfortran.map \
+               $(top_srcdir)/../contrib/make_sunver.pl \
+               $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
+       perl $(top_srcdir)/../contrib/make_sunver.pl \
+         $(srcdir)/gfortran.map \
+         $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+        `echo $(libgfortran_la_LIBADD) | \
+           sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+        > $@ || (rm -f $@ ; exit 1)
+endif
+else
+version_arg =
+version_dep =
+endif
+
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
+           $(lt_host_flags)
+
+toolexeclib_LTLIBRARIES = libgfortran.la
+toolexeclib_DATA = libgfortran.spec
+libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
+libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+       $(LTLDFLAGS) $(LIBQUADLIB) -lm $(extra_ldflags_libgfortran) \
+       $(version_arg) -Wc,-shared-libgcc
+libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP)
+
+myexeclib_LTLIBRARIES = libgfortranbegin.la
+myexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
+libgfortranbegin_la_SOURCES = fmain.c
+libgfortranbegin_la_LDFLAGS = -static
+libgfortranbegin_la_LINK = $(LINK) $(libgfortranbegin_la_LDFLAGS)
+
+cafexeclib_LTLIBRARIES = libcaf_single.la
+cafexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
+libcaf_single_la_SOURCES = caf/single.c
+libcaf_single_la_LDFLAGS = -static
+libcaf_single_la_DEPENDENCIES = caf/libcaf.h
+libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS)
+
+## io.h conflicts with a system header on some platforms, so
+## use -iquote
+AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
+             -I$(srcdir)/$(MULTISRCTOP)../gcc/config $(LIBQUADINCLUDE) \
+             -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+             -I$(srcdir)/$(MULTISRCTOP)../libgcc \
+             -I$(MULTIBUILDTOP)../libgcc
+
+# Fortran rules for complex multiplication and division
+AM_CFLAGS += -fcx-fortran-rules
+
+# Use -ffunction-sections -fdata-sections if supported by the compiler
+AM_CFLAGS += $(SECTION_FLAGS)
+
+# Some targets require additional compiler options for IEEE compatibility.
+AM_CFLAGS += $(IEEE_FLAGS)
+
+gfor_io_src= \
+io/close.c \
+io/file_pos.c \
+io/format.c \
+io/inquire.c \
+io/intrinsics.c \
+io/list_read.c \
+io/lock.c \
+io/open.c \
+io/read.c \
+io/size_from_kind.c \
+io/transfer.c \
+io/transfer128.c \
+io/unit.c \
+io/unix.c \
+io/write.c \
+io/fbuf.c
+
+gfor_io_headers= \
+io/io.h \
+io/fbuf.h \
+io/format.h \
+io/unix.h
+
+gfor_helper_src= \
+intrinsics/associated.c \
+intrinsics/abort.c \
+intrinsics/access.c \
+intrinsics/args.c \
+intrinsics/bit_intrinsics.c \
+intrinsics/c99_functions.c \
+intrinsics/chdir.c \
+intrinsics/chmod.c \
+intrinsics/clock.c \
+intrinsics/cpu_time.c \
+intrinsics/cshift0.c \
+intrinsics/ctime.c \
+intrinsics/date_and_time.c \
+intrinsics/dtime.c \
+intrinsics/env.c \
+intrinsics/eoshift0.c \
+intrinsics/eoshift2.c \
+intrinsics/erfc_scaled.c \
+intrinsics/etime.c \
+intrinsics/execute_command_line.c \
+intrinsics/exit.c \
+intrinsics/extends_type_of.c \
+intrinsics/fnum.c \
+intrinsics/gerror.c \
+intrinsics/getcwd.c \
+intrinsics/getlog.c \
+intrinsics/getXid.c \
+intrinsics/hostnm.c \
+intrinsics/ierrno.c \
+intrinsics/ishftc.c \
+intrinsics/iso_c_generated_procs.c \
+intrinsics/iso_c_binding.c \
+intrinsics/kill.c \
+intrinsics/link.c \
+intrinsics/malloc.c \
+intrinsics/mvbits.c \
+intrinsics/move_alloc.c \
+intrinsics/pack_generic.c \
+intrinsics/perror.c \
+intrinsics/selected_char_kind.c \
+intrinsics/signal.c \
+intrinsics/size.c \
+intrinsics/sleep.c \
+intrinsics/spread_generic.c \
+intrinsics/string_intrinsics.c \
+intrinsics/system.c \
+intrinsics/rand.c \
+intrinsics/random.c \
+intrinsics/rename.c \
+intrinsics/reshape_generic.c \
+intrinsics/reshape_packed.c \
+intrinsics/selected_int_kind.f90 \
+intrinsics/selected_real_kind.f90 \
+intrinsics/stat.c \
+intrinsics/symlnk.c \
+intrinsics/system_clock.c \
+intrinsics/time.c \
+intrinsics/transpose_generic.c \
+intrinsics/umask.c \
+intrinsics/unlink.c \
+intrinsics/unpack_generic.c \
+runtime/in_pack_generic.c \
+runtime/in_unpack_generic.c
+
+gfor_src= \
+runtime/backtrace.c \
+runtime/bounds.c \
+runtime/compile_options.c \
+runtime/convert_char.c \
+runtime/environ.c \
+runtime/error.c \
+runtime/fpu.c \
+runtime/main.c \
+runtime/memory.c \
+runtime/pause.c \
+runtime/stop.c \
+runtime/string.c \
+runtime/select.c
+
+i_all_c= \
+$(srcdir)/generated/all_l1.c \
+$(srcdir)/generated/all_l2.c \
+$(srcdir)/generated/all_l4.c \
+$(srcdir)/generated/all_l8.c \
+$(srcdir)/generated/all_l16.c
+
+i_any_c= \
+$(srcdir)/generated/any_l1.c \
+$(srcdir)/generated/any_l2.c \
+$(srcdir)/generated/any_l4.c \
+$(srcdir)/generated/any_l8.c \
+$(srcdir)/generated/any_l16.c
+
+i_bessel_c= \
+$(srcdir)/generated/bessel_r4.c \
+$(srcdir)/generated/bessel_r8.c \
+$(srcdir)/generated/bessel_r10.c \
+$(srcdir)/generated/bessel_r16.c
+
+i_count_c= \
+$(srcdir)/generated/count_1_l.c \
+$(srcdir)/generated/count_2_l.c \
+$(srcdir)/generated/count_4_l.c \
+$(srcdir)/generated/count_8_l.c \
+$(srcdir)/generated/count_16_l.c
+
+i_iall_c= \
+$(srcdir)/generated/iall_i1.c \
+$(srcdir)/generated/iall_i2.c \
+$(srcdir)/generated/iall_i4.c \
+$(srcdir)/generated/iall_i8.c \
+$(srcdir)/generated/iall_i16.c
+
+i_iany_c= \
+$(srcdir)/generated/iany_i1.c \
+$(srcdir)/generated/iany_i2.c \
+$(srcdir)/generated/iany_i4.c \
+$(srcdir)/generated/iany_i8.c \
+$(srcdir)/generated/iany_i16.c
+
+i_iparity_c= \
+$(srcdir)/generated/iparity_i1.c \
+$(srcdir)/generated/iparity_i2.c \
+$(srcdir)/generated/iparity_i4.c \
+$(srcdir)/generated/iparity_i8.c \
+$(srcdir)/generated/iparity_i16.c
+
+i_maxloc0_c= \
+$(srcdir)/generated/maxloc0_4_i1.c \
+$(srcdir)/generated/maxloc0_8_i1.c \
+$(srcdir)/generated/maxloc0_16_i1.c \
+$(srcdir)/generated/maxloc0_4_i2.c \
+$(srcdir)/generated/maxloc0_8_i2.c \
+$(srcdir)/generated/maxloc0_16_i2.c \
+$(srcdir)/generated/maxloc0_4_i4.c \
+$(srcdir)/generated/maxloc0_8_i4.c \
+$(srcdir)/generated/maxloc0_16_i4.c \
+$(srcdir)/generated/maxloc0_4_i8.c \
+$(srcdir)/generated/maxloc0_8_i8.c \
+$(srcdir)/generated/maxloc0_16_i8.c \
+$(srcdir)/generated/maxloc0_4_i16.c \
+$(srcdir)/generated/maxloc0_8_i16.c \
+$(srcdir)/generated/maxloc0_16_i16.c \
+$(srcdir)/generated/maxloc0_4_r4.c \
+$(srcdir)/generated/maxloc0_8_r4.c \
+$(srcdir)/generated/maxloc0_16_r4.c \
+$(srcdir)/generated/maxloc0_4_r8.c \
+$(srcdir)/generated/maxloc0_8_r8.c \
+$(srcdir)/generated/maxloc0_16_r8.c \
+$(srcdir)/generated/maxloc0_4_r10.c \
+$(srcdir)/generated/maxloc0_8_r10.c \
+$(srcdir)/generated/maxloc0_16_r10.c \
+$(srcdir)/generated/maxloc0_4_r16.c \
+$(srcdir)/generated/maxloc0_8_r16.c \
+$(srcdir)/generated/maxloc0_16_r16.c
+
+i_maxloc1_c= \
+$(srcdir)/generated/maxloc1_4_i1.c \
+$(srcdir)/generated/maxloc1_8_i1.c \
+$(srcdir)/generated/maxloc1_16_i1.c \
+$(srcdir)/generated/maxloc1_4_i2.c \
+$(srcdir)/generated/maxloc1_8_i2.c \
+$(srcdir)/generated/maxloc1_16_i2.c \
+$(srcdir)/generated/maxloc1_4_i4.c \
+$(srcdir)/generated/maxloc1_8_i4.c \
+$(srcdir)/generated/maxloc1_16_i4.c \
+$(srcdir)/generated/maxloc1_4_i8.c \
+$(srcdir)/generated/maxloc1_8_i8.c \
+$(srcdir)/generated/maxloc1_16_i8.c \
+$(srcdir)/generated/maxloc1_4_i16.c \
+$(srcdir)/generated/maxloc1_8_i16.c \
+$(srcdir)/generated/maxloc1_16_i16.c \
+$(srcdir)/generated/maxloc1_4_r4.c \
+$(srcdir)/generated/maxloc1_8_r4.c \
+$(srcdir)/generated/maxloc1_16_r4.c \
+$(srcdir)/generated/maxloc1_4_r8.c \
+$(srcdir)/generated/maxloc1_8_r8.c \
+$(srcdir)/generated/maxloc1_16_r8.c \
+$(srcdir)/generated/maxloc1_4_r10.c \
+$(srcdir)/generated/maxloc1_8_r10.c \
+$(srcdir)/generated/maxloc1_16_r10.c \
+$(srcdir)/generated/maxloc1_4_r16.c \
+$(srcdir)/generated/maxloc1_8_r16.c \
+$(srcdir)/generated/maxloc1_16_r16.c
+
+i_maxval_c= \
+$(srcdir)/generated/maxval_i1.c \
+$(srcdir)/generated/maxval_i2.c \
+$(srcdir)/generated/maxval_i4.c \
+$(srcdir)/generated/maxval_i8.c \
+$(srcdir)/generated/maxval_i16.c \
+$(srcdir)/generated/maxval_r4.c \
+$(srcdir)/generated/maxval_r8.c \
+$(srcdir)/generated/maxval_r10.c \
+$(srcdir)/generated/maxval_r16.c
+
+i_minloc0_c= \
+$(srcdir)/generated/minloc0_4_i1.c \
+$(srcdir)/generated/minloc0_8_i1.c \
+$(srcdir)/generated/minloc0_16_i1.c \
+$(srcdir)/generated/minloc0_4_i2.c \
+$(srcdir)/generated/minloc0_8_i2.c \
+$(srcdir)/generated/minloc0_16_i2.c \
+$(srcdir)/generated/minloc0_4_i4.c \
+$(srcdir)/generated/minloc0_8_i4.c \
+$(srcdir)/generated/minloc0_16_i4.c \
+$(srcdir)/generated/minloc0_4_i8.c \
+$(srcdir)/generated/minloc0_8_i8.c \
+$(srcdir)/generated/minloc0_16_i8.c \
+$(srcdir)/generated/minloc0_4_i16.c \
+$(srcdir)/generated/minloc0_8_i16.c \
+$(srcdir)/generated/minloc0_16_i16.c \
+$(srcdir)/generated/minloc0_4_r4.c \
+$(srcdir)/generated/minloc0_8_r4.c \
+$(srcdir)/generated/minloc0_16_r4.c \
+$(srcdir)/generated/minloc0_4_r8.c \
+$(srcdir)/generated/minloc0_8_r8.c \
+$(srcdir)/generated/minloc0_16_r8.c \
+$(srcdir)/generated/minloc0_4_r10.c \
+$(srcdir)/generated/minloc0_8_r10.c \
+$(srcdir)/generated/minloc0_16_r10.c \
+$(srcdir)/generated/minloc0_4_r16.c \
+$(srcdir)/generated/minloc0_8_r16.c \
+$(srcdir)/generated/minloc0_16_r16.c
+
+i_minloc1_c= \
+$(srcdir)/generated/minloc1_4_i1.c \
+$(srcdir)/generated/minloc1_8_i1.c \
+$(srcdir)/generated/minloc1_16_i1.c \
+$(srcdir)/generated/minloc1_4_i2.c \
+$(srcdir)/generated/minloc1_8_i2.c \
+$(srcdir)/generated/minloc1_16_i2.c \
+$(srcdir)/generated/minloc1_4_i4.c \
+$(srcdir)/generated/minloc1_8_i4.c \
+$(srcdir)/generated/minloc1_16_i4.c \
+$(srcdir)/generated/minloc1_4_i8.c \
+$(srcdir)/generated/minloc1_8_i8.c \
+$(srcdir)/generated/minloc1_16_i8.c \
+$(srcdir)/generated/minloc1_4_i16.c \
+$(srcdir)/generated/minloc1_8_i16.c \
+$(srcdir)/generated/minloc1_16_i16.c \
+$(srcdir)/generated/minloc1_4_r4.c \
+$(srcdir)/generated/minloc1_8_r4.c \
+$(srcdir)/generated/minloc1_16_r4.c \
+$(srcdir)/generated/minloc1_4_r8.c \
+$(srcdir)/generated/minloc1_8_r8.c \
+$(srcdir)/generated/minloc1_16_r8.c \
+$(srcdir)/generated/minloc1_4_r10.c \
+$(srcdir)/generated/minloc1_8_r10.c \
+$(srcdir)/generated/minloc1_16_r10.c \
+$(srcdir)/generated/minloc1_4_r16.c \
+$(srcdir)/generated/minloc1_8_r16.c \
+$(srcdir)/generated/minloc1_16_r16.c
+
+i_minval_c= \
+$(srcdir)/generated/minval_i1.c \
+$(srcdir)/generated/minval_i2.c \
+$(srcdir)/generated/minval_i4.c \
+$(srcdir)/generated/minval_i8.c \
+$(srcdir)/generated/minval_i16.c \
+$(srcdir)/generated/minval_r4.c \
+$(srcdir)/generated/minval_r8.c \
+$(srcdir)/generated/minval_r10.c \
+$(srcdir)/generated/minval_r16.c
+
+i_norm2_c= \
+$(srcdir)/generated/norm2_r4.c \
+$(srcdir)/generated/norm2_r8.c \
+$(srcdir)/generated/norm2_r10.c \
+$(srcdir)/generated/norm2_r16.c
+
+i_parity_c = \
+$(srcdir)/generated/parity_l1.c \
+$(srcdir)/generated/parity_l2.c \
+$(srcdir)/generated/parity_l4.c \
+$(srcdir)/generated/parity_l8.c \
+$(srcdir)/generated/parity_l16.c
+
+i_sum_c= \
+$(srcdir)/generated/sum_i1.c \
+$(srcdir)/generated/sum_i2.c \
+$(srcdir)/generated/sum_i4.c \
+$(srcdir)/generated/sum_i8.c \
+$(srcdir)/generated/sum_i16.c \
+$(srcdir)/generated/sum_r4.c \
+$(srcdir)/generated/sum_r8.c \
+$(srcdir)/generated/sum_r10.c \
+$(srcdir)/generated/sum_r16.c \
+$(srcdir)/generated/sum_c4.c \
+$(srcdir)/generated/sum_c8.c \
+$(srcdir)/generated/sum_c10.c \
+$(srcdir)/generated/sum_c16.c
+
+i_product_c= \
+$(srcdir)/generated/product_i1.c \
+$(srcdir)/generated/product_i2.c \
+$(srcdir)/generated/product_i4.c \
+$(srcdir)/generated/product_i8.c \
+$(srcdir)/generated/product_i16.c \
+$(srcdir)/generated/product_r4.c \
+$(srcdir)/generated/product_r8.c \
+$(srcdir)/generated/product_r10.c \
+$(srcdir)/generated/product_r16.c \
+$(srcdir)/generated/product_c4.c \
+$(srcdir)/generated/product_c8.c \
+$(srcdir)/generated/product_c10.c \
+$(srcdir)/generated/product_c16.c
+
+i_matmul_c= \
+$(srcdir)/generated/matmul_i1.c \
+$(srcdir)/generated/matmul_i2.c \
+$(srcdir)/generated/matmul_i4.c \
+$(srcdir)/generated/matmul_i8.c \
+$(srcdir)/generated/matmul_i16.c \
+$(srcdir)/generated/matmul_r4.c \
+$(srcdir)/generated/matmul_r8.c \
+$(srcdir)/generated/matmul_r10.c \
+$(srcdir)/generated/matmul_r16.c \
+$(srcdir)/generated/matmul_c4.c \
+$(srcdir)/generated/matmul_c8.c \
+$(srcdir)/generated/matmul_c10.c \
+$(srcdir)/generated/matmul_c16.c
+
+i_matmull_c= \
+$(srcdir)/generated/matmul_l4.c \
+$(srcdir)/generated/matmul_l8.c \
+$(srcdir)/generated/matmul_l16.c
+
+i_transpose_c= \
+$(srcdir)/generated/transpose_i4.c \
+$(srcdir)/generated/transpose_i8.c \
+$(srcdir)/generated/transpose_i16.c \
+$(srcdir)/generated/transpose_r4.c \
+$(srcdir)/generated/transpose_r8.c \
+$(srcdir)/generated/transpose_r10.c \
+$(srcdir)/generated/transpose_r16.c \
+$(srcdir)/generated/transpose_c4.c \
+$(srcdir)/generated/transpose_c8.c \
+$(srcdir)/generated/transpose_c10.c \
+$(srcdir)/generated/transpose_c16.c
+
+i_shape_c= \
+$(srcdir)/generated/shape_i4.c \
+$(srcdir)/generated/shape_i8.c \
+$(srcdir)/generated/shape_i16.c
+
+i_reshape_c= \
+$(srcdir)/generated/reshape_i4.c \
+$(srcdir)/generated/reshape_i8.c \
+$(srcdir)/generated/reshape_i16.c \
+$(srcdir)/generated/reshape_r4.c \
+$(srcdir)/generated/reshape_r8.c \
+$(srcdir)/generated/reshape_r10.c \
+$(srcdir)/generated/reshape_r16.c \
+$(srcdir)/generated/reshape_c4.c \
+$(srcdir)/generated/reshape_c8.c \
+$(srcdir)/generated/reshape_c10.c \
+$(srcdir)/generated/reshape_c16.c
+
+i_eoshift1_c= \
+$(srcdir)/generated/eoshift1_4.c \
+$(srcdir)/generated/eoshift1_8.c \
+$(srcdir)/generated/eoshift1_16.c
+
+i_eoshift3_c= \
+$(srcdir)/generated/eoshift3_4.c \
+$(srcdir)/generated/eoshift3_8.c \
+$(srcdir)/generated/eoshift3_16.c
+
+i_cshift0_c= \
+$(srcdir)/generated/cshift0_i1.c \
+$(srcdir)/generated/cshift0_i2.c \
+$(srcdir)/generated/cshift0_i4.c \
+$(srcdir)/generated/cshift0_i8.c \
+$(srcdir)/generated/cshift0_i16.c \
+$(srcdir)/generated/cshift0_r4.c \
+$(srcdir)/generated/cshift0_r8.c \
+$(srcdir)/generated/cshift0_r10.c \
+$(srcdir)/generated/cshift0_r16.c \
+$(srcdir)/generated/cshift0_c4.c \
+$(srcdir)/generated/cshift0_c8.c \
+$(srcdir)/generated/cshift0_c10.c \
+$(srcdir)/generated/cshift0_c16.c
+
+i_cshift1_c= \
+$(srcdir)/generated/cshift1_4.c \
+$(srcdir)/generated/cshift1_8.c \
+$(srcdir)/generated/cshift1_16.c
+
+in_pack_c = \
+$(srcdir)/generated/in_pack_i1.c \
+$(srcdir)/generated/in_pack_i2.c \
+$(srcdir)/generated/in_pack_i4.c \
+$(srcdir)/generated/in_pack_i8.c \
+$(srcdir)/generated/in_pack_i16.c \
+$(srcdir)/generated/in_pack_r4.c \
+$(srcdir)/generated/in_pack_r8.c \
+$(srcdir)/generated/in_pack_r10.c \
+$(srcdir)/generated/in_pack_r16.c \
+$(srcdir)/generated/in_pack_c4.c \
+$(srcdir)/generated/in_pack_c8.c \
+$(srcdir)/generated/in_pack_c10.c \
+$(srcdir)/generated/in_pack_c16.c
+
+in_unpack_c = \
+$(srcdir)/generated/in_unpack_i1.c \
+$(srcdir)/generated/in_unpack_i2.c \
+$(srcdir)/generated/in_unpack_i4.c \
+$(srcdir)/generated/in_unpack_i8.c \
+$(srcdir)/generated/in_unpack_i16.c \
+$(srcdir)/generated/in_unpack_r4.c \
+$(srcdir)/generated/in_unpack_r8.c \
+$(srcdir)/generated/in_unpack_r10.c \
+$(srcdir)/generated/in_unpack_r16.c \
+$(srcdir)/generated/in_unpack_c4.c \
+$(srcdir)/generated/in_unpack_c8.c \
+$(srcdir)/generated/in_unpack_c10.c \
+$(srcdir)/generated/in_unpack_c16.c
+
+i_exponent_c = \
+$(srcdir)/generated/exponent_r4.c \
+$(srcdir)/generated/exponent_r8.c \
+$(srcdir)/generated/exponent_r10.c \
+$(srcdir)/generated/exponent_r16.c
+
+i_spacing_c = \
+$(srcdir)/generated/spacing_r4.c \
+$(srcdir)/generated/spacing_r8.c \
+$(srcdir)/generated/spacing_r10.c \
+$(srcdir)/generated/spacing_r16.c
+
+i_rrspacing_c = \
+$(srcdir)/generated/rrspacing_r4.c \
+$(srcdir)/generated/rrspacing_r8.c \
+$(srcdir)/generated/rrspacing_r10.c \
+$(srcdir)/generated/rrspacing_r16.c
+
+i_fraction_c = \
+$(srcdir)/generated/fraction_r4.c \
+$(srcdir)/generated/fraction_r8.c \
+$(srcdir)/generated/fraction_r10.c \
+$(srcdir)/generated/fraction_r16.c
+
+i_nearest_c = \
+$(srcdir)/generated/nearest_r4.c \
+$(srcdir)/generated/nearest_r8.c \
+$(srcdir)/generated/nearest_r10.c \
+$(srcdir)/generated/nearest_r16.c
+
+i_set_exponent_c = \
+$(srcdir)/generated/set_exponent_r4.c \
+$(srcdir)/generated/set_exponent_r8.c \
+$(srcdir)/generated/set_exponent_r10.c \
+$(srcdir)/generated/set_exponent_r16.c
+
+i_pow_c = \
+$(srcdir)/generated/pow_i4_i4.c \
+$(srcdir)/generated/pow_i8_i4.c \
+$(srcdir)/generated/pow_i16_i4.c \
+$(srcdir)/generated/pow_r16_i4.c \
+$(srcdir)/generated/pow_c4_i4.c \
+$(srcdir)/generated/pow_c8_i4.c \
+$(srcdir)/generated/pow_c10_i4.c \
+$(srcdir)/generated/pow_c16_i4.c \
+$(srcdir)/generated/pow_i4_i8.c \
+$(srcdir)/generated/pow_i8_i8.c \
+$(srcdir)/generated/pow_i16_i8.c \
+$(srcdir)/generated/pow_r4_i8.c \
+$(srcdir)/generated/pow_r8_i8.c \
+$(srcdir)/generated/pow_r10_i8.c \
+$(srcdir)/generated/pow_r16_i8.c \
+$(srcdir)/generated/pow_c4_i8.c \
+$(srcdir)/generated/pow_c8_i8.c \
+$(srcdir)/generated/pow_c10_i8.c \
+$(srcdir)/generated/pow_c16_i8.c \
+$(srcdir)/generated/pow_i4_i16.c \
+$(srcdir)/generated/pow_i8_i16.c \
+$(srcdir)/generated/pow_i16_i16.c \
+$(srcdir)/generated/pow_r4_i16.c \
+$(srcdir)/generated/pow_r8_i16.c \
+$(srcdir)/generated/pow_r10_i16.c \
+$(srcdir)/generated/pow_r16_i16.c \
+$(srcdir)/generated/pow_c4_i16.c \
+$(srcdir)/generated/pow_c8_i16.c \
+$(srcdir)/generated/pow_c10_i16.c \
+$(srcdir)/generated/pow_c16_i16.c
+
+i_pack_c = \
+$(srcdir)/generated/pack_i1.c \
+$(srcdir)/generated/pack_i2.c \
+$(srcdir)/generated/pack_i4.c \
+$(srcdir)/generated/pack_i8.c \
+$(srcdir)/generated/pack_i16.c \
+$(srcdir)/generated/pack_r4.c \
+$(srcdir)/generated/pack_r8.c \
+$(srcdir)/generated/pack_r10.c \
+$(srcdir)/generated/pack_r16.c \
+$(srcdir)/generated/pack_c4.c \
+$(srcdir)/generated/pack_c8.c \
+$(srcdir)/generated/pack_c10.c \
+$(srcdir)/generated/pack_c16.c
+
+i_unpack_c = \
+$(srcdir)/generated/unpack_i1.c \
+$(srcdir)/generated/unpack_i2.c \
+$(srcdir)/generated/unpack_i4.c \
+$(srcdir)/generated/unpack_i8.c \
+$(srcdir)/generated/unpack_i16.c \
+$(srcdir)/generated/unpack_r4.c \
+$(srcdir)/generated/unpack_r8.c \
+$(srcdir)/generated/unpack_r10.c \
+$(srcdir)/generated/unpack_r16.c \
+$(srcdir)/generated/unpack_c4.c \
+$(srcdir)/generated/unpack_c8.c \
+$(srcdir)/generated/unpack_c10.c \
+$(srcdir)/generated/unpack_c16.c
+
+i_spread_c = \
+$(srcdir)/generated/spread_i1.c \
+$(srcdir)/generated/spread_i2.c \
+$(srcdir)/generated/spread_i4.c \
+$(srcdir)/generated/spread_i8.c \
+$(srcdir)/generated/spread_i16.c \
+$(srcdir)/generated/spread_r4.c \
+$(srcdir)/generated/spread_r8.c \
+$(srcdir)/generated/spread_r10.c \
+$(srcdir)/generated/spread_r16.c \
+$(srcdir)/generated/spread_c4.c \
+$(srcdir)/generated/spread_c8.c \
+$(srcdir)/generated/spread_c10.c \
+$(srcdir)/generated/spread_c16.c 
+
+m4_files= m4/iparm.m4 m4/ifunction.m4 m4/iforeach.m4 m4/all.m4 \
+    m4/any.m4 m4/count.m4 m4/maxloc0.m4 m4/maxloc1.m4 m4/maxval.m4 \
+    m4/minloc0.m4 m4/minloc1.m4 m4/minval.m4 m4/product.m4 m4/sum.m4 \
+    m4/matmul.m4 m4/matmull.m4 m4/ifunction_logical.m4 \
+    m4/ctrig.m4 m4/cexp.m4 m4/chyp.m4 m4/mtype.m4 \
+    m4/specific.m4 m4/specific2.m4 m4/head.m4 m4/shape.m4 m4/reshape.m4 \
+    m4/transpose.m4 m4/eoshift1.m4 m4/eoshift3.m4 m4/exponent.m4 \
+    m4/fraction.m4 m4/nearest.m4 m4/set_exponent.m4 m4/pow.m4 \
+    m4/misc_specifics.m4 m4/rrspacing.m4 m4/spacing.m4 m4/pack.m4 \
+    m4/unpack.m4 m4/spread.m4 m4/bessel.m4 m4/norm2.m4 m4/parity.m4 \
+    m4/iall.m4 m4/iany.m4 m4/iparity.m4
+
+gfor_built_src= $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \
+    $(i_maxloc1_c) $(i_maxval_c) $(i_minloc0_c) $(i_minloc1_c) $(i_minval_c) \
+    $(i_product_c) $(i_sum_c) $(i_bessel_c) $(i_iall_c) $(i_iany_c) \
+    $(i_iparity_c) $(i_norm2_c) $(i_parity_c) \
+    $(i_matmul_c) $(i_matmull_c) $(i_transpose_c) $(i_shape_c) $(i_eoshift1_c) \
+    $(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \
+    $(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \
+    $(i_pow_c) $(i_rrspacing_c) $(i_spacing_c) $(i_pack_c) $(i_unpack_c) \
+    $(i_spread_c) selected_int_kind.inc selected_real_kind.inc kinds.h \
+    $(i_cshift0_c) kinds.inc c99_protos.inc fpu-target.h
+
+# Machine generated specifics
+gfor_built_specific_src= \
+$(srcdir)/generated/_abs_c4.F90 \
+$(srcdir)/generated/_abs_c8.F90 \
+$(srcdir)/generated/_abs_c10.F90 \
+$(srcdir)/generated/_abs_c16.F90 \
+$(srcdir)/generated/_abs_i4.F90 \
+$(srcdir)/generated/_abs_i8.F90 \
+$(srcdir)/generated/_abs_i16.F90 \
+$(srcdir)/generated/_abs_r4.F90 \
+$(srcdir)/generated/_abs_r8.F90 \
+$(srcdir)/generated/_abs_r10.F90 \
+$(srcdir)/generated/_abs_r16.F90 \
+$(srcdir)/generated/_aimag_c4.F90 \
+$(srcdir)/generated/_aimag_c8.F90 \
+$(srcdir)/generated/_aimag_c10.F90 \
+$(srcdir)/generated/_aimag_c16.F90 \
+$(srcdir)/generated/_exp_r4.F90 \
+$(srcdir)/generated/_exp_r8.F90 \
+$(srcdir)/generated/_exp_r10.F90 \
+$(srcdir)/generated/_exp_r16.F90 \
+$(srcdir)/generated/_exp_c4.F90 \
+$(srcdir)/generated/_exp_c8.F90 \
+$(srcdir)/generated/_exp_c10.F90 \
+$(srcdir)/generated/_exp_c16.F90 \
+$(srcdir)/generated/_log_r4.F90 \
+$(srcdir)/generated/_log_r8.F90 \
+$(srcdir)/generated/_log_r10.F90 \
+$(srcdir)/generated/_log_r16.F90 \
+$(srcdir)/generated/_log_c4.F90 \
+$(srcdir)/generated/_log_c8.F90 \
+$(srcdir)/generated/_log_c10.F90 \
+$(srcdir)/generated/_log_c16.F90 \
+$(srcdir)/generated/_log10_r4.F90 \
+$(srcdir)/generated/_log10_r8.F90 \
+$(srcdir)/generated/_log10_r10.F90 \
+$(srcdir)/generated/_log10_r16.F90 \
+$(srcdir)/generated/_sqrt_r4.F90 \
+$(srcdir)/generated/_sqrt_r8.F90 \
+$(srcdir)/generated/_sqrt_r10.F90 \
+$(srcdir)/generated/_sqrt_r16.F90 \
+$(srcdir)/generated/_sqrt_c4.F90 \
+$(srcdir)/generated/_sqrt_c8.F90 \
+$(srcdir)/generated/_sqrt_c10.F90 \
+$(srcdir)/generated/_sqrt_c16.F90 \
+$(srcdir)/generated/_asin_r4.F90 \
+$(srcdir)/generated/_asin_r8.F90 \
+$(srcdir)/generated/_asin_r10.F90 \
+$(srcdir)/generated/_asin_r16.F90 \
+$(srcdir)/generated/_asinh_r4.F90 \
+$(srcdir)/generated/_asinh_r8.F90 \
+$(srcdir)/generated/_asinh_r10.F90 \
+$(srcdir)/generated/_asinh_r16.F90 \
+$(srcdir)/generated/_acos_r4.F90 \
+$(srcdir)/generated/_acos_r8.F90 \
+$(srcdir)/generated/_acos_r10.F90 \
+$(srcdir)/generated/_acos_r16.F90 \
+$(srcdir)/generated/_acosh_r4.F90 \
+$(srcdir)/generated/_acosh_r8.F90 \
+$(srcdir)/generated/_acosh_r10.F90 \
+$(srcdir)/generated/_acosh_r16.F90 \
+$(srcdir)/generated/_atan_r4.F90 \
+$(srcdir)/generated/_atan_r8.F90 \
+$(srcdir)/generated/_atan_r10.F90 \
+$(srcdir)/generated/_atan_r16.F90 \
+$(srcdir)/generated/_atanh_r4.F90 \
+$(srcdir)/generated/_atanh_r8.F90 \
+$(srcdir)/generated/_atanh_r10.F90 \
+$(srcdir)/generated/_atanh_r16.F90 \
+$(srcdir)/generated/_sin_r4.F90 \
+$(srcdir)/generated/_sin_r8.F90 \
+$(srcdir)/generated/_sin_r10.F90 \
+$(srcdir)/generated/_sin_r16.F90 \
+$(srcdir)/generated/_sin_c4.F90 \
+$(srcdir)/generated/_sin_c8.F90 \
+$(srcdir)/generated/_sin_c10.F90 \
+$(srcdir)/generated/_sin_c16.F90 \
+$(srcdir)/generated/_cos_r4.F90 \
+$(srcdir)/generated/_cos_r8.F90 \
+$(srcdir)/generated/_cos_r10.F90 \
+$(srcdir)/generated/_cos_r16.F90 \
+$(srcdir)/generated/_cos_c4.F90 \
+$(srcdir)/generated/_cos_c8.F90 \
+$(srcdir)/generated/_cos_c10.F90 \
+$(srcdir)/generated/_cos_c16.F90 \
+$(srcdir)/generated/_tan_r4.F90 \
+$(srcdir)/generated/_tan_r8.F90 \
+$(srcdir)/generated/_tan_r10.F90 \
+$(srcdir)/generated/_tan_r16.F90 \
+$(srcdir)/generated/_sinh_r4.F90 \
+$(srcdir)/generated/_sinh_r8.F90 \
+$(srcdir)/generated/_sinh_r10.F90 \
+$(srcdir)/generated/_sinh_r16.F90 \
+$(srcdir)/generated/_cosh_r4.F90 \
+$(srcdir)/generated/_cosh_r8.F90 \
+$(srcdir)/generated/_cosh_r10.F90 \
+$(srcdir)/generated/_cosh_r16.F90 \
+$(srcdir)/generated/_tanh_r4.F90 \
+$(srcdir)/generated/_tanh_r8.F90 \
+$(srcdir)/generated/_tanh_r10.F90 \
+$(srcdir)/generated/_tanh_r16.F90 \
+$(srcdir)/generated/_conjg_c4.F90 \
+$(srcdir)/generated/_conjg_c8.F90 \
+$(srcdir)/generated/_conjg_c10.F90 \
+$(srcdir)/generated/_conjg_c16.F90 \
+$(srcdir)/generated/_aint_r4.F90 \
+$(srcdir)/generated/_aint_r8.F90 \
+$(srcdir)/generated/_aint_r10.F90 \
+$(srcdir)/generated/_aint_r16.F90 \
+$(srcdir)/generated/_anint_r4.F90 \
+$(srcdir)/generated/_anint_r8.F90 \
+$(srcdir)/generated/_anint_r10.F90 \
+$(srcdir)/generated/_anint_r16.F90
+
+gfor_built_specific2_src= \
+$(srcdir)/generated/_sign_i4.F90 \
+$(srcdir)/generated/_sign_i8.F90 \
+$(srcdir)/generated/_sign_i16.F90 \
+$(srcdir)/generated/_sign_r4.F90 \
+$(srcdir)/generated/_sign_r8.F90 \
+$(srcdir)/generated/_sign_r10.F90 \
+$(srcdir)/generated/_sign_r16.F90 \
+$(srcdir)/generated/_dim_i4.F90 \
+$(srcdir)/generated/_dim_i8.F90 \
+$(srcdir)/generated/_dim_i16.F90 \
+$(srcdir)/generated/_dim_r4.F90 \
+$(srcdir)/generated/_dim_r8.F90 \
+$(srcdir)/generated/_dim_r10.F90 \
+$(srcdir)/generated/_dim_r16.F90 \
+$(srcdir)/generated/_atan2_r4.F90 \
+$(srcdir)/generated/_atan2_r8.F90 \
+$(srcdir)/generated/_atan2_r10.F90 \
+$(srcdir)/generated/_atan2_r16.F90 \
+$(srcdir)/generated/_mod_i4.F90 \
+$(srcdir)/generated/_mod_i8.F90 \
+$(srcdir)/generated/_mod_i16.F90 \
+$(srcdir)/generated/_mod_r4.F90 \
+$(srcdir)/generated/_mod_r8.F90 \
+$(srcdir)/generated/_mod_r10.F90 \
+$(srcdir)/generated/_mod_r16.F90
+
+gfor_misc_specifics = $(srcdir)/generated/misc_specifics.F90
+
+gfor_specific_src= \
+$(gfor_built_specific_src) \
+$(gfor_built_specific2_src) \
+$(gfor_misc_specifics) \
+intrinsics/dprod_r8.f90 \
+intrinsics/f2c_specifics.F90
+
+# Turn on vectorization and loop unrolling for matmul.
+$(patsubst %.c,%.lo,$(notdir $(i_matmul_c))): AM_CFLAGS += -ftree-vectorize -funroll-loops
+# Logical matmul doesn't vectorize.
+$(patsubst %.c,%.lo,$(notdir $(i_matmull_c))): AM_CFLAGS += -funroll-loops
+
+# Add the -fallow-leading-underscore option when needed
+$(patsubst %.F90,%.lo,$(patsubst %.f90,%.lo,$(notdir $(gfor_specific_src)))): AM_FCFLAGS += -fallow-leading-underscore
+selected_real_kind.lo selected_int_kind.lo: AM_FCFLAGS += -fallow-leading-underscore
+
+BUILT_SOURCES=$(gfor_built_src) $(gfor_built_specific_src) \
+    $(gfor_built_specific2_src) $(gfor_misc_specifics)
+
+prereq_SRC = $(gfor_src) $(gfor_built_src) $(gfor_io_src) \
+    $(gfor_helper_src) $(gfor_io_headers) $(gfor_specific_src)
+
+if onestep
+# dummy sources for libtool
+BUILT_SOURCES+=libgfortran_c.c libgfortran_f.f90
+libgfortran_c.c libgfortran_f.f90 libgfortran_F.F90:
+       echo > $@
+# overrides for libtool perusing the dummy sources
+libgfortran_c.o: $(filter %.c,$(prereq_SRC))
+       $(COMPILE) -c $^ -o $@ -combine
+
+libgfortran_c.lo: $(filter %.c,$(prereq_SRC))
+       $(LTCOMPILE) -c -o $@ $^ -combine
+
+#libgfortran_f.o: $(filter %.f %.f90,$(prereq_SRC))
+#      $(FCCOMPILE) -c $^ -o $@ -combine
+
+#libgfortran_f.lo: $(filter %.f %.f90,$(prereq_SRC))
+#      $(LTFCCOMPILE) -c -o $@ $^ -combine
+# not currently used:
+#libgfortran_F.o: $(filter %.F %.F90,$(prereq_SRC))
+#      $(PPFCCOMPILE) -c $^ -o $@ -combine
+#
+#libgfortran_F.lo: 
+#      $(LTPPFCCOMPILE) -c -o $@ $^ -combine
+
+libgfortran_la_SOURCES = libgfortran_c.c $(filter-out %.c,$(prereq_SRC))
+
+else
+libgfortran_la_SOURCES = $(prereq_SRC)
+
+endif
+
+I_M4_DEPS=m4/iparm.m4
+I_M4_DEPS0=$(I_M4_DEPS) m4/iforeach.m4
+I_M4_DEPS1=$(I_M4_DEPS) m4/ifunction.m4
+I_M4_DEPS2=$(I_M4_DEPS) m4/ifunction_logical.m4
+
+kinds.h: $(srcdir)/mk-kinds-h.sh
+       $(SHELL) $(srcdir)/mk-kinds-h.sh '$(FCCOMPILE)' > $@ || rm $@
+
+kinds.inc: kinds.h
+       grep '^#' < kinds.h > $@
+
+c99_protos.inc: $(srcdir)/c99_protos.h
+       grep '^#' < $(srcdir)/c99_protos.h > $@
+
+selected_int_kind.inc: $(srcdir)/mk-sik-inc.sh
+       $(SHELL) $(srcdir)/mk-sik-inc.sh '$(FCCOMPILE)' > $@ || rm $@
+
+selected_real_kind.inc: $(srcdir)/mk-srk-inc.sh
+       $(SHELL) $(srcdir)/mk-srk-inc.sh '$(FCCOMPILE)' > $@ || rm $@
+
+fpu-target.h: $(srcdir)/$(FPU_HOST_HEADER)
+       cp $(srcdir)/$(FPU_HOST_HEADER) $@
+
+## A 'normal' build shouldn't need to regenerate these
+## so we only include them in maintainer mode
+
+if MAINTAINER_MODE
+$(i_all_c): m4/all.m4 $(I_M4_DEPS2)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 all.m4 > $@
+
+$(i_bessel_c): m4/bessel.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 bessel.m4 > $@
+
+$(i_any_c): m4/any.m4 $(I_M4_DEPS2)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 any.m4 > $@
+
+$(i_count_c): m4/count.m4 $(I_M4_DEPS2)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 count.m4 > $@
+
+$(i_iall_c): m4/iall.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 iall.m4 > $@
+
+$(i_iany_c): m4/iany.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 iany.m4 > $@
+
+$(i_iparity_c): m4/iparity.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 iparity.m4 > $@
+
+$(i_maxloc0_c): m4/maxloc0.m4 $(I_M4_DEPS0)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 maxloc0.m4 > $@
+
+$(i_maxloc1_c): m4/maxloc1.m4 $(I_M4_DEPS1)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 maxloc1.m4 > $@
+
+$(i_maxval_c): m4/maxval.m4 $(I_M4_DEPS1)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 maxval.m4 > $@
+
+$(i_minloc0_c): m4/minloc0.m4 $(I_M4_DEPS0)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 minloc0.m4 > $@
+
+$(i_minloc1_c): m4/minloc1.m4 $(I_M4_DEPS1)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 minloc1.m4 > $@
+
+$(i_minval_c): m4/minval.m4 $(I_M4_DEPS1)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 minval.m4 > $@
+
+$(i_product_c): m4/product.m4 $(I_M4_DEPS1)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 product.m4 > $@
+
+$(i_sum_c): m4/sum.m4 $(I_M4_DEPS1)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 sum.m4 > $@
+
+$(i_matmul_c): m4/matmul.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 matmul.m4 > $@
+
+$(i_matmull_c): m4/matmull.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 matmull.m4 > $@
+
+$(i_norm2_c): m4/norm2.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 norm2.m4 > $@
+
+$(i_parity_c): m4/parity.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 parity.m4 > $@
+
+$(i_transpose_c): m4/transpose.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 transpose.m4 > $@
+
+$(i_shape_c): m4/shape.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 shape.m4 > $@
+
+$(i_reshape_c): m4/reshape.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 reshape.m4 > $@
+
+$(i_eoshift1_c): m4/eoshift1.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 eoshift1.m4 > $@
+
+$(i_eoshift3_c): m4/eoshift3.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 eoshift3.m4 > $@
+
+$(i_cshift0_c): m4/cshift0.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 cshift0.m4 > $@
+
+$(i_cshift1_c): m4/cshift1.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 cshift1.m4 > $@
+
+$(in_pack_c): m4/in_pack.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 in_pack.m4 > $@
+
+$(in_unpack_c): m4/in_unpack.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 in_unpack.m4 > $@
+
+$(i_exponent_c): m4/exponent.m4 m4/mtype.m4
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 exponent.m4 > $@
+
+$(i_rrspacing_c): m4/rrspacing.m4 m4/mtype.m4
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 rrspacing.m4 > $@
+
+$(i_spacing_c): m4/spacing.m4 m4/mtype.m4
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 spacing.m4 > $@
+
+$(i_fraction_c): m4/fraction.m4 m4/mtype.m4
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 fraction.m4 > $@
+
+$(i_nearest_c): m4/nearest.m4 m4/mtype.m4
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 nearest.m4 > $@
+
+$(i_set_exponent_c): m4/set_exponent.m4 m4/mtype.m4
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 set_exponent.m4 > $@
+
+$(i_pow_c): m4/pow.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 pow.m4 > $@
+
+$(i_pack_c): m4/pack.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 pack.m4 > $@
+
+$(i_unpack_c): m4/unpack.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 unpack.m4 > $@
+
+$(i_spread_c): m4/spread.m4 $(I_M4_DEPS)
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 spread.m4 > $@
+
+$(gfor_built_specific_src): m4/specific.m4 m4/head.m4
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 specific.m4 > $@
+
+$(gfor_built_specific2_src): m4/specific2.m4 m4/head.m4
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 specific2.m4 > $@
+
+$(gfor_misc_specifics): m4/misc_specifics.m4 m4/head.m4
+       $(M4) -Dfile=$@ -I$(srcdir)/m4 misc_specifics.m4 > $@
+## end of maintainer mode only rules
+endif
+
+EXTRA_DIST = $(m4_files)
diff --git a/l4/pkg/libgfortran/lib/contrib/Makefile.in b/l4/pkg/libgfortran/lib/contrib/Makefile.in
new file mode 100644 (file)
index 0000000..b65eca4
--- /dev/null
@@ -0,0 +1,6051 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+
+# dummy sources for libtool
+@onestep_TRUE@am__append_1 = libgfortran_c.c libgfortran_f.f90
+subdir = .
+DIST_COMMON = ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+       $(top_srcdir)/configure $(am__configure_deps) \
+       $(srcdir)/config.h.in $(srcdir)/../mkinstalldirs \
+       $(srcdir)/libgfortran.spec.in $(srcdir)/../depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
+       $(top_srcdir)/../config/lead-dot.m4 \
+       $(top_srcdir)/../config/lthostflags.m4 \
+       $(top_srcdir)/../config/multi.m4 \
+       $(top_srcdir)/../config/override.m4 \
+       $(top_srcdir)/../config/stdint.m4 \
+       $(top_srcdir)/../config/unwind_ipinfo.m4 \
+       $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
+       $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/acx.m4 \
+       $(top_srcdir)/../config/no-executables.m4 \
+       $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = libgfortran.spec
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(cafexeclibdir)" \
+       "$(DESTDIR)$(myexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" \
+       "$(DESTDIR)$(toolexeclibdir)"
+LTLIBRARIES = $(cafexeclib_LTLIBRARIES) $(myexeclib_LTLIBRARIES) \
+       $(toolexeclib_LTLIBRARIES)
+libcaf_single_la_LIBADD =
+am_libcaf_single_la_OBJECTS = single.lo
+libcaf_single_la_OBJECTS = $(am_libcaf_single_la_OBJECTS)
+libgfortran_la_LIBADD =
+am__objects_1 = backtrace.lo bounds.lo compile_options.lo \
+       convert_char.lo environ.lo error.lo fpu.lo main.lo memory.lo \
+       pause.lo stop.lo string.lo select.lo
+am__objects_2 = all_l1.lo all_l2.lo all_l4.lo all_l8.lo all_l16.lo
+am__objects_3 = any_l1.lo any_l2.lo any_l4.lo any_l8.lo any_l16.lo
+am__objects_4 = count_1_l.lo count_2_l.lo count_4_l.lo count_8_l.lo \
+       count_16_l.lo
+am__objects_5 = maxloc0_4_i1.lo maxloc0_8_i1.lo maxloc0_16_i1.lo \
+       maxloc0_4_i2.lo maxloc0_8_i2.lo maxloc0_16_i2.lo \
+       maxloc0_4_i4.lo maxloc0_8_i4.lo maxloc0_16_i4.lo \
+       maxloc0_4_i8.lo maxloc0_8_i8.lo maxloc0_16_i8.lo \
+       maxloc0_4_i16.lo maxloc0_8_i16.lo maxloc0_16_i16.lo \
+       maxloc0_4_r4.lo maxloc0_8_r4.lo maxloc0_16_r4.lo \
+       maxloc0_4_r8.lo maxloc0_8_r8.lo maxloc0_16_r8.lo \
+       maxloc0_4_r10.lo maxloc0_8_r10.lo maxloc0_16_r10.lo \
+       maxloc0_4_r16.lo maxloc0_8_r16.lo maxloc0_16_r16.lo
+am__objects_6 = maxloc1_4_i1.lo maxloc1_8_i1.lo maxloc1_16_i1.lo \
+       maxloc1_4_i2.lo maxloc1_8_i2.lo maxloc1_16_i2.lo \
+       maxloc1_4_i4.lo maxloc1_8_i4.lo maxloc1_16_i4.lo \
+       maxloc1_4_i8.lo maxloc1_8_i8.lo maxloc1_16_i8.lo \
+       maxloc1_4_i16.lo maxloc1_8_i16.lo maxloc1_16_i16.lo \
+       maxloc1_4_r4.lo maxloc1_8_r4.lo maxloc1_16_r4.lo \
+       maxloc1_4_r8.lo maxloc1_8_r8.lo maxloc1_16_r8.lo \
+       maxloc1_4_r10.lo maxloc1_8_r10.lo maxloc1_16_r10.lo \
+       maxloc1_4_r16.lo maxloc1_8_r16.lo maxloc1_16_r16.lo
+am__objects_7 = maxval_i1.lo maxval_i2.lo maxval_i4.lo maxval_i8.lo \
+       maxval_i16.lo maxval_r4.lo maxval_r8.lo maxval_r10.lo \
+       maxval_r16.lo
+am__objects_8 = minloc0_4_i1.lo minloc0_8_i1.lo minloc0_16_i1.lo \
+       minloc0_4_i2.lo minloc0_8_i2.lo minloc0_16_i2.lo \
+       minloc0_4_i4.lo minloc0_8_i4.lo minloc0_16_i4.lo \
+       minloc0_4_i8.lo minloc0_8_i8.lo minloc0_16_i8.lo \
+       minloc0_4_i16.lo minloc0_8_i16.lo minloc0_16_i16.lo \
+       minloc0_4_r4.lo minloc0_8_r4.lo minloc0_16_r4.lo \
+       minloc0_4_r8.lo minloc0_8_r8.lo minloc0_16_r8.lo \
+       minloc0_4_r10.lo minloc0_8_r10.lo minloc0_16_r10.lo \
+       minloc0_4_r16.lo minloc0_8_r16.lo minloc0_16_r16.lo
+am__objects_9 = minloc1_4_i1.lo minloc1_8_i1.lo minloc1_16_i1.lo \
+       minloc1_4_i2.lo minloc1_8_i2.lo minloc1_16_i2.lo \
+       minloc1_4_i4.lo minloc1_8_i4.lo minloc1_16_i4.lo \
+       minloc1_4_i8.lo minloc1_8_i8.lo minloc1_16_i8.lo \
+       minloc1_4_i16.lo minloc1_8_i16.lo minloc1_16_i16.lo \
+       minloc1_4_r4.lo minloc1_8_r4.lo minloc1_16_r4.lo \
+       minloc1_4_r8.lo minloc1_8_r8.lo minloc1_16_r8.lo \
+       minloc1_4_r10.lo minloc1_8_r10.lo minloc1_16_r10.lo \
+       minloc1_4_r16.lo minloc1_8_r16.lo minloc1_16_r16.lo
+am__objects_10 = minval_i1.lo minval_i2.lo minval_i4.lo minval_i8.lo \
+       minval_i16.lo minval_r4.lo minval_r8.lo minval_r10.lo \
+       minval_r16.lo
+am__objects_11 = product_i1.lo product_i2.lo product_i4.lo \
+       product_i8.lo product_i16.lo product_r4.lo product_r8.lo \
+       product_r10.lo product_r16.lo product_c4.lo product_c8.lo \
+       product_c10.lo product_c16.lo
+am__objects_12 = sum_i1.lo sum_i2.lo sum_i4.lo sum_i8.lo sum_i16.lo \
+       sum_r4.lo sum_r8.lo sum_r10.lo sum_r16.lo sum_c4.lo sum_c8.lo \
+       sum_c10.lo sum_c16.lo
+am__objects_13 = bessel_r4.lo bessel_r8.lo bessel_r10.lo bessel_r16.lo
+am__objects_14 = iall_i1.lo iall_i2.lo iall_i4.lo iall_i8.lo \
+       iall_i16.lo
+am__objects_15 = iany_i1.lo iany_i2.lo iany_i4.lo iany_i8.lo \
+       iany_i16.lo
+am__objects_16 = iparity_i1.lo iparity_i2.lo iparity_i4.lo \
+       iparity_i8.lo iparity_i16.lo
+am__objects_17 = norm2_r4.lo norm2_r8.lo norm2_r10.lo norm2_r16.lo
+am__objects_18 = parity_l1.lo parity_l2.lo parity_l4.lo parity_l8.lo \
+       parity_l16.lo
+am__objects_19 = matmul_i1.lo matmul_i2.lo matmul_i4.lo matmul_i8.lo \
+       matmul_i16.lo matmul_r4.lo matmul_r8.lo matmul_r10.lo \
+       matmul_r16.lo matmul_c4.lo matmul_c8.lo matmul_c10.lo \
+       matmul_c16.lo
+am__objects_20 = matmul_l4.lo matmul_l8.lo matmul_l16.lo
+am__objects_21 = transpose_i4.lo transpose_i8.lo transpose_i16.lo \
+       transpose_r4.lo transpose_r8.lo transpose_r10.lo \
+       transpose_r16.lo transpose_c4.lo transpose_c8.lo \
+       transpose_c10.lo transpose_c16.lo
+am__objects_22 = shape_i4.lo shape_i8.lo shape_i16.lo
+am__objects_23 = eoshift1_4.lo eoshift1_8.lo eoshift1_16.lo
+am__objects_24 = eoshift3_4.lo eoshift3_8.lo eoshift3_16.lo
+am__objects_25 = cshift1_4.lo cshift1_8.lo cshift1_16.lo
+am__objects_26 = reshape_i4.lo reshape_i8.lo reshape_i16.lo \
+       reshape_r4.lo reshape_r8.lo reshape_r10.lo reshape_r16.lo \
+       reshape_c4.lo reshape_c8.lo reshape_c10.lo reshape_c16.lo
+am__objects_27 = in_pack_i1.lo in_pack_i2.lo in_pack_i4.lo \
+       in_pack_i8.lo in_pack_i16.lo in_pack_r4.lo in_pack_r8.lo \
+       in_pack_r10.lo in_pack_r16.lo in_pack_c4.lo in_pack_c8.lo \
+       in_pack_c10.lo in_pack_c16.lo
+am__objects_28 = in_unpack_i1.lo in_unpack_i2.lo in_unpack_i4.lo \
+       in_unpack_i8.lo in_unpack_i16.lo in_unpack_r4.lo \
+       in_unpack_r8.lo in_unpack_r10.lo in_unpack_r16.lo \
+       in_unpack_c4.lo in_unpack_c8.lo in_unpack_c10.lo \
+       in_unpack_c16.lo
+am__objects_29 = exponent_r4.lo exponent_r8.lo exponent_r10.lo \
+       exponent_r16.lo
+am__objects_30 = fraction_r4.lo fraction_r8.lo fraction_r10.lo \
+       fraction_r16.lo
+am__objects_31 = nearest_r4.lo nearest_r8.lo nearest_r10.lo \
+       nearest_r16.lo
+am__objects_32 = set_exponent_r4.lo set_exponent_r8.lo \
+       set_exponent_r10.lo set_exponent_r16.lo
+am__objects_33 = pow_i4_i4.lo pow_i8_i4.lo pow_i16_i4.lo pow_r16_i4.lo \
+       pow_c4_i4.lo pow_c8_i4.lo pow_c10_i4.lo pow_c16_i4.lo \
+       pow_i4_i8.lo pow_i8_i8.lo pow_i16_i8.lo pow_r4_i8.lo \
+       pow_r8_i8.lo pow_r10_i8.lo pow_r16_i8.lo pow_c4_i8.lo \
+       pow_c8_i8.lo pow_c10_i8.lo pow_c16_i8.lo pow_i4_i16.lo \
+       pow_i8_i16.lo pow_i16_i16.lo pow_r4_i16.lo pow_r8_i16.lo \
+       pow_r10_i16.lo pow_r16_i16.lo pow_c4_i16.lo pow_c8_i16.lo \
+       pow_c10_i16.lo pow_c16_i16.lo
+am__objects_34 = rrspacing_r4.lo rrspacing_r8.lo rrspacing_r10.lo \
+       rrspacing_r16.lo
+am__objects_35 = spacing_r4.lo spacing_r8.lo spacing_r10.lo \
+       spacing_r16.lo
+am__objects_36 = pack_i1.lo pack_i2.lo pack_i4.lo pack_i8.lo \
+       pack_i16.lo pack_r4.lo pack_r8.lo pack_r10.lo pack_r16.lo \
+       pack_c4.lo pack_c8.lo pack_c10.lo pack_c16.lo
+am__objects_37 = unpack_i1.lo unpack_i2.lo unpack_i4.lo unpack_i8.lo \
+       unpack_i16.lo unpack_r4.lo unpack_r8.lo unpack_r10.lo \
+       unpack_r16.lo unpack_c4.lo unpack_c8.lo unpack_c10.lo \
+       unpack_c16.lo
+am__objects_38 = spread_i1.lo spread_i2.lo spread_i4.lo spread_i8.lo \
+       spread_i16.lo spread_r4.lo spread_r8.lo spread_r10.lo \
+       spread_r16.lo spread_c4.lo spread_c8.lo spread_c10.lo \
+       spread_c16.lo
+am__objects_39 = cshift0_i1.lo cshift0_i2.lo cshift0_i4.lo \
+       cshift0_i8.lo cshift0_i16.lo cshift0_r4.lo cshift0_r8.lo \
+       cshift0_r10.lo cshift0_r16.lo cshift0_c4.lo cshift0_c8.lo \
+       cshift0_c10.lo cshift0_c16.lo
+am__objects_40 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \
+       $(am__objects_5) $(am__objects_6) $(am__objects_7) \
+       $(am__objects_8) $(am__objects_9) $(am__objects_10) \
+       $(am__objects_11) $(am__objects_12) $(am__objects_13) \
+       $(am__objects_14) $(am__objects_15) $(am__objects_16) \
+       $(am__objects_17) $(am__objects_18) $(am__objects_19) \
+       $(am__objects_20) $(am__objects_21) $(am__objects_22) \
+       $(am__objects_23) $(am__objects_24) $(am__objects_25) \
+       $(am__objects_26) $(am__objects_27) $(am__objects_28) \
+       $(am__objects_29) $(am__objects_30) $(am__objects_31) \
+       $(am__objects_32) $(am__objects_33) $(am__objects_34) \
+       $(am__objects_35) $(am__objects_36) $(am__objects_37) \
+       $(am__objects_38) $(am__objects_39)
+am__objects_41 = close.lo file_pos.lo format.lo inquire.lo \
+       intrinsics.lo list_read.lo lock.lo open.lo read.lo \
+       size_from_kind.lo transfer.lo transfer128.lo unit.lo unix.lo \
+       write.lo fbuf.lo
+am__objects_42 = associated.lo abort.lo access.lo args.lo \
+       bit_intrinsics.lo c99_functions.lo chdir.lo chmod.lo clock.lo \
+       cpu_time.lo cshift0.lo ctime.lo date_and_time.lo dtime.lo \
+       env.lo eoshift0.lo eoshift2.lo erfc_scaled.lo etime.lo \
+       execute_command_line.lo exit.lo extends_type_of.lo fnum.lo \
+       gerror.lo getcwd.lo getlog.lo getXid.lo hostnm.lo ierrno.lo \
+       ishftc.lo iso_c_generated_procs.lo iso_c_binding.lo kill.lo \
+       link.lo malloc.lo mvbits.lo move_alloc.lo pack_generic.lo \
+       perror.lo selected_char_kind.lo signal.lo size.lo sleep.lo \
+       spread_generic.lo string_intrinsics.lo system.lo rand.lo \
+       random.lo rename.lo reshape_generic.lo reshape_packed.lo \
+       selected_int_kind.lo selected_real_kind.lo stat.lo symlnk.lo \
+       system_clock.lo time.lo transpose_generic.lo umask.lo \
+       unlink.lo unpack_generic.lo in_pack_generic.lo \
+       in_unpack_generic.lo
+am__objects_43 =
+am__objects_44 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \
+       _abs_i4.lo _abs_i8.lo _abs_i16.lo _abs_r4.lo _abs_r8.lo \
+       _abs_r10.lo _abs_r16.lo _aimag_c4.lo _aimag_c8.lo \
+       _aimag_c10.lo _aimag_c16.lo _exp_r4.lo _exp_r8.lo _exp_r10.lo \
+       _exp_r16.lo _exp_c4.lo _exp_c8.lo _exp_c10.lo _exp_c16.lo \
+       _log_r4.lo _log_r8.lo _log_r10.lo _log_r16.lo _log_c4.lo \
+       _log_c8.lo _log_c10.lo _log_c16.lo _log10_r4.lo _log10_r8.lo \
+       _log10_r10.lo _log10_r16.lo _sqrt_r4.lo _sqrt_r8.lo \
+       _sqrt_r10.lo _sqrt_r16.lo _sqrt_c4.lo _sqrt_c8.lo _sqrt_c10.lo \
+       _sqrt_c16.lo _asin_r4.lo _asin_r8.lo _asin_r10.lo _asin_r16.lo \
+       _asinh_r4.lo _asinh_r8.lo _asinh_r10.lo _asinh_r16.lo \
+       _acos_r4.lo _acos_r8.lo _acos_r10.lo _acos_r16.lo _acosh_r4.lo \
+       _acosh_r8.lo _acosh_r10.lo _acosh_r16.lo _atan_r4.lo \
+       _atan_r8.lo _atan_r10.lo _atan_r16.lo _atanh_r4.lo \
+       _atanh_r8.lo _atanh_r10.lo _atanh_r16.lo _sin_r4.lo _sin_r8.lo \
+       _sin_r10.lo _sin_r16.lo _sin_c4.lo _sin_c8.lo _sin_c10.lo \
+       _sin_c16.lo _cos_r4.lo _cos_r8.lo _cos_r10.lo _cos_r16.lo \
+       _cos_c4.lo _cos_c8.lo _cos_c10.lo _cos_c16.lo _tan_r4.lo \
+       _tan_r8.lo _tan_r10.lo _tan_r16.lo _sinh_r4.lo _sinh_r8.lo \
+       _sinh_r10.lo _sinh_r16.lo _cosh_r4.lo _cosh_r8.lo _cosh_r10.lo \
+       _cosh_r16.lo _tanh_r4.lo _tanh_r8.lo _tanh_r10.lo _tanh_r16.lo \
+       _conjg_c4.lo _conjg_c8.lo _conjg_c10.lo _conjg_c16.lo \
+       _aint_r4.lo _aint_r8.lo _aint_r10.lo _aint_r16.lo _anint_r4.lo \
+       _anint_r8.lo _anint_r10.lo _anint_r16.lo
+am__objects_45 = _sign_i4.lo _sign_i8.lo _sign_i16.lo _sign_r4.lo \
+       _sign_r8.lo _sign_r10.lo _sign_r16.lo _dim_i4.lo _dim_i8.lo \
+       _dim_i16.lo _dim_r4.lo _dim_r8.lo _dim_r10.lo _dim_r16.lo \
+       _atan2_r4.lo _atan2_r8.lo _atan2_r10.lo _atan2_r16.lo \
+       _mod_i4.lo _mod_i8.lo _mod_i16.lo _mod_r4.lo _mod_r8.lo \
+       _mod_r10.lo _mod_r16.lo
+am__objects_46 = misc_specifics.lo
+am__objects_47 = $(am__objects_44) $(am__objects_45) $(am__objects_46) \
+       dprod_r8.lo f2c_specifics.lo
+am__objects_48 = $(am__objects_1) $(am__objects_40) $(am__objects_41) \
+       $(am__objects_42) $(am__objects_43) $(am__objects_47)
+@onestep_FALSE@am_libgfortran_la_OBJECTS = $(am__objects_48)
+@onestep_TRUE@am_libgfortran_la_OBJECTS = libgfortran_c.lo
+libgfortran_la_OBJECTS = $(am_libgfortran_la_OBJECTS)
+libgfortranbegin_la_LIBADD =
+am_libgfortranbegin_la_OBJECTS = fmain.lo
+libgfortranbegin_la_OBJECTS = $(am_libgfortranbegin_la_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/../depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+SOURCES = $(libcaf_single_la_SOURCES) $(libgfortran_la_SOURCES) \
+       $(libgfortranbegin_la_SOURCES)
+MULTISRCTOP = 
+MULTIBUILDTOP = 
+MULTIDIRS = 
+MULTISUBDIR = 
+MULTIDO = true
+MULTICLEAN = true
+DATA = $(toolexeclib_DATA)
+ETAGS = etags
+CTAGS = ctags
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+
+# Fortran rules for complex multiplication and division
+
+# Use -ffunction-sections -fdata-sections if supported by the compiler
+
+# Some targets require additional compiler options for IEEE compatibility.
+AM_CFLAGS = @AM_CFLAGS@ -fcx-fortran-rules $(SECTION_FLAGS) \
+       $(IEEE_FLAGS)
+AM_FCFLAGS = @AM_FCFLAGS@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FGREP = @FGREP@
+FPU_HOST_HEADER = @FPU_HOST_HEADER@
+GREP = @GREP@
+IEEE_FLAGS = @IEEE_FLAGS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBQUADINCLUDE = @LIBQUADINCLUDE@
+LIBQUADLIB = @LIBQUADLIB@
+LIBQUADLIB_DEP = @LIBQUADLIB_DEP@
+LIBQUADSPEC = @LIBQUADSPEC@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SECTION_FLAGS = @SECTION_FLAGS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_libsubdir = @build_libsubdir@
+build_os = @build_os@
+build_subdir = @build_subdir@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+enable_shared = @enable_shared@
+enable_static = @enable_static@
+exec_prefix = @exec_prefix@
+extra_ldflags_libgfortran = @extra_ldflags_libgfortran@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_subdir = @host_subdir@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_host_flags = @lt_host_flags@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+onestep = @onestep@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_noncanonical = @target_noncanonical@
+target_os = @target_os@
+target_subdir = @target_subdir@
+target_vendor = @target_vendor@
+toolexecdir = @toolexecdir@
+toolexeclibdir = @toolexeclibdir@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ACLOCAL_AMFLAGS = -I .. -I ../config
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+@LIBGFOR_USE_SYMVER_FALSE@version_arg = 
+@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,-M,gfortran.map-sun
+@LIBGFOR_USE_SYMVER_FALSE@version_dep = 
+@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = $(srcdir)/gfortran.map
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = gfortran.map-sun
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
+           $(lt_host_flags)
+
+toolexeclib_LTLIBRARIES = libgfortran.la
+toolexeclib_DATA = libgfortran.spec
+libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
+libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+       $(LTLDFLAGS) $(LIBQUADLIB) -lm $(extra_ldflags_libgfortran) \
+       $(version_arg) -Wc,-shared-libgcc
+
+libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP)
+myexeclib_LTLIBRARIES = libgfortranbegin.la
+myexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
+libgfortranbegin_la_SOURCES = fmain.c
+libgfortranbegin_la_LDFLAGS = -static
+libgfortranbegin_la_LINK = $(LINK) $(libgfortranbegin_la_LDFLAGS)
+cafexeclib_LTLIBRARIES = libcaf_single.la
+cafexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
+libcaf_single_la_SOURCES = caf/single.c
+libcaf_single_la_LDFLAGS = -static
+libcaf_single_la_DEPENDENCIES = caf/libcaf.h
+libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS)
+AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
+             -I$(srcdir)/$(MULTISRCTOP)../gcc/config $(LIBQUADINCLUDE) \
+             -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+             -I$(srcdir)/$(MULTISRCTOP)../libgcc \
+             -I$(MULTIBUILDTOP)../libgcc
+
+gfor_io_src = \
+io/close.c \
+io/file_pos.c \
+io/format.c \
+io/inquire.c \
+io/intrinsics.c \
+io/list_read.c \
+io/lock.c \
+io/open.c \
+io/read.c \
+io/size_from_kind.c \
+io/transfer.c \
+io/transfer128.c \
+io/unit.c \
+io/unix.c \
+io/write.c \
+io/fbuf.c
+
+gfor_io_headers = \
+io/io.h \
+io/fbuf.h \
+io/format.h \
+io/unix.h
+
+gfor_helper_src = \
+intrinsics/associated.c \
+intrinsics/abort.c \
+intrinsics/access.c \
+intrinsics/args.c \
+intrinsics/bit_intrinsics.c \
+intrinsics/c99_functions.c \
+intrinsics/chdir.c \
+intrinsics/chmod.c \
+intrinsics/clock.c \
+intrinsics/cpu_time.c \
+intrinsics/cshift0.c \
+intrinsics/ctime.c \
+intrinsics/date_and_time.c \
+intrinsics/dtime.c \
+intrinsics/env.c \
+intrinsics/eoshift0.c \
+intrinsics/eoshift2.c \
+intrinsics/erfc_scaled.c \
+intrinsics/etime.c \
+intrinsics/execute_command_line.c \
+intrinsics/exit.c \
+intrinsics/extends_type_of.c \
+intrinsics/fnum.c \
+intrinsics/gerror.c \
+intrinsics/getcwd.c \
+intrinsics/getlog.c \
+intrinsics/getXid.c \
+intrinsics/hostnm.c \
+intrinsics/ierrno.c \
+intrinsics/ishftc.c \
+intrinsics/iso_c_generated_procs.c \
+intrinsics/iso_c_binding.c \
+intrinsics/kill.c \
+intrinsics/link.c \
+intrinsics/malloc.c \
+intrinsics/mvbits.c \
+intrinsics/move_alloc.c \
+intrinsics/pack_generic.c \
+intrinsics/perror.c \
+intrinsics/selected_char_kind.c \
+intrinsics/signal.c \
+intrinsics/size.c \
+intrinsics/sleep.c \
+intrinsics/spread_generic.c \
+intrinsics/string_intrinsics.c \
+intrinsics/system.c \
+intrinsics/rand.c \
+intrinsics/random.c \
+intrinsics/rename.c \
+intrinsics/reshape_generic.c \
+intrinsics/reshape_packed.c \
+intrinsics/selected_int_kind.f90 \
+intrinsics/selected_real_kind.f90 \
+intrinsics/stat.c \
+intrinsics/symlnk.c \
+intrinsics/system_clock.c \
+intrinsics/time.c \
+intrinsics/transpose_generic.c \
+intrinsics/umask.c \
+intrinsics/unlink.c \
+intrinsics/unpack_generic.c \
+runtime/in_pack_generic.c \
+runtime/in_unpack_generic.c
+
+gfor_src = \
+runtime/backtrace.c \
+runtime/bounds.c \
+runtime/compile_options.c \
+runtime/convert_char.c \
+runtime/environ.c \
+runtime/error.c \
+runtime/fpu.c \
+runtime/main.c \
+runtime/memory.c \
+runtime/pause.c \
+runtime/stop.c \
+runtime/string.c \
+runtime/select.c
+
+i_all_c = \
+$(srcdir)/generated/all_l1.c \
+$(srcdir)/generated/all_l2.c \
+$(srcdir)/generated/all_l4.c \
+$(srcdir)/generated/all_l8.c \
+$(srcdir)/generated/all_l16.c
+
+i_any_c = \
+$(srcdir)/generated/any_l1.c \
+$(srcdir)/generated/any_l2.c \
+$(srcdir)/generated/any_l4.c \
+$(srcdir)/generated/any_l8.c \
+$(srcdir)/generated/any_l16.c
+
+i_bessel_c = \
+$(srcdir)/generated/bessel_r4.c \
+$(srcdir)/generated/bessel_r8.c \
+$(srcdir)/generated/bessel_r10.c \
+$(srcdir)/generated/bessel_r16.c
+
+i_count_c = \
+$(srcdir)/generated/count_1_l.c \
+$(srcdir)/generated/count_2_l.c \
+$(srcdir)/generated/count_4_l.c \
+$(srcdir)/generated/count_8_l.c \
+$(srcdir)/generated/count_16_l.c
+
+i_iall_c = \
+$(srcdir)/generated/iall_i1.c \
+$(srcdir)/generated/iall_i2.c \
+$(srcdir)/generated/iall_i4.c \
+$(srcdir)/generated/iall_i8.c \
+$(srcdir)/generated/iall_i16.c
+
+i_iany_c = \
+$(srcdir)/generated/iany_i1.c \
+$(srcdir)/generated/iany_i2.c \
+$(srcdir)/generated/iany_i4.c \
+$(srcdir)/generated/iany_i8.c \
+$(srcdir)/generated/iany_i16.c
+
+i_iparity_c = \
+$(srcdir)/generated/iparity_i1.c \
+$(srcdir)/generated/iparity_i2.c \
+$(srcdir)/generated/iparity_i4.c \
+$(srcdir)/generated/iparity_i8.c \
+$(srcdir)/generated/iparity_i16.c
+
+i_maxloc0_c = \
+$(srcdir)/generated/maxloc0_4_i1.c \
+$(srcdir)/generated/maxloc0_8_i1.c \
+$(srcdir)/generated/maxloc0_16_i1.c \
+$(srcdir)/generated/maxloc0_4_i2.c \
+$(srcdir)/generated/maxloc0_8_i2.c \
+$(srcdir)/generated/maxloc0_16_i2.c \
+$(srcdir)/generated/maxloc0_4_i4.c \
+$(srcdir)/generated/maxloc0_8_i4.c \
+$(srcdir)/generated/maxloc0_16_i4.c \
+$(srcdir)/generated/maxloc0_4_i8.c \
+$(srcdir)/generated/maxloc0_8_i8.c \
+$(srcdir)/generated/maxloc0_16_i8.c \
+$(srcdir)/generated/maxloc0_4_i16.c \
+$(srcdir)/generated/maxloc0_8_i16.c \
+$(srcdir)/generated/maxloc0_16_i16.c \
+$(srcdir)/generated/maxloc0_4_r4.c \
+$(srcdir)/generated/maxloc0_8_r4.c \
+$(srcdir)/generated/maxloc0_16_r4.c \
+$(srcdir)/generated/maxloc0_4_r8.c \
+$(srcdir)/generated/maxloc0_8_r8.c \
+$(srcdir)/generated/maxloc0_16_r8.c \
+$(srcdir)/generated/maxloc0_4_r10.c \
+$(srcdir)/generated/maxloc0_8_r10.c \
+$(srcdir)/generated/maxloc0_16_r10.c \
+$(srcdir)/generated/maxloc0_4_r16.c \
+$(srcdir)/generated/maxloc0_8_r16.c \
+$(srcdir)/generated/maxloc0_16_r16.c
+
+i_maxloc1_c = \
+$(srcdir)/generated/maxloc1_4_i1.c \
+$(srcdir)/generated/maxloc1_8_i1.c \
+$(srcdir)/generated/maxloc1_16_i1.c \
+$(srcdir)/generated/maxloc1_4_i2.c \
+$(srcdir)/generated/maxloc1_8_i2.c \
+$(srcdir)/generated/maxloc1_16_i2.c \
+$(srcdir)/generated/maxloc1_4_i4.c \
+$(srcdir)/generated/maxloc1_8_i4.c \
+$(srcdir)/generated/maxloc1_16_i4.c \
+$(srcdir)/generated/maxloc1_4_i8.c \
+$(srcdir)/generated/maxloc1_8_i8.c \
+$(srcdir)/generated/maxloc1_16_i8.c \
+$(srcdir)/generated/maxloc1_4_i16.c \
+$(srcdir)/generated/maxloc1_8_i16.c \
+$(srcdir)/generated/maxloc1_16_i16.c \
+$(srcdir)/generated/maxloc1_4_r4.c \
+$(srcdir)/generated/maxloc1_8_r4.c \
+$(srcdir)/generated/maxloc1_16_r4.c \
+$(srcdir)/generated/maxloc1_4_r8.c \
+$(srcdir)/generated/maxloc1_8_r8.c \
+$(srcdir)/generated/maxloc1_16_r8.c \
+$(srcdir)/generated/maxloc1_4_r10.c \
+$(srcdir)/generated/maxloc1_8_r10.c \
+$(srcdir)/generated/maxloc1_16_r10.c \
+$(srcdir)/generated/maxloc1_4_r16.c \
+$(srcdir)/generated/maxloc1_8_r16.c \
+$(srcdir)/generated/maxloc1_16_r16.c
+
+i_maxval_c = \
+$(srcdir)/generated/maxval_i1.c \
+$(srcdir)/generated/maxval_i2.c \
+$(srcdir)/generated/maxval_i4.c \
+$(srcdir)/generated/maxval_i8.c \
+$(srcdir)/generated/maxval_i16.c \
+$(srcdir)/generated/maxval_r4.c \
+$(srcdir)/generated/maxval_r8.c \
+$(srcdir)/generated/maxval_r10.c \
+$(srcdir)/generated/maxval_r16.c
+
+i_minloc0_c = \
+$(srcdir)/generated/minloc0_4_i1.c \
+$(srcdir)/generated/minloc0_8_i1.c \
+$(srcdir)/generated/minloc0_16_i1.c \
+$(srcdir)/generated/minloc0_4_i2.c \
+$(srcdir)/generated/minloc0_8_i2.c \
+$(srcdir)/generated/minloc0_16_i2.c \
+$(srcdir)/generated/minloc0_4_i4.c \
+$(srcdir)/generated/minloc0_8_i4.c \
+$(srcdir)/generated/minloc0_16_i4.c \
+$(srcdir)/generated/minloc0_4_i8.c \
+$(srcdir)/generated/minloc0_8_i8.c \
+$(srcdir)/generated/minloc0_16_i8.c \
+$(srcdir)/generated/minloc0_4_i16.c \
+$(srcdir)/generated/minloc0_8_i16.c \
+$(srcdir)/generated/minloc0_16_i16.c \
+$(srcdir)/generated/minloc0_4_r4.c \
+$(srcdir)/generated/minloc0_8_r4.c \
+$(srcdir)/generated/minloc0_16_r4.c \
+$(srcdir)/generated/minloc0_4_r8.c \
+$(srcdir)/generated/minloc0_8_r8.c \
+$(srcdir)/generated/minloc0_16_r8.c \
+$(srcdir)/generated/minloc0_4_r10.c \
+$(srcdir)/generated/minloc0_8_r10.c \
+$(srcdir)/generated/minloc0_16_r10.c \
+$(srcdir)/generated/minloc0_4_r16.c \
+$(srcdir)/generated/minloc0_8_r16.c \
+$(srcdir)/generated/minloc0_16_r16.c
+
+i_minloc1_c = \
+$(srcdir)/generated/minloc1_4_i1.c \
+$(srcdir)/generated/minloc1_8_i1.c \
+$(srcdir)/generated/minloc1_16_i1.c \
+$(srcdir)/generated/minloc1_4_i2.c \
+$(srcdir)/generated/minloc1_8_i2.c \
+$(srcdir)/generated/minloc1_16_i2.c \
+$(srcdir)/generated/minloc1_4_i4.c \
+$(srcdir)/generated/minloc1_8_i4.c \
+$(srcdir)/generated/minloc1_16_i4.c \
+$(srcdir)/generated/minloc1_4_i8.c \
+$(srcdir)/generated/minloc1_8_i8.c \
+$(srcdir)/generated/minloc1_16_i8.c \
+$(srcdir)/generated/minloc1_4_i16.c \
+$(srcdir)/generated/minloc1_8_i16.c \
+$(srcdir)/generated/minloc1_16_i16.c \
+$(srcdir)/generated/minloc1_4_r4.c \
+$(srcdir)/generated/minloc1_8_r4.c \
+$(srcdir)/generated/minloc1_16_r4.c \
+$(srcdir)/generated/minloc1_4_r8.c \
+$(srcdir)/generated/minloc1_8_r8.c \
+$(srcdir)/generated/minloc1_16_r8.c \
+$(srcdir)/generated/minloc1_4_r10.c \
+$(srcdir)/generated/minloc1_8_r10.c \
+$(srcdir)/generated/minloc1_16_r10.c \
+$(srcdir)/generated/minloc1_4_r16.c \
+$(srcdir)/generated/minloc1_8_r16.c \
+$(srcdir)/generated/minloc1_16_r16.c
+
+i_minval_c = \
+$(srcdir)/generated/minval_i1.c \
+$(srcdir)/generated/minval_i2.c \
+$(srcdir)/generated/minval_i4.c \
+$(srcdir)/generated/minval_i8.c \
+$(srcdir)/generated/minval_i16.c \
+$(srcdir)/generated/minval_r4.c \
+$(srcdir)/generated/minval_r8.c \
+$(srcdir)/generated/minval_r10.c \
+$(srcdir)/generated/minval_r16.c
+
+i_norm2_c = \
+$(srcdir)/generated/norm2_r4.c \
+$(srcdir)/generated/norm2_r8.c \
+$(srcdir)/generated/norm2_r10.c \
+$(srcdir)/generated/norm2_r16.c
+
+i_parity_c = \
+$(srcdir)/generated/parity_l1.c \
+$(srcdir)/generated/parity_l2.c \
+$(srcdir)/generated/parity_l4.c \
+$(srcdir)/generated/parity_l8.c \
+$(srcdir)/generated/parity_l16.c
+
+i_sum_c = \
+$(srcdir)/generated/sum_i1.c \
+$(srcdir)/generated/sum_i2.c \
+$(srcdir)/generated/sum_i4.c \
+$(srcdir)/generated/sum_i8.c \
+$(srcdir)/generated/sum_i16.c \
+$(srcdir)/generated/sum_r4.c \
+$(srcdir)/generated/sum_r8.c \
+$(srcdir)/generated/sum_r10.c \
+$(srcdir)/generated/sum_r16.c \
+$(srcdir)/generated/sum_c4.c \
+$(srcdir)/generated/sum_c8.c \
+$(srcdir)/generated/sum_c10.c \
+$(srcdir)/generated/sum_c16.c
+
+i_product_c = \
+$(srcdir)/generated/product_i1.c \
+$(srcdir)/generated/product_i2.c \
+$(srcdir)/generated/product_i4.c \
+$(srcdir)/generated/product_i8.c \
+$(srcdir)/generated/product_i16.c \
+$(srcdir)/generated/product_r4.c \
+$(srcdir)/generated/product_r8.c \
+$(srcdir)/generated/product_r10.c \
+$(srcdir)/generated/product_r16.c \
+$(srcdir)/generated/product_c4.c \
+$(srcdir)/generated/product_c8.c \
+$(srcdir)/generated/product_c10.c \
+$(srcdir)/generated/product_c16.c
+
+i_matmul_c = \
+$(srcdir)/generated/matmul_i1.c \
+$(srcdir)/generated/matmul_i2.c \
+$(srcdir)/generated/matmul_i4.c \
+$(srcdir)/generated/matmul_i8.c \
+$(srcdir)/generated/matmul_i16.c \
+$(srcdir)/generated/matmul_r4.c \
+$(srcdir)/generated/matmul_r8.c \
+$(srcdir)/generated/matmul_r10.c \
+$(srcdir)/generated/matmul_r16.c \
+$(srcdir)/generated/matmul_c4.c \
+$(srcdir)/generated/matmul_c8.c \
+$(srcdir)/generated/matmul_c10.c \
+$(srcdir)/generated/matmul_c16.c
+
+i_matmull_c = \
+$(srcdir)/generated/matmul_l4.c \
+$(srcdir)/generated/matmul_l8.c \
+$(srcdir)/generated/matmul_l16.c
+
+i_transpose_c = \
+$(srcdir)/generated/transpose_i4.c \
+$(srcdir)/generated/transpose_i8.c \
+$(srcdir)/generated/transpose_i16.c \
+$(srcdir)/generated/transpose_r4.c \
+$(srcdir)/generated/transpose_r8.c \
+$(srcdir)/generated/transpose_r10.c \
+$(srcdir)/generated/transpose_r16.c \
+$(srcdir)/generated/transpose_c4.c \
+$(srcdir)/generated/transpose_c8.c \
+$(srcdir)/generated/transpose_c10.c \
+$(srcdir)/generated/transpose_c16.c
+
+i_shape_c = \
+$(srcdir)/generated/shape_i4.c \
+$(srcdir)/generated/shape_i8.c \
+$(srcdir)/generated/shape_i16.c
+
+i_reshape_c = \
+$(srcdir)/generated/reshape_i4.c \
+$(srcdir)/generated/reshape_i8.c \
+$(srcdir)/generated/reshape_i16.c \
+$(srcdir)/generated/reshape_r4.c \
+$(srcdir)/generated/reshape_r8.c \
+$(srcdir)/generated/reshape_r10.c \
+$(srcdir)/generated/reshape_r16.c \
+$(srcdir)/generated/reshape_c4.c \
+$(srcdir)/generated/reshape_c8.c \
+$(srcdir)/generated/reshape_c10.c \
+$(srcdir)/generated/reshape_c16.c
+
+i_eoshift1_c = \
+$(srcdir)/generated/eoshift1_4.c \
+$(srcdir)/generated/eoshift1_8.c \
+$(srcdir)/generated/eoshift1_16.c
+
+i_eoshift3_c = \
+$(srcdir)/generated/eoshift3_4.c \
+$(srcdir)/generated/eoshift3_8.c \
+$(srcdir)/generated/eoshift3_16.c
+
+i_cshift0_c = \
+$(srcdir)/generated/cshift0_i1.c \
+$(srcdir)/generated/cshift0_i2.c \
+$(srcdir)/generated/cshift0_i4.c \
+$(srcdir)/generated/cshift0_i8.c \
+$(srcdir)/generated/cshift0_i16.c \
+$(srcdir)/generated/cshift0_r4.c \
+$(srcdir)/generated/cshift0_r8.c \
+$(srcdir)/generated/cshift0_r10.c \
+$(srcdir)/generated/cshift0_r16.c \
+$(srcdir)/generated/cshift0_c4.c \
+$(srcdir)/generated/cshift0_c8.c \
+$(srcdir)/generated/cshift0_c10.c \
+$(srcdir)/generated/cshift0_c16.c
+
+i_cshift1_c = \
+$(srcdir)/generated/cshift1_4.c \
+$(srcdir)/generated/cshift1_8.c \
+$(srcdir)/generated/cshift1_16.c
+
+in_pack_c = \
+$(srcdir)/generated/in_pack_i1.c \
+$(srcdir)/generated/in_pack_i2.c \
+$(srcdir)/generated/in_pack_i4.c \
+$(srcdir)/generated/in_pack_i8.c \
+$(srcdir)/generated/in_pack_i16.c \
+$(srcdir)/generated/in_pack_r4.c \
+$(srcdir)/generated/in_pack_r8.c \
+$(srcdir)/generated/in_pack_r10.c \
+$(srcdir)/generated/in_pack_r16.c \
+$(srcdir)/generated/in_pack_c4.c \
+$(srcdir)/generated/in_pack_c8.c \
+$(srcdir)/generated/in_pack_c10.c \
+$(srcdir)/generated/in_pack_c16.c
+
+in_unpack_c = \
+$(srcdir)/generated/in_unpack_i1.c \
+$(srcdir)/generated/in_unpack_i2.c \
+$(srcdir)/generated/in_unpack_i4.c \
+$(srcdir)/generated/in_unpack_i8.c \
+$(srcdir)/generated/in_unpack_i16.c \
+$(srcdir)/generated/in_unpack_r4.c \
+$(srcdir)/generated/in_unpack_r8.c \
+$(srcdir)/generated/in_unpack_r10.c \
+$(srcdir)/generated/in_unpack_r16.c \
+$(srcdir)/generated/in_unpack_c4.c \
+$(srcdir)/generated/in_unpack_c8.c \
+$(srcdir)/generated/in_unpack_c10.c \
+$(srcdir)/generated/in_unpack_c16.c
+
+i_exponent_c = \
+$(srcdir)/generated/exponent_r4.c \
+$(srcdir)/generated/exponent_r8.c \
+$(srcdir)/generated/exponent_r10.c \
+$(srcdir)/generated/exponent_r16.c
+
+i_spacing_c = \
+$(srcdir)/generated/spacing_r4.c \
+$(srcdir)/generated/spacing_r8.c \
+$(srcdir)/generated/spacing_r10.c \
+$(srcdir)/generated/spacing_r16.c
+
+i_rrspacing_c = \
+$(srcdir)/generated/rrspacing_r4.c \
+$(srcdir)/generated/rrspacing_r8.c \
+$(srcdir)/generated/rrspacing_r10.c \
+$(srcdir)/generated/rrspacing_r16.c
+
+i_fraction_c = \
+$(srcdir)/generated/fraction_r4.c \
+$(srcdir)/generated/fraction_r8.c \
+$(srcdir)/generated/fraction_r10.c \
+$(srcdir)/generated/fraction_r16.c
+
+i_nearest_c = \
+$(srcdir)/generated/nearest_r4.c \
+$(srcdir)/generated/nearest_r8.c \
+$(srcdir)/generated/nearest_r10.c \
+$(srcdir)/generated/nearest_r16.c
+
+i_set_exponent_c = \
+$(srcdir)/generated/set_exponent_r4.c \
+$(srcdir)/generated/set_exponent_r8.c \
+$(srcdir)/generated/set_exponent_r10.c \
+$(srcdir)/generated/set_exponent_r16.c
+
+i_pow_c = \
+$(srcdir)/generated/pow_i4_i4.c \
+$(srcdir)/generated/pow_i8_i4.c \
+$(srcdir)/generated/pow_i16_i4.c \
+$(srcdir)/generated/pow_r16_i4.c \
+$(srcdir)/generated/pow_c4_i4.c \
+$(srcdir)/generated/pow_c8_i4.c \
+$(srcdir)/generated/pow_c10_i4.c \
+$(srcdir)/generated/pow_c16_i4.c \
+$(srcdir)/generated/pow_i4_i8.c \
+$(srcdir)/generated/pow_i8_i8.c \
+$(srcdir)/generated/pow_i16_i8.c \
+$(srcdir)/generated/pow_r4_i8.c \
+$(srcdir)/generated/pow_r8_i8.c \
+$(srcdir)/generated/pow_r10_i8.c \
+$(srcdir)/generated/pow_r16_i8.c \
+$(srcdir)/generated/pow_c4_i8.c \
+$(srcdir)/generated/pow_c8_i8.c \
+$(srcdir)/generated/pow_c10_i8.c \
+$(srcdir)/generated/pow_c16_i8.c \
+$(srcdir)/generated/pow_i4_i16.c \
+$(srcdir)/generated/pow_i8_i16.c \
+$(srcdir)/generated/pow_i16_i16.c \
+$(srcdir)/generated/pow_r4_i16.c \
+$(srcdir)/generated/pow_r8_i16.c \
+$(srcdir)/generated/pow_r10_i16.c \
+$(srcdir)/generated/pow_r16_i16.c \
+$(srcdir)/generated/pow_c4_i16.c \
+$(srcdir)/generated/pow_c8_i16.c \
+$(srcdir)/generated/pow_c10_i16.c \
+$(srcdir)/generated/pow_c16_i16.c
+
+i_pack_c = \
+$(srcdir)/generated/pack_i1.c \
+$(srcdir)/generated/pack_i2.c \
+$(srcdir)/generated/pack_i4.c \
+$(srcdir)/generated/pack_i8.c \
+$(srcdir)/generated/pack_i16.c \
+$(srcdir)/generated/pack_r4.c \
+$(srcdir)/generated/pack_r8.c \
+$(srcdir)/generated/pack_r10.c \
+$(srcdir)/generated/pack_r16.c \
+$(srcdir)/generated/pack_c4.c \
+$(srcdir)/generated/pack_c8.c \
+$(srcdir)/generated/pack_c10.c \
+$(srcdir)/generated/pack_c16.c
+
+i_unpack_c = \
+$(srcdir)/generated/unpack_i1.c \
+$(srcdir)/generated/unpack_i2.c \
+$(srcdir)/generated/unpack_i4.c \
+$(srcdir)/generated/unpack_i8.c \
+$(srcdir)/generated/unpack_i16.c \
+$(srcdir)/generated/unpack_r4.c \
+$(srcdir)/generated/unpack_r8.c \
+$(srcdir)/generated/unpack_r10.c \
+$(srcdir)/generated/unpack_r16.c \
+$(srcdir)/generated/unpack_c4.c \
+$(srcdir)/generated/unpack_c8.c \
+$(srcdir)/generated/unpack_c10.c \
+$(srcdir)/generated/unpack_c16.c
+
+i_spread_c = \
+$(srcdir)/generated/spread_i1.c \
+$(srcdir)/generated/spread_i2.c \
+$(srcdir)/generated/spread_i4.c \
+$(srcdir)/generated/spread_i8.c \
+$(srcdir)/generated/spread_i16.c \
+$(srcdir)/generated/spread_r4.c \
+$(srcdir)/generated/spread_r8.c \
+$(srcdir)/generated/spread_r10.c \
+$(srcdir)/generated/spread_r16.c \
+$(srcdir)/generated/spread_c4.c \
+$(srcdir)/generated/spread_c8.c \
+$(srcdir)/generated/spread_c10.c \
+$(srcdir)/generated/spread_c16.c 
+
+m4_files = m4/iparm.m4 m4/ifunction.m4 m4/iforeach.m4 m4/all.m4 \
+    m4/any.m4 m4/count.m4 m4/maxloc0.m4 m4/maxloc1.m4 m4/maxval.m4 \
+    m4/minloc0.m4 m4/minloc1.m4 m4/minval.m4 m4/product.m4 m4/sum.m4 \
+    m4/matmul.m4 m4/matmull.m4 m4/ifunction_logical.m4 \
+    m4/ctrig.m4 m4/cexp.m4 m4/chyp.m4 m4/mtype.m4 \
+    m4/specific.m4 m4/specific2.m4 m4/head.m4 m4/shape.m4 m4/reshape.m4 \
+    m4/transpose.m4 m4/eoshift1.m4 m4/eoshift3.m4 m4/exponent.m4 \
+    m4/fraction.m4 m4/nearest.m4 m4/set_exponent.m4 m4/pow.m4 \
+    m4/misc_specifics.m4 m4/rrspacing.m4 m4/spacing.m4 m4/pack.m4 \
+    m4/unpack.m4 m4/spread.m4 m4/bessel.m4 m4/norm2.m4 m4/parity.m4 \
+    m4/iall.m4 m4/iany.m4 m4/iparity.m4
+
+gfor_built_src = $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \
+    $(i_maxloc1_c) $(i_maxval_c) $(i_minloc0_c) $(i_minloc1_c) $(i_minval_c) \
+    $(i_product_c) $(i_sum_c) $(i_bessel_c) $(i_iall_c) $(i_iany_c) \
+    $(i_iparity_c) $(i_norm2_c) $(i_parity_c) \
+    $(i_matmul_c) $(i_matmull_c) $(i_transpose_c) $(i_shape_c) $(i_eoshift1_c) \
+    $(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \
+    $(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \
+    $(i_pow_c) $(i_rrspacing_c) $(i_spacing_c) $(i_pack_c) $(i_unpack_c) \
+    $(i_spread_c) selected_int_kind.inc selected_real_kind.inc kinds.h \
+    $(i_cshift0_c) kinds.inc c99_protos.inc fpu-target.h
+
+
+# Machine generated specifics
+gfor_built_specific_src = \
+$(srcdir)/generated/_abs_c4.F90 \
+$(srcdir)/generated/_abs_c8.F90 \
+$(srcdir)/generated/_abs_c10.F90 \
+$(srcdir)/generated/_abs_c16.F90 \
+$(srcdir)/generated/_abs_i4.F90 \
+$(srcdir)/generated/_abs_i8.F90 \
+$(srcdir)/generated/_abs_i16.F90 \
+$(srcdir)/generated/_abs_r4.F90 \
+$(srcdir)/generated/_abs_r8.F90 \
+$(srcdir)/generated/_abs_r10.F90 \
+$(srcdir)/generated/_abs_r16.F90 \
+$(srcdir)/generated/_aimag_c4.F90 \
+$(srcdir)/generated/_aimag_c8.F90 \
+$(srcdir)/generated/_aimag_c10.F90 \
+$(srcdir)/generated/_aimag_c16.F90 \
+$(srcdir)/generated/_exp_r4.F90 \
+$(srcdir)/generated/_exp_r8.F90 \
+$(srcdir)/generated/_exp_r10.F90 \
+$(srcdir)/generated/_exp_r16.F90 \
+$(srcdir)/generated/_exp_c4.F90 \
+$(srcdir)/generated/_exp_c8.F90 \
+$(srcdir)/generated/_exp_c10.F90 \
+$(srcdir)/generated/_exp_c16.F90 \
+$(srcdir)/generated/_log_r4.F90 \
+$(srcdir)/generated/_log_r8.F90 \
+$(srcdir)/generated/_log_r10.F90 \
+$(srcdir)/generated/_log_r16.F90 \
+$(srcdir)/generated/_log_c4.F90 \
+$(srcdir)/generated/_log_c8.F90 \
+$(srcdir)/generated/_log_c10.F90 \
+$(srcdir)/generated/_log_c16.F90 \
+$(srcdir)/generated/_log10_r4.F90 \
+$(srcdir)/generated/_log10_r8.F90 \
+$(srcdir)/generated/_log10_r10.F90 \
+$(srcdir)/generated/_log10_r16.F90 \
+$(srcdir)/generated/_sqrt_r4.F90 \
+$(srcdir)/generated/_sqrt_r8.F90 \
+$(srcdir)/generated/_sqrt_r10.F90 \
+$(srcdir)/generated/_sqrt_r16.F90 \
+$(srcdir)/generated/_sqrt_c4.F90 \
+$(srcdir)/generated/_sqrt_c8.F90 \
+$(srcdir)/generated/_sqrt_c10.F90 \
+$(srcdir)/generated/_sqrt_c16.F90 \
+$(srcdir)/generated/_asin_r4.F90 \
+$(srcdir)/generated/_asin_r8.F90 \
+$(srcdir)/generated/_asin_r10.F90 \
+$(srcdir)/generated/_asin_r16.F90 \
+$(srcdir)/generated/_asinh_r4.F90 \
+$(srcdir)/generated/_asinh_r8.F90 \
+$(srcdir)/generated/_asinh_r10.F90 \
+$(srcdir)/generated/_asinh_r16.F90 \
+$(srcdir)/generated/_acos_r4.F90 \
+$(srcdir)/generated/_acos_r8.F90 \
+$(srcdir)/generated/_acos_r10.F90 \
+$(srcdir)/generated/_acos_r16.F90 \
+$(srcdir)/generated/_acosh_r4.F90 \
+$(srcdir)/generated/_acosh_r8.F90 \
+$(srcdir)/generated/_acosh_r10.F90 \
+$(srcdir)/generated/_acosh_r16.F90 \
+$(srcdir)/generated/_atan_r4.F90 \
+$(srcdir)/generated/_atan_r8.F90 \
+$(srcdir)/generated/_atan_r10.F90 \
+$(srcdir)/generated/_atan_r16.F90 \
+$(srcdir)/generated/_atanh_r4.F90 \
+$(srcdir)/generated/_atanh_r8.F90 \
+$(srcdir)/generated/_atanh_r10.F90 \
+$(srcdir)/generated/_atanh_r16.F90 \
+$(srcdir)/generated/_sin_r4.F90 \
+$(srcdir)/generated/_sin_r8.F90 \
+$(srcdir)/generated/_sin_r10.F90 \
+$(srcdir)/generated/_sin_r16.F90 \
+$(srcdir)/generated/_sin_c4.F90 \
+$(srcdir)/generated/_sin_c8.F90 \
+$(srcdir)/generated/_sin_c10.F90 \
+$(srcdir)/generated/_sin_c16.F90 \
+$(srcdir)/generated/_cos_r4.F90 \
+$(srcdir)/generated/_cos_r8.F90 \
+$(srcdir)/generated/_cos_r10.F90 \
+$(srcdir)/generated/_cos_r16.F90 \
+$(srcdir)/generated/_cos_c4.F90 \
+$(srcdir)/generated/_cos_c8.F90 \
+$(srcdir)/generated/_cos_c10.F90 \
+$(srcdir)/generated/_cos_c16.F90 \
+$(srcdir)/generated/_tan_r4.F90 \
+$(srcdir)/generated/_tan_r8.F90 \
+$(srcdir)/generated/_tan_r10.F90 \
+$(srcdir)/generated/_tan_r16.F90 \
+$(srcdir)/generated/_sinh_r4.F90 \
+$(srcdir)/generated/_sinh_r8.F90 \
+$(srcdir)/generated/_sinh_r10.F90 \
+$(srcdir)/generated/_sinh_r16.F90 \
+$(srcdir)/generated/_cosh_r4.F90 \
+$(srcdir)/generated/_cosh_r8.F90 \
+$(srcdir)/generated/_cosh_r10.F90 \
+$(srcdir)/generated/_cosh_r16.F90 \
+$(srcdir)/generated/_tanh_r4.F90 \
+$(srcdir)/generated/_tanh_r8.F90 \
+$(srcdir)/generated/_tanh_r10.F90 \
+$(srcdir)/generated/_tanh_r16.F90 \
+$(srcdir)/generated/_conjg_c4.F90 \
+$(srcdir)/generated/_conjg_c8.F90 \
+$(srcdir)/generated/_conjg_c10.F90 \
+$(srcdir)/generated/_conjg_c16.F90 \
+$(srcdir)/generated/_aint_r4.F90 \
+$(srcdir)/generated/_aint_r8.F90 \
+$(srcdir)/generated/_aint_r10.F90 \
+$(srcdir)/generated/_aint_r16.F90 \
+$(srcdir)/generated/_anint_r4.F90 \
+$(srcdir)/generated/_anint_r8.F90 \
+$(srcdir)/generated/_anint_r10.F90 \
+$(srcdir)/generated/_anint_r16.F90
+
+gfor_built_specific2_src = \
+$(srcdir)/generated/_sign_i4.F90 \
+$(srcdir)/generated/_sign_i8.F90 \
+$(srcdir)/generated/_sign_i16.F90 \
+$(srcdir)/generated/_sign_r4.F90 \
+$(srcdir)/generated/_sign_r8.F90 \
+$(srcdir)/generated/_sign_r10.F90 \
+$(srcdir)/generated/_sign_r16.F90 \
+$(srcdir)/generated/_dim_i4.F90 \
+$(srcdir)/generated/_dim_i8.F90 \
+$(srcdir)/generated/_dim_i16.F90 \
+$(srcdir)/generated/_dim_r4.F90 \
+$(srcdir)/generated/_dim_r8.F90 \
+$(srcdir)/generated/_dim_r10.F90 \
+$(srcdir)/generated/_dim_r16.F90 \
+$(srcdir)/generated/_atan2_r4.F90 \
+$(srcdir)/generated/_atan2_r8.F90 \
+$(srcdir)/generated/_atan2_r10.F90 \
+$(srcdir)/generated/_atan2_r16.F90 \
+$(srcdir)/generated/_mod_i4.F90 \
+$(srcdir)/generated/_mod_i8.F90 \
+$(srcdir)/generated/_mod_i16.F90 \
+$(srcdir)/generated/_mod_r4.F90 \
+$(srcdir)/generated/_mod_r8.F90 \
+$(srcdir)/generated/_mod_r10.F90 \
+$(srcdir)/generated/_mod_r16.F90
+
+gfor_misc_specifics = $(srcdir)/generated/misc_specifics.F90
+gfor_specific_src = \
+$(gfor_built_specific_src) \
+$(gfor_built_specific2_src) \
+$(gfor_misc_specifics) \
+intrinsics/dprod_r8.f90 \
+intrinsics/f2c_specifics.F90
+
+BUILT_SOURCES = $(gfor_built_src) $(gfor_built_specific_src) \
+       $(gfor_built_specific2_src) $(gfor_misc_specifics) \
+       $(am__append_1)
+prereq_SRC = $(gfor_src) $(gfor_built_src) $(gfor_io_src) \
+    $(gfor_helper_src) $(gfor_io_headers) $(gfor_specific_src)
+
+@onestep_FALSE@libgfortran_la_SOURCES = $(prereq_SRC)
+
+#libgfortran_f.o: $(filter %.f %.f90,$(prereq_SRC))
+#      $(FCCOMPILE) -c $^ -o $@ -combine
+
+#libgfortran_f.lo: $(filter %.f %.f90,$(prereq_SRC))
+#      $(LTFCCOMPILE) -c -o $@ $^ -combine
+# not currently used:
+#libgfortran_F.o: $(filter %.F %.F90,$(prereq_SRC))
+#      $(PPFCCOMPILE) -c $^ -o $@ -combine
+#
+#libgfortran_F.lo: 
+#      $(LTPPFCCOMPILE) -c -o $@ $^ -combine
+@onestep_TRUE@libgfortran_la_SOURCES = libgfortran_c.c $(filter-out %.c,$(prereq_SRC))
+I_M4_DEPS = m4/iparm.m4
+I_M4_DEPS0 = $(I_M4_DEPS) m4/iforeach.m4
+I_M4_DEPS1 = $(I_M4_DEPS) m4/ifunction.m4
+I_M4_DEPS2 = $(I_M4_DEPS) m4/ifunction_logical.m4
+EXTRA_DIST = $(m4_files)
+all: $(BUILT_SOURCES) config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .c .f90 .lo .o .obj
+am--refresh:
+       @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+       else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+       @rm -f stamp-h1
+       cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+       ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+       rm -f stamp-h1
+       touch $@
+
+distclean-hdr:
+       -rm -f config.h stamp-h1
+libgfortran.spec: $(top_builddir)/config.status $(srcdir)/libgfortran.spec.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+install-cafexeclibLTLIBRARIES: $(cafexeclib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(cafexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(cafexeclibdir)"
+       @list='$(cafexeclib_LTLIBRARIES)'; test -n "$(cafexeclibdir)" || list=; \
+       list2=; for p in $$list; do \
+         if test -f $$p; then \
+           list2="$$list2 $$p"; \
+         else :; fi; \
+       done; \
+       test -z "$$list2" || { \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(cafexeclibdir)'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(cafexeclibdir)"; \
+       }
+
+uninstall-cafexeclibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(cafexeclib_LTLIBRARIES)'; test -n "$(cafexeclibdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(cafexeclibdir)/$$f'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(cafexeclibdir)/$$f"; \
+       done
+
+clean-cafexeclibLTLIBRARIES:
+       -test -z "$(cafexeclib_LTLIBRARIES)" || rm -f $(cafexeclib_LTLIBRARIES)
+       @list='$(cafexeclib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-myexeclibLTLIBRARIES: $(myexeclib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(myexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(myexeclibdir)"
+       @list='$(myexeclib_LTLIBRARIES)'; test -n "$(myexeclibdir)" || list=; \
+       list2=; for p in $$list; do \
+         if test -f $$p; then \
+           list2="$$list2 $$p"; \
+         else :; fi; \
+       done; \
+       test -z "$$list2" || { \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(myexeclibdir)'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(myexeclibdir)"; \
+       }
+
+uninstall-myexeclibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(myexeclib_LTLIBRARIES)'; test -n "$(myexeclibdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(myexeclibdir)/$$f'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(myexeclibdir)/$$f"; \
+       done
+
+clean-myexeclibLTLIBRARIES:
+       -test -z "$(myexeclib_LTLIBRARIES)" || rm -f $(myexeclib_LTLIBRARIES)
+       @list='$(myexeclib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)"
+       @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
+       list2=; for p in $$list; do \
+         if test -f $$p; then \
+           list2="$$list2 $$p"; \
+         else :; fi; \
+       done; \
+       test -z "$$list2" || { \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \
+       }
+
+uninstall-toolexeclibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(toolexeclibdir)/$$f'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(toolexeclibdir)/$$f"; \
+       done
+
+clean-toolexeclibLTLIBRARIES:
+       -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
+       @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libcaf_single.la: $(libcaf_single_la_OBJECTS) $(libcaf_single_la_DEPENDENCIES) 
+       $(libcaf_single_la_LINK) -rpath $(cafexeclibdir) $(libcaf_single_la_OBJECTS) $(libcaf_single_la_LIBADD) $(LIBS)
+libgfortran.la: $(libgfortran_la_OBJECTS) $(libgfortran_la_DEPENDENCIES) 
+       $(libgfortran_la_LINK) -rpath $(toolexeclibdir) $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD) $(LIBS)
+libgfortranbegin.la: $(libgfortranbegin_la_OBJECTS) $(libgfortranbegin_la_DEPENDENCIES) 
+       $(libgfortranbegin_la_LINK) -rpath $(myexeclibdir) $(libgfortranbegin_la_OBJECTS) $(libgfortranbegin_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abort.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/all_l1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/all_l16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/all_l2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/all_l4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/all_l8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/any_l1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/any_l16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/any_l2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/any_l4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/any_l8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/args.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/associated.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backtrace.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bessel_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bessel_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bessel_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bessel_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit_intrinsics.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bounds.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c99_functions.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chdir.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_options.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_char.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count_16_l.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count_1_l.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count_2_l.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count_4_l.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count_8_l.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu_time.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift1_16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift1_4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift1_8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctime.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/date_and_time.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtime.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environ.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eoshift0.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eoshift1_16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eoshift1_4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eoshift1_8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eoshift2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eoshift3_16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eoshift3_4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eoshift3_8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erfc_scaled.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/etime.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execute_command_line.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exit.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exponent_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exponent_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exponent_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exponent_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extends_type_of.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbuf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_pos.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmain.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnum.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpu.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fraction_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fraction_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fraction_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fraction_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gerror.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getXid.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getlog.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostnm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iall_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iall_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iall_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iall_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iall_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iany_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iany_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iany_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iany_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iany_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ierrno.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_generic.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_generic.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inquire.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intrinsics.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iparity_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iparity_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iparity_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iparity_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iparity_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ishftc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_c_binding.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_c_generated_procs.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgfortran_c.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list_read.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_l16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_l4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_l8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matmul_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_16_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_16_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_16_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_16_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_16_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_16_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_16_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_16_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_16_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_4_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_4_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_4_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_4_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_4_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_4_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_4_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_4_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_4_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_8_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_8_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_8_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_8_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_8_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_8_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_8_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_8_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc0_8_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_16_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_16_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_16_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_16_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_16_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_16_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_16_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_16_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_16_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_4_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_4_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_4_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_4_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_4_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_4_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_4_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_4_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_4_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_8_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_8_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_8_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_8_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_8_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_8_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_8_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_8_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxloc1_8_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxval_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxval_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxval_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxval_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxval_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxval_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxval_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxval_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxval_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_16_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_16_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_16_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_16_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_16_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_16_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_16_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_16_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_16_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_4_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_4_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_4_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_4_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_4_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_4_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_4_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_4_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_4_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_8_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_8_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_8_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_8_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_8_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_8_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_8_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_8_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc0_8_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_16_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_16_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_16_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_16_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_16_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_16_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_16_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_16_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_16_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_4_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_4_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_4_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_4_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_4_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_4_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_4_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_4_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_4_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_8_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_8_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_8_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_8_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_8_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_8_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_8_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_8_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minloc1_8_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_alloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mvbits.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nearest_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nearest_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nearest_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nearest_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_generic.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity_l8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perror.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c10_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c10_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c10_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c16_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c16_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c16_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c4_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c4_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c4_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c8_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c8_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_c8_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i16_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i16_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i16_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i4_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i4_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i4_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i8_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i8_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i8_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r10_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r10_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r16_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r16_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r16_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r4_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r4_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r8_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r8_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rand.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_generic.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_packed.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reshape_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrspacing_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrspacing_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrspacing_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrspacing_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selected_char_kind.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_exponent_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_exponent_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_exponent_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_exponent_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shape_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shape_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shape_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/single.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/size.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/size_from_kind.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spacing_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spacing_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spacing_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spacing_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_generic.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spread_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stop.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string_intrinsics.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlnk.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system_clock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transfer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transfer128.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_generic.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transpose_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_generic.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.Plo@am__quote@
+
+.F90.o:
+       $(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+       $(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+       $(LTPPFCCOMPILE) -c -o $@ $<
+
+_abs_c4.lo: $(srcdir)/generated/_abs_c4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_c4.lo `test -f '$(srcdir)/generated/_abs_c4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_c4.F90
+
+_abs_c8.lo: $(srcdir)/generated/_abs_c8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_c8.lo `test -f '$(srcdir)/generated/_abs_c8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_c8.F90
+
+_abs_c10.lo: $(srcdir)/generated/_abs_c10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_c10.lo `test -f '$(srcdir)/generated/_abs_c10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_c10.F90
+
+_abs_c16.lo: $(srcdir)/generated/_abs_c16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_c16.lo `test -f '$(srcdir)/generated/_abs_c16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_c16.F90
+
+_abs_i4.lo: $(srcdir)/generated/_abs_i4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_i4.lo `test -f '$(srcdir)/generated/_abs_i4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_i4.F90
+
+_abs_i8.lo: $(srcdir)/generated/_abs_i8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_i8.lo `test -f '$(srcdir)/generated/_abs_i8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_i8.F90
+
+_abs_i16.lo: $(srcdir)/generated/_abs_i16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_i16.lo `test -f '$(srcdir)/generated/_abs_i16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_i16.F90
+
+_abs_r4.lo: $(srcdir)/generated/_abs_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_r4.lo `test -f '$(srcdir)/generated/_abs_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_r4.F90
+
+_abs_r8.lo: $(srcdir)/generated/_abs_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_r8.lo `test -f '$(srcdir)/generated/_abs_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_r8.F90
+
+_abs_r10.lo: $(srcdir)/generated/_abs_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_r10.lo `test -f '$(srcdir)/generated/_abs_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_r10.F90
+
+_abs_r16.lo: $(srcdir)/generated/_abs_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _abs_r16.lo `test -f '$(srcdir)/generated/_abs_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_abs_r16.F90
+
+_aimag_c4.lo: $(srcdir)/generated/_aimag_c4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _aimag_c4.lo `test -f '$(srcdir)/generated/_aimag_c4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_aimag_c4.F90
+
+_aimag_c8.lo: $(srcdir)/generated/_aimag_c8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _aimag_c8.lo `test -f '$(srcdir)/generated/_aimag_c8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_aimag_c8.F90
+
+_aimag_c10.lo: $(srcdir)/generated/_aimag_c10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _aimag_c10.lo `test -f '$(srcdir)/generated/_aimag_c10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_aimag_c10.F90
+
+_aimag_c16.lo: $(srcdir)/generated/_aimag_c16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _aimag_c16.lo `test -f '$(srcdir)/generated/_aimag_c16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_aimag_c16.F90
+
+_exp_r4.lo: $(srcdir)/generated/_exp_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _exp_r4.lo `test -f '$(srcdir)/generated/_exp_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_exp_r4.F90
+
+_exp_r8.lo: $(srcdir)/generated/_exp_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _exp_r8.lo `test -f '$(srcdir)/generated/_exp_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_exp_r8.F90
+
+_exp_r10.lo: $(srcdir)/generated/_exp_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _exp_r10.lo `test -f '$(srcdir)/generated/_exp_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_exp_r10.F90
+
+_exp_r16.lo: $(srcdir)/generated/_exp_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _exp_r16.lo `test -f '$(srcdir)/generated/_exp_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_exp_r16.F90
+
+_exp_c4.lo: $(srcdir)/generated/_exp_c4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _exp_c4.lo `test -f '$(srcdir)/generated/_exp_c4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_exp_c4.F90
+
+_exp_c8.lo: $(srcdir)/generated/_exp_c8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _exp_c8.lo `test -f '$(srcdir)/generated/_exp_c8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_exp_c8.F90
+
+_exp_c10.lo: $(srcdir)/generated/_exp_c10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _exp_c10.lo `test -f '$(srcdir)/generated/_exp_c10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_exp_c10.F90
+
+_exp_c16.lo: $(srcdir)/generated/_exp_c16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _exp_c16.lo `test -f '$(srcdir)/generated/_exp_c16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_exp_c16.F90
+
+_log_r4.lo: $(srcdir)/generated/_log_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log_r4.lo `test -f '$(srcdir)/generated/_log_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log_r4.F90
+
+_log_r8.lo: $(srcdir)/generated/_log_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log_r8.lo `test -f '$(srcdir)/generated/_log_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log_r8.F90
+
+_log_r10.lo: $(srcdir)/generated/_log_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log_r10.lo `test -f '$(srcdir)/generated/_log_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log_r10.F90
+
+_log_r16.lo: $(srcdir)/generated/_log_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log_r16.lo `test -f '$(srcdir)/generated/_log_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log_r16.F90
+
+_log_c4.lo: $(srcdir)/generated/_log_c4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log_c4.lo `test -f '$(srcdir)/generated/_log_c4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log_c4.F90
+
+_log_c8.lo: $(srcdir)/generated/_log_c8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log_c8.lo `test -f '$(srcdir)/generated/_log_c8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log_c8.F90
+
+_log_c10.lo: $(srcdir)/generated/_log_c10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log_c10.lo `test -f '$(srcdir)/generated/_log_c10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log_c10.F90
+
+_log_c16.lo: $(srcdir)/generated/_log_c16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log_c16.lo `test -f '$(srcdir)/generated/_log_c16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log_c16.F90
+
+_log10_r4.lo: $(srcdir)/generated/_log10_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log10_r4.lo `test -f '$(srcdir)/generated/_log10_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log10_r4.F90
+
+_log10_r8.lo: $(srcdir)/generated/_log10_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log10_r8.lo `test -f '$(srcdir)/generated/_log10_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log10_r8.F90
+
+_log10_r10.lo: $(srcdir)/generated/_log10_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log10_r10.lo `test -f '$(srcdir)/generated/_log10_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log10_r10.F90
+
+_log10_r16.lo: $(srcdir)/generated/_log10_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _log10_r16.lo `test -f '$(srcdir)/generated/_log10_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_log10_r16.F90
+
+_sqrt_r4.lo: $(srcdir)/generated/_sqrt_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sqrt_r4.lo `test -f '$(srcdir)/generated/_sqrt_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sqrt_r4.F90
+
+_sqrt_r8.lo: $(srcdir)/generated/_sqrt_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sqrt_r8.lo `test -f '$(srcdir)/generated/_sqrt_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sqrt_r8.F90
+
+_sqrt_r10.lo: $(srcdir)/generated/_sqrt_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sqrt_r10.lo `test -f '$(srcdir)/generated/_sqrt_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sqrt_r10.F90
+
+_sqrt_r16.lo: $(srcdir)/generated/_sqrt_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sqrt_r16.lo `test -f '$(srcdir)/generated/_sqrt_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sqrt_r16.F90
+
+_sqrt_c4.lo: $(srcdir)/generated/_sqrt_c4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sqrt_c4.lo `test -f '$(srcdir)/generated/_sqrt_c4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sqrt_c4.F90
+
+_sqrt_c8.lo: $(srcdir)/generated/_sqrt_c8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sqrt_c8.lo `test -f '$(srcdir)/generated/_sqrt_c8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sqrt_c8.F90
+
+_sqrt_c10.lo: $(srcdir)/generated/_sqrt_c10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sqrt_c10.lo `test -f '$(srcdir)/generated/_sqrt_c10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sqrt_c10.F90
+
+_sqrt_c16.lo: $(srcdir)/generated/_sqrt_c16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sqrt_c16.lo `test -f '$(srcdir)/generated/_sqrt_c16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sqrt_c16.F90
+
+_asin_r4.lo: $(srcdir)/generated/_asin_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _asin_r4.lo `test -f '$(srcdir)/generated/_asin_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_asin_r4.F90
+
+_asin_r8.lo: $(srcdir)/generated/_asin_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _asin_r8.lo `test -f '$(srcdir)/generated/_asin_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_asin_r8.F90
+
+_asin_r10.lo: $(srcdir)/generated/_asin_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _asin_r10.lo `test -f '$(srcdir)/generated/_asin_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_asin_r10.F90
+
+_asin_r16.lo: $(srcdir)/generated/_asin_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _asin_r16.lo `test -f '$(srcdir)/generated/_asin_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_asin_r16.F90
+
+_asinh_r4.lo: $(srcdir)/generated/_asinh_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _asinh_r4.lo `test -f '$(srcdir)/generated/_asinh_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_asinh_r4.F90
+
+_asinh_r8.lo: $(srcdir)/generated/_asinh_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _asinh_r8.lo `test -f '$(srcdir)/generated/_asinh_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_asinh_r8.F90
+
+_asinh_r10.lo: $(srcdir)/generated/_asinh_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _asinh_r10.lo `test -f '$(srcdir)/generated/_asinh_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_asinh_r10.F90
+
+_asinh_r16.lo: $(srcdir)/generated/_asinh_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _asinh_r16.lo `test -f '$(srcdir)/generated/_asinh_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_asinh_r16.F90
+
+_acos_r4.lo: $(srcdir)/generated/_acos_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _acos_r4.lo `test -f '$(srcdir)/generated/_acos_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_acos_r4.F90
+
+_acos_r8.lo: $(srcdir)/generated/_acos_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _acos_r8.lo `test -f '$(srcdir)/generated/_acos_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_acos_r8.F90
+
+_acos_r10.lo: $(srcdir)/generated/_acos_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _acos_r10.lo `test -f '$(srcdir)/generated/_acos_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_acos_r10.F90
+
+_acos_r16.lo: $(srcdir)/generated/_acos_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _acos_r16.lo `test -f '$(srcdir)/generated/_acos_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_acos_r16.F90
+
+_acosh_r4.lo: $(srcdir)/generated/_acosh_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _acosh_r4.lo `test -f '$(srcdir)/generated/_acosh_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_acosh_r4.F90
+
+_acosh_r8.lo: $(srcdir)/generated/_acosh_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _acosh_r8.lo `test -f '$(srcdir)/generated/_acosh_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_acosh_r8.F90
+
+_acosh_r10.lo: $(srcdir)/generated/_acosh_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _acosh_r10.lo `test -f '$(srcdir)/generated/_acosh_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_acosh_r10.F90
+
+_acosh_r16.lo: $(srcdir)/generated/_acosh_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _acosh_r16.lo `test -f '$(srcdir)/generated/_acosh_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_acosh_r16.F90
+
+_atan_r4.lo: $(srcdir)/generated/_atan_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atan_r4.lo `test -f '$(srcdir)/generated/_atan_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atan_r4.F90
+
+_atan_r8.lo: $(srcdir)/generated/_atan_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atan_r8.lo `test -f '$(srcdir)/generated/_atan_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atan_r8.F90
+
+_atan_r10.lo: $(srcdir)/generated/_atan_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atan_r10.lo `test -f '$(srcdir)/generated/_atan_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atan_r10.F90
+
+_atan_r16.lo: $(srcdir)/generated/_atan_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atan_r16.lo `test -f '$(srcdir)/generated/_atan_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atan_r16.F90
+
+_atanh_r4.lo: $(srcdir)/generated/_atanh_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atanh_r4.lo `test -f '$(srcdir)/generated/_atanh_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atanh_r4.F90
+
+_atanh_r8.lo: $(srcdir)/generated/_atanh_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atanh_r8.lo `test -f '$(srcdir)/generated/_atanh_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atanh_r8.F90
+
+_atanh_r10.lo: $(srcdir)/generated/_atanh_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atanh_r10.lo `test -f '$(srcdir)/generated/_atanh_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atanh_r10.F90
+
+_atanh_r16.lo: $(srcdir)/generated/_atanh_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atanh_r16.lo `test -f '$(srcdir)/generated/_atanh_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atanh_r16.F90
+
+_sin_r4.lo: $(srcdir)/generated/_sin_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sin_r4.lo `test -f '$(srcdir)/generated/_sin_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sin_r4.F90
+
+_sin_r8.lo: $(srcdir)/generated/_sin_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sin_r8.lo `test -f '$(srcdir)/generated/_sin_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sin_r8.F90
+
+_sin_r10.lo: $(srcdir)/generated/_sin_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sin_r10.lo `test -f '$(srcdir)/generated/_sin_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sin_r10.F90
+
+_sin_r16.lo: $(srcdir)/generated/_sin_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sin_r16.lo `test -f '$(srcdir)/generated/_sin_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sin_r16.F90
+
+_sin_c4.lo: $(srcdir)/generated/_sin_c4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sin_c4.lo `test -f '$(srcdir)/generated/_sin_c4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sin_c4.F90
+
+_sin_c8.lo: $(srcdir)/generated/_sin_c8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sin_c8.lo `test -f '$(srcdir)/generated/_sin_c8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sin_c8.F90
+
+_sin_c10.lo: $(srcdir)/generated/_sin_c10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sin_c10.lo `test -f '$(srcdir)/generated/_sin_c10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sin_c10.F90
+
+_sin_c16.lo: $(srcdir)/generated/_sin_c16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sin_c16.lo `test -f '$(srcdir)/generated/_sin_c16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sin_c16.F90
+
+_cos_r4.lo: $(srcdir)/generated/_cos_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cos_r4.lo `test -f '$(srcdir)/generated/_cos_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cos_r4.F90
+
+_cos_r8.lo: $(srcdir)/generated/_cos_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cos_r8.lo `test -f '$(srcdir)/generated/_cos_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cos_r8.F90
+
+_cos_r10.lo: $(srcdir)/generated/_cos_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cos_r10.lo `test -f '$(srcdir)/generated/_cos_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cos_r10.F90
+
+_cos_r16.lo: $(srcdir)/generated/_cos_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cos_r16.lo `test -f '$(srcdir)/generated/_cos_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cos_r16.F90
+
+_cos_c4.lo: $(srcdir)/generated/_cos_c4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cos_c4.lo `test -f '$(srcdir)/generated/_cos_c4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cos_c4.F90
+
+_cos_c8.lo: $(srcdir)/generated/_cos_c8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cos_c8.lo `test -f '$(srcdir)/generated/_cos_c8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cos_c8.F90
+
+_cos_c10.lo: $(srcdir)/generated/_cos_c10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cos_c10.lo `test -f '$(srcdir)/generated/_cos_c10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cos_c10.F90
+
+_cos_c16.lo: $(srcdir)/generated/_cos_c16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cos_c16.lo `test -f '$(srcdir)/generated/_cos_c16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cos_c16.F90
+
+_tan_r4.lo: $(srcdir)/generated/_tan_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _tan_r4.lo `test -f '$(srcdir)/generated/_tan_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_tan_r4.F90
+
+_tan_r8.lo: $(srcdir)/generated/_tan_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _tan_r8.lo `test -f '$(srcdir)/generated/_tan_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_tan_r8.F90
+
+_tan_r10.lo: $(srcdir)/generated/_tan_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _tan_r10.lo `test -f '$(srcdir)/generated/_tan_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_tan_r10.F90
+
+_tan_r16.lo: $(srcdir)/generated/_tan_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _tan_r16.lo `test -f '$(srcdir)/generated/_tan_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_tan_r16.F90
+
+_sinh_r4.lo: $(srcdir)/generated/_sinh_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sinh_r4.lo `test -f '$(srcdir)/generated/_sinh_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sinh_r4.F90
+
+_sinh_r8.lo: $(srcdir)/generated/_sinh_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sinh_r8.lo `test -f '$(srcdir)/generated/_sinh_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sinh_r8.F90
+
+_sinh_r10.lo: $(srcdir)/generated/_sinh_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sinh_r10.lo `test -f '$(srcdir)/generated/_sinh_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sinh_r10.F90
+
+_sinh_r16.lo: $(srcdir)/generated/_sinh_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sinh_r16.lo `test -f '$(srcdir)/generated/_sinh_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sinh_r16.F90
+
+_cosh_r4.lo: $(srcdir)/generated/_cosh_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cosh_r4.lo `test -f '$(srcdir)/generated/_cosh_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cosh_r4.F90
+
+_cosh_r8.lo: $(srcdir)/generated/_cosh_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cosh_r8.lo `test -f '$(srcdir)/generated/_cosh_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cosh_r8.F90
+
+_cosh_r10.lo: $(srcdir)/generated/_cosh_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cosh_r10.lo `test -f '$(srcdir)/generated/_cosh_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cosh_r10.F90
+
+_cosh_r16.lo: $(srcdir)/generated/_cosh_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _cosh_r16.lo `test -f '$(srcdir)/generated/_cosh_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_cosh_r16.F90
+
+_tanh_r4.lo: $(srcdir)/generated/_tanh_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _tanh_r4.lo `test -f '$(srcdir)/generated/_tanh_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_tanh_r4.F90
+
+_tanh_r8.lo: $(srcdir)/generated/_tanh_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _tanh_r8.lo `test -f '$(srcdir)/generated/_tanh_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_tanh_r8.F90
+
+_tanh_r10.lo: $(srcdir)/generated/_tanh_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _tanh_r10.lo `test -f '$(srcdir)/generated/_tanh_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_tanh_r10.F90
+
+_tanh_r16.lo: $(srcdir)/generated/_tanh_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _tanh_r16.lo `test -f '$(srcdir)/generated/_tanh_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_tanh_r16.F90
+
+_conjg_c4.lo: $(srcdir)/generated/_conjg_c4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _conjg_c4.lo `test -f '$(srcdir)/generated/_conjg_c4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_conjg_c4.F90
+
+_conjg_c8.lo: $(srcdir)/generated/_conjg_c8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _conjg_c8.lo `test -f '$(srcdir)/generated/_conjg_c8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_conjg_c8.F90
+
+_conjg_c10.lo: $(srcdir)/generated/_conjg_c10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _conjg_c10.lo `test -f '$(srcdir)/generated/_conjg_c10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_conjg_c10.F90
+
+_conjg_c16.lo: $(srcdir)/generated/_conjg_c16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _conjg_c16.lo `test -f '$(srcdir)/generated/_conjg_c16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_conjg_c16.F90
+
+_aint_r4.lo: $(srcdir)/generated/_aint_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _aint_r4.lo `test -f '$(srcdir)/generated/_aint_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_aint_r4.F90
+
+_aint_r8.lo: $(srcdir)/generated/_aint_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _aint_r8.lo `test -f '$(srcdir)/generated/_aint_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_aint_r8.F90
+
+_aint_r10.lo: $(srcdir)/generated/_aint_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _aint_r10.lo `test -f '$(srcdir)/generated/_aint_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_aint_r10.F90
+
+_aint_r16.lo: $(srcdir)/generated/_aint_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _aint_r16.lo `test -f '$(srcdir)/generated/_aint_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_aint_r16.F90
+
+_anint_r4.lo: $(srcdir)/generated/_anint_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _anint_r4.lo `test -f '$(srcdir)/generated/_anint_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_anint_r4.F90
+
+_anint_r8.lo: $(srcdir)/generated/_anint_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _anint_r8.lo `test -f '$(srcdir)/generated/_anint_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_anint_r8.F90
+
+_anint_r10.lo: $(srcdir)/generated/_anint_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _anint_r10.lo `test -f '$(srcdir)/generated/_anint_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_anint_r10.F90
+
+_anint_r16.lo: $(srcdir)/generated/_anint_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _anint_r16.lo `test -f '$(srcdir)/generated/_anint_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_anint_r16.F90
+
+_sign_i4.lo: $(srcdir)/generated/_sign_i4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sign_i4.lo `test -f '$(srcdir)/generated/_sign_i4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sign_i4.F90
+
+_sign_i8.lo: $(srcdir)/generated/_sign_i8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sign_i8.lo `test -f '$(srcdir)/generated/_sign_i8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sign_i8.F90
+
+_sign_i16.lo: $(srcdir)/generated/_sign_i16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sign_i16.lo `test -f '$(srcdir)/generated/_sign_i16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sign_i16.F90
+
+_sign_r4.lo: $(srcdir)/generated/_sign_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sign_r4.lo `test -f '$(srcdir)/generated/_sign_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sign_r4.F90
+
+_sign_r8.lo: $(srcdir)/generated/_sign_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sign_r8.lo `test -f '$(srcdir)/generated/_sign_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sign_r8.F90
+
+_sign_r10.lo: $(srcdir)/generated/_sign_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sign_r10.lo `test -f '$(srcdir)/generated/_sign_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sign_r10.F90
+
+_sign_r16.lo: $(srcdir)/generated/_sign_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _sign_r16.lo `test -f '$(srcdir)/generated/_sign_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_sign_r16.F90
+
+_dim_i4.lo: $(srcdir)/generated/_dim_i4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _dim_i4.lo `test -f '$(srcdir)/generated/_dim_i4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_dim_i4.F90
+
+_dim_i8.lo: $(srcdir)/generated/_dim_i8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _dim_i8.lo `test -f '$(srcdir)/generated/_dim_i8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_dim_i8.F90
+
+_dim_i16.lo: $(srcdir)/generated/_dim_i16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _dim_i16.lo `test -f '$(srcdir)/generated/_dim_i16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_dim_i16.F90
+
+_dim_r4.lo: $(srcdir)/generated/_dim_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _dim_r4.lo `test -f '$(srcdir)/generated/_dim_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_dim_r4.F90
+
+_dim_r8.lo: $(srcdir)/generated/_dim_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _dim_r8.lo `test -f '$(srcdir)/generated/_dim_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_dim_r8.F90
+
+_dim_r10.lo: $(srcdir)/generated/_dim_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _dim_r10.lo `test -f '$(srcdir)/generated/_dim_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_dim_r10.F90
+
+_dim_r16.lo: $(srcdir)/generated/_dim_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _dim_r16.lo `test -f '$(srcdir)/generated/_dim_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_dim_r16.F90
+
+_atan2_r4.lo: $(srcdir)/generated/_atan2_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atan2_r4.lo `test -f '$(srcdir)/generated/_atan2_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atan2_r4.F90
+
+_atan2_r8.lo: $(srcdir)/generated/_atan2_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atan2_r8.lo `test -f '$(srcdir)/generated/_atan2_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atan2_r8.F90
+
+_atan2_r10.lo: $(srcdir)/generated/_atan2_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atan2_r10.lo `test -f '$(srcdir)/generated/_atan2_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atan2_r10.F90
+
+_atan2_r16.lo: $(srcdir)/generated/_atan2_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _atan2_r16.lo `test -f '$(srcdir)/generated/_atan2_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_atan2_r16.F90
+
+_mod_i4.lo: $(srcdir)/generated/_mod_i4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _mod_i4.lo `test -f '$(srcdir)/generated/_mod_i4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_mod_i4.F90
+
+_mod_i8.lo: $(srcdir)/generated/_mod_i8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _mod_i8.lo `test -f '$(srcdir)/generated/_mod_i8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_mod_i8.F90
+
+_mod_i16.lo: $(srcdir)/generated/_mod_i16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _mod_i16.lo `test -f '$(srcdir)/generated/_mod_i16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_mod_i16.F90
+
+_mod_r4.lo: $(srcdir)/generated/_mod_r4.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _mod_r4.lo `test -f '$(srcdir)/generated/_mod_r4.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_mod_r4.F90
+
+_mod_r8.lo: $(srcdir)/generated/_mod_r8.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _mod_r8.lo `test -f '$(srcdir)/generated/_mod_r8.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_mod_r8.F90
+
+_mod_r10.lo: $(srcdir)/generated/_mod_r10.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _mod_r10.lo `test -f '$(srcdir)/generated/_mod_r10.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_mod_r10.F90
+
+_mod_r16.lo: $(srcdir)/generated/_mod_r16.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o _mod_r16.lo `test -f '$(srcdir)/generated/_mod_r16.F90' || echo '$(srcdir)/'`$(srcdir)/generated/_mod_r16.F90
+
+misc_specifics.lo: $(srcdir)/generated/misc_specifics.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o misc_specifics.lo `test -f '$(srcdir)/generated/misc_specifics.F90' || echo '$(srcdir)/'`$(srcdir)/generated/misc_specifics.F90
+
+f2c_specifics.lo: intrinsics/f2c_specifics.F90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o f2c_specifics.lo `test -f 'intrinsics/f2c_specifics.F90' || echo '$(srcdir)/'`intrinsics/f2c_specifics.F90
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+single.lo: caf/single.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT single.lo -MD -MP -MF $(DEPDIR)/single.Tpo -c -o single.lo `test -f 'caf/single.c' || echo '$(srcdir)/'`caf/single.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/single.Tpo $(DEPDIR)/single.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='caf/single.c' object='single.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o single.lo `test -f 'caf/single.c' || echo '$(srcdir)/'`caf/single.c
+
+backtrace.lo: runtime/backtrace.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backtrace.lo -MD -MP -MF $(DEPDIR)/backtrace.Tpo -c -o backtrace.lo `test -f 'runtime/backtrace.c' || echo '$(srcdir)/'`runtime/backtrace.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/backtrace.Tpo $(DEPDIR)/backtrace.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/backtrace.c' object='backtrace.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace.lo `test -f 'runtime/backtrace.c' || echo '$(srcdir)/'`runtime/backtrace.c
+
+bounds.lo: runtime/bounds.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bounds.lo -MD -MP -MF $(DEPDIR)/bounds.Tpo -c -o bounds.lo `test -f 'runtime/bounds.c' || echo '$(srcdir)/'`runtime/bounds.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/bounds.Tpo $(DEPDIR)/bounds.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/bounds.c' object='bounds.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bounds.lo `test -f 'runtime/bounds.c' || echo '$(srcdir)/'`runtime/bounds.c
+
+compile_options.lo: runtime/compile_options.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compile_options.lo -MD -MP -MF $(DEPDIR)/compile_options.Tpo -c -o compile_options.lo `test -f 'runtime/compile_options.c' || echo '$(srcdir)/'`runtime/compile_options.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/compile_options.Tpo $(DEPDIR)/compile_options.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/compile_options.c' object='compile_options.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compile_options.lo `test -f 'runtime/compile_options.c' || echo '$(srcdir)/'`runtime/compile_options.c
+
+convert_char.lo: runtime/convert_char.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT convert_char.lo -MD -MP -MF $(DEPDIR)/convert_char.Tpo -c -o convert_char.lo `test -f 'runtime/convert_char.c' || echo '$(srcdir)/'`runtime/convert_char.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/convert_char.Tpo $(DEPDIR)/convert_char.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/convert_char.c' object='convert_char.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o convert_char.lo `test -f 'runtime/convert_char.c' || echo '$(srcdir)/'`runtime/convert_char.c
+
+environ.lo: runtime/environ.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT environ.lo -MD -MP -MF $(DEPDIR)/environ.Tpo -c -o environ.lo `test -f 'runtime/environ.c' || echo '$(srcdir)/'`runtime/environ.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/environ.Tpo $(DEPDIR)/environ.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/environ.c' object='environ.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o environ.lo `test -f 'runtime/environ.c' || echo '$(srcdir)/'`runtime/environ.c
+
+error.lo: runtime/error.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT error.lo -MD -MP -MF $(DEPDIR)/error.Tpo -c -o error.lo `test -f 'runtime/error.c' || echo '$(srcdir)/'`runtime/error.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/error.Tpo $(DEPDIR)/error.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/error.c' object='error.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o error.lo `test -f 'runtime/error.c' || echo '$(srcdir)/'`runtime/error.c
+
+fpu.lo: runtime/fpu.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fpu.lo -MD -MP -MF $(DEPDIR)/fpu.Tpo -c -o fpu.lo `test -f 'runtime/fpu.c' || echo '$(srcdir)/'`runtime/fpu.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/fpu.Tpo $(DEPDIR)/fpu.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/fpu.c' object='fpu.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fpu.lo `test -f 'runtime/fpu.c' || echo '$(srcdir)/'`runtime/fpu.c
+
+main.lo: runtime/main.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT main.lo -MD -MP -MF $(DEPDIR)/main.Tpo -c -o main.lo `test -f 'runtime/main.c' || echo '$(srcdir)/'`runtime/main.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/main.Tpo $(DEPDIR)/main.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/main.c' object='main.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o main.lo `test -f 'runtime/main.c' || echo '$(srcdir)/'`runtime/main.c
+
+memory.lo: runtime/memory.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.lo -MD -MP -MF $(DEPDIR)/memory.Tpo -c -o memory.lo `test -f 'runtime/memory.c' || echo '$(srcdir)/'`runtime/memory.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/memory.Tpo $(DEPDIR)/memory.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/memory.c' object='memory.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f 'runtime/memory.c' || echo '$(srcdir)/'`runtime/memory.c
+
+pause.lo: runtime/pause.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pause.lo -MD -MP -MF $(DEPDIR)/pause.Tpo -c -o pause.lo `test -f 'runtime/pause.c' || echo '$(srcdir)/'`runtime/pause.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pause.Tpo $(DEPDIR)/pause.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/pause.c' object='pause.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pause.lo `test -f 'runtime/pause.c' || echo '$(srcdir)/'`runtime/pause.c
+
+stop.lo: runtime/stop.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stop.lo -MD -MP -MF $(DEPDIR)/stop.Tpo -c -o stop.lo `test -f 'runtime/stop.c' || echo '$(srcdir)/'`runtime/stop.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/stop.Tpo $(DEPDIR)/stop.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/stop.c' object='stop.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stop.lo `test -f 'runtime/stop.c' || echo '$(srcdir)/'`runtime/stop.c
+
+string.lo: runtime/string.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT string.lo -MD -MP -MF $(DEPDIR)/string.Tpo -c -o string.lo `test -f 'runtime/string.c' || echo '$(srcdir)/'`runtime/string.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/string.Tpo $(DEPDIR)/string.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/string.c' object='string.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o string.lo `test -f 'runtime/string.c' || echo '$(srcdir)/'`runtime/string.c
+
+select.lo: runtime/select.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT select.lo -MD -MP -MF $(DEPDIR)/select.Tpo -c -o select.lo `test -f 'runtime/select.c' || echo '$(srcdir)/'`runtime/select.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/select.Tpo $(DEPDIR)/select.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/select.c' object='select.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o select.lo `test -f 'runtime/select.c' || echo '$(srcdir)/'`runtime/select.c
+
+all_l1.lo: $(srcdir)/generated/all_l1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT all_l1.lo -MD -MP -MF $(DEPDIR)/all_l1.Tpo -c -o all_l1.lo `test -f '$(srcdir)/generated/all_l1.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/all_l1.Tpo $(DEPDIR)/all_l1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/all_l1.c' object='all_l1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o all_l1.lo `test -f '$(srcdir)/generated/all_l1.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l1.c
+
+all_l2.lo: $(srcdir)/generated/all_l2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT all_l2.lo -MD -MP -MF $(DEPDIR)/all_l2.Tpo -c -o all_l2.lo `test -f '$(srcdir)/generated/all_l2.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/all_l2.Tpo $(DEPDIR)/all_l2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/all_l2.c' object='all_l2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o all_l2.lo `test -f '$(srcdir)/generated/all_l2.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l2.c
+
+all_l4.lo: $(srcdir)/generated/all_l4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT all_l4.lo -MD -MP -MF $(DEPDIR)/all_l4.Tpo -c -o all_l4.lo `test -f '$(srcdir)/generated/all_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/all_l4.Tpo $(DEPDIR)/all_l4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/all_l4.c' object='all_l4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o all_l4.lo `test -f '$(srcdir)/generated/all_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l4.c
+
+all_l8.lo: $(srcdir)/generated/all_l8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT all_l8.lo -MD -MP -MF $(DEPDIR)/all_l8.Tpo -c -o all_l8.lo `test -f '$(srcdir)/generated/all_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/all_l8.Tpo $(DEPDIR)/all_l8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/all_l8.c' object='all_l8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o all_l8.lo `test -f '$(srcdir)/generated/all_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l8.c
+
+all_l16.lo: $(srcdir)/generated/all_l16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT all_l16.lo -MD -MP -MF $(DEPDIR)/all_l16.Tpo -c -o all_l16.lo `test -f '$(srcdir)/generated/all_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/all_l16.Tpo $(DEPDIR)/all_l16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/all_l16.c' object='all_l16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o all_l16.lo `test -f '$(srcdir)/generated/all_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/all_l16.c
+
+any_l1.lo: $(srcdir)/generated/any_l1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT any_l1.lo -MD -MP -MF $(DEPDIR)/any_l1.Tpo -c -o any_l1.lo `test -f '$(srcdir)/generated/any_l1.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/any_l1.Tpo $(DEPDIR)/any_l1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/any_l1.c' object='any_l1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o any_l1.lo `test -f '$(srcdir)/generated/any_l1.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l1.c
+
+any_l2.lo: $(srcdir)/generated/any_l2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT any_l2.lo -MD -MP -MF $(DEPDIR)/any_l2.Tpo -c -o any_l2.lo `test -f '$(srcdir)/generated/any_l2.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/any_l2.Tpo $(DEPDIR)/any_l2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/any_l2.c' object='any_l2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o any_l2.lo `test -f '$(srcdir)/generated/any_l2.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l2.c
+
+any_l4.lo: $(srcdir)/generated/any_l4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT any_l4.lo -MD -MP -MF $(DEPDIR)/any_l4.Tpo -c -o any_l4.lo `test -f '$(srcdir)/generated/any_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/any_l4.Tpo $(DEPDIR)/any_l4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/any_l4.c' object='any_l4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o any_l4.lo `test -f '$(srcdir)/generated/any_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l4.c
+
+any_l8.lo: $(srcdir)/generated/any_l8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT any_l8.lo -MD -MP -MF $(DEPDIR)/any_l8.Tpo -c -o any_l8.lo `test -f '$(srcdir)/generated/any_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/any_l8.Tpo $(DEPDIR)/any_l8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/any_l8.c' object='any_l8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o any_l8.lo `test -f '$(srcdir)/generated/any_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l8.c
+
+any_l16.lo: $(srcdir)/generated/any_l16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT any_l16.lo -MD -MP -MF $(DEPDIR)/any_l16.Tpo -c -o any_l16.lo `test -f '$(srcdir)/generated/any_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/any_l16.Tpo $(DEPDIR)/any_l16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/any_l16.c' object='any_l16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o any_l16.lo `test -f '$(srcdir)/generated/any_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/any_l16.c
+
+count_1_l.lo: $(srcdir)/generated/count_1_l.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT count_1_l.lo -MD -MP -MF $(DEPDIR)/count_1_l.Tpo -c -o count_1_l.lo `test -f '$(srcdir)/generated/count_1_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_1_l.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/count_1_l.Tpo $(DEPDIR)/count_1_l.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/count_1_l.c' object='count_1_l.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o count_1_l.lo `test -f '$(srcdir)/generated/count_1_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_1_l.c
+
+count_2_l.lo: $(srcdir)/generated/count_2_l.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT count_2_l.lo -MD -MP -MF $(DEPDIR)/count_2_l.Tpo -c -o count_2_l.lo `test -f '$(srcdir)/generated/count_2_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_2_l.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/count_2_l.Tpo $(DEPDIR)/count_2_l.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/count_2_l.c' object='count_2_l.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o count_2_l.lo `test -f '$(srcdir)/generated/count_2_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_2_l.c
+
+count_4_l.lo: $(srcdir)/generated/count_4_l.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT count_4_l.lo -MD -MP -MF $(DEPDIR)/count_4_l.Tpo -c -o count_4_l.lo `test -f '$(srcdir)/generated/count_4_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_4_l.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/count_4_l.Tpo $(DEPDIR)/count_4_l.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/count_4_l.c' object='count_4_l.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o count_4_l.lo `test -f '$(srcdir)/generated/count_4_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_4_l.c
+
+count_8_l.lo: $(srcdir)/generated/count_8_l.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT count_8_l.lo -MD -MP -MF $(DEPDIR)/count_8_l.Tpo -c -o count_8_l.lo `test -f '$(srcdir)/generated/count_8_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_8_l.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/count_8_l.Tpo $(DEPDIR)/count_8_l.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/count_8_l.c' object='count_8_l.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o count_8_l.lo `test -f '$(srcdir)/generated/count_8_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_8_l.c
+
+count_16_l.lo: $(srcdir)/generated/count_16_l.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT count_16_l.lo -MD -MP -MF $(DEPDIR)/count_16_l.Tpo -c -o count_16_l.lo `test -f '$(srcdir)/generated/count_16_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_16_l.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/count_16_l.Tpo $(DEPDIR)/count_16_l.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/count_16_l.c' object='count_16_l.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o count_16_l.lo `test -f '$(srcdir)/generated/count_16_l.c' || echo '$(srcdir)/'`$(srcdir)/generated/count_16_l.c
+
+maxloc0_4_i1.lo: $(srcdir)/generated/maxloc0_4_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_4_i1.lo -MD -MP -MF $(DEPDIR)/maxloc0_4_i1.Tpo -c -o maxloc0_4_i1.lo `test -f '$(srcdir)/generated/maxloc0_4_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_4_i1.Tpo $(DEPDIR)/maxloc0_4_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_4_i1.c' object='maxloc0_4_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_4_i1.lo `test -f '$(srcdir)/generated/maxloc0_4_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i1.c
+
+maxloc0_8_i1.lo: $(srcdir)/generated/maxloc0_8_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_8_i1.lo -MD -MP -MF $(DEPDIR)/maxloc0_8_i1.Tpo -c -o maxloc0_8_i1.lo `test -f '$(srcdir)/generated/maxloc0_8_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_8_i1.Tpo $(DEPDIR)/maxloc0_8_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_8_i1.c' object='maxloc0_8_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_8_i1.lo `test -f '$(srcdir)/generated/maxloc0_8_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i1.c
+
+maxloc0_16_i1.lo: $(srcdir)/generated/maxloc0_16_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_16_i1.lo -MD -MP -MF $(DEPDIR)/maxloc0_16_i1.Tpo -c -o maxloc0_16_i1.lo `test -f '$(srcdir)/generated/maxloc0_16_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_16_i1.Tpo $(DEPDIR)/maxloc0_16_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_16_i1.c' object='maxloc0_16_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_16_i1.lo `test -f '$(srcdir)/generated/maxloc0_16_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i1.c
+
+maxloc0_4_i2.lo: $(srcdir)/generated/maxloc0_4_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_4_i2.lo -MD -MP -MF $(DEPDIR)/maxloc0_4_i2.Tpo -c -o maxloc0_4_i2.lo `test -f '$(srcdir)/generated/maxloc0_4_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_4_i2.Tpo $(DEPDIR)/maxloc0_4_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_4_i2.c' object='maxloc0_4_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_4_i2.lo `test -f '$(srcdir)/generated/maxloc0_4_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i2.c
+
+maxloc0_8_i2.lo: $(srcdir)/generated/maxloc0_8_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_8_i2.lo -MD -MP -MF $(DEPDIR)/maxloc0_8_i2.Tpo -c -o maxloc0_8_i2.lo `test -f '$(srcdir)/generated/maxloc0_8_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_8_i2.Tpo $(DEPDIR)/maxloc0_8_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_8_i2.c' object='maxloc0_8_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_8_i2.lo `test -f '$(srcdir)/generated/maxloc0_8_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i2.c
+
+maxloc0_16_i2.lo: $(srcdir)/generated/maxloc0_16_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_16_i2.lo -MD -MP -MF $(DEPDIR)/maxloc0_16_i2.Tpo -c -o maxloc0_16_i2.lo `test -f '$(srcdir)/generated/maxloc0_16_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_16_i2.Tpo $(DEPDIR)/maxloc0_16_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_16_i2.c' object='maxloc0_16_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_16_i2.lo `test -f '$(srcdir)/generated/maxloc0_16_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i2.c
+
+maxloc0_4_i4.lo: $(srcdir)/generated/maxloc0_4_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_4_i4.lo -MD -MP -MF $(DEPDIR)/maxloc0_4_i4.Tpo -c -o maxloc0_4_i4.lo `test -f '$(srcdir)/generated/maxloc0_4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_4_i4.Tpo $(DEPDIR)/maxloc0_4_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_4_i4.c' object='maxloc0_4_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_4_i4.lo `test -f '$(srcdir)/generated/maxloc0_4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i4.c
+
+maxloc0_8_i4.lo: $(srcdir)/generated/maxloc0_8_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_8_i4.lo -MD -MP -MF $(DEPDIR)/maxloc0_8_i4.Tpo -c -o maxloc0_8_i4.lo `test -f '$(srcdir)/generated/maxloc0_8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_8_i4.Tpo $(DEPDIR)/maxloc0_8_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_8_i4.c' object='maxloc0_8_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_8_i4.lo `test -f '$(srcdir)/generated/maxloc0_8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i4.c
+
+maxloc0_16_i4.lo: $(srcdir)/generated/maxloc0_16_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_16_i4.lo -MD -MP -MF $(DEPDIR)/maxloc0_16_i4.Tpo -c -o maxloc0_16_i4.lo `test -f '$(srcdir)/generated/maxloc0_16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_16_i4.Tpo $(DEPDIR)/maxloc0_16_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_16_i4.c' object='maxloc0_16_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_16_i4.lo `test -f '$(srcdir)/generated/maxloc0_16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i4.c
+
+maxloc0_4_i8.lo: $(srcdir)/generated/maxloc0_4_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_4_i8.lo -MD -MP -MF $(DEPDIR)/maxloc0_4_i8.Tpo -c -o maxloc0_4_i8.lo `test -f '$(srcdir)/generated/maxloc0_4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_4_i8.Tpo $(DEPDIR)/maxloc0_4_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_4_i8.c' object='maxloc0_4_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_4_i8.lo `test -f '$(srcdir)/generated/maxloc0_4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i8.c
+
+maxloc0_8_i8.lo: $(srcdir)/generated/maxloc0_8_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_8_i8.lo -MD -MP -MF $(DEPDIR)/maxloc0_8_i8.Tpo -c -o maxloc0_8_i8.lo `test -f '$(srcdir)/generated/maxloc0_8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_8_i8.Tpo $(DEPDIR)/maxloc0_8_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_8_i8.c' object='maxloc0_8_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_8_i8.lo `test -f '$(srcdir)/generated/maxloc0_8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i8.c
+
+maxloc0_16_i8.lo: $(srcdir)/generated/maxloc0_16_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_16_i8.lo -MD -MP -MF $(DEPDIR)/maxloc0_16_i8.Tpo -c -o maxloc0_16_i8.lo `test -f '$(srcdir)/generated/maxloc0_16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_16_i8.Tpo $(DEPDIR)/maxloc0_16_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_16_i8.c' object='maxloc0_16_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_16_i8.lo `test -f '$(srcdir)/generated/maxloc0_16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i8.c
+
+maxloc0_4_i16.lo: $(srcdir)/generated/maxloc0_4_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_4_i16.lo -MD -MP -MF $(DEPDIR)/maxloc0_4_i16.Tpo -c -o maxloc0_4_i16.lo `test -f '$(srcdir)/generated/maxloc0_4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_4_i16.Tpo $(DEPDIR)/maxloc0_4_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_4_i16.c' object='maxloc0_4_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_4_i16.lo `test -f '$(srcdir)/generated/maxloc0_4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_i16.c
+
+maxloc0_8_i16.lo: $(srcdir)/generated/maxloc0_8_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_8_i16.lo -MD -MP -MF $(DEPDIR)/maxloc0_8_i16.Tpo -c -o maxloc0_8_i16.lo `test -f '$(srcdir)/generated/maxloc0_8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_8_i16.Tpo $(DEPDIR)/maxloc0_8_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_8_i16.c' object='maxloc0_8_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_8_i16.lo `test -f '$(srcdir)/generated/maxloc0_8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_i16.c
+
+maxloc0_16_i16.lo: $(srcdir)/generated/maxloc0_16_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_16_i16.lo -MD -MP -MF $(DEPDIR)/maxloc0_16_i16.Tpo -c -o maxloc0_16_i16.lo `test -f '$(srcdir)/generated/maxloc0_16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_16_i16.Tpo $(DEPDIR)/maxloc0_16_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_16_i16.c' object='maxloc0_16_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_16_i16.lo `test -f '$(srcdir)/generated/maxloc0_16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_i16.c
+
+maxloc0_4_r4.lo: $(srcdir)/generated/maxloc0_4_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_4_r4.lo -MD -MP -MF $(DEPDIR)/maxloc0_4_r4.Tpo -c -o maxloc0_4_r4.lo `test -f '$(srcdir)/generated/maxloc0_4_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_4_r4.Tpo $(DEPDIR)/maxloc0_4_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_4_r4.c' object='maxloc0_4_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_4_r4.lo `test -f '$(srcdir)/generated/maxloc0_4_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_r4.c
+
+maxloc0_8_r4.lo: $(srcdir)/generated/maxloc0_8_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_8_r4.lo -MD -MP -MF $(DEPDIR)/maxloc0_8_r4.Tpo -c -o maxloc0_8_r4.lo `test -f '$(srcdir)/generated/maxloc0_8_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_8_r4.Tpo $(DEPDIR)/maxloc0_8_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_8_r4.c' object='maxloc0_8_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_8_r4.lo `test -f '$(srcdir)/generated/maxloc0_8_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_r4.c
+
+maxloc0_16_r4.lo: $(srcdir)/generated/maxloc0_16_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_16_r4.lo -MD -MP -MF $(DEPDIR)/maxloc0_16_r4.Tpo -c -o maxloc0_16_r4.lo `test -f '$(srcdir)/generated/maxloc0_16_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_16_r4.Tpo $(DEPDIR)/maxloc0_16_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_16_r4.c' object='maxloc0_16_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_16_r4.lo `test -f '$(srcdir)/generated/maxloc0_16_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_r4.c
+
+maxloc0_4_r8.lo: $(srcdir)/generated/maxloc0_4_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_4_r8.lo -MD -MP -MF $(DEPDIR)/maxloc0_4_r8.Tpo -c -o maxloc0_4_r8.lo `test -f '$(srcdir)/generated/maxloc0_4_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_4_r8.Tpo $(DEPDIR)/maxloc0_4_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_4_r8.c' object='maxloc0_4_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_4_r8.lo `test -f '$(srcdir)/generated/maxloc0_4_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_r8.c
+
+maxloc0_8_r8.lo: $(srcdir)/generated/maxloc0_8_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_8_r8.lo -MD -MP -MF $(DEPDIR)/maxloc0_8_r8.Tpo -c -o maxloc0_8_r8.lo `test -f '$(srcdir)/generated/maxloc0_8_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_8_r8.Tpo $(DEPDIR)/maxloc0_8_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_8_r8.c' object='maxloc0_8_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_8_r8.lo `test -f '$(srcdir)/generated/maxloc0_8_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_r8.c
+
+maxloc0_16_r8.lo: $(srcdir)/generated/maxloc0_16_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_16_r8.lo -MD -MP -MF $(DEPDIR)/maxloc0_16_r8.Tpo -c -o maxloc0_16_r8.lo `test -f '$(srcdir)/generated/maxloc0_16_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_16_r8.Tpo $(DEPDIR)/maxloc0_16_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_16_r8.c' object='maxloc0_16_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_16_r8.lo `test -f '$(srcdir)/generated/maxloc0_16_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_r8.c
+
+maxloc0_4_r10.lo: $(srcdir)/generated/maxloc0_4_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_4_r10.lo -MD -MP -MF $(DEPDIR)/maxloc0_4_r10.Tpo -c -o maxloc0_4_r10.lo `test -f '$(srcdir)/generated/maxloc0_4_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_4_r10.Tpo $(DEPDIR)/maxloc0_4_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_4_r10.c' object='maxloc0_4_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_4_r10.lo `test -f '$(srcdir)/generated/maxloc0_4_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_r10.c
+
+maxloc0_8_r10.lo: $(srcdir)/generated/maxloc0_8_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_8_r10.lo -MD -MP -MF $(DEPDIR)/maxloc0_8_r10.Tpo -c -o maxloc0_8_r10.lo `test -f '$(srcdir)/generated/maxloc0_8_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_8_r10.Tpo $(DEPDIR)/maxloc0_8_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_8_r10.c' object='maxloc0_8_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_8_r10.lo `test -f '$(srcdir)/generated/maxloc0_8_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_r10.c
+
+maxloc0_16_r10.lo: $(srcdir)/generated/maxloc0_16_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_16_r10.lo -MD -MP -MF $(DEPDIR)/maxloc0_16_r10.Tpo -c -o maxloc0_16_r10.lo `test -f '$(srcdir)/generated/maxloc0_16_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_16_r10.Tpo $(DEPDIR)/maxloc0_16_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_16_r10.c' object='maxloc0_16_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_16_r10.lo `test -f '$(srcdir)/generated/maxloc0_16_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_r10.c
+
+maxloc0_4_r16.lo: $(srcdir)/generated/maxloc0_4_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_4_r16.lo -MD -MP -MF $(DEPDIR)/maxloc0_4_r16.Tpo -c -o maxloc0_4_r16.lo `test -f '$(srcdir)/generated/maxloc0_4_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_4_r16.Tpo $(DEPDIR)/maxloc0_4_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_4_r16.c' object='maxloc0_4_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_4_r16.lo `test -f '$(srcdir)/generated/maxloc0_4_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_4_r16.c
+
+maxloc0_8_r16.lo: $(srcdir)/generated/maxloc0_8_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_8_r16.lo -MD -MP -MF $(DEPDIR)/maxloc0_8_r16.Tpo -c -o maxloc0_8_r16.lo `test -f '$(srcdir)/generated/maxloc0_8_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_8_r16.Tpo $(DEPDIR)/maxloc0_8_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_8_r16.c' object='maxloc0_8_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_8_r16.lo `test -f '$(srcdir)/generated/maxloc0_8_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_8_r16.c
+
+maxloc0_16_r16.lo: $(srcdir)/generated/maxloc0_16_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc0_16_r16.lo -MD -MP -MF $(DEPDIR)/maxloc0_16_r16.Tpo -c -o maxloc0_16_r16.lo `test -f '$(srcdir)/generated/maxloc0_16_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc0_16_r16.Tpo $(DEPDIR)/maxloc0_16_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc0_16_r16.c' object='maxloc0_16_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc0_16_r16.lo `test -f '$(srcdir)/generated/maxloc0_16_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc0_16_r16.c
+
+maxloc1_4_i1.lo: $(srcdir)/generated/maxloc1_4_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_4_i1.lo -MD -MP -MF $(DEPDIR)/maxloc1_4_i1.Tpo -c -o maxloc1_4_i1.lo `test -f '$(srcdir)/generated/maxloc1_4_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_4_i1.Tpo $(DEPDIR)/maxloc1_4_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_4_i1.c' object='maxloc1_4_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_4_i1.lo `test -f '$(srcdir)/generated/maxloc1_4_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i1.c
+
+maxloc1_8_i1.lo: $(srcdir)/generated/maxloc1_8_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_8_i1.lo -MD -MP -MF $(DEPDIR)/maxloc1_8_i1.Tpo -c -o maxloc1_8_i1.lo `test -f '$(srcdir)/generated/maxloc1_8_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_8_i1.Tpo $(DEPDIR)/maxloc1_8_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_8_i1.c' object='maxloc1_8_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_8_i1.lo `test -f '$(srcdir)/generated/maxloc1_8_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i1.c
+
+maxloc1_16_i1.lo: $(srcdir)/generated/maxloc1_16_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_16_i1.lo -MD -MP -MF $(DEPDIR)/maxloc1_16_i1.Tpo -c -o maxloc1_16_i1.lo `test -f '$(srcdir)/generated/maxloc1_16_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_16_i1.Tpo $(DEPDIR)/maxloc1_16_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_16_i1.c' object='maxloc1_16_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_16_i1.lo `test -f '$(srcdir)/generated/maxloc1_16_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i1.c
+
+maxloc1_4_i2.lo: $(srcdir)/generated/maxloc1_4_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_4_i2.lo -MD -MP -MF $(DEPDIR)/maxloc1_4_i2.Tpo -c -o maxloc1_4_i2.lo `test -f '$(srcdir)/generated/maxloc1_4_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_4_i2.Tpo $(DEPDIR)/maxloc1_4_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_4_i2.c' object='maxloc1_4_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_4_i2.lo `test -f '$(srcdir)/generated/maxloc1_4_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i2.c
+
+maxloc1_8_i2.lo: $(srcdir)/generated/maxloc1_8_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_8_i2.lo -MD -MP -MF $(DEPDIR)/maxloc1_8_i2.Tpo -c -o maxloc1_8_i2.lo `test -f '$(srcdir)/generated/maxloc1_8_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_8_i2.Tpo $(DEPDIR)/maxloc1_8_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_8_i2.c' object='maxloc1_8_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_8_i2.lo `test -f '$(srcdir)/generated/maxloc1_8_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i2.c
+
+maxloc1_16_i2.lo: $(srcdir)/generated/maxloc1_16_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_16_i2.lo -MD -MP -MF $(DEPDIR)/maxloc1_16_i2.Tpo -c -o maxloc1_16_i2.lo `test -f '$(srcdir)/generated/maxloc1_16_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_16_i2.Tpo $(DEPDIR)/maxloc1_16_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_16_i2.c' object='maxloc1_16_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_16_i2.lo `test -f '$(srcdir)/generated/maxloc1_16_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i2.c
+
+maxloc1_4_i4.lo: $(srcdir)/generated/maxloc1_4_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_4_i4.lo -MD -MP -MF $(DEPDIR)/maxloc1_4_i4.Tpo -c -o maxloc1_4_i4.lo `test -f '$(srcdir)/generated/maxloc1_4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_4_i4.Tpo $(DEPDIR)/maxloc1_4_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_4_i4.c' object='maxloc1_4_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_4_i4.lo `test -f '$(srcdir)/generated/maxloc1_4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i4.c
+
+maxloc1_8_i4.lo: $(srcdir)/generated/maxloc1_8_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_8_i4.lo -MD -MP -MF $(DEPDIR)/maxloc1_8_i4.Tpo -c -o maxloc1_8_i4.lo `test -f '$(srcdir)/generated/maxloc1_8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_8_i4.Tpo $(DEPDIR)/maxloc1_8_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_8_i4.c' object='maxloc1_8_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_8_i4.lo `test -f '$(srcdir)/generated/maxloc1_8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i4.c
+
+maxloc1_16_i4.lo: $(srcdir)/generated/maxloc1_16_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_16_i4.lo -MD -MP -MF $(DEPDIR)/maxloc1_16_i4.Tpo -c -o maxloc1_16_i4.lo `test -f '$(srcdir)/generated/maxloc1_16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_16_i4.Tpo $(DEPDIR)/maxloc1_16_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_16_i4.c' object='maxloc1_16_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_16_i4.lo `test -f '$(srcdir)/generated/maxloc1_16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i4.c
+
+maxloc1_4_i8.lo: $(srcdir)/generated/maxloc1_4_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_4_i8.lo -MD -MP -MF $(DEPDIR)/maxloc1_4_i8.Tpo -c -o maxloc1_4_i8.lo `test -f '$(srcdir)/generated/maxloc1_4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_4_i8.Tpo $(DEPDIR)/maxloc1_4_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_4_i8.c' object='maxloc1_4_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_4_i8.lo `test -f '$(srcdir)/generated/maxloc1_4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i8.c
+
+maxloc1_8_i8.lo: $(srcdir)/generated/maxloc1_8_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_8_i8.lo -MD -MP -MF $(DEPDIR)/maxloc1_8_i8.Tpo -c -o maxloc1_8_i8.lo `test -f '$(srcdir)/generated/maxloc1_8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_8_i8.Tpo $(DEPDIR)/maxloc1_8_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_8_i8.c' object='maxloc1_8_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_8_i8.lo `test -f '$(srcdir)/generated/maxloc1_8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i8.c
+
+maxloc1_16_i8.lo: $(srcdir)/generated/maxloc1_16_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_16_i8.lo -MD -MP -MF $(DEPDIR)/maxloc1_16_i8.Tpo -c -o maxloc1_16_i8.lo `test -f '$(srcdir)/generated/maxloc1_16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_16_i8.Tpo $(DEPDIR)/maxloc1_16_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_16_i8.c' object='maxloc1_16_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_16_i8.lo `test -f '$(srcdir)/generated/maxloc1_16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i8.c
+
+maxloc1_4_i16.lo: $(srcdir)/generated/maxloc1_4_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_4_i16.lo -MD -MP -MF $(DEPDIR)/maxloc1_4_i16.Tpo -c -o maxloc1_4_i16.lo `test -f '$(srcdir)/generated/maxloc1_4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_4_i16.Tpo $(DEPDIR)/maxloc1_4_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_4_i16.c' object='maxloc1_4_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_4_i16.lo `test -f '$(srcdir)/generated/maxloc1_4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_i16.c
+
+maxloc1_8_i16.lo: $(srcdir)/generated/maxloc1_8_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_8_i16.lo -MD -MP -MF $(DEPDIR)/maxloc1_8_i16.Tpo -c -o maxloc1_8_i16.lo `test -f '$(srcdir)/generated/maxloc1_8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_8_i16.Tpo $(DEPDIR)/maxloc1_8_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_8_i16.c' object='maxloc1_8_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_8_i16.lo `test -f '$(srcdir)/generated/maxloc1_8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_i16.c
+
+maxloc1_16_i16.lo: $(srcdir)/generated/maxloc1_16_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_16_i16.lo -MD -MP -MF $(DEPDIR)/maxloc1_16_i16.Tpo -c -o maxloc1_16_i16.lo `test -f '$(srcdir)/generated/maxloc1_16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_16_i16.Tpo $(DEPDIR)/maxloc1_16_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_16_i16.c' object='maxloc1_16_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_16_i16.lo `test -f '$(srcdir)/generated/maxloc1_16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_i16.c
+
+maxloc1_4_r4.lo: $(srcdir)/generated/maxloc1_4_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_4_r4.lo -MD -MP -MF $(DEPDIR)/maxloc1_4_r4.Tpo -c -o maxloc1_4_r4.lo `test -f '$(srcdir)/generated/maxloc1_4_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_4_r4.Tpo $(DEPDIR)/maxloc1_4_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_4_r4.c' object='maxloc1_4_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_4_r4.lo `test -f '$(srcdir)/generated/maxloc1_4_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_r4.c
+
+maxloc1_8_r4.lo: $(srcdir)/generated/maxloc1_8_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_8_r4.lo -MD -MP -MF $(DEPDIR)/maxloc1_8_r4.Tpo -c -o maxloc1_8_r4.lo `test -f '$(srcdir)/generated/maxloc1_8_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_8_r4.Tpo $(DEPDIR)/maxloc1_8_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_8_r4.c' object='maxloc1_8_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_8_r4.lo `test -f '$(srcdir)/generated/maxloc1_8_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_r4.c
+
+maxloc1_16_r4.lo: $(srcdir)/generated/maxloc1_16_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_16_r4.lo -MD -MP -MF $(DEPDIR)/maxloc1_16_r4.Tpo -c -o maxloc1_16_r4.lo `test -f '$(srcdir)/generated/maxloc1_16_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_16_r4.Tpo $(DEPDIR)/maxloc1_16_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_16_r4.c' object='maxloc1_16_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_16_r4.lo `test -f '$(srcdir)/generated/maxloc1_16_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_r4.c
+
+maxloc1_4_r8.lo: $(srcdir)/generated/maxloc1_4_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_4_r8.lo -MD -MP -MF $(DEPDIR)/maxloc1_4_r8.Tpo -c -o maxloc1_4_r8.lo `test -f '$(srcdir)/generated/maxloc1_4_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_4_r8.Tpo $(DEPDIR)/maxloc1_4_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_4_r8.c' object='maxloc1_4_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_4_r8.lo `test -f '$(srcdir)/generated/maxloc1_4_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_r8.c
+
+maxloc1_8_r8.lo: $(srcdir)/generated/maxloc1_8_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_8_r8.lo -MD -MP -MF $(DEPDIR)/maxloc1_8_r8.Tpo -c -o maxloc1_8_r8.lo `test -f '$(srcdir)/generated/maxloc1_8_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_8_r8.Tpo $(DEPDIR)/maxloc1_8_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_8_r8.c' object='maxloc1_8_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_8_r8.lo `test -f '$(srcdir)/generated/maxloc1_8_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_r8.c
+
+maxloc1_16_r8.lo: $(srcdir)/generated/maxloc1_16_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_16_r8.lo -MD -MP -MF $(DEPDIR)/maxloc1_16_r8.Tpo -c -o maxloc1_16_r8.lo `test -f '$(srcdir)/generated/maxloc1_16_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_16_r8.Tpo $(DEPDIR)/maxloc1_16_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_16_r8.c' object='maxloc1_16_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_16_r8.lo `test -f '$(srcdir)/generated/maxloc1_16_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_r8.c
+
+maxloc1_4_r10.lo: $(srcdir)/generated/maxloc1_4_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_4_r10.lo -MD -MP -MF $(DEPDIR)/maxloc1_4_r10.Tpo -c -o maxloc1_4_r10.lo `test -f '$(srcdir)/generated/maxloc1_4_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_4_r10.Tpo $(DEPDIR)/maxloc1_4_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_4_r10.c' object='maxloc1_4_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_4_r10.lo `test -f '$(srcdir)/generated/maxloc1_4_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_r10.c
+
+maxloc1_8_r10.lo: $(srcdir)/generated/maxloc1_8_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_8_r10.lo -MD -MP -MF $(DEPDIR)/maxloc1_8_r10.Tpo -c -o maxloc1_8_r10.lo `test -f '$(srcdir)/generated/maxloc1_8_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_8_r10.Tpo $(DEPDIR)/maxloc1_8_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_8_r10.c' object='maxloc1_8_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_8_r10.lo `test -f '$(srcdir)/generated/maxloc1_8_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_r10.c
+
+maxloc1_16_r10.lo: $(srcdir)/generated/maxloc1_16_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_16_r10.lo -MD -MP -MF $(DEPDIR)/maxloc1_16_r10.Tpo -c -o maxloc1_16_r10.lo `test -f '$(srcdir)/generated/maxloc1_16_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_16_r10.Tpo $(DEPDIR)/maxloc1_16_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_16_r10.c' object='maxloc1_16_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_16_r10.lo `test -f '$(srcdir)/generated/maxloc1_16_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_r10.c
+
+maxloc1_4_r16.lo: $(srcdir)/generated/maxloc1_4_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_4_r16.lo -MD -MP -MF $(DEPDIR)/maxloc1_4_r16.Tpo -c -o maxloc1_4_r16.lo `test -f '$(srcdir)/generated/maxloc1_4_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_4_r16.Tpo $(DEPDIR)/maxloc1_4_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_4_r16.c' object='maxloc1_4_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_4_r16.lo `test -f '$(srcdir)/generated/maxloc1_4_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_4_r16.c
+
+maxloc1_8_r16.lo: $(srcdir)/generated/maxloc1_8_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_8_r16.lo -MD -MP -MF $(DEPDIR)/maxloc1_8_r16.Tpo -c -o maxloc1_8_r16.lo `test -f '$(srcdir)/generated/maxloc1_8_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_8_r16.Tpo $(DEPDIR)/maxloc1_8_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_8_r16.c' object='maxloc1_8_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_8_r16.lo `test -f '$(srcdir)/generated/maxloc1_8_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_8_r16.c
+
+maxloc1_16_r16.lo: $(srcdir)/generated/maxloc1_16_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxloc1_16_r16.lo -MD -MP -MF $(DEPDIR)/maxloc1_16_r16.Tpo -c -o maxloc1_16_r16.lo `test -f '$(srcdir)/generated/maxloc1_16_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxloc1_16_r16.Tpo $(DEPDIR)/maxloc1_16_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxloc1_16_r16.c' object='maxloc1_16_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxloc1_16_r16.lo `test -f '$(srcdir)/generated/maxloc1_16_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxloc1_16_r16.c
+
+maxval_i1.lo: $(srcdir)/generated/maxval_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxval_i1.lo -MD -MP -MF $(DEPDIR)/maxval_i1.Tpo -c -o maxval_i1.lo `test -f '$(srcdir)/generated/maxval_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxval_i1.Tpo $(DEPDIR)/maxval_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxval_i1.c' object='maxval_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxval_i1.lo `test -f '$(srcdir)/generated/maxval_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i1.c
+
+maxval_i2.lo: $(srcdir)/generated/maxval_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxval_i2.lo -MD -MP -MF $(DEPDIR)/maxval_i2.Tpo -c -o maxval_i2.lo `test -f '$(srcdir)/generated/maxval_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxval_i2.Tpo $(DEPDIR)/maxval_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxval_i2.c' object='maxval_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxval_i2.lo `test -f '$(srcdir)/generated/maxval_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i2.c
+
+maxval_i4.lo: $(srcdir)/generated/maxval_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxval_i4.lo -MD -MP -MF $(DEPDIR)/maxval_i4.Tpo -c -o maxval_i4.lo `test -f '$(srcdir)/generated/maxval_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxval_i4.Tpo $(DEPDIR)/maxval_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxval_i4.c' object='maxval_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxval_i4.lo `test -f '$(srcdir)/generated/maxval_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i4.c
+
+maxval_i8.lo: $(srcdir)/generated/maxval_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxval_i8.lo -MD -MP -MF $(DEPDIR)/maxval_i8.Tpo -c -o maxval_i8.lo `test -f '$(srcdir)/generated/maxval_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxval_i8.Tpo $(DEPDIR)/maxval_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxval_i8.c' object='maxval_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxval_i8.lo `test -f '$(srcdir)/generated/maxval_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i8.c
+
+maxval_i16.lo: $(srcdir)/generated/maxval_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxval_i16.lo -MD -MP -MF $(DEPDIR)/maxval_i16.Tpo -c -o maxval_i16.lo `test -f '$(srcdir)/generated/maxval_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxval_i16.Tpo $(DEPDIR)/maxval_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxval_i16.c' object='maxval_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxval_i16.lo `test -f '$(srcdir)/generated/maxval_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_i16.c
+
+maxval_r4.lo: $(srcdir)/generated/maxval_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxval_r4.lo -MD -MP -MF $(DEPDIR)/maxval_r4.Tpo -c -o maxval_r4.lo `test -f '$(srcdir)/generated/maxval_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxval_r4.Tpo $(DEPDIR)/maxval_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxval_r4.c' object='maxval_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxval_r4.lo `test -f '$(srcdir)/generated/maxval_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_r4.c
+
+maxval_r8.lo: $(srcdir)/generated/maxval_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxval_r8.lo -MD -MP -MF $(DEPDIR)/maxval_r8.Tpo -c -o maxval_r8.lo `test -f '$(srcdir)/generated/maxval_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxval_r8.Tpo $(DEPDIR)/maxval_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxval_r8.c' object='maxval_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxval_r8.lo `test -f '$(srcdir)/generated/maxval_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_r8.c
+
+maxval_r10.lo: $(srcdir)/generated/maxval_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxval_r10.lo -MD -MP -MF $(DEPDIR)/maxval_r10.Tpo -c -o maxval_r10.lo `test -f '$(srcdir)/generated/maxval_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxval_r10.Tpo $(DEPDIR)/maxval_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxval_r10.c' object='maxval_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxval_r10.lo `test -f '$(srcdir)/generated/maxval_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_r10.c
+
+maxval_r16.lo: $(srcdir)/generated/maxval_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT maxval_r16.lo -MD -MP -MF $(DEPDIR)/maxval_r16.Tpo -c -o maxval_r16.lo `test -f '$(srcdir)/generated/maxval_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/maxval_r16.Tpo $(DEPDIR)/maxval_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/maxval_r16.c' object='maxval_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o maxval_r16.lo `test -f '$(srcdir)/generated/maxval_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/maxval_r16.c
+
+minloc0_4_i1.lo: $(srcdir)/generated/minloc0_4_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_4_i1.lo -MD -MP -MF $(DEPDIR)/minloc0_4_i1.Tpo -c -o minloc0_4_i1.lo `test -f '$(srcdir)/generated/minloc0_4_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_4_i1.Tpo $(DEPDIR)/minloc0_4_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_4_i1.c' object='minloc0_4_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_4_i1.lo `test -f '$(srcdir)/generated/minloc0_4_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i1.c
+
+minloc0_8_i1.lo: $(srcdir)/generated/minloc0_8_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_8_i1.lo -MD -MP -MF $(DEPDIR)/minloc0_8_i1.Tpo -c -o minloc0_8_i1.lo `test -f '$(srcdir)/generated/minloc0_8_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_8_i1.Tpo $(DEPDIR)/minloc0_8_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_8_i1.c' object='minloc0_8_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_8_i1.lo `test -f '$(srcdir)/generated/minloc0_8_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i1.c
+
+minloc0_16_i1.lo: $(srcdir)/generated/minloc0_16_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_16_i1.lo -MD -MP -MF $(DEPDIR)/minloc0_16_i1.Tpo -c -o minloc0_16_i1.lo `test -f '$(srcdir)/generated/minloc0_16_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_16_i1.Tpo $(DEPDIR)/minloc0_16_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_16_i1.c' object='minloc0_16_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_16_i1.lo `test -f '$(srcdir)/generated/minloc0_16_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i1.c
+
+minloc0_4_i2.lo: $(srcdir)/generated/minloc0_4_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_4_i2.lo -MD -MP -MF $(DEPDIR)/minloc0_4_i2.Tpo -c -o minloc0_4_i2.lo `test -f '$(srcdir)/generated/minloc0_4_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_4_i2.Tpo $(DEPDIR)/minloc0_4_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_4_i2.c' object='minloc0_4_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_4_i2.lo `test -f '$(srcdir)/generated/minloc0_4_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i2.c
+
+minloc0_8_i2.lo: $(srcdir)/generated/minloc0_8_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_8_i2.lo -MD -MP -MF $(DEPDIR)/minloc0_8_i2.Tpo -c -o minloc0_8_i2.lo `test -f '$(srcdir)/generated/minloc0_8_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_8_i2.Tpo $(DEPDIR)/minloc0_8_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_8_i2.c' object='minloc0_8_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_8_i2.lo `test -f '$(srcdir)/generated/minloc0_8_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i2.c
+
+minloc0_16_i2.lo: $(srcdir)/generated/minloc0_16_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_16_i2.lo -MD -MP -MF $(DEPDIR)/minloc0_16_i2.Tpo -c -o minloc0_16_i2.lo `test -f '$(srcdir)/generated/minloc0_16_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_16_i2.Tpo $(DEPDIR)/minloc0_16_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_16_i2.c' object='minloc0_16_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_16_i2.lo `test -f '$(srcdir)/generated/minloc0_16_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i2.c
+
+minloc0_4_i4.lo: $(srcdir)/generated/minloc0_4_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_4_i4.lo -MD -MP -MF $(DEPDIR)/minloc0_4_i4.Tpo -c -o minloc0_4_i4.lo `test -f '$(srcdir)/generated/minloc0_4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_4_i4.Tpo $(DEPDIR)/minloc0_4_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_4_i4.c' object='minloc0_4_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_4_i4.lo `test -f '$(srcdir)/generated/minloc0_4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i4.c
+
+minloc0_8_i4.lo: $(srcdir)/generated/minloc0_8_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_8_i4.lo -MD -MP -MF $(DEPDIR)/minloc0_8_i4.Tpo -c -o minloc0_8_i4.lo `test -f '$(srcdir)/generated/minloc0_8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_8_i4.Tpo $(DEPDIR)/minloc0_8_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_8_i4.c' object='minloc0_8_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_8_i4.lo `test -f '$(srcdir)/generated/minloc0_8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i4.c
+
+minloc0_16_i4.lo: $(srcdir)/generated/minloc0_16_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_16_i4.lo -MD -MP -MF $(DEPDIR)/minloc0_16_i4.Tpo -c -o minloc0_16_i4.lo `test -f '$(srcdir)/generated/minloc0_16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_16_i4.Tpo $(DEPDIR)/minloc0_16_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_16_i4.c' object='minloc0_16_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_16_i4.lo `test -f '$(srcdir)/generated/minloc0_16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i4.c
+
+minloc0_4_i8.lo: $(srcdir)/generated/minloc0_4_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_4_i8.lo -MD -MP -MF $(DEPDIR)/minloc0_4_i8.Tpo -c -o minloc0_4_i8.lo `test -f '$(srcdir)/generated/minloc0_4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_4_i8.Tpo $(DEPDIR)/minloc0_4_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_4_i8.c' object='minloc0_4_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_4_i8.lo `test -f '$(srcdir)/generated/minloc0_4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i8.c
+
+minloc0_8_i8.lo: $(srcdir)/generated/minloc0_8_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_8_i8.lo -MD -MP -MF $(DEPDIR)/minloc0_8_i8.Tpo -c -o minloc0_8_i8.lo `test -f '$(srcdir)/generated/minloc0_8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_8_i8.Tpo $(DEPDIR)/minloc0_8_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_8_i8.c' object='minloc0_8_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_8_i8.lo `test -f '$(srcdir)/generated/minloc0_8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i8.c
+
+minloc0_16_i8.lo: $(srcdir)/generated/minloc0_16_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_16_i8.lo -MD -MP -MF $(DEPDIR)/minloc0_16_i8.Tpo -c -o minloc0_16_i8.lo `test -f '$(srcdir)/generated/minloc0_16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_16_i8.Tpo $(DEPDIR)/minloc0_16_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_16_i8.c' object='minloc0_16_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_16_i8.lo `test -f '$(srcdir)/generated/minloc0_16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i8.c
+
+minloc0_4_i16.lo: $(srcdir)/generated/minloc0_4_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_4_i16.lo -MD -MP -MF $(DEPDIR)/minloc0_4_i16.Tpo -c -o minloc0_4_i16.lo `test -f '$(srcdir)/generated/minloc0_4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_4_i16.Tpo $(DEPDIR)/minloc0_4_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_4_i16.c' object='minloc0_4_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_4_i16.lo `test -f '$(srcdir)/generated/minloc0_4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_i16.c
+
+minloc0_8_i16.lo: $(srcdir)/generated/minloc0_8_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_8_i16.lo -MD -MP -MF $(DEPDIR)/minloc0_8_i16.Tpo -c -o minloc0_8_i16.lo `test -f '$(srcdir)/generated/minloc0_8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_8_i16.Tpo $(DEPDIR)/minloc0_8_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_8_i16.c' object='minloc0_8_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_8_i16.lo `test -f '$(srcdir)/generated/minloc0_8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_i16.c
+
+minloc0_16_i16.lo: $(srcdir)/generated/minloc0_16_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_16_i16.lo -MD -MP -MF $(DEPDIR)/minloc0_16_i16.Tpo -c -o minloc0_16_i16.lo `test -f '$(srcdir)/generated/minloc0_16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_16_i16.Tpo $(DEPDIR)/minloc0_16_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_16_i16.c' object='minloc0_16_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_16_i16.lo `test -f '$(srcdir)/generated/minloc0_16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_i16.c
+
+minloc0_4_r4.lo: $(srcdir)/generated/minloc0_4_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_4_r4.lo -MD -MP -MF $(DEPDIR)/minloc0_4_r4.Tpo -c -o minloc0_4_r4.lo `test -f '$(srcdir)/generated/minloc0_4_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_4_r4.Tpo $(DEPDIR)/minloc0_4_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_4_r4.c' object='minloc0_4_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_4_r4.lo `test -f '$(srcdir)/generated/minloc0_4_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_r4.c
+
+minloc0_8_r4.lo: $(srcdir)/generated/minloc0_8_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_8_r4.lo -MD -MP -MF $(DEPDIR)/minloc0_8_r4.Tpo -c -o minloc0_8_r4.lo `test -f '$(srcdir)/generated/minloc0_8_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_8_r4.Tpo $(DEPDIR)/minloc0_8_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_8_r4.c' object='minloc0_8_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_8_r4.lo `test -f '$(srcdir)/generated/minloc0_8_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_r4.c
+
+minloc0_16_r4.lo: $(srcdir)/generated/minloc0_16_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_16_r4.lo -MD -MP -MF $(DEPDIR)/minloc0_16_r4.Tpo -c -o minloc0_16_r4.lo `test -f '$(srcdir)/generated/minloc0_16_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_16_r4.Tpo $(DEPDIR)/minloc0_16_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_16_r4.c' object='minloc0_16_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_16_r4.lo `test -f '$(srcdir)/generated/minloc0_16_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_r4.c
+
+minloc0_4_r8.lo: $(srcdir)/generated/minloc0_4_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_4_r8.lo -MD -MP -MF $(DEPDIR)/minloc0_4_r8.Tpo -c -o minloc0_4_r8.lo `test -f '$(srcdir)/generated/minloc0_4_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_4_r8.Tpo $(DEPDIR)/minloc0_4_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_4_r8.c' object='minloc0_4_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_4_r8.lo `test -f '$(srcdir)/generated/minloc0_4_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_r8.c
+
+minloc0_8_r8.lo: $(srcdir)/generated/minloc0_8_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_8_r8.lo -MD -MP -MF $(DEPDIR)/minloc0_8_r8.Tpo -c -o minloc0_8_r8.lo `test -f '$(srcdir)/generated/minloc0_8_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_8_r8.Tpo $(DEPDIR)/minloc0_8_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_8_r8.c' object='minloc0_8_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_8_r8.lo `test -f '$(srcdir)/generated/minloc0_8_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_r8.c
+
+minloc0_16_r8.lo: $(srcdir)/generated/minloc0_16_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_16_r8.lo -MD -MP -MF $(DEPDIR)/minloc0_16_r8.Tpo -c -o minloc0_16_r8.lo `test -f '$(srcdir)/generated/minloc0_16_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_16_r8.Tpo $(DEPDIR)/minloc0_16_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_16_r8.c' object='minloc0_16_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_16_r8.lo `test -f '$(srcdir)/generated/minloc0_16_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_r8.c
+
+minloc0_4_r10.lo: $(srcdir)/generated/minloc0_4_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_4_r10.lo -MD -MP -MF $(DEPDIR)/minloc0_4_r10.Tpo -c -o minloc0_4_r10.lo `test -f '$(srcdir)/generated/minloc0_4_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_4_r10.Tpo $(DEPDIR)/minloc0_4_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_4_r10.c' object='minloc0_4_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_4_r10.lo `test -f '$(srcdir)/generated/minloc0_4_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_r10.c
+
+minloc0_8_r10.lo: $(srcdir)/generated/minloc0_8_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_8_r10.lo -MD -MP -MF $(DEPDIR)/minloc0_8_r10.Tpo -c -o minloc0_8_r10.lo `test -f '$(srcdir)/generated/minloc0_8_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_8_r10.Tpo $(DEPDIR)/minloc0_8_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_8_r10.c' object='minloc0_8_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_8_r10.lo `test -f '$(srcdir)/generated/minloc0_8_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_r10.c
+
+minloc0_16_r10.lo: $(srcdir)/generated/minloc0_16_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_16_r10.lo -MD -MP -MF $(DEPDIR)/minloc0_16_r10.Tpo -c -o minloc0_16_r10.lo `test -f '$(srcdir)/generated/minloc0_16_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_16_r10.Tpo $(DEPDIR)/minloc0_16_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_16_r10.c' object='minloc0_16_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_16_r10.lo `test -f '$(srcdir)/generated/minloc0_16_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_r10.c
+
+minloc0_4_r16.lo: $(srcdir)/generated/minloc0_4_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_4_r16.lo -MD -MP -MF $(DEPDIR)/minloc0_4_r16.Tpo -c -o minloc0_4_r16.lo `test -f '$(srcdir)/generated/minloc0_4_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_4_r16.Tpo $(DEPDIR)/minloc0_4_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_4_r16.c' object='minloc0_4_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_4_r16.lo `test -f '$(srcdir)/generated/minloc0_4_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_4_r16.c
+
+minloc0_8_r16.lo: $(srcdir)/generated/minloc0_8_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_8_r16.lo -MD -MP -MF $(DEPDIR)/minloc0_8_r16.Tpo -c -o minloc0_8_r16.lo `test -f '$(srcdir)/generated/minloc0_8_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_8_r16.Tpo $(DEPDIR)/minloc0_8_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_8_r16.c' object='minloc0_8_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_8_r16.lo `test -f '$(srcdir)/generated/minloc0_8_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_8_r16.c
+
+minloc0_16_r16.lo: $(srcdir)/generated/minloc0_16_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc0_16_r16.lo -MD -MP -MF $(DEPDIR)/minloc0_16_r16.Tpo -c -o minloc0_16_r16.lo `test -f '$(srcdir)/generated/minloc0_16_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc0_16_r16.Tpo $(DEPDIR)/minloc0_16_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc0_16_r16.c' object='minloc0_16_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc0_16_r16.lo `test -f '$(srcdir)/generated/minloc0_16_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc0_16_r16.c
+
+minloc1_4_i1.lo: $(srcdir)/generated/minloc1_4_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_4_i1.lo -MD -MP -MF $(DEPDIR)/minloc1_4_i1.Tpo -c -o minloc1_4_i1.lo `test -f '$(srcdir)/generated/minloc1_4_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_4_i1.Tpo $(DEPDIR)/minloc1_4_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_4_i1.c' object='minloc1_4_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_4_i1.lo `test -f '$(srcdir)/generated/minloc1_4_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i1.c
+
+minloc1_8_i1.lo: $(srcdir)/generated/minloc1_8_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_8_i1.lo -MD -MP -MF $(DEPDIR)/minloc1_8_i1.Tpo -c -o minloc1_8_i1.lo `test -f '$(srcdir)/generated/minloc1_8_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_8_i1.Tpo $(DEPDIR)/minloc1_8_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_8_i1.c' object='minloc1_8_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_8_i1.lo `test -f '$(srcdir)/generated/minloc1_8_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i1.c
+
+minloc1_16_i1.lo: $(srcdir)/generated/minloc1_16_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_16_i1.lo -MD -MP -MF $(DEPDIR)/minloc1_16_i1.Tpo -c -o minloc1_16_i1.lo `test -f '$(srcdir)/generated/minloc1_16_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_16_i1.Tpo $(DEPDIR)/minloc1_16_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_16_i1.c' object='minloc1_16_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_16_i1.lo `test -f '$(srcdir)/generated/minloc1_16_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i1.c
+
+minloc1_4_i2.lo: $(srcdir)/generated/minloc1_4_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_4_i2.lo -MD -MP -MF $(DEPDIR)/minloc1_4_i2.Tpo -c -o minloc1_4_i2.lo `test -f '$(srcdir)/generated/minloc1_4_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_4_i2.Tpo $(DEPDIR)/minloc1_4_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_4_i2.c' object='minloc1_4_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_4_i2.lo `test -f '$(srcdir)/generated/minloc1_4_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i2.c
+
+minloc1_8_i2.lo: $(srcdir)/generated/minloc1_8_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_8_i2.lo -MD -MP -MF $(DEPDIR)/minloc1_8_i2.Tpo -c -o minloc1_8_i2.lo `test -f '$(srcdir)/generated/minloc1_8_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_8_i2.Tpo $(DEPDIR)/minloc1_8_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_8_i2.c' object='minloc1_8_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_8_i2.lo `test -f '$(srcdir)/generated/minloc1_8_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i2.c
+
+minloc1_16_i2.lo: $(srcdir)/generated/minloc1_16_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_16_i2.lo -MD -MP -MF $(DEPDIR)/minloc1_16_i2.Tpo -c -o minloc1_16_i2.lo `test -f '$(srcdir)/generated/minloc1_16_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_16_i2.Tpo $(DEPDIR)/minloc1_16_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_16_i2.c' object='minloc1_16_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_16_i2.lo `test -f '$(srcdir)/generated/minloc1_16_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i2.c
+
+minloc1_4_i4.lo: $(srcdir)/generated/minloc1_4_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_4_i4.lo -MD -MP -MF $(DEPDIR)/minloc1_4_i4.Tpo -c -o minloc1_4_i4.lo `test -f '$(srcdir)/generated/minloc1_4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_4_i4.Tpo $(DEPDIR)/minloc1_4_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_4_i4.c' object='minloc1_4_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_4_i4.lo `test -f '$(srcdir)/generated/minloc1_4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i4.c
+
+minloc1_8_i4.lo: $(srcdir)/generated/minloc1_8_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_8_i4.lo -MD -MP -MF $(DEPDIR)/minloc1_8_i4.Tpo -c -o minloc1_8_i4.lo `test -f '$(srcdir)/generated/minloc1_8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_8_i4.Tpo $(DEPDIR)/minloc1_8_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_8_i4.c' object='minloc1_8_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_8_i4.lo `test -f '$(srcdir)/generated/minloc1_8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i4.c
+
+minloc1_16_i4.lo: $(srcdir)/generated/minloc1_16_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_16_i4.lo -MD -MP -MF $(DEPDIR)/minloc1_16_i4.Tpo -c -o minloc1_16_i4.lo `test -f '$(srcdir)/generated/minloc1_16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_16_i4.Tpo $(DEPDIR)/minloc1_16_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_16_i4.c' object='minloc1_16_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_16_i4.lo `test -f '$(srcdir)/generated/minloc1_16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i4.c
+
+minloc1_4_i8.lo: $(srcdir)/generated/minloc1_4_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_4_i8.lo -MD -MP -MF $(DEPDIR)/minloc1_4_i8.Tpo -c -o minloc1_4_i8.lo `test -f '$(srcdir)/generated/minloc1_4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_4_i8.Tpo $(DEPDIR)/minloc1_4_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_4_i8.c' object='minloc1_4_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_4_i8.lo `test -f '$(srcdir)/generated/minloc1_4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i8.c
+
+minloc1_8_i8.lo: $(srcdir)/generated/minloc1_8_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_8_i8.lo -MD -MP -MF $(DEPDIR)/minloc1_8_i8.Tpo -c -o minloc1_8_i8.lo `test -f '$(srcdir)/generated/minloc1_8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_8_i8.Tpo $(DEPDIR)/minloc1_8_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_8_i8.c' object='minloc1_8_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_8_i8.lo `test -f '$(srcdir)/generated/minloc1_8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i8.c
+
+minloc1_16_i8.lo: $(srcdir)/generated/minloc1_16_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_16_i8.lo -MD -MP -MF $(DEPDIR)/minloc1_16_i8.Tpo -c -o minloc1_16_i8.lo `test -f '$(srcdir)/generated/minloc1_16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_16_i8.Tpo $(DEPDIR)/minloc1_16_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_16_i8.c' object='minloc1_16_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_16_i8.lo `test -f '$(srcdir)/generated/minloc1_16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i8.c
+
+minloc1_4_i16.lo: $(srcdir)/generated/minloc1_4_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_4_i16.lo -MD -MP -MF $(DEPDIR)/minloc1_4_i16.Tpo -c -o minloc1_4_i16.lo `test -f '$(srcdir)/generated/minloc1_4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_4_i16.Tpo $(DEPDIR)/minloc1_4_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_4_i16.c' object='minloc1_4_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_4_i16.lo `test -f '$(srcdir)/generated/minloc1_4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_i16.c
+
+minloc1_8_i16.lo: $(srcdir)/generated/minloc1_8_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_8_i16.lo -MD -MP -MF $(DEPDIR)/minloc1_8_i16.Tpo -c -o minloc1_8_i16.lo `test -f '$(srcdir)/generated/minloc1_8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_8_i16.Tpo $(DEPDIR)/minloc1_8_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_8_i16.c' object='minloc1_8_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_8_i16.lo `test -f '$(srcdir)/generated/minloc1_8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_i16.c
+
+minloc1_16_i16.lo: $(srcdir)/generated/minloc1_16_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_16_i16.lo -MD -MP -MF $(DEPDIR)/minloc1_16_i16.Tpo -c -o minloc1_16_i16.lo `test -f '$(srcdir)/generated/minloc1_16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_16_i16.Tpo $(DEPDIR)/minloc1_16_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_16_i16.c' object='minloc1_16_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_16_i16.lo `test -f '$(srcdir)/generated/minloc1_16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_i16.c
+
+minloc1_4_r4.lo: $(srcdir)/generated/minloc1_4_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_4_r4.lo -MD -MP -MF $(DEPDIR)/minloc1_4_r4.Tpo -c -o minloc1_4_r4.lo `test -f '$(srcdir)/generated/minloc1_4_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_4_r4.Tpo $(DEPDIR)/minloc1_4_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_4_r4.c' object='minloc1_4_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_4_r4.lo `test -f '$(srcdir)/generated/minloc1_4_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_r4.c
+
+minloc1_8_r4.lo: $(srcdir)/generated/minloc1_8_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_8_r4.lo -MD -MP -MF $(DEPDIR)/minloc1_8_r4.Tpo -c -o minloc1_8_r4.lo `test -f '$(srcdir)/generated/minloc1_8_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_8_r4.Tpo $(DEPDIR)/minloc1_8_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_8_r4.c' object='minloc1_8_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_8_r4.lo `test -f '$(srcdir)/generated/minloc1_8_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_r4.c
+
+minloc1_16_r4.lo: $(srcdir)/generated/minloc1_16_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_16_r4.lo -MD -MP -MF $(DEPDIR)/minloc1_16_r4.Tpo -c -o minloc1_16_r4.lo `test -f '$(srcdir)/generated/minloc1_16_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_16_r4.Tpo $(DEPDIR)/minloc1_16_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_16_r4.c' object='minloc1_16_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_16_r4.lo `test -f '$(srcdir)/generated/minloc1_16_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_r4.c
+
+minloc1_4_r8.lo: $(srcdir)/generated/minloc1_4_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_4_r8.lo -MD -MP -MF $(DEPDIR)/minloc1_4_r8.Tpo -c -o minloc1_4_r8.lo `test -f '$(srcdir)/generated/minloc1_4_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_4_r8.Tpo $(DEPDIR)/minloc1_4_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_4_r8.c' object='minloc1_4_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_4_r8.lo `test -f '$(srcdir)/generated/minloc1_4_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_r8.c
+
+minloc1_8_r8.lo: $(srcdir)/generated/minloc1_8_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_8_r8.lo -MD -MP -MF $(DEPDIR)/minloc1_8_r8.Tpo -c -o minloc1_8_r8.lo `test -f '$(srcdir)/generated/minloc1_8_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_8_r8.Tpo $(DEPDIR)/minloc1_8_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_8_r8.c' object='minloc1_8_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_8_r8.lo `test -f '$(srcdir)/generated/minloc1_8_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_r8.c
+
+minloc1_16_r8.lo: $(srcdir)/generated/minloc1_16_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_16_r8.lo -MD -MP -MF $(DEPDIR)/minloc1_16_r8.Tpo -c -o minloc1_16_r8.lo `test -f '$(srcdir)/generated/minloc1_16_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_16_r8.Tpo $(DEPDIR)/minloc1_16_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_16_r8.c' object='minloc1_16_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_16_r8.lo `test -f '$(srcdir)/generated/minloc1_16_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_r8.c
+
+minloc1_4_r10.lo: $(srcdir)/generated/minloc1_4_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_4_r10.lo -MD -MP -MF $(DEPDIR)/minloc1_4_r10.Tpo -c -o minloc1_4_r10.lo `test -f '$(srcdir)/generated/minloc1_4_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_4_r10.Tpo $(DEPDIR)/minloc1_4_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_4_r10.c' object='minloc1_4_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_4_r10.lo `test -f '$(srcdir)/generated/minloc1_4_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_r10.c
+
+minloc1_8_r10.lo: $(srcdir)/generated/minloc1_8_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_8_r10.lo -MD -MP -MF $(DEPDIR)/minloc1_8_r10.Tpo -c -o minloc1_8_r10.lo `test -f '$(srcdir)/generated/minloc1_8_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_8_r10.Tpo $(DEPDIR)/minloc1_8_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_8_r10.c' object='minloc1_8_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_8_r10.lo `test -f '$(srcdir)/generated/minloc1_8_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_r10.c
+
+minloc1_16_r10.lo: $(srcdir)/generated/minloc1_16_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_16_r10.lo -MD -MP -MF $(DEPDIR)/minloc1_16_r10.Tpo -c -o minloc1_16_r10.lo `test -f '$(srcdir)/generated/minloc1_16_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_16_r10.Tpo $(DEPDIR)/minloc1_16_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_16_r10.c' object='minloc1_16_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_16_r10.lo `test -f '$(srcdir)/generated/minloc1_16_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_r10.c
+
+minloc1_4_r16.lo: $(srcdir)/generated/minloc1_4_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_4_r16.lo -MD -MP -MF $(DEPDIR)/minloc1_4_r16.Tpo -c -o minloc1_4_r16.lo `test -f '$(srcdir)/generated/minloc1_4_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_4_r16.Tpo $(DEPDIR)/minloc1_4_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_4_r16.c' object='minloc1_4_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_4_r16.lo `test -f '$(srcdir)/generated/minloc1_4_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_4_r16.c
+
+minloc1_8_r16.lo: $(srcdir)/generated/minloc1_8_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_8_r16.lo -MD -MP -MF $(DEPDIR)/minloc1_8_r16.Tpo -c -o minloc1_8_r16.lo `test -f '$(srcdir)/generated/minloc1_8_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_8_r16.Tpo $(DEPDIR)/minloc1_8_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_8_r16.c' object='minloc1_8_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_8_r16.lo `test -f '$(srcdir)/generated/minloc1_8_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_8_r16.c
+
+minloc1_16_r16.lo: $(srcdir)/generated/minloc1_16_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minloc1_16_r16.lo -MD -MP -MF $(DEPDIR)/minloc1_16_r16.Tpo -c -o minloc1_16_r16.lo `test -f '$(srcdir)/generated/minloc1_16_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minloc1_16_r16.Tpo $(DEPDIR)/minloc1_16_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minloc1_16_r16.c' object='minloc1_16_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minloc1_16_r16.lo `test -f '$(srcdir)/generated/minloc1_16_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minloc1_16_r16.c
+
+minval_i1.lo: $(srcdir)/generated/minval_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minval_i1.lo -MD -MP -MF $(DEPDIR)/minval_i1.Tpo -c -o minval_i1.lo `test -f '$(srcdir)/generated/minval_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minval_i1.Tpo $(DEPDIR)/minval_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minval_i1.c' object='minval_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minval_i1.lo `test -f '$(srcdir)/generated/minval_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i1.c
+
+minval_i2.lo: $(srcdir)/generated/minval_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minval_i2.lo -MD -MP -MF $(DEPDIR)/minval_i2.Tpo -c -o minval_i2.lo `test -f '$(srcdir)/generated/minval_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minval_i2.Tpo $(DEPDIR)/minval_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minval_i2.c' object='minval_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minval_i2.lo `test -f '$(srcdir)/generated/minval_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i2.c
+
+minval_i4.lo: $(srcdir)/generated/minval_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minval_i4.lo -MD -MP -MF $(DEPDIR)/minval_i4.Tpo -c -o minval_i4.lo `test -f '$(srcdir)/generated/minval_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minval_i4.Tpo $(DEPDIR)/minval_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minval_i4.c' object='minval_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minval_i4.lo `test -f '$(srcdir)/generated/minval_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i4.c
+
+minval_i8.lo: $(srcdir)/generated/minval_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minval_i8.lo -MD -MP -MF $(DEPDIR)/minval_i8.Tpo -c -o minval_i8.lo `test -f '$(srcdir)/generated/minval_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minval_i8.Tpo $(DEPDIR)/minval_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minval_i8.c' object='minval_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minval_i8.lo `test -f '$(srcdir)/generated/minval_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i8.c
+
+minval_i16.lo: $(srcdir)/generated/minval_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minval_i16.lo -MD -MP -MF $(DEPDIR)/minval_i16.Tpo -c -o minval_i16.lo `test -f '$(srcdir)/generated/minval_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minval_i16.Tpo $(DEPDIR)/minval_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minval_i16.c' object='minval_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minval_i16.lo `test -f '$(srcdir)/generated/minval_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_i16.c
+
+minval_r4.lo: $(srcdir)/generated/minval_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minval_r4.lo -MD -MP -MF $(DEPDIR)/minval_r4.Tpo -c -o minval_r4.lo `test -f '$(srcdir)/generated/minval_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minval_r4.Tpo $(DEPDIR)/minval_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minval_r4.c' object='minval_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minval_r4.lo `test -f '$(srcdir)/generated/minval_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_r4.c
+
+minval_r8.lo: $(srcdir)/generated/minval_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minval_r8.lo -MD -MP -MF $(DEPDIR)/minval_r8.Tpo -c -o minval_r8.lo `test -f '$(srcdir)/generated/minval_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minval_r8.Tpo $(DEPDIR)/minval_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minval_r8.c' object='minval_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minval_r8.lo `test -f '$(srcdir)/generated/minval_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_r8.c
+
+minval_r10.lo: $(srcdir)/generated/minval_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minval_r10.lo -MD -MP -MF $(DEPDIR)/minval_r10.Tpo -c -o minval_r10.lo `test -f '$(srcdir)/generated/minval_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minval_r10.Tpo $(DEPDIR)/minval_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minval_r10.c' object='minval_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minval_r10.lo `test -f '$(srcdir)/generated/minval_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_r10.c
+
+minval_r16.lo: $(srcdir)/generated/minval_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minval_r16.lo -MD -MP -MF $(DEPDIR)/minval_r16.Tpo -c -o minval_r16.lo `test -f '$(srcdir)/generated/minval_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/minval_r16.Tpo $(DEPDIR)/minval_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/minval_r16.c' object='minval_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minval_r16.lo `test -f '$(srcdir)/generated/minval_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/minval_r16.c
+
+product_i1.lo: $(srcdir)/generated/product_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_i1.lo -MD -MP -MF $(DEPDIR)/product_i1.Tpo -c -o product_i1.lo `test -f '$(srcdir)/generated/product_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_i1.Tpo $(DEPDIR)/product_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_i1.c' object='product_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_i1.lo `test -f '$(srcdir)/generated/product_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i1.c
+
+product_i2.lo: $(srcdir)/generated/product_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_i2.lo -MD -MP -MF $(DEPDIR)/product_i2.Tpo -c -o product_i2.lo `test -f '$(srcdir)/generated/product_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_i2.Tpo $(DEPDIR)/product_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_i2.c' object='product_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_i2.lo `test -f '$(srcdir)/generated/product_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i2.c
+
+product_i4.lo: $(srcdir)/generated/product_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_i4.lo -MD -MP -MF $(DEPDIR)/product_i4.Tpo -c -o product_i4.lo `test -f '$(srcdir)/generated/product_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_i4.Tpo $(DEPDIR)/product_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_i4.c' object='product_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_i4.lo `test -f '$(srcdir)/generated/product_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i4.c
+
+product_i8.lo: $(srcdir)/generated/product_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_i8.lo -MD -MP -MF $(DEPDIR)/product_i8.Tpo -c -o product_i8.lo `test -f '$(srcdir)/generated/product_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_i8.Tpo $(DEPDIR)/product_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_i8.c' object='product_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_i8.lo `test -f '$(srcdir)/generated/product_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i8.c
+
+product_i16.lo: $(srcdir)/generated/product_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_i16.lo -MD -MP -MF $(DEPDIR)/product_i16.Tpo -c -o product_i16.lo `test -f '$(srcdir)/generated/product_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_i16.Tpo $(DEPDIR)/product_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_i16.c' object='product_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_i16.lo `test -f '$(srcdir)/generated/product_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_i16.c
+
+product_r4.lo: $(srcdir)/generated/product_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_r4.lo -MD -MP -MF $(DEPDIR)/product_r4.Tpo -c -o product_r4.lo `test -f '$(srcdir)/generated/product_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_r4.Tpo $(DEPDIR)/product_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_r4.c' object='product_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_r4.lo `test -f '$(srcdir)/generated/product_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_r4.c
+
+product_r8.lo: $(srcdir)/generated/product_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_r8.lo -MD -MP -MF $(DEPDIR)/product_r8.Tpo -c -o product_r8.lo `test -f '$(srcdir)/generated/product_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_r8.Tpo $(DEPDIR)/product_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_r8.c' object='product_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_r8.lo `test -f '$(srcdir)/generated/product_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_r8.c
+
+product_r10.lo: $(srcdir)/generated/product_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_r10.lo -MD -MP -MF $(DEPDIR)/product_r10.Tpo -c -o product_r10.lo `test -f '$(srcdir)/generated/product_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_r10.Tpo $(DEPDIR)/product_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_r10.c' object='product_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_r10.lo `test -f '$(srcdir)/generated/product_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_r10.c
+
+product_r16.lo: $(srcdir)/generated/product_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_r16.lo -MD -MP -MF $(DEPDIR)/product_r16.Tpo -c -o product_r16.lo `test -f '$(srcdir)/generated/product_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_r16.Tpo $(DEPDIR)/product_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_r16.c' object='product_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_r16.lo `test -f '$(srcdir)/generated/product_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_r16.c
+
+product_c4.lo: $(srcdir)/generated/product_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_c4.lo -MD -MP -MF $(DEPDIR)/product_c4.Tpo -c -o product_c4.lo `test -f '$(srcdir)/generated/product_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_c4.Tpo $(DEPDIR)/product_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_c4.c' object='product_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_c4.lo `test -f '$(srcdir)/generated/product_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_c4.c
+
+product_c8.lo: $(srcdir)/generated/product_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_c8.lo -MD -MP -MF $(DEPDIR)/product_c8.Tpo -c -o product_c8.lo `test -f '$(srcdir)/generated/product_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_c8.Tpo $(DEPDIR)/product_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_c8.c' object='product_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_c8.lo `test -f '$(srcdir)/generated/product_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_c8.c
+
+product_c10.lo: $(srcdir)/generated/product_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_c10.lo -MD -MP -MF $(DEPDIR)/product_c10.Tpo -c -o product_c10.lo `test -f '$(srcdir)/generated/product_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_c10.Tpo $(DEPDIR)/product_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_c10.c' object='product_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_c10.lo `test -f '$(srcdir)/generated/product_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_c10.c
+
+product_c16.lo: $(srcdir)/generated/product_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT product_c16.lo -MD -MP -MF $(DEPDIR)/product_c16.Tpo -c -o product_c16.lo `test -f '$(srcdir)/generated/product_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/product_c16.Tpo $(DEPDIR)/product_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/product_c16.c' object='product_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o product_c16.lo `test -f '$(srcdir)/generated/product_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/product_c16.c
+
+sum_i1.lo: $(srcdir)/generated/sum_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_i1.lo -MD -MP -MF $(DEPDIR)/sum_i1.Tpo -c -o sum_i1.lo `test -f '$(srcdir)/generated/sum_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_i1.Tpo $(DEPDIR)/sum_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_i1.c' object='sum_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_i1.lo `test -f '$(srcdir)/generated/sum_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i1.c
+
+sum_i2.lo: $(srcdir)/generated/sum_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_i2.lo -MD -MP -MF $(DEPDIR)/sum_i2.Tpo -c -o sum_i2.lo `test -f '$(srcdir)/generated/sum_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_i2.Tpo $(DEPDIR)/sum_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_i2.c' object='sum_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_i2.lo `test -f '$(srcdir)/generated/sum_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i2.c
+
+sum_i4.lo: $(srcdir)/generated/sum_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_i4.lo -MD -MP -MF $(DEPDIR)/sum_i4.Tpo -c -o sum_i4.lo `test -f '$(srcdir)/generated/sum_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_i4.Tpo $(DEPDIR)/sum_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_i4.c' object='sum_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_i4.lo `test -f '$(srcdir)/generated/sum_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i4.c
+
+sum_i8.lo: $(srcdir)/generated/sum_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_i8.lo -MD -MP -MF $(DEPDIR)/sum_i8.Tpo -c -o sum_i8.lo `test -f '$(srcdir)/generated/sum_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_i8.Tpo $(DEPDIR)/sum_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_i8.c' object='sum_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_i8.lo `test -f '$(srcdir)/generated/sum_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i8.c
+
+sum_i16.lo: $(srcdir)/generated/sum_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_i16.lo -MD -MP -MF $(DEPDIR)/sum_i16.Tpo -c -o sum_i16.lo `test -f '$(srcdir)/generated/sum_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_i16.Tpo $(DEPDIR)/sum_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_i16.c' object='sum_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_i16.lo `test -f '$(srcdir)/generated/sum_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_i16.c
+
+sum_r4.lo: $(srcdir)/generated/sum_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_r4.lo -MD -MP -MF $(DEPDIR)/sum_r4.Tpo -c -o sum_r4.lo `test -f '$(srcdir)/generated/sum_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_r4.Tpo $(DEPDIR)/sum_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_r4.c' object='sum_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_r4.lo `test -f '$(srcdir)/generated/sum_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_r4.c
+
+sum_r8.lo: $(srcdir)/generated/sum_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_r8.lo -MD -MP -MF $(DEPDIR)/sum_r8.Tpo -c -o sum_r8.lo `test -f '$(srcdir)/generated/sum_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_r8.Tpo $(DEPDIR)/sum_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_r8.c' object='sum_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_r8.lo `test -f '$(srcdir)/generated/sum_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_r8.c
+
+sum_r10.lo: $(srcdir)/generated/sum_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_r10.lo -MD -MP -MF $(DEPDIR)/sum_r10.Tpo -c -o sum_r10.lo `test -f '$(srcdir)/generated/sum_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_r10.Tpo $(DEPDIR)/sum_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_r10.c' object='sum_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_r10.lo `test -f '$(srcdir)/generated/sum_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_r10.c
+
+sum_r16.lo: $(srcdir)/generated/sum_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_r16.lo -MD -MP -MF $(DEPDIR)/sum_r16.Tpo -c -o sum_r16.lo `test -f '$(srcdir)/generated/sum_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_r16.Tpo $(DEPDIR)/sum_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_r16.c' object='sum_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_r16.lo `test -f '$(srcdir)/generated/sum_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_r16.c
+
+sum_c4.lo: $(srcdir)/generated/sum_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_c4.lo -MD -MP -MF $(DEPDIR)/sum_c4.Tpo -c -o sum_c4.lo `test -f '$(srcdir)/generated/sum_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_c4.Tpo $(DEPDIR)/sum_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_c4.c' object='sum_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_c4.lo `test -f '$(srcdir)/generated/sum_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_c4.c
+
+sum_c8.lo: $(srcdir)/generated/sum_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_c8.lo -MD -MP -MF $(DEPDIR)/sum_c8.Tpo -c -o sum_c8.lo `test -f '$(srcdir)/generated/sum_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_c8.Tpo $(DEPDIR)/sum_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_c8.c' object='sum_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_c8.lo `test -f '$(srcdir)/generated/sum_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_c8.c
+
+sum_c10.lo: $(srcdir)/generated/sum_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_c10.lo -MD -MP -MF $(DEPDIR)/sum_c10.Tpo -c -o sum_c10.lo `test -f '$(srcdir)/generated/sum_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_c10.Tpo $(DEPDIR)/sum_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_c10.c' object='sum_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_c10.lo `test -f '$(srcdir)/generated/sum_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_c10.c
+
+sum_c16.lo: $(srcdir)/generated/sum_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sum_c16.lo -MD -MP -MF $(DEPDIR)/sum_c16.Tpo -c -o sum_c16.lo `test -f '$(srcdir)/generated/sum_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sum_c16.Tpo $(DEPDIR)/sum_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/sum_c16.c' object='sum_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_c16.lo `test -f '$(srcdir)/generated/sum_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_c16.c
+
+bessel_r4.lo: $(srcdir)/generated/bessel_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bessel_r4.lo -MD -MP -MF $(DEPDIR)/bessel_r4.Tpo -c -o bessel_r4.lo `test -f '$(srcdir)/generated/bessel_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/bessel_r4.Tpo $(DEPDIR)/bessel_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/bessel_r4.c' object='bessel_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel_r4.lo `test -f '$(srcdir)/generated/bessel_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r4.c
+
+bessel_r8.lo: $(srcdir)/generated/bessel_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bessel_r8.lo -MD -MP -MF $(DEPDIR)/bessel_r8.Tpo -c -o bessel_r8.lo `test -f '$(srcdir)/generated/bessel_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/bessel_r8.Tpo $(DEPDIR)/bessel_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/bessel_r8.c' object='bessel_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel_r8.lo `test -f '$(srcdir)/generated/bessel_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r8.c
+
+bessel_r10.lo: $(srcdir)/generated/bessel_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bessel_r10.lo -MD -MP -MF $(DEPDIR)/bessel_r10.Tpo -c -o bessel_r10.lo `test -f '$(srcdir)/generated/bessel_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/bessel_r10.Tpo $(DEPDIR)/bessel_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/bessel_r10.c' object='bessel_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel_r10.lo `test -f '$(srcdir)/generated/bessel_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r10.c
+
+bessel_r16.lo: $(srcdir)/generated/bessel_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bessel_r16.lo -MD -MP -MF $(DEPDIR)/bessel_r16.Tpo -c -o bessel_r16.lo `test -f '$(srcdir)/generated/bessel_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/bessel_r16.Tpo $(DEPDIR)/bessel_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/bessel_r16.c' object='bessel_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel_r16.lo `test -f '$(srcdir)/generated/bessel_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r16.c
+
+iall_i1.lo: $(srcdir)/generated/iall_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iall_i1.lo -MD -MP -MF $(DEPDIR)/iall_i1.Tpo -c -o iall_i1.lo `test -f '$(srcdir)/generated/iall_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iall_i1.Tpo $(DEPDIR)/iall_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iall_i1.c' object='iall_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iall_i1.lo `test -f '$(srcdir)/generated/iall_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i1.c
+
+iall_i2.lo: $(srcdir)/generated/iall_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iall_i2.lo -MD -MP -MF $(DEPDIR)/iall_i2.Tpo -c -o iall_i2.lo `test -f '$(srcdir)/generated/iall_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iall_i2.Tpo $(DEPDIR)/iall_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iall_i2.c' object='iall_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iall_i2.lo `test -f '$(srcdir)/generated/iall_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i2.c
+
+iall_i4.lo: $(srcdir)/generated/iall_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iall_i4.lo -MD -MP -MF $(DEPDIR)/iall_i4.Tpo -c -o iall_i4.lo `test -f '$(srcdir)/generated/iall_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iall_i4.Tpo $(DEPDIR)/iall_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iall_i4.c' object='iall_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iall_i4.lo `test -f '$(srcdir)/generated/iall_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i4.c
+
+iall_i8.lo: $(srcdir)/generated/iall_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iall_i8.lo -MD -MP -MF $(DEPDIR)/iall_i8.Tpo -c -o iall_i8.lo `test -f '$(srcdir)/generated/iall_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iall_i8.Tpo $(DEPDIR)/iall_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iall_i8.c' object='iall_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iall_i8.lo `test -f '$(srcdir)/generated/iall_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i8.c
+
+iall_i16.lo: $(srcdir)/generated/iall_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iall_i16.lo -MD -MP -MF $(DEPDIR)/iall_i16.Tpo -c -o iall_i16.lo `test -f '$(srcdir)/generated/iall_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iall_i16.Tpo $(DEPDIR)/iall_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iall_i16.c' object='iall_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iall_i16.lo `test -f '$(srcdir)/generated/iall_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/iall_i16.c
+
+iany_i1.lo: $(srcdir)/generated/iany_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iany_i1.lo -MD -MP -MF $(DEPDIR)/iany_i1.Tpo -c -o iany_i1.lo `test -f '$(srcdir)/generated/iany_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iany_i1.Tpo $(DEPDIR)/iany_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iany_i1.c' object='iany_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iany_i1.lo `test -f '$(srcdir)/generated/iany_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i1.c
+
+iany_i2.lo: $(srcdir)/generated/iany_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iany_i2.lo -MD -MP -MF $(DEPDIR)/iany_i2.Tpo -c -o iany_i2.lo `test -f '$(srcdir)/generated/iany_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iany_i2.Tpo $(DEPDIR)/iany_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iany_i2.c' object='iany_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iany_i2.lo `test -f '$(srcdir)/generated/iany_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i2.c
+
+iany_i4.lo: $(srcdir)/generated/iany_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iany_i4.lo -MD -MP -MF $(DEPDIR)/iany_i4.Tpo -c -o iany_i4.lo `test -f '$(srcdir)/generated/iany_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iany_i4.Tpo $(DEPDIR)/iany_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iany_i4.c' object='iany_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iany_i4.lo `test -f '$(srcdir)/generated/iany_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i4.c
+
+iany_i8.lo: $(srcdir)/generated/iany_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iany_i8.lo -MD -MP -MF $(DEPDIR)/iany_i8.Tpo -c -o iany_i8.lo `test -f '$(srcdir)/generated/iany_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iany_i8.Tpo $(DEPDIR)/iany_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iany_i8.c' object='iany_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iany_i8.lo `test -f '$(srcdir)/generated/iany_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i8.c
+
+iany_i16.lo: $(srcdir)/generated/iany_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iany_i16.lo -MD -MP -MF $(DEPDIR)/iany_i16.Tpo -c -o iany_i16.lo `test -f '$(srcdir)/generated/iany_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iany_i16.Tpo $(DEPDIR)/iany_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iany_i16.c' object='iany_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iany_i16.lo `test -f '$(srcdir)/generated/iany_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/iany_i16.c
+
+iparity_i1.lo: $(srcdir)/generated/iparity_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iparity_i1.lo -MD -MP -MF $(DEPDIR)/iparity_i1.Tpo -c -o iparity_i1.lo `test -f '$(srcdir)/generated/iparity_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iparity_i1.Tpo $(DEPDIR)/iparity_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iparity_i1.c' object='iparity_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iparity_i1.lo `test -f '$(srcdir)/generated/iparity_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i1.c
+
+iparity_i2.lo: $(srcdir)/generated/iparity_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iparity_i2.lo -MD -MP -MF $(DEPDIR)/iparity_i2.Tpo -c -o iparity_i2.lo `test -f '$(srcdir)/generated/iparity_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iparity_i2.Tpo $(DEPDIR)/iparity_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iparity_i2.c' object='iparity_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iparity_i2.lo `test -f '$(srcdir)/generated/iparity_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i2.c
+
+iparity_i4.lo: $(srcdir)/generated/iparity_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iparity_i4.lo -MD -MP -MF $(DEPDIR)/iparity_i4.Tpo -c -o iparity_i4.lo `test -f '$(srcdir)/generated/iparity_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iparity_i4.Tpo $(DEPDIR)/iparity_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iparity_i4.c' object='iparity_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iparity_i4.lo `test -f '$(srcdir)/generated/iparity_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i4.c
+
+iparity_i8.lo: $(srcdir)/generated/iparity_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iparity_i8.lo -MD -MP -MF $(DEPDIR)/iparity_i8.Tpo -c -o iparity_i8.lo `test -f '$(srcdir)/generated/iparity_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iparity_i8.Tpo $(DEPDIR)/iparity_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iparity_i8.c' object='iparity_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iparity_i8.lo `test -f '$(srcdir)/generated/iparity_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i8.c
+
+iparity_i16.lo: $(srcdir)/generated/iparity_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iparity_i16.lo -MD -MP -MF $(DEPDIR)/iparity_i16.Tpo -c -o iparity_i16.lo `test -f '$(srcdir)/generated/iparity_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iparity_i16.Tpo $(DEPDIR)/iparity_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/iparity_i16.c' object='iparity_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iparity_i16.lo `test -f '$(srcdir)/generated/iparity_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/iparity_i16.c
+
+norm2_r4.lo: $(srcdir)/generated/norm2_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT norm2_r4.lo -MD -MP -MF $(DEPDIR)/norm2_r4.Tpo -c -o norm2_r4.lo `test -f '$(srcdir)/generated/norm2_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/norm2_r4.Tpo $(DEPDIR)/norm2_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/norm2_r4.c' object='norm2_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o norm2_r4.lo `test -f '$(srcdir)/generated/norm2_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r4.c
+
+norm2_r8.lo: $(srcdir)/generated/norm2_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT norm2_r8.lo -MD -MP -MF $(DEPDIR)/norm2_r8.Tpo -c -o norm2_r8.lo `test -f '$(srcdir)/generated/norm2_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/norm2_r8.Tpo $(DEPDIR)/norm2_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/norm2_r8.c' object='norm2_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o norm2_r8.lo `test -f '$(srcdir)/generated/norm2_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r8.c
+
+norm2_r10.lo: $(srcdir)/generated/norm2_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT norm2_r10.lo -MD -MP -MF $(DEPDIR)/norm2_r10.Tpo -c -o norm2_r10.lo `test -f '$(srcdir)/generated/norm2_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/norm2_r10.Tpo $(DEPDIR)/norm2_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/norm2_r10.c' object='norm2_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o norm2_r10.lo `test -f '$(srcdir)/generated/norm2_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r10.c
+
+norm2_r16.lo: $(srcdir)/generated/norm2_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT norm2_r16.lo -MD -MP -MF $(DEPDIR)/norm2_r16.Tpo -c -o norm2_r16.lo `test -f '$(srcdir)/generated/norm2_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/norm2_r16.Tpo $(DEPDIR)/norm2_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/norm2_r16.c' object='norm2_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o norm2_r16.lo `test -f '$(srcdir)/generated/norm2_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/norm2_r16.c
+
+parity_l1.lo: $(srcdir)/generated/parity_l1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l1.lo -MD -MP -MF $(DEPDIR)/parity_l1.Tpo -c -o parity_l1.lo `test -f '$(srcdir)/generated/parity_l1.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l1.Tpo $(DEPDIR)/parity_l1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l1.c' object='parity_l1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l1.lo `test -f '$(srcdir)/generated/parity_l1.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l1.c
+
+parity_l2.lo: $(srcdir)/generated/parity_l2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l2.lo -MD -MP -MF $(DEPDIR)/parity_l2.Tpo -c -o parity_l2.lo `test -f '$(srcdir)/generated/parity_l2.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l2.Tpo $(DEPDIR)/parity_l2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l2.c' object='parity_l2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l2.lo `test -f '$(srcdir)/generated/parity_l2.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l2.c
+
+parity_l4.lo: $(srcdir)/generated/parity_l4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l4.lo -MD -MP -MF $(DEPDIR)/parity_l4.Tpo -c -o parity_l4.lo `test -f '$(srcdir)/generated/parity_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l4.Tpo $(DEPDIR)/parity_l4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l4.c' object='parity_l4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l4.lo `test -f '$(srcdir)/generated/parity_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l4.c
+
+parity_l8.lo: $(srcdir)/generated/parity_l8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l8.lo -MD -MP -MF $(DEPDIR)/parity_l8.Tpo -c -o parity_l8.lo `test -f '$(srcdir)/generated/parity_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l8.Tpo $(DEPDIR)/parity_l8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l8.c' object='parity_l8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l8.lo `test -f '$(srcdir)/generated/parity_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l8.c
+
+parity_l16.lo: $(srcdir)/generated/parity_l16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parity_l16.lo -MD -MP -MF $(DEPDIR)/parity_l16.Tpo -c -o parity_l16.lo `test -f '$(srcdir)/generated/parity_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/parity_l16.Tpo $(DEPDIR)/parity_l16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/parity_l16.c' object='parity_l16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parity_l16.lo `test -f '$(srcdir)/generated/parity_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/parity_l16.c
+
+matmul_i1.lo: $(srcdir)/generated/matmul_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_i1.lo -MD -MP -MF $(DEPDIR)/matmul_i1.Tpo -c -o matmul_i1.lo `test -f '$(srcdir)/generated/matmul_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_i1.Tpo $(DEPDIR)/matmul_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_i1.c' object='matmul_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_i1.lo `test -f '$(srcdir)/generated/matmul_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i1.c
+
+matmul_i2.lo: $(srcdir)/generated/matmul_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_i2.lo -MD -MP -MF $(DEPDIR)/matmul_i2.Tpo -c -o matmul_i2.lo `test -f '$(srcdir)/generated/matmul_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_i2.Tpo $(DEPDIR)/matmul_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_i2.c' object='matmul_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_i2.lo `test -f '$(srcdir)/generated/matmul_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i2.c
+
+matmul_i4.lo: $(srcdir)/generated/matmul_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_i4.lo -MD -MP -MF $(DEPDIR)/matmul_i4.Tpo -c -o matmul_i4.lo `test -f '$(srcdir)/generated/matmul_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_i4.Tpo $(DEPDIR)/matmul_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_i4.c' object='matmul_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_i4.lo `test -f '$(srcdir)/generated/matmul_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i4.c
+
+matmul_i8.lo: $(srcdir)/generated/matmul_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_i8.lo -MD -MP -MF $(DEPDIR)/matmul_i8.Tpo -c -o matmul_i8.lo `test -f '$(srcdir)/generated/matmul_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_i8.Tpo $(DEPDIR)/matmul_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_i8.c' object='matmul_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_i8.lo `test -f '$(srcdir)/generated/matmul_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i8.c
+
+matmul_i16.lo: $(srcdir)/generated/matmul_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_i16.lo -MD -MP -MF $(DEPDIR)/matmul_i16.Tpo -c -o matmul_i16.lo `test -f '$(srcdir)/generated/matmul_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_i16.Tpo $(DEPDIR)/matmul_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_i16.c' object='matmul_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_i16.lo `test -f '$(srcdir)/generated/matmul_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i16.c
+
+matmul_r4.lo: $(srcdir)/generated/matmul_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_r4.lo -MD -MP -MF $(DEPDIR)/matmul_r4.Tpo -c -o matmul_r4.lo `test -f '$(srcdir)/generated/matmul_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_r4.Tpo $(DEPDIR)/matmul_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_r4.c' object='matmul_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_r4.lo `test -f '$(srcdir)/generated/matmul_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_r4.c
+
+matmul_r8.lo: $(srcdir)/generated/matmul_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_r8.lo -MD -MP -MF $(DEPDIR)/matmul_r8.Tpo -c -o matmul_r8.lo `test -f '$(srcdir)/generated/matmul_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_r8.Tpo $(DEPDIR)/matmul_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_r8.c' object='matmul_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_r8.lo `test -f '$(srcdir)/generated/matmul_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_r8.c
+
+matmul_r10.lo: $(srcdir)/generated/matmul_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_r10.lo -MD -MP -MF $(DEPDIR)/matmul_r10.Tpo -c -o matmul_r10.lo `test -f '$(srcdir)/generated/matmul_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_r10.Tpo $(DEPDIR)/matmul_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_r10.c' object='matmul_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_r10.lo `test -f '$(srcdir)/generated/matmul_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_r10.c
+
+matmul_r16.lo: $(srcdir)/generated/matmul_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_r16.lo -MD -MP -MF $(DEPDIR)/matmul_r16.Tpo -c -o matmul_r16.lo `test -f '$(srcdir)/generated/matmul_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_r16.Tpo $(DEPDIR)/matmul_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_r16.c' object='matmul_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_r16.lo `test -f '$(srcdir)/generated/matmul_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_r16.c
+
+matmul_c4.lo: $(srcdir)/generated/matmul_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_c4.lo -MD -MP -MF $(DEPDIR)/matmul_c4.Tpo -c -o matmul_c4.lo `test -f '$(srcdir)/generated/matmul_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_c4.Tpo $(DEPDIR)/matmul_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_c4.c' object='matmul_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_c4.lo `test -f '$(srcdir)/generated/matmul_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_c4.c
+
+matmul_c8.lo: $(srcdir)/generated/matmul_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_c8.lo -MD -MP -MF $(DEPDIR)/matmul_c8.Tpo -c -o matmul_c8.lo `test -f '$(srcdir)/generated/matmul_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_c8.Tpo $(DEPDIR)/matmul_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_c8.c' object='matmul_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_c8.lo `test -f '$(srcdir)/generated/matmul_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_c8.c
+
+matmul_c10.lo: $(srcdir)/generated/matmul_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_c10.lo -MD -MP -MF $(DEPDIR)/matmul_c10.Tpo -c -o matmul_c10.lo `test -f '$(srcdir)/generated/matmul_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_c10.Tpo $(DEPDIR)/matmul_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_c10.c' object='matmul_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_c10.lo `test -f '$(srcdir)/generated/matmul_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_c10.c
+
+matmul_c16.lo: $(srcdir)/generated/matmul_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_c16.lo -MD -MP -MF $(DEPDIR)/matmul_c16.Tpo -c -o matmul_c16.lo `test -f '$(srcdir)/generated/matmul_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_c16.Tpo $(DEPDIR)/matmul_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_c16.c' object='matmul_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_c16.lo `test -f '$(srcdir)/generated/matmul_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_c16.c
+
+matmul_l4.lo: $(srcdir)/generated/matmul_l4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_l4.lo -MD -MP -MF $(DEPDIR)/matmul_l4.Tpo -c -o matmul_l4.lo `test -f '$(srcdir)/generated/matmul_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_l4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_l4.Tpo $(DEPDIR)/matmul_l4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_l4.c' object='matmul_l4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_l4.lo `test -f '$(srcdir)/generated/matmul_l4.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_l4.c
+
+matmul_l8.lo: $(srcdir)/generated/matmul_l8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_l8.lo -MD -MP -MF $(DEPDIR)/matmul_l8.Tpo -c -o matmul_l8.lo `test -f '$(srcdir)/generated/matmul_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_l8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_l8.Tpo $(DEPDIR)/matmul_l8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_l8.c' object='matmul_l8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_l8.lo `test -f '$(srcdir)/generated/matmul_l8.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_l8.c
+
+matmul_l16.lo: $(srcdir)/generated/matmul_l16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_l16.lo -MD -MP -MF $(DEPDIR)/matmul_l16.Tpo -c -o matmul_l16.lo `test -f '$(srcdir)/generated/matmul_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_l16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/matmul_l16.Tpo $(DEPDIR)/matmul_l16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/matmul_l16.c' object='matmul_l16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o matmul_l16.lo `test -f '$(srcdir)/generated/matmul_l16.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_l16.c
+
+transpose_i4.lo: $(srcdir)/generated/transpose_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_i4.lo -MD -MP -MF $(DEPDIR)/transpose_i4.Tpo -c -o transpose_i4.lo `test -f '$(srcdir)/generated/transpose_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_i4.Tpo $(DEPDIR)/transpose_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_i4.c' object='transpose_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_i4.lo `test -f '$(srcdir)/generated/transpose_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_i4.c
+
+transpose_i8.lo: $(srcdir)/generated/transpose_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_i8.lo -MD -MP -MF $(DEPDIR)/transpose_i8.Tpo -c -o transpose_i8.lo `test -f '$(srcdir)/generated/transpose_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_i8.Tpo $(DEPDIR)/transpose_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_i8.c' object='transpose_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_i8.lo `test -f '$(srcdir)/generated/transpose_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_i8.c
+
+transpose_i16.lo: $(srcdir)/generated/transpose_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_i16.lo -MD -MP -MF $(DEPDIR)/transpose_i16.Tpo -c -o transpose_i16.lo `test -f '$(srcdir)/generated/transpose_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_i16.Tpo $(DEPDIR)/transpose_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_i16.c' object='transpose_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_i16.lo `test -f '$(srcdir)/generated/transpose_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_i16.c
+
+transpose_r4.lo: $(srcdir)/generated/transpose_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_r4.lo -MD -MP -MF $(DEPDIR)/transpose_r4.Tpo -c -o transpose_r4.lo `test -f '$(srcdir)/generated/transpose_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_r4.Tpo $(DEPDIR)/transpose_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_r4.c' object='transpose_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_r4.lo `test -f '$(srcdir)/generated/transpose_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_r4.c
+
+transpose_r8.lo: $(srcdir)/generated/transpose_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_r8.lo -MD -MP -MF $(DEPDIR)/transpose_r8.Tpo -c -o transpose_r8.lo `test -f '$(srcdir)/generated/transpose_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_r8.Tpo $(DEPDIR)/transpose_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_r8.c' object='transpose_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_r8.lo `test -f '$(srcdir)/generated/transpose_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_r8.c
+
+transpose_r10.lo: $(srcdir)/generated/transpose_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_r10.lo -MD -MP -MF $(DEPDIR)/transpose_r10.Tpo -c -o transpose_r10.lo `test -f '$(srcdir)/generated/transpose_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_r10.Tpo $(DEPDIR)/transpose_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_r10.c' object='transpose_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_r10.lo `test -f '$(srcdir)/generated/transpose_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_r10.c
+
+transpose_r16.lo: $(srcdir)/generated/transpose_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_r16.lo -MD -MP -MF $(DEPDIR)/transpose_r16.Tpo -c -o transpose_r16.lo `test -f '$(srcdir)/generated/transpose_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_r16.Tpo $(DEPDIR)/transpose_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_r16.c' object='transpose_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_r16.lo `test -f '$(srcdir)/generated/transpose_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_r16.c
+
+transpose_c4.lo: $(srcdir)/generated/transpose_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_c4.lo -MD -MP -MF $(DEPDIR)/transpose_c4.Tpo -c -o transpose_c4.lo `test -f '$(srcdir)/generated/transpose_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_c4.Tpo $(DEPDIR)/transpose_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_c4.c' object='transpose_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_c4.lo `test -f '$(srcdir)/generated/transpose_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_c4.c
+
+transpose_c8.lo: $(srcdir)/generated/transpose_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_c8.lo -MD -MP -MF $(DEPDIR)/transpose_c8.Tpo -c -o transpose_c8.lo `test -f '$(srcdir)/generated/transpose_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_c8.Tpo $(DEPDIR)/transpose_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_c8.c' object='transpose_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_c8.lo `test -f '$(srcdir)/generated/transpose_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_c8.c
+
+transpose_c10.lo: $(srcdir)/generated/transpose_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_c10.lo -MD -MP -MF $(DEPDIR)/transpose_c10.Tpo -c -o transpose_c10.lo `test -f '$(srcdir)/generated/transpose_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_c10.Tpo $(DEPDIR)/transpose_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_c10.c' object='transpose_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_c10.lo `test -f '$(srcdir)/generated/transpose_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_c10.c
+
+transpose_c16.lo: $(srcdir)/generated/transpose_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_c16.lo -MD -MP -MF $(DEPDIR)/transpose_c16.Tpo -c -o transpose_c16.lo `test -f '$(srcdir)/generated/transpose_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_c16.Tpo $(DEPDIR)/transpose_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/transpose_c16.c' object='transpose_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_c16.lo `test -f '$(srcdir)/generated/transpose_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/transpose_c16.c
+
+shape_i4.lo: $(srcdir)/generated/shape_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shape_i4.lo -MD -MP -MF $(DEPDIR)/shape_i4.Tpo -c -o shape_i4.lo `test -f '$(srcdir)/generated/shape_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/shape_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/shape_i4.Tpo $(DEPDIR)/shape_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/shape_i4.c' object='shape_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shape_i4.lo `test -f '$(srcdir)/generated/shape_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/shape_i4.c
+
+shape_i8.lo: $(srcdir)/generated/shape_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shape_i8.lo -MD -MP -MF $(DEPDIR)/shape_i8.Tpo -c -o shape_i8.lo `test -f '$(srcdir)/generated/shape_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/shape_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/shape_i8.Tpo $(DEPDIR)/shape_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/shape_i8.c' object='shape_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shape_i8.lo `test -f '$(srcdir)/generated/shape_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/shape_i8.c
+
+shape_i16.lo: $(srcdir)/generated/shape_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shape_i16.lo -MD -MP -MF $(DEPDIR)/shape_i16.Tpo -c -o shape_i16.lo `test -f '$(srcdir)/generated/shape_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/shape_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/shape_i16.Tpo $(DEPDIR)/shape_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/shape_i16.c' object='shape_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shape_i16.lo `test -f '$(srcdir)/generated/shape_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/shape_i16.c
+
+eoshift1_4.lo: $(srcdir)/generated/eoshift1_4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eoshift1_4.lo -MD -MP -MF $(DEPDIR)/eoshift1_4.Tpo -c -o eoshift1_4.lo `test -f '$(srcdir)/generated/eoshift1_4.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift1_4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/eoshift1_4.Tpo $(DEPDIR)/eoshift1_4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/eoshift1_4.c' object='eoshift1_4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eoshift1_4.lo `test -f '$(srcdir)/generated/eoshift1_4.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift1_4.c
+
+eoshift1_8.lo: $(srcdir)/generated/eoshift1_8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eoshift1_8.lo -MD -MP -MF $(DEPDIR)/eoshift1_8.Tpo -c -o eoshift1_8.lo `test -f '$(srcdir)/generated/eoshift1_8.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift1_8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/eoshift1_8.Tpo $(DEPDIR)/eoshift1_8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/eoshift1_8.c' object='eoshift1_8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eoshift1_8.lo `test -f '$(srcdir)/generated/eoshift1_8.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift1_8.c
+
+eoshift1_16.lo: $(srcdir)/generated/eoshift1_16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eoshift1_16.lo -MD -MP -MF $(DEPDIR)/eoshift1_16.Tpo -c -o eoshift1_16.lo `test -f '$(srcdir)/generated/eoshift1_16.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift1_16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/eoshift1_16.Tpo $(DEPDIR)/eoshift1_16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/eoshift1_16.c' object='eoshift1_16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eoshift1_16.lo `test -f '$(srcdir)/generated/eoshift1_16.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift1_16.c
+
+eoshift3_4.lo: $(srcdir)/generated/eoshift3_4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eoshift3_4.lo -MD -MP -MF $(DEPDIR)/eoshift3_4.Tpo -c -o eoshift3_4.lo `test -f '$(srcdir)/generated/eoshift3_4.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift3_4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/eoshift3_4.Tpo $(DEPDIR)/eoshift3_4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/eoshift3_4.c' object='eoshift3_4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eoshift3_4.lo `test -f '$(srcdir)/generated/eoshift3_4.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift3_4.c
+
+eoshift3_8.lo: $(srcdir)/generated/eoshift3_8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eoshift3_8.lo -MD -MP -MF $(DEPDIR)/eoshift3_8.Tpo -c -o eoshift3_8.lo `test -f '$(srcdir)/generated/eoshift3_8.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift3_8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/eoshift3_8.Tpo $(DEPDIR)/eoshift3_8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/eoshift3_8.c' object='eoshift3_8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eoshift3_8.lo `test -f '$(srcdir)/generated/eoshift3_8.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift3_8.c
+
+eoshift3_16.lo: $(srcdir)/generated/eoshift3_16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eoshift3_16.lo -MD -MP -MF $(DEPDIR)/eoshift3_16.Tpo -c -o eoshift3_16.lo `test -f '$(srcdir)/generated/eoshift3_16.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift3_16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/eoshift3_16.Tpo $(DEPDIR)/eoshift3_16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/eoshift3_16.c' object='eoshift3_16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eoshift3_16.lo `test -f '$(srcdir)/generated/eoshift3_16.c' || echo '$(srcdir)/'`$(srcdir)/generated/eoshift3_16.c
+
+cshift1_4.lo: $(srcdir)/generated/cshift1_4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift1_4.lo -MD -MP -MF $(DEPDIR)/cshift1_4.Tpo -c -o cshift1_4.lo `test -f '$(srcdir)/generated/cshift1_4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift1_4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift1_4.Tpo $(DEPDIR)/cshift1_4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift1_4.c' object='cshift1_4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift1_4.lo `test -f '$(srcdir)/generated/cshift1_4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift1_4.c
+
+cshift1_8.lo: $(srcdir)/generated/cshift1_8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift1_8.lo -MD -MP -MF $(DEPDIR)/cshift1_8.Tpo -c -o cshift1_8.lo `test -f '$(srcdir)/generated/cshift1_8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift1_8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift1_8.Tpo $(DEPDIR)/cshift1_8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift1_8.c' object='cshift1_8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift1_8.lo `test -f '$(srcdir)/generated/cshift1_8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift1_8.c
+
+cshift1_16.lo: $(srcdir)/generated/cshift1_16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift1_16.lo -MD -MP -MF $(DEPDIR)/cshift1_16.Tpo -c -o cshift1_16.lo `test -f '$(srcdir)/generated/cshift1_16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift1_16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift1_16.Tpo $(DEPDIR)/cshift1_16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift1_16.c' object='cshift1_16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift1_16.lo `test -f '$(srcdir)/generated/cshift1_16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift1_16.c
+
+reshape_i4.lo: $(srcdir)/generated/reshape_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_i4.lo -MD -MP -MF $(DEPDIR)/reshape_i4.Tpo -c -o reshape_i4.lo `test -f '$(srcdir)/generated/reshape_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_i4.Tpo $(DEPDIR)/reshape_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_i4.c' object='reshape_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_i4.lo `test -f '$(srcdir)/generated/reshape_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_i4.c
+
+reshape_i8.lo: $(srcdir)/generated/reshape_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_i8.lo -MD -MP -MF $(DEPDIR)/reshape_i8.Tpo -c -o reshape_i8.lo `test -f '$(srcdir)/generated/reshape_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_i8.Tpo $(DEPDIR)/reshape_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_i8.c' object='reshape_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_i8.lo `test -f '$(srcdir)/generated/reshape_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_i8.c
+
+reshape_i16.lo: $(srcdir)/generated/reshape_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_i16.lo -MD -MP -MF $(DEPDIR)/reshape_i16.Tpo -c -o reshape_i16.lo `test -f '$(srcdir)/generated/reshape_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_i16.Tpo $(DEPDIR)/reshape_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_i16.c' object='reshape_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_i16.lo `test -f '$(srcdir)/generated/reshape_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_i16.c
+
+reshape_r4.lo: $(srcdir)/generated/reshape_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_r4.lo -MD -MP -MF $(DEPDIR)/reshape_r4.Tpo -c -o reshape_r4.lo `test -f '$(srcdir)/generated/reshape_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_r4.Tpo $(DEPDIR)/reshape_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_r4.c' object='reshape_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_r4.lo `test -f '$(srcdir)/generated/reshape_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_r4.c
+
+reshape_r8.lo: $(srcdir)/generated/reshape_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_r8.lo -MD -MP -MF $(DEPDIR)/reshape_r8.Tpo -c -o reshape_r8.lo `test -f '$(srcdir)/generated/reshape_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_r8.Tpo $(DEPDIR)/reshape_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_r8.c' object='reshape_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_r8.lo `test -f '$(srcdir)/generated/reshape_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_r8.c
+
+reshape_r10.lo: $(srcdir)/generated/reshape_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_r10.lo -MD -MP -MF $(DEPDIR)/reshape_r10.Tpo -c -o reshape_r10.lo `test -f '$(srcdir)/generated/reshape_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_r10.Tpo $(DEPDIR)/reshape_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_r10.c' object='reshape_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_r10.lo `test -f '$(srcdir)/generated/reshape_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_r10.c
+
+reshape_r16.lo: $(srcdir)/generated/reshape_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_r16.lo -MD -MP -MF $(DEPDIR)/reshape_r16.Tpo -c -o reshape_r16.lo `test -f '$(srcdir)/generated/reshape_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_r16.Tpo $(DEPDIR)/reshape_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_r16.c' object='reshape_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_r16.lo `test -f '$(srcdir)/generated/reshape_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_r16.c
+
+reshape_c4.lo: $(srcdir)/generated/reshape_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_c4.lo -MD -MP -MF $(DEPDIR)/reshape_c4.Tpo -c -o reshape_c4.lo `test -f '$(srcdir)/generated/reshape_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_c4.Tpo $(DEPDIR)/reshape_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_c4.c' object='reshape_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_c4.lo `test -f '$(srcdir)/generated/reshape_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_c4.c
+
+reshape_c8.lo: $(srcdir)/generated/reshape_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_c8.lo -MD -MP -MF $(DEPDIR)/reshape_c8.Tpo -c -o reshape_c8.lo `test -f '$(srcdir)/generated/reshape_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_c8.Tpo $(DEPDIR)/reshape_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_c8.c' object='reshape_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_c8.lo `test -f '$(srcdir)/generated/reshape_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_c8.c
+
+reshape_c10.lo: $(srcdir)/generated/reshape_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_c10.lo -MD -MP -MF $(DEPDIR)/reshape_c10.Tpo -c -o reshape_c10.lo `test -f '$(srcdir)/generated/reshape_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_c10.Tpo $(DEPDIR)/reshape_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_c10.c' object='reshape_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_c10.lo `test -f '$(srcdir)/generated/reshape_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_c10.c
+
+reshape_c16.lo: $(srcdir)/generated/reshape_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_c16.lo -MD -MP -MF $(DEPDIR)/reshape_c16.Tpo -c -o reshape_c16.lo `test -f '$(srcdir)/generated/reshape_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_c16.Tpo $(DEPDIR)/reshape_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/reshape_c16.c' object='reshape_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_c16.lo `test -f '$(srcdir)/generated/reshape_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_c16.c
+
+in_pack_i1.lo: $(srcdir)/generated/in_pack_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_i1.lo -MD -MP -MF $(DEPDIR)/in_pack_i1.Tpo -c -o in_pack_i1.lo `test -f '$(srcdir)/generated/in_pack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_i1.Tpo $(DEPDIR)/in_pack_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_i1.c' object='in_pack_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_i1.lo `test -f '$(srcdir)/generated/in_pack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i1.c
+
+in_pack_i2.lo: $(srcdir)/generated/in_pack_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_i2.lo -MD -MP -MF $(DEPDIR)/in_pack_i2.Tpo -c -o in_pack_i2.lo `test -f '$(srcdir)/generated/in_pack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_i2.Tpo $(DEPDIR)/in_pack_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_i2.c' object='in_pack_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_i2.lo `test -f '$(srcdir)/generated/in_pack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i2.c
+
+in_pack_i4.lo: $(srcdir)/generated/in_pack_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_i4.lo -MD -MP -MF $(DEPDIR)/in_pack_i4.Tpo -c -o in_pack_i4.lo `test -f '$(srcdir)/generated/in_pack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_i4.Tpo $(DEPDIR)/in_pack_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_i4.c' object='in_pack_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_i4.lo `test -f '$(srcdir)/generated/in_pack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i4.c
+
+in_pack_i8.lo: $(srcdir)/generated/in_pack_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_i8.lo -MD -MP -MF $(DEPDIR)/in_pack_i8.Tpo -c -o in_pack_i8.lo `test -f '$(srcdir)/generated/in_pack_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_i8.Tpo $(DEPDIR)/in_pack_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_i8.c' object='in_pack_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_i8.lo `test -f '$(srcdir)/generated/in_pack_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i8.c
+
+in_pack_i16.lo: $(srcdir)/generated/in_pack_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_i16.lo -MD -MP -MF $(DEPDIR)/in_pack_i16.Tpo -c -o in_pack_i16.lo `test -f '$(srcdir)/generated/in_pack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_i16.Tpo $(DEPDIR)/in_pack_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_i16.c' object='in_pack_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_i16.lo `test -f '$(srcdir)/generated/in_pack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i16.c
+
+in_pack_r4.lo: $(srcdir)/generated/in_pack_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_r4.lo -MD -MP -MF $(DEPDIR)/in_pack_r4.Tpo -c -o in_pack_r4.lo `test -f '$(srcdir)/generated/in_pack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_r4.Tpo $(DEPDIR)/in_pack_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_r4.c' object='in_pack_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_r4.lo `test -f '$(srcdir)/generated/in_pack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r4.c
+
+in_pack_r8.lo: $(srcdir)/generated/in_pack_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_r8.lo -MD -MP -MF $(DEPDIR)/in_pack_r8.Tpo -c -o in_pack_r8.lo `test -f '$(srcdir)/generated/in_pack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_r8.Tpo $(DEPDIR)/in_pack_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_r8.c' object='in_pack_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_r8.lo `test -f '$(srcdir)/generated/in_pack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r8.c
+
+in_pack_r10.lo: $(srcdir)/generated/in_pack_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_r10.lo -MD -MP -MF $(DEPDIR)/in_pack_r10.Tpo -c -o in_pack_r10.lo `test -f '$(srcdir)/generated/in_pack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_r10.Tpo $(DEPDIR)/in_pack_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_r10.c' object='in_pack_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_r10.lo `test -f '$(srcdir)/generated/in_pack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r10.c
+
+in_pack_r16.lo: $(srcdir)/generated/in_pack_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_r16.lo -MD -MP -MF $(DEPDIR)/in_pack_r16.Tpo -c -o in_pack_r16.lo `test -f '$(srcdir)/generated/in_pack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_r16.Tpo $(DEPDIR)/in_pack_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_r16.c' object='in_pack_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_r16.lo `test -f '$(srcdir)/generated/in_pack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r16.c
+
+in_pack_c4.lo: $(srcdir)/generated/in_pack_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_c4.lo -MD -MP -MF $(DEPDIR)/in_pack_c4.Tpo -c -o in_pack_c4.lo `test -f '$(srcdir)/generated/in_pack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_c4.Tpo $(DEPDIR)/in_pack_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_c4.c' object='in_pack_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_c4.lo `test -f '$(srcdir)/generated/in_pack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c4.c
+
+in_pack_c8.lo: $(srcdir)/generated/in_pack_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_c8.lo -MD -MP -MF $(DEPDIR)/in_pack_c8.Tpo -c -o in_pack_c8.lo `test -f '$(srcdir)/generated/in_pack_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_c8.Tpo $(DEPDIR)/in_pack_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_c8.c' object='in_pack_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_c8.lo `test -f '$(srcdir)/generated/in_pack_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c8.c
+
+in_pack_c10.lo: $(srcdir)/generated/in_pack_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_c10.lo -MD -MP -MF $(DEPDIR)/in_pack_c10.Tpo -c -o in_pack_c10.lo `test -f '$(srcdir)/generated/in_pack_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_c10.Tpo $(DEPDIR)/in_pack_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_c10.c' object='in_pack_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_c10.lo `test -f '$(srcdir)/generated/in_pack_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c10.c
+
+in_pack_c16.lo: $(srcdir)/generated/in_pack_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_c16.lo -MD -MP -MF $(DEPDIR)/in_pack_c16.Tpo -c -o in_pack_c16.lo `test -f '$(srcdir)/generated/in_pack_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_c16.Tpo $(DEPDIR)/in_pack_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_pack_c16.c' object='in_pack_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_c16.lo `test -f '$(srcdir)/generated/in_pack_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c16.c
+
+in_unpack_i1.lo: $(srcdir)/generated/in_unpack_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_i1.lo -MD -MP -MF $(DEPDIR)/in_unpack_i1.Tpo -c -o in_unpack_i1.lo `test -f '$(srcdir)/generated/in_unpack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_i1.Tpo $(DEPDIR)/in_unpack_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_i1.c' object='in_unpack_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_i1.lo `test -f '$(srcdir)/generated/in_unpack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i1.c
+
+in_unpack_i2.lo: $(srcdir)/generated/in_unpack_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_i2.lo -MD -MP -MF $(DEPDIR)/in_unpack_i2.Tpo -c -o in_unpack_i2.lo `test -f '$(srcdir)/generated/in_unpack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_i2.Tpo $(DEPDIR)/in_unpack_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_i2.c' object='in_unpack_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_i2.lo `test -f '$(srcdir)/generated/in_unpack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i2.c
+
+in_unpack_i4.lo: $(srcdir)/generated/in_unpack_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_i4.lo -MD -MP -MF $(DEPDIR)/in_unpack_i4.Tpo -c -o in_unpack_i4.lo `test -f '$(srcdir)/generated/in_unpack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_i4.Tpo $(DEPDIR)/in_unpack_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_i4.c' object='in_unpack_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_i4.lo `test -f '$(srcdir)/generated/in_unpack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i4.c
+
+in_unpack_i8.lo: $(srcdir)/generated/in_unpack_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_i8.lo -MD -MP -MF $(DEPDIR)/in_unpack_i8.Tpo -c -o in_unpack_i8.lo `test -f '$(srcdir)/generated/in_unpack_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_i8.Tpo $(DEPDIR)/in_unpack_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_i8.c' object='in_unpack_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_i8.lo `test -f '$(srcdir)/generated/in_unpack_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i8.c
+
+in_unpack_i16.lo: $(srcdir)/generated/in_unpack_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_i16.lo -MD -MP -MF $(DEPDIR)/in_unpack_i16.Tpo -c -o in_unpack_i16.lo `test -f '$(srcdir)/generated/in_unpack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_i16.Tpo $(DEPDIR)/in_unpack_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_i16.c' object='in_unpack_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_i16.lo `test -f '$(srcdir)/generated/in_unpack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i16.c
+
+in_unpack_r4.lo: $(srcdir)/generated/in_unpack_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_r4.lo -MD -MP -MF $(DEPDIR)/in_unpack_r4.Tpo -c -o in_unpack_r4.lo `test -f '$(srcdir)/generated/in_unpack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_r4.Tpo $(DEPDIR)/in_unpack_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_r4.c' object='in_unpack_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_r4.lo `test -f '$(srcdir)/generated/in_unpack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r4.c
+
+in_unpack_r8.lo: $(srcdir)/generated/in_unpack_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_r8.lo -MD -MP -MF $(DEPDIR)/in_unpack_r8.Tpo -c -o in_unpack_r8.lo `test -f '$(srcdir)/generated/in_unpack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_r8.Tpo $(DEPDIR)/in_unpack_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_r8.c' object='in_unpack_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_r8.lo `test -f '$(srcdir)/generated/in_unpack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r8.c
+
+in_unpack_r10.lo: $(srcdir)/generated/in_unpack_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_r10.lo -MD -MP -MF $(DEPDIR)/in_unpack_r10.Tpo -c -o in_unpack_r10.lo `test -f '$(srcdir)/generated/in_unpack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_r10.Tpo $(DEPDIR)/in_unpack_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_r10.c' object='in_unpack_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_r10.lo `test -f '$(srcdir)/generated/in_unpack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r10.c
+
+in_unpack_r16.lo: $(srcdir)/generated/in_unpack_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_r16.lo -MD -MP -MF $(DEPDIR)/in_unpack_r16.Tpo -c -o in_unpack_r16.lo `test -f '$(srcdir)/generated/in_unpack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_r16.Tpo $(DEPDIR)/in_unpack_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_r16.c' object='in_unpack_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_r16.lo `test -f '$(srcdir)/generated/in_unpack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r16.c
+
+in_unpack_c4.lo: $(srcdir)/generated/in_unpack_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_c4.lo -MD -MP -MF $(DEPDIR)/in_unpack_c4.Tpo -c -o in_unpack_c4.lo `test -f '$(srcdir)/generated/in_unpack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_c4.Tpo $(DEPDIR)/in_unpack_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_c4.c' object='in_unpack_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_c4.lo `test -f '$(srcdir)/generated/in_unpack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_c4.c
+
+in_unpack_c8.lo: $(srcdir)/generated/in_unpack_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_c8.lo -MD -MP -MF $(DEPDIR)/in_unpack_c8.Tpo -c -o in_unpack_c8.lo `test -f '$(srcdir)/generated/in_unpack_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_c8.Tpo $(DEPDIR)/in_unpack_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_c8.c' object='in_unpack_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_c8.lo `test -f '$(srcdir)/generated/in_unpack_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_c8.c
+
+in_unpack_c10.lo: $(srcdir)/generated/in_unpack_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_c10.lo -MD -MP -MF $(DEPDIR)/in_unpack_c10.Tpo -c -o in_unpack_c10.lo `test -f '$(srcdir)/generated/in_unpack_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_c10.Tpo $(DEPDIR)/in_unpack_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_c10.c' object='in_unpack_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_c10.lo `test -f '$(srcdir)/generated/in_unpack_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_c10.c
+
+in_unpack_c16.lo: $(srcdir)/generated/in_unpack_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_c16.lo -MD -MP -MF $(DEPDIR)/in_unpack_c16.Tpo -c -o in_unpack_c16.lo `test -f '$(srcdir)/generated/in_unpack_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_c16.Tpo $(DEPDIR)/in_unpack_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/in_unpack_c16.c' object='in_unpack_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_c16.lo `test -f '$(srcdir)/generated/in_unpack_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_c16.c
+
+exponent_r4.lo: $(srcdir)/generated/exponent_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT exponent_r4.lo -MD -MP -MF $(DEPDIR)/exponent_r4.Tpo -c -o exponent_r4.lo `test -f '$(srcdir)/generated/exponent_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/exponent_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/exponent_r4.Tpo $(DEPDIR)/exponent_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/exponent_r4.c' object='exponent_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o exponent_r4.lo `test -f '$(srcdir)/generated/exponent_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/exponent_r4.c
+
+exponent_r8.lo: $(srcdir)/generated/exponent_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT exponent_r8.lo -MD -MP -MF $(DEPDIR)/exponent_r8.Tpo -c -o exponent_r8.lo `test -f '$(srcdir)/generated/exponent_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/exponent_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/exponent_r8.Tpo $(DEPDIR)/exponent_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/exponent_r8.c' object='exponent_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o exponent_r8.lo `test -f '$(srcdir)/generated/exponent_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/exponent_r8.c
+
+exponent_r10.lo: $(srcdir)/generated/exponent_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT exponent_r10.lo -MD -MP -MF $(DEPDIR)/exponent_r10.Tpo -c -o exponent_r10.lo `test -f '$(srcdir)/generated/exponent_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/exponent_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/exponent_r10.Tpo $(DEPDIR)/exponent_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/exponent_r10.c' object='exponent_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o exponent_r10.lo `test -f '$(srcdir)/generated/exponent_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/exponent_r10.c
+
+exponent_r16.lo: $(srcdir)/generated/exponent_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT exponent_r16.lo -MD -MP -MF $(DEPDIR)/exponent_r16.Tpo -c -o exponent_r16.lo `test -f '$(srcdir)/generated/exponent_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/exponent_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/exponent_r16.Tpo $(DEPDIR)/exponent_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/exponent_r16.c' object='exponent_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o exponent_r16.lo `test -f '$(srcdir)/generated/exponent_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/exponent_r16.c
+
+fraction_r4.lo: $(srcdir)/generated/fraction_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fraction_r4.lo -MD -MP -MF $(DEPDIR)/fraction_r4.Tpo -c -o fraction_r4.lo `test -f '$(srcdir)/generated/fraction_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/fraction_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/fraction_r4.Tpo $(DEPDIR)/fraction_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/fraction_r4.c' object='fraction_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fraction_r4.lo `test -f '$(srcdir)/generated/fraction_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/fraction_r4.c
+
+fraction_r8.lo: $(srcdir)/generated/fraction_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fraction_r8.lo -MD -MP -MF $(DEPDIR)/fraction_r8.Tpo -c -o fraction_r8.lo `test -f '$(srcdir)/generated/fraction_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/fraction_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/fraction_r8.Tpo $(DEPDIR)/fraction_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/fraction_r8.c' object='fraction_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fraction_r8.lo `test -f '$(srcdir)/generated/fraction_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/fraction_r8.c
+
+fraction_r10.lo: $(srcdir)/generated/fraction_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fraction_r10.lo -MD -MP -MF $(DEPDIR)/fraction_r10.Tpo -c -o fraction_r10.lo `test -f '$(srcdir)/generated/fraction_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/fraction_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/fraction_r10.Tpo $(DEPDIR)/fraction_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/fraction_r10.c' object='fraction_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fraction_r10.lo `test -f '$(srcdir)/generated/fraction_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/fraction_r10.c
+
+fraction_r16.lo: $(srcdir)/generated/fraction_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fraction_r16.lo -MD -MP -MF $(DEPDIR)/fraction_r16.Tpo -c -o fraction_r16.lo `test -f '$(srcdir)/generated/fraction_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/fraction_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/fraction_r16.Tpo $(DEPDIR)/fraction_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/fraction_r16.c' object='fraction_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fraction_r16.lo `test -f '$(srcdir)/generated/fraction_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/fraction_r16.c
+
+nearest_r4.lo: $(srcdir)/generated/nearest_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nearest_r4.lo -MD -MP -MF $(DEPDIR)/nearest_r4.Tpo -c -o nearest_r4.lo `test -f '$(srcdir)/generated/nearest_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/nearest_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/nearest_r4.Tpo $(DEPDIR)/nearest_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/nearest_r4.c' object='nearest_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nearest_r4.lo `test -f '$(srcdir)/generated/nearest_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/nearest_r4.c
+
+nearest_r8.lo: $(srcdir)/generated/nearest_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nearest_r8.lo -MD -MP -MF $(DEPDIR)/nearest_r8.Tpo -c -o nearest_r8.lo `test -f '$(srcdir)/generated/nearest_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/nearest_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/nearest_r8.Tpo $(DEPDIR)/nearest_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/nearest_r8.c' object='nearest_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nearest_r8.lo `test -f '$(srcdir)/generated/nearest_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/nearest_r8.c
+
+nearest_r10.lo: $(srcdir)/generated/nearest_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nearest_r10.lo -MD -MP -MF $(DEPDIR)/nearest_r10.Tpo -c -o nearest_r10.lo `test -f '$(srcdir)/generated/nearest_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/nearest_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/nearest_r10.Tpo $(DEPDIR)/nearest_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/nearest_r10.c' object='nearest_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nearest_r10.lo `test -f '$(srcdir)/generated/nearest_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/nearest_r10.c
+
+nearest_r16.lo: $(srcdir)/generated/nearest_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nearest_r16.lo -MD -MP -MF $(DEPDIR)/nearest_r16.Tpo -c -o nearest_r16.lo `test -f '$(srcdir)/generated/nearest_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/nearest_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/nearest_r16.Tpo $(DEPDIR)/nearest_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/nearest_r16.c' object='nearest_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nearest_r16.lo `test -f '$(srcdir)/generated/nearest_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/nearest_r16.c
+
+set_exponent_r4.lo: $(srcdir)/generated/set_exponent_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT set_exponent_r4.lo -MD -MP -MF $(DEPDIR)/set_exponent_r4.Tpo -c -o set_exponent_r4.lo `test -f '$(srcdir)/generated/set_exponent_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/set_exponent_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/set_exponent_r4.Tpo $(DEPDIR)/set_exponent_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/set_exponent_r4.c' object='set_exponent_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o set_exponent_r4.lo `test -f '$(srcdir)/generated/set_exponent_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/set_exponent_r4.c
+
+set_exponent_r8.lo: $(srcdir)/generated/set_exponent_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT set_exponent_r8.lo -MD -MP -MF $(DEPDIR)/set_exponent_r8.Tpo -c -o set_exponent_r8.lo `test -f '$(srcdir)/generated/set_exponent_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/set_exponent_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/set_exponent_r8.Tpo $(DEPDIR)/set_exponent_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/set_exponent_r8.c' object='set_exponent_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o set_exponent_r8.lo `test -f '$(srcdir)/generated/set_exponent_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/set_exponent_r8.c
+
+set_exponent_r10.lo: $(srcdir)/generated/set_exponent_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT set_exponent_r10.lo -MD -MP -MF $(DEPDIR)/set_exponent_r10.Tpo -c -o set_exponent_r10.lo `test -f '$(srcdir)/generated/set_exponent_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/set_exponent_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/set_exponent_r10.Tpo $(DEPDIR)/set_exponent_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/set_exponent_r10.c' object='set_exponent_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o set_exponent_r10.lo `test -f '$(srcdir)/generated/set_exponent_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/set_exponent_r10.c
+
+set_exponent_r16.lo: $(srcdir)/generated/set_exponent_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT set_exponent_r16.lo -MD -MP -MF $(DEPDIR)/set_exponent_r16.Tpo -c -o set_exponent_r16.lo `test -f '$(srcdir)/generated/set_exponent_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/set_exponent_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/set_exponent_r16.Tpo $(DEPDIR)/set_exponent_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/set_exponent_r16.c' object='set_exponent_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o set_exponent_r16.lo `test -f '$(srcdir)/generated/set_exponent_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/set_exponent_r16.c
+
+pow_i4_i4.lo: $(srcdir)/generated/pow_i4_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_i4_i4.lo -MD -MP -MF $(DEPDIR)/pow_i4_i4.Tpo -c -o pow_i4_i4.lo `test -f '$(srcdir)/generated/pow_i4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i4_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_i4_i4.Tpo $(DEPDIR)/pow_i4_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_i4_i4.c' object='pow_i4_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i4_i4.lo `test -f '$(srcdir)/generated/pow_i4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i4_i4.c
+
+pow_i8_i4.lo: $(srcdir)/generated/pow_i8_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_i8_i4.lo -MD -MP -MF $(DEPDIR)/pow_i8_i4.Tpo -c -o pow_i8_i4.lo `test -f '$(srcdir)/generated/pow_i8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i8_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_i8_i4.Tpo $(DEPDIR)/pow_i8_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_i8_i4.c' object='pow_i8_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i8_i4.lo `test -f '$(srcdir)/generated/pow_i8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i8_i4.c
+
+pow_i16_i4.lo: $(srcdir)/generated/pow_i16_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_i16_i4.lo -MD -MP -MF $(DEPDIR)/pow_i16_i4.Tpo -c -o pow_i16_i4.lo `test -f '$(srcdir)/generated/pow_i16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i16_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_i16_i4.Tpo $(DEPDIR)/pow_i16_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_i16_i4.c' object='pow_i16_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i16_i4.lo `test -f '$(srcdir)/generated/pow_i16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i16_i4.c
+
+pow_r16_i4.lo: $(srcdir)/generated/pow_r16_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r16_i4.lo -MD -MP -MF $(DEPDIR)/pow_r16_i4.Tpo -c -o pow_r16_i4.lo `test -f '$(srcdir)/generated/pow_r16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r16_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_r16_i4.Tpo $(DEPDIR)/pow_r16_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_r16_i4.c' object='pow_r16_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r16_i4.lo `test -f '$(srcdir)/generated/pow_r16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r16_i4.c
+
+pow_c4_i4.lo: $(srcdir)/generated/pow_c4_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c4_i4.lo -MD -MP -MF $(DEPDIR)/pow_c4_i4.Tpo -c -o pow_c4_i4.lo `test -f '$(srcdir)/generated/pow_c4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c4_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c4_i4.Tpo $(DEPDIR)/pow_c4_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c4_i4.c' object='pow_c4_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c4_i4.lo `test -f '$(srcdir)/generated/pow_c4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c4_i4.c
+
+pow_c8_i4.lo: $(srcdir)/generated/pow_c8_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c8_i4.lo -MD -MP -MF $(DEPDIR)/pow_c8_i4.Tpo -c -o pow_c8_i4.lo `test -f '$(srcdir)/generated/pow_c8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c8_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c8_i4.Tpo $(DEPDIR)/pow_c8_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c8_i4.c' object='pow_c8_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c8_i4.lo `test -f '$(srcdir)/generated/pow_c8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c8_i4.c
+
+pow_c10_i4.lo: $(srcdir)/generated/pow_c10_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c10_i4.lo -MD -MP -MF $(DEPDIR)/pow_c10_i4.Tpo -c -o pow_c10_i4.lo `test -f '$(srcdir)/generated/pow_c10_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c10_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c10_i4.Tpo $(DEPDIR)/pow_c10_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c10_i4.c' object='pow_c10_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c10_i4.lo `test -f '$(srcdir)/generated/pow_c10_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c10_i4.c
+
+pow_c16_i4.lo: $(srcdir)/generated/pow_c16_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c16_i4.lo -MD -MP -MF $(DEPDIR)/pow_c16_i4.Tpo -c -o pow_c16_i4.lo `test -f '$(srcdir)/generated/pow_c16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c16_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c16_i4.Tpo $(DEPDIR)/pow_c16_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c16_i4.c' object='pow_c16_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c16_i4.lo `test -f '$(srcdir)/generated/pow_c16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c16_i4.c
+
+pow_i4_i8.lo: $(srcdir)/generated/pow_i4_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_i4_i8.lo -MD -MP -MF $(DEPDIR)/pow_i4_i8.Tpo -c -o pow_i4_i8.lo `test -f '$(srcdir)/generated/pow_i4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i4_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_i4_i8.Tpo $(DEPDIR)/pow_i4_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_i4_i8.c' object='pow_i4_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i4_i8.lo `test -f '$(srcdir)/generated/pow_i4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i4_i8.c
+
+pow_i8_i8.lo: $(srcdir)/generated/pow_i8_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_i8_i8.lo -MD -MP -MF $(DEPDIR)/pow_i8_i8.Tpo -c -o pow_i8_i8.lo `test -f '$(srcdir)/generated/pow_i8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i8_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_i8_i8.Tpo $(DEPDIR)/pow_i8_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_i8_i8.c' object='pow_i8_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i8_i8.lo `test -f '$(srcdir)/generated/pow_i8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i8_i8.c
+
+pow_i16_i8.lo: $(srcdir)/generated/pow_i16_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_i16_i8.lo -MD -MP -MF $(DEPDIR)/pow_i16_i8.Tpo -c -o pow_i16_i8.lo `test -f '$(srcdir)/generated/pow_i16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i16_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_i16_i8.Tpo $(DEPDIR)/pow_i16_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_i16_i8.c' object='pow_i16_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i16_i8.lo `test -f '$(srcdir)/generated/pow_i16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i16_i8.c
+
+pow_r4_i8.lo: $(srcdir)/generated/pow_r4_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r4_i8.lo -MD -MP -MF $(DEPDIR)/pow_r4_i8.Tpo -c -o pow_r4_i8.lo `test -f '$(srcdir)/generated/pow_r4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r4_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_r4_i8.Tpo $(DEPDIR)/pow_r4_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_r4_i8.c' object='pow_r4_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r4_i8.lo `test -f '$(srcdir)/generated/pow_r4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r4_i8.c
+
+pow_r8_i8.lo: $(srcdir)/generated/pow_r8_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r8_i8.lo -MD -MP -MF $(DEPDIR)/pow_r8_i8.Tpo -c -o pow_r8_i8.lo `test -f '$(srcdir)/generated/pow_r8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r8_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_r8_i8.Tpo $(DEPDIR)/pow_r8_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_r8_i8.c' object='pow_r8_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r8_i8.lo `test -f '$(srcdir)/generated/pow_r8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r8_i8.c
+
+pow_r10_i8.lo: $(srcdir)/generated/pow_r10_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r10_i8.lo -MD -MP -MF $(DEPDIR)/pow_r10_i8.Tpo -c -o pow_r10_i8.lo `test -f '$(srcdir)/generated/pow_r10_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r10_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_r10_i8.Tpo $(DEPDIR)/pow_r10_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_r10_i8.c' object='pow_r10_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r10_i8.lo `test -f '$(srcdir)/generated/pow_r10_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r10_i8.c
+
+pow_r16_i8.lo: $(srcdir)/generated/pow_r16_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r16_i8.lo -MD -MP -MF $(DEPDIR)/pow_r16_i8.Tpo -c -o pow_r16_i8.lo `test -f '$(srcdir)/generated/pow_r16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r16_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_r16_i8.Tpo $(DEPDIR)/pow_r16_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_r16_i8.c' object='pow_r16_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r16_i8.lo `test -f '$(srcdir)/generated/pow_r16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r16_i8.c
+
+pow_c4_i8.lo: $(srcdir)/generated/pow_c4_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c4_i8.lo -MD -MP -MF $(DEPDIR)/pow_c4_i8.Tpo -c -o pow_c4_i8.lo `test -f '$(srcdir)/generated/pow_c4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c4_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c4_i8.Tpo $(DEPDIR)/pow_c4_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c4_i8.c' object='pow_c4_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c4_i8.lo `test -f '$(srcdir)/generated/pow_c4_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c4_i8.c
+
+pow_c8_i8.lo: $(srcdir)/generated/pow_c8_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c8_i8.lo -MD -MP -MF $(DEPDIR)/pow_c8_i8.Tpo -c -o pow_c8_i8.lo `test -f '$(srcdir)/generated/pow_c8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c8_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c8_i8.Tpo $(DEPDIR)/pow_c8_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c8_i8.c' object='pow_c8_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c8_i8.lo `test -f '$(srcdir)/generated/pow_c8_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c8_i8.c
+
+pow_c10_i8.lo: $(srcdir)/generated/pow_c10_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c10_i8.lo -MD -MP -MF $(DEPDIR)/pow_c10_i8.Tpo -c -o pow_c10_i8.lo `test -f '$(srcdir)/generated/pow_c10_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c10_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c10_i8.Tpo $(DEPDIR)/pow_c10_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c10_i8.c' object='pow_c10_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c10_i8.lo `test -f '$(srcdir)/generated/pow_c10_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c10_i8.c
+
+pow_c16_i8.lo: $(srcdir)/generated/pow_c16_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c16_i8.lo -MD -MP -MF $(DEPDIR)/pow_c16_i8.Tpo -c -o pow_c16_i8.lo `test -f '$(srcdir)/generated/pow_c16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c16_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c16_i8.Tpo $(DEPDIR)/pow_c16_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c16_i8.c' object='pow_c16_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c16_i8.lo `test -f '$(srcdir)/generated/pow_c16_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c16_i8.c
+
+pow_i4_i16.lo: $(srcdir)/generated/pow_i4_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_i4_i16.lo -MD -MP -MF $(DEPDIR)/pow_i4_i16.Tpo -c -o pow_i4_i16.lo `test -f '$(srcdir)/generated/pow_i4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i4_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_i4_i16.Tpo $(DEPDIR)/pow_i4_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_i4_i16.c' object='pow_i4_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i4_i16.lo `test -f '$(srcdir)/generated/pow_i4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i4_i16.c
+
+pow_i8_i16.lo: $(srcdir)/generated/pow_i8_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_i8_i16.lo -MD -MP -MF $(DEPDIR)/pow_i8_i16.Tpo -c -o pow_i8_i16.lo `test -f '$(srcdir)/generated/pow_i8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i8_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_i8_i16.Tpo $(DEPDIR)/pow_i8_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_i8_i16.c' object='pow_i8_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i8_i16.lo `test -f '$(srcdir)/generated/pow_i8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i8_i16.c
+
+pow_i16_i16.lo: $(srcdir)/generated/pow_i16_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_i16_i16.lo -MD -MP -MF $(DEPDIR)/pow_i16_i16.Tpo -c -o pow_i16_i16.lo `test -f '$(srcdir)/generated/pow_i16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i16_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_i16_i16.Tpo $(DEPDIR)/pow_i16_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_i16_i16.c' object='pow_i16_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i16_i16.lo `test -f '$(srcdir)/generated/pow_i16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i16_i16.c
+
+pow_r4_i16.lo: $(srcdir)/generated/pow_r4_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r4_i16.lo -MD -MP -MF $(DEPDIR)/pow_r4_i16.Tpo -c -o pow_r4_i16.lo `test -f '$(srcdir)/generated/pow_r4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r4_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_r4_i16.Tpo $(DEPDIR)/pow_r4_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_r4_i16.c' object='pow_r4_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r4_i16.lo `test -f '$(srcdir)/generated/pow_r4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r4_i16.c
+
+pow_r8_i16.lo: $(srcdir)/generated/pow_r8_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r8_i16.lo -MD -MP -MF $(DEPDIR)/pow_r8_i16.Tpo -c -o pow_r8_i16.lo `test -f '$(srcdir)/generated/pow_r8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r8_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_r8_i16.Tpo $(DEPDIR)/pow_r8_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_r8_i16.c' object='pow_r8_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r8_i16.lo `test -f '$(srcdir)/generated/pow_r8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r8_i16.c
+
+pow_r10_i16.lo: $(srcdir)/generated/pow_r10_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r10_i16.lo -MD -MP -MF $(DEPDIR)/pow_r10_i16.Tpo -c -o pow_r10_i16.lo `test -f '$(srcdir)/generated/pow_r10_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r10_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_r10_i16.Tpo $(DEPDIR)/pow_r10_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_r10_i16.c' object='pow_r10_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r10_i16.lo `test -f '$(srcdir)/generated/pow_r10_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r10_i16.c
+
+pow_r16_i16.lo: $(srcdir)/generated/pow_r16_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r16_i16.lo -MD -MP -MF $(DEPDIR)/pow_r16_i16.Tpo -c -o pow_r16_i16.lo `test -f '$(srcdir)/generated/pow_r16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r16_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_r16_i16.Tpo $(DEPDIR)/pow_r16_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_r16_i16.c' object='pow_r16_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r16_i16.lo `test -f '$(srcdir)/generated/pow_r16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r16_i16.c
+
+pow_c4_i16.lo: $(srcdir)/generated/pow_c4_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c4_i16.lo -MD -MP -MF $(DEPDIR)/pow_c4_i16.Tpo -c -o pow_c4_i16.lo `test -f '$(srcdir)/generated/pow_c4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c4_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c4_i16.Tpo $(DEPDIR)/pow_c4_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c4_i16.c' object='pow_c4_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c4_i16.lo `test -f '$(srcdir)/generated/pow_c4_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c4_i16.c
+
+pow_c8_i16.lo: $(srcdir)/generated/pow_c8_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c8_i16.lo -MD -MP -MF $(DEPDIR)/pow_c8_i16.Tpo -c -o pow_c8_i16.lo `test -f '$(srcdir)/generated/pow_c8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c8_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c8_i16.Tpo $(DEPDIR)/pow_c8_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c8_i16.c' object='pow_c8_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c8_i16.lo `test -f '$(srcdir)/generated/pow_c8_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c8_i16.c
+
+pow_c10_i16.lo: $(srcdir)/generated/pow_c10_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c10_i16.lo -MD -MP -MF $(DEPDIR)/pow_c10_i16.Tpo -c -o pow_c10_i16.lo `test -f '$(srcdir)/generated/pow_c10_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c10_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c10_i16.Tpo $(DEPDIR)/pow_c10_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c10_i16.c' object='pow_c10_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c10_i16.lo `test -f '$(srcdir)/generated/pow_c10_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c10_i16.c
+
+pow_c16_i16.lo: $(srcdir)/generated/pow_c16_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c16_i16.lo -MD -MP -MF $(DEPDIR)/pow_c16_i16.Tpo -c -o pow_c16_i16.lo `test -f '$(srcdir)/generated/pow_c16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c16_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pow_c16_i16.Tpo $(DEPDIR)/pow_c16_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pow_c16_i16.c' object='pow_c16_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_c16_i16.lo `test -f '$(srcdir)/generated/pow_c16_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c16_i16.c
+
+rrspacing_r4.lo: $(srcdir)/generated/rrspacing_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rrspacing_r4.lo -MD -MP -MF $(DEPDIR)/rrspacing_r4.Tpo -c -o rrspacing_r4.lo `test -f '$(srcdir)/generated/rrspacing_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/rrspacing_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/rrspacing_r4.Tpo $(DEPDIR)/rrspacing_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/rrspacing_r4.c' object='rrspacing_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rrspacing_r4.lo `test -f '$(srcdir)/generated/rrspacing_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/rrspacing_r4.c
+
+rrspacing_r8.lo: $(srcdir)/generated/rrspacing_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rrspacing_r8.lo -MD -MP -MF $(DEPDIR)/rrspacing_r8.Tpo -c -o rrspacing_r8.lo `test -f '$(srcdir)/generated/rrspacing_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/rrspacing_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/rrspacing_r8.Tpo $(DEPDIR)/rrspacing_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/rrspacing_r8.c' object='rrspacing_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rrspacing_r8.lo `test -f '$(srcdir)/generated/rrspacing_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/rrspacing_r8.c
+
+rrspacing_r10.lo: $(srcdir)/generated/rrspacing_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rrspacing_r10.lo -MD -MP -MF $(DEPDIR)/rrspacing_r10.Tpo -c -o rrspacing_r10.lo `test -f '$(srcdir)/generated/rrspacing_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/rrspacing_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/rrspacing_r10.Tpo $(DEPDIR)/rrspacing_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/rrspacing_r10.c' object='rrspacing_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rrspacing_r10.lo `test -f '$(srcdir)/generated/rrspacing_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/rrspacing_r10.c
+
+rrspacing_r16.lo: $(srcdir)/generated/rrspacing_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rrspacing_r16.lo -MD -MP -MF $(DEPDIR)/rrspacing_r16.Tpo -c -o rrspacing_r16.lo `test -f '$(srcdir)/generated/rrspacing_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/rrspacing_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/rrspacing_r16.Tpo $(DEPDIR)/rrspacing_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/rrspacing_r16.c' object='rrspacing_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rrspacing_r16.lo `test -f '$(srcdir)/generated/rrspacing_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/rrspacing_r16.c
+
+spacing_r4.lo: $(srcdir)/generated/spacing_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spacing_r4.lo -MD -MP -MF $(DEPDIR)/spacing_r4.Tpo -c -o spacing_r4.lo `test -f '$(srcdir)/generated/spacing_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/spacing_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spacing_r4.Tpo $(DEPDIR)/spacing_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spacing_r4.c' object='spacing_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spacing_r4.lo `test -f '$(srcdir)/generated/spacing_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/spacing_r4.c
+
+spacing_r8.lo: $(srcdir)/generated/spacing_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spacing_r8.lo -MD -MP -MF $(DEPDIR)/spacing_r8.Tpo -c -o spacing_r8.lo `test -f '$(srcdir)/generated/spacing_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/spacing_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spacing_r8.Tpo $(DEPDIR)/spacing_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spacing_r8.c' object='spacing_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spacing_r8.lo `test -f '$(srcdir)/generated/spacing_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/spacing_r8.c
+
+spacing_r10.lo: $(srcdir)/generated/spacing_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spacing_r10.lo -MD -MP -MF $(DEPDIR)/spacing_r10.Tpo -c -o spacing_r10.lo `test -f '$(srcdir)/generated/spacing_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/spacing_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spacing_r10.Tpo $(DEPDIR)/spacing_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spacing_r10.c' object='spacing_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spacing_r10.lo `test -f '$(srcdir)/generated/spacing_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/spacing_r10.c
+
+spacing_r16.lo: $(srcdir)/generated/spacing_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spacing_r16.lo -MD -MP -MF $(DEPDIR)/spacing_r16.Tpo -c -o spacing_r16.lo `test -f '$(srcdir)/generated/spacing_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/spacing_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spacing_r16.Tpo $(DEPDIR)/spacing_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spacing_r16.c' object='spacing_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spacing_r16.lo `test -f '$(srcdir)/generated/spacing_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/spacing_r16.c
+
+pack_i1.lo: $(srcdir)/generated/pack_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_i1.lo -MD -MP -MF $(DEPDIR)/pack_i1.Tpo -c -o pack_i1.lo `test -f '$(srcdir)/generated/pack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_i1.Tpo $(DEPDIR)/pack_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_i1.c' object='pack_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_i1.lo `test -f '$(srcdir)/generated/pack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i1.c
+
+pack_i2.lo: $(srcdir)/generated/pack_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_i2.lo -MD -MP -MF $(DEPDIR)/pack_i2.Tpo -c -o pack_i2.lo `test -f '$(srcdir)/generated/pack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_i2.Tpo $(DEPDIR)/pack_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_i2.c' object='pack_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_i2.lo `test -f '$(srcdir)/generated/pack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i2.c
+
+pack_i4.lo: $(srcdir)/generated/pack_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_i4.lo -MD -MP -MF $(DEPDIR)/pack_i4.Tpo -c -o pack_i4.lo `test -f '$(srcdir)/generated/pack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_i4.Tpo $(DEPDIR)/pack_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_i4.c' object='pack_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_i4.lo `test -f '$(srcdir)/generated/pack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i4.c
+
+pack_i8.lo: $(srcdir)/generated/pack_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_i8.lo -MD -MP -MF $(DEPDIR)/pack_i8.Tpo -c -o pack_i8.lo `test -f '$(srcdir)/generated/pack_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_i8.Tpo $(DEPDIR)/pack_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_i8.c' object='pack_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_i8.lo `test -f '$(srcdir)/generated/pack_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i8.c
+
+pack_i16.lo: $(srcdir)/generated/pack_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_i16.lo -MD -MP -MF $(DEPDIR)/pack_i16.Tpo -c -o pack_i16.lo `test -f '$(srcdir)/generated/pack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_i16.Tpo $(DEPDIR)/pack_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_i16.c' object='pack_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_i16.lo `test -f '$(srcdir)/generated/pack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_i16.c
+
+pack_r4.lo: $(srcdir)/generated/pack_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_r4.lo -MD -MP -MF $(DEPDIR)/pack_r4.Tpo -c -o pack_r4.lo `test -f '$(srcdir)/generated/pack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_r4.Tpo $(DEPDIR)/pack_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_r4.c' object='pack_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_r4.lo `test -f '$(srcdir)/generated/pack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_r4.c
+
+pack_r8.lo: $(srcdir)/generated/pack_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_r8.lo -MD -MP -MF $(DEPDIR)/pack_r8.Tpo -c -o pack_r8.lo `test -f '$(srcdir)/generated/pack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_r8.Tpo $(DEPDIR)/pack_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_r8.c' object='pack_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_r8.lo `test -f '$(srcdir)/generated/pack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_r8.c
+
+pack_r10.lo: $(srcdir)/generated/pack_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_r10.lo -MD -MP -MF $(DEPDIR)/pack_r10.Tpo -c -o pack_r10.lo `test -f '$(srcdir)/generated/pack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_r10.Tpo $(DEPDIR)/pack_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_r10.c' object='pack_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_r10.lo `test -f '$(srcdir)/generated/pack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_r10.c
+
+pack_r16.lo: $(srcdir)/generated/pack_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_r16.lo -MD -MP -MF $(DEPDIR)/pack_r16.Tpo -c -o pack_r16.lo `test -f '$(srcdir)/generated/pack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_r16.Tpo $(DEPDIR)/pack_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_r16.c' object='pack_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_r16.lo `test -f '$(srcdir)/generated/pack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_r16.c
+
+pack_c4.lo: $(srcdir)/generated/pack_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_c4.lo -MD -MP -MF $(DEPDIR)/pack_c4.Tpo -c -o pack_c4.lo `test -f '$(srcdir)/generated/pack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_c4.Tpo $(DEPDIR)/pack_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_c4.c' object='pack_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_c4.lo `test -f '$(srcdir)/generated/pack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_c4.c
+
+pack_c8.lo: $(srcdir)/generated/pack_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_c8.lo -MD -MP -MF $(DEPDIR)/pack_c8.Tpo -c -o pack_c8.lo `test -f '$(srcdir)/generated/pack_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_c8.Tpo $(DEPDIR)/pack_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_c8.c' object='pack_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_c8.lo `test -f '$(srcdir)/generated/pack_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_c8.c
+
+pack_c10.lo: $(srcdir)/generated/pack_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_c10.lo -MD -MP -MF $(DEPDIR)/pack_c10.Tpo -c -o pack_c10.lo `test -f '$(srcdir)/generated/pack_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_c10.Tpo $(DEPDIR)/pack_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_c10.c' object='pack_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_c10.lo `test -f '$(srcdir)/generated/pack_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_c10.c
+
+pack_c16.lo: $(srcdir)/generated/pack_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_c16.lo -MD -MP -MF $(DEPDIR)/pack_c16.Tpo -c -o pack_c16.lo `test -f '$(srcdir)/generated/pack_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_c16.Tpo $(DEPDIR)/pack_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/pack_c16.c' object='pack_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_c16.lo `test -f '$(srcdir)/generated/pack_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/pack_c16.c
+
+unpack_i1.lo: $(srcdir)/generated/unpack_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_i1.lo -MD -MP -MF $(DEPDIR)/unpack_i1.Tpo -c -o unpack_i1.lo `test -f '$(srcdir)/generated/unpack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_i1.Tpo $(DEPDIR)/unpack_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_i1.c' object='unpack_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_i1.lo `test -f '$(srcdir)/generated/unpack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i1.c
+
+unpack_i2.lo: $(srcdir)/generated/unpack_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_i2.lo -MD -MP -MF $(DEPDIR)/unpack_i2.Tpo -c -o unpack_i2.lo `test -f '$(srcdir)/generated/unpack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_i2.Tpo $(DEPDIR)/unpack_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_i2.c' object='unpack_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_i2.lo `test -f '$(srcdir)/generated/unpack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i2.c
+
+unpack_i4.lo: $(srcdir)/generated/unpack_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_i4.lo -MD -MP -MF $(DEPDIR)/unpack_i4.Tpo -c -o unpack_i4.lo `test -f '$(srcdir)/generated/unpack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_i4.Tpo $(DEPDIR)/unpack_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_i4.c' object='unpack_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_i4.lo `test -f '$(srcdir)/generated/unpack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i4.c
+
+unpack_i8.lo: $(srcdir)/generated/unpack_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_i8.lo -MD -MP -MF $(DEPDIR)/unpack_i8.Tpo -c -o unpack_i8.lo `test -f '$(srcdir)/generated/unpack_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_i8.Tpo $(DEPDIR)/unpack_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_i8.c' object='unpack_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_i8.lo `test -f '$(srcdir)/generated/unpack_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i8.c
+
+unpack_i16.lo: $(srcdir)/generated/unpack_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_i16.lo -MD -MP -MF $(DEPDIR)/unpack_i16.Tpo -c -o unpack_i16.lo `test -f '$(srcdir)/generated/unpack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_i16.Tpo $(DEPDIR)/unpack_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_i16.c' object='unpack_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_i16.lo `test -f '$(srcdir)/generated/unpack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_i16.c
+
+unpack_r4.lo: $(srcdir)/generated/unpack_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_r4.lo -MD -MP -MF $(DEPDIR)/unpack_r4.Tpo -c -o unpack_r4.lo `test -f '$(srcdir)/generated/unpack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_r4.Tpo $(DEPDIR)/unpack_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_r4.c' object='unpack_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_r4.lo `test -f '$(srcdir)/generated/unpack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_r4.c
+
+unpack_r8.lo: $(srcdir)/generated/unpack_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_r8.lo -MD -MP -MF $(DEPDIR)/unpack_r8.Tpo -c -o unpack_r8.lo `test -f '$(srcdir)/generated/unpack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_r8.Tpo $(DEPDIR)/unpack_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_r8.c' object='unpack_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_r8.lo `test -f '$(srcdir)/generated/unpack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_r8.c
+
+unpack_r10.lo: $(srcdir)/generated/unpack_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_r10.lo -MD -MP -MF $(DEPDIR)/unpack_r10.Tpo -c -o unpack_r10.lo `test -f '$(srcdir)/generated/unpack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_r10.Tpo $(DEPDIR)/unpack_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_r10.c' object='unpack_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_r10.lo `test -f '$(srcdir)/generated/unpack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_r10.c
+
+unpack_r16.lo: $(srcdir)/generated/unpack_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_r16.lo -MD -MP -MF $(DEPDIR)/unpack_r16.Tpo -c -o unpack_r16.lo `test -f '$(srcdir)/generated/unpack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_r16.Tpo $(DEPDIR)/unpack_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_r16.c' object='unpack_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_r16.lo `test -f '$(srcdir)/generated/unpack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_r16.c
+
+unpack_c4.lo: $(srcdir)/generated/unpack_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_c4.lo -MD -MP -MF $(DEPDIR)/unpack_c4.Tpo -c -o unpack_c4.lo `test -f '$(srcdir)/generated/unpack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_c4.Tpo $(DEPDIR)/unpack_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_c4.c' object='unpack_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_c4.lo `test -f '$(srcdir)/generated/unpack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_c4.c
+
+unpack_c8.lo: $(srcdir)/generated/unpack_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_c8.lo -MD -MP -MF $(DEPDIR)/unpack_c8.Tpo -c -o unpack_c8.lo `test -f '$(srcdir)/generated/unpack_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_c8.Tpo $(DEPDIR)/unpack_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_c8.c' object='unpack_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_c8.lo `test -f '$(srcdir)/generated/unpack_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_c8.c
+
+unpack_c10.lo: $(srcdir)/generated/unpack_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_c10.lo -MD -MP -MF $(DEPDIR)/unpack_c10.Tpo -c -o unpack_c10.lo `test -f '$(srcdir)/generated/unpack_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_c10.Tpo $(DEPDIR)/unpack_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_c10.c' object='unpack_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_c10.lo `test -f '$(srcdir)/generated/unpack_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_c10.c
+
+unpack_c16.lo: $(srcdir)/generated/unpack_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_c16.lo -MD -MP -MF $(DEPDIR)/unpack_c16.Tpo -c -o unpack_c16.lo `test -f '$(srcdir)/generated/unpack_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_c16.Tpo $(DEPDIR)/unpack_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/unpack_c16.c' object='unpack_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_c16.lo `test -f '$(srcdir)/generated/unpack_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/unpack_c16.c
+
+spread_i1.lo: $(srcdir)/generated/spread_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_i1.lo -MD -MP -MF $(DEPDIR)/spread_i1.Tpo -c -o spread_i1.lo `test -f '$(srcdir)/generated/spread_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_i1.Tpo $(DEPDIR)/spread_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_i1.c' object='spread_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_i1.lo `test -f '$(srcdir)/generated/spread_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i1.c
+
+spread_i2.lo: $(srcdir)/generated/spread_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_i2.lo -MD -MP -MF $(DEPDIR)/spread_i2.Tpo -c -o spread_i2.lo `test -f '$(srcdir)/generated/spread_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_i2.Tpo $(DEPDIR)/spread_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_i2.c' object='spread_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_i2.lo `test -f '$(srcdir)/generated/spread_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i2.c
+
+spread_i4.lo: $(srcdir)/generated/spread_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_i4.lo -MD -MP -MF $(DEPDIR)/spread_i4.Tpo -c -o spread_i4.lo `test -f '$(srcdir)/generated/spread_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_i4.Tpo $(DEPDIR)/spread_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_i4.c' object='spread_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_i4.lo `test -f '$(srcdir)/generated/spread_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i4.c
+
+spread_i8.lo: $(srcdir)/generated/spread_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_i8.lo -MD -MP -MF $(DEPDIR)/spread_i8.Tpo -c -o spread_i8.lo `test -f '$(srcdir)/generated/spread_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_i8.Tpo $(DEPDIR)/spread_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_i8.c' object='spread_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_i8.lo `test -f '$(srcdir)/generated/spread_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i8.c
+
+spread_i16.lo: $(srcdir)/generated/spread_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_i16.lo -MD -MP -MF $(DEPDIR)/spread_i16.Tpo -c -o spread_i16.lo `test -f '$(srcdir)/generated/spread_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_i16.Tpo $(DEPDIR)/spread_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_i16.c' object='spread_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_i16.lo `test -f '$(srcdir)/generated/spread_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_i16.c
+
+spread_r4.lo: $(srcdir)/generated/spread_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_r4.lo -MD -MP -MF $(DEPDIR)/spread_r4.Tpo -c -o spread_r4.lo `test -f '$(srcdir)/generated/spread_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_r4.Tpo $(DEPDIR)/spread_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_r4.c' object='spread_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_r4.lo `test -f '$(srcdir)/generated/spread_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_r4.c
+
+spread_r8.lo: $(srcdir)/generated/spread_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_r8.lo -MD -MP -MF $(DEPDIR)/spread_r8.Tpo -c -o spread_r8.lo `test -f '$(srcdir)/generated/spread_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_r8.Tpo $(DEPDIR)/spread_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_r8.c' object='spread_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_r8.lo `test -f '$(srcdir)/generated/spread_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_r8.c
+
+spread_r10.lo: $(srcdir)/generated/spread_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_r10.lo -MD -MP -MF $(DEPDIR)/spread_r10.Tpo -c -o spread_r10.lo `test -f '$(srcdir)/generated/spread_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_r10.Tpo $(DEPDIR)/spread_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_r10.c' object='spread_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_r10.lo `test -f '$(srcdir)/generated/spread_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_r10.c
+
+spread_r16.lo: $(srcdir)/generated/spread_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_r16.lo -MD -MP -MF $(DEPDIR)/spread_r16.Tpo -c -o spread_r16.lo `test -f '$(srcdir)/generated/spread_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_r16.Tpo $(DEPDIR)/spread_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_r16.c' object='spread_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_r16.lo `test -f '$(srcdir)/generated/spread_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_r16.c
+
+spread_c4.lo: $(srcdir)/generated/spread_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_c4.lo -MD -MP -MF $(DEPDIR)/spread_c4.Tpo -c -o spread_c4.lo `test -f '$(srcdir)/generated/spread_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_c4.Tpo $(DEPDIR)/spread_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_c4.c' object='spread_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_c4.lo `test -f '$(srcdir)/generated/spread_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_c4.c
+
+spread_c8.lo: $(srcdir)/generated/spread_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_c8.lo -MD -MP -MF $(DEPDIR)/spread_c8.Tpo -c -o spread_c8.lo `test -f '$(srcdir)/generated/spread_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_c8.Tpo $(DEPDIR)/spread_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_c8.c' object='spread_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_c8.lo `test -f '$(srcdir)/generated/spread_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_c8.c
+
+spread_c10.lo: $(srcdir)/generated/spread_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_c10.lo -MD -MP -MF $(DEPDIR)/spread_c10.Tpo -c -o spread_c10.lo `test -f '$(srcdir)/generated/spread_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_c10.Tpo $(DEPDIR)/spread_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_c10.c' object='spread_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_c10.lo `test -f '$(srcdir)/generated/spread_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_c10.c
+
+spread_c16.lo: $(srcdir)/generated/spread_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_c16.lo -MD -MP -MF $(DEPDIR)/spread_c16.Tpo -c -o spread_c16.lo `test -f '$(srcdir)/generated/spread_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_c16.Tpo $(DEPDIR)/spread_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/spread_c16.c' object='spread_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_c16.lo `test -f '$(srcdir)/generated/spread_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_c16.c
+
+cshift0_i1.lo: $(srcdir)/generated/cshift0_i1.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i1.lo -MD -MP -MF $(DEPDIR)/cshift0_i1.Tpo -c -o cshift0_i1.lo `test -f '$(srcdir)/generated/cshift0_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i1.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_i1.Tpo $(DEPDIR)/cshift0_i1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_i1.c' object='cshift0_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i1.lo `test -f '$(srcdir)/generated/cshift0_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i1.c
+
+cshift0_i2.lo: $(srcdir)/generated/cshift0_i2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i2.lo -MD -MP -MF $(DEPDIR)/cshift0_i2.Tpo -c -o cshift0_i2.lo `test -f '$(srcdir)/generated/cshift0_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_i2.Tpo $(DEPDIR)/cshift0_i2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_i2.c' object='cshift0_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i2.lo `test -f '$(srcdir)/generated/cshift0_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i2.c
+
+cshift0_i4.lo: $(srcdir)/generated/cshift0_i4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i4.lo -MD -MP -MF $(DEPDIR)/cshift0_i4.Tpo -c -o cshift0_i4.lo `test -f '$(srcdir)/generated/cshift0_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_i4.Tpo $(DEPDIR)/cshift0_i4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_i4.c' object='cshift0_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i4.lo `test -f '$(srcdir)/generated/cshift0_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i4.c
+
+cshift0_i8.lo: $(srcdir)/generated/cshift0_i8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i8.lo -MD -MP -MF $(DEPDIR)/cshift0_i8.Tpo -c -o cshift0_i8.lo `test -f '$(srcdir)/generated/cshift0_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_i8.Tpo $(DEPDIR)/cshift0_i8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_i8.c' object='cshift0_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i8.lo `test -f '$(srcdir)/generated/cshift0_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i8.c
+
+cshift0_i16.lo: $(srcdir)/generated/cshift0_i16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i16.lo -MD -MP -MF $(DEPDIR)/cshift0_i16.Tpo -c -o cshift0_i16.lo `test -f '$(srcdir)/generated/cshift0_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_i16.Tpo $(DEPDIR)/cshift0_i16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_i16.c' object='cshift0_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i16.lo `test -f '$(srcdir)/generated/cshift0_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i16.c
+
+cshift0_r4.lo: $(srcdir)/generated/cshift0_r4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_r4.lo -MD -MP -MF $(DEPDIR)/cshift0_r4.Tpo -c -o cshift0_r4.lo `test -f '$(srcdir)/generated/cshift0_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_r4.Tpo $(DEPDIR)/cshift0_r4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_r4.c' object='cshift0_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_r4.lo `test -f '$(srcdir)/generated/cshift0_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r4.c
+
+cshift0_r8.lo: $(srcdir)/generated/cshift0_r8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_r8.lo -MD -MP -MF $(DEPDIR)/cshift0_r8.Tpo -c -o cshift0_r8.lo `test -f '$(srcdir)/generated/cshift0_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_r8.Tpo $(DEPDIR)/cshift0_r8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_r8.c' object='cshift0_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_r8.lo `test -f '$(srcdir)/generated/cshift0_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r8.c
+
+cshift0_r10.lo: $(srcdir)/generated/cshift0_r10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_r10.lo -MD -MP -MF $(DEPDIR)/cshift0_r10.Tpo -c -o cshift0_r10.lo `test -f '$(srcdir)/generated/cshift0_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_r10.Tpo $(DEPDIR)/cshift0_r10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_r10.c' object='cshift0_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_r10.lo `test -f '$(srcdir)/generated/cshift0_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r10.c
+
+cshift0_r16.lo: $(srcdir)/generated/cshift0_r16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_r16.lo -MD -MP -MF $(DEPDIR)/cshift0_r16.Tpo -c -o cshift0_r16.lo `test -f '$(srcdir)/generated/cshift0_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_r16.Tpo $(DEPDIR)/cshift0_r16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_r16.c' object='cshift0_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_r16.lo `test -f '$(srcdir)/generated/cshift0_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r16.c
+
+cshift0_c4.lo: $(srcdir)/generated/cshift0_c4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_c4.lo -MD -MP -MF $(DEPDIR)/cshift0_c4.Tpo -c -o cshift0_c4.lo `test -f '$(srcdir)/generated/cshift0_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c4.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_c4.Tpo $(DEPDIR)/cshift0_c4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_c4.c' object='cshift0_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_c4.lo `test -f '$(srcdir)/generated/cshift0_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c4.c
+
+cshift0_c8.lo: $(srcdir)/generated/cshift0_c8.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_c8.lo -MD -MP -MF $(DEPDIR)/cshift0_c8.Tpo -c -o cshift0_c8.lo `test -f '$(srcdir)/generated/cshift0_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c8.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_c8.Tpo $(DEPDIR)/cshift0_c8.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_c8.c' object='cshift0_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_c8.lo `test -f '$(srcdir)/generated/cshift0_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c8.c
+
+cshift0_c10.lo: $(srcdir)/generated/cshift0_c10.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_c10.lo -MD -MP -MF $(DEPDIR)/cshift0_c10.Tpo -c -o cshift0_c10.lo `test -f '$(srcdir)/generated/cshift0_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c10.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_c10.Tpo $(DEPDIR)/cshift0_c10.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_c10.c' object='cshift0_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_c10.lo `test -f '$(srcdir)/generated/cshift0_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c10.c
+
+cshift0_c16.lo: $(srcdir)/generated/cshift0_c16.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_c16.lo -MD -MP -MF $(DEPDIR)/cshift0_c16.Tpo -c -o cshift0_c16.lo `test -f '$(srcdir)/generated/cshift0_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c16.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0_c16.Tpo $(DEPDIR)/cshift0_c16.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(srcdir)/generated/cshift0_c16.c' object='cshift0_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_c16.lo `test -f '$(srcdir)/generated/cshift0_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c16.c
+
+close.lo: io/close.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT close.lo -MD -MP -MF $(DEPDIR)/close.Tpo -c -o close.lo `test -f 'io/close.c' || echo '$(srcdir)/'`io/close.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/close.Tpo $(DEPDIR)/close.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/close.c' object='close.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o close.lo `test -f 'io/close.c' || echo '$(srcdir)/'`io/close.c
+
+file_pos.lo: io/file_pos.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file_pos.lo -MD -MP -MF $(DEPDIR)/file_pos.Tpo -c -o file_pos.lo `test -f 'io/file_pos.c' || echo '$(srcdir)/'`io/file_pos.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/file_pos.Tpo $(DEPDIR)/file_pos.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/file_pos.c' object='file_pos.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file_pos.lo `test -f 'io/file_pos.c' || echo '$(srcdir)/'`io/file_pos.c
+
+format.lo: io/format.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT format.lo -MD -MP -MF $(DEPDIR)/format.Tpo -c -o format.lo `test -f 'io/format.c' || echo '$(srcdir)/'`io/format.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/format.Tpo $(DEPDIR)/format.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/format.c' object='format.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o format.lo `test -f 'io/format.c' || echo '$(srcdir)/'`io/format.c
+
+inquire.lo: io/inquire.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inquire.lo -MD -MP -MF $(DEPDIR)/inquire.Tpo -c -o inquire.lo `test -f 'io/inquire.c' || echo '$(srcdir)/'`io/inquire.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/inquire.Tpo $(DEPDIR)/inquire.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/inquire.c' object='inquire.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inquire.lo `test -f 'io/inquire.c' || echo '$(srcdir)/'`io/inquire.c
+
+intrinsics.lo: io/intrinsics.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT intrinsics.lo -MD -MP -MF $(DEPDIR)/intrinsics.Tpo -c -o intrinsics.lo `test -f 'io/intrinsics.c' || echo '$(srcdir)/'`io/intrinsics.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/intrinsics.Tpo $(DEPDIR)/intrinsics.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/intrinsics.c' object='intrinsics.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o intrinsics.lo `test -f 'io/intrinsics.c' || echo '$(srcdir)/'`io/intrinsics.c
+
+list_read.lo: io/list_read.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT list_read.lo -MD -MP -MF $(DEPDIR)/list_read.Tpo -c -o list_read.lo `test -f 'io/list_read.c' || echo '$(srcdir)/'`io/list_read.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/list_read.Tpo $(DEPDIR)/list_read.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/list_read.c' object='list_read.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o list_read.lo `test -f 'io/list_read.c' || echo '$(srcdir)/'`io/list_read.c
+
+lock.lo: io/lock.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lock.lo -MD -MP -MF $(DEPDIR)/lock.Tpo -c -o lock.lo `test -f 'io/lock.c' || echo '$(srcdir)/'`io/lock.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lock.Tpo $(DEPDIR)/lock.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/lock.c' object='lock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lock.lo `test -f 'io/lock.c' || echo '$(srcdir)/'`io/lock.c
+
+open.lo: io/open.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT open.lo -MD -MP -MF $(DEPDIR)/open.Tpo -c -o open.lo `test -f 'io/open.c' || echo '$(srcdir)/'`io/open.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/open.Tpo $(DEPDIR)/open.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/open.c' object='open.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o open.lo `test -f 'io/open.c' || echo '$(srcdir)/'`io/open.c
+
+read.lo: io/read.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT read.lo -MD -MP -MF $(DEPDIR)/read.Tpo -c -o read.lo `test -f 'io/read.c' || echo '$(srcdir)/'`io/read.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/read.Tpo $(DEPDIR)/read.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/read.c' object='read.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o read.lo `test -f 'io/read.c' || echo '$(srcdir)/'`io/read.c
+
+size_from_kind.lo: io/size_from_kind.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT size_from_kind.lo -MD -MP -MF $(DEPDIR)/size_from_kind.Tpo -c -o size_from_kind.lo `test -f 'io/size_from_kind.c' || echo '$(srcdir)/'`io/size_from_kind.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/size_from_kind.Tpo $(DEPDIR)/size_from_kind.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/size_from_kind.c' object='size_from_kind.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o size_from_kind.lo `test -f 'io/size_from_kind.c' || echo '$(srcdir)/'`io/size_from_kind.c
+
+transfer.lo: io/transfer.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transfer.lo -MD -MP -MF $(DEPDIR)/transfer.Tpo -c -o transfer.lo `test -f 'io/transfer.c' || echo '$(srcdir)/'`io/transfer.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transfer.Tpo $(DEPDIR)/transfer.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/transfer.c' object='transfer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transfer.lo `test -f 'io/transfer.c' || echo '$(srcdir)/'`io/transfer.c
+
+transfer128.lo: io/transfer128.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transfer128.lo -MD -MP -MF $(DEPDIR)/transfer128.Tpo -c -o transfer128.lo `test -f 'io/transfer128.c' || echo '$(srcdir)/'`io/transfer128.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transfer128.Tpo $(DEPDIR)/transfer128.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/transfer128.c' object='transfer128.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transfer128.lo `test -f 'io/transfer128.c' || echo '$(srcdir)/'`io/transfer128.c
+
+unit.lo: io/unit.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit.lo -MD -MP -MF $(DEPDIR)/unit.Tpo -c -o unit.lo `test -f 'io/unit.c' || echo '$(srcdir)/'`io/unit.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unit.Tpo $(DEPDIR)/unit.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/unit.c' object='unit.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit.lo `test -f 'io/unit.c' || echo '$(srcdir)/'`io/unit.c
+
+unix.lo: io/unix.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unix.lo -MD -MP -MF $(DEPDIR)/unix.Tpo -c -o unix.lo `test -f 'io/unix.c' || echo '$(srcdir)/'`io/unix.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unix.Tpo $(DEPDIR)/unix.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/unix.c' object='unix.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unix.lo `test -f 'io/unix.c' || echo '$(srcdir)/'`io/unix.c
+
+write.lo: io/write.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT write.lo -MD -MP -MF $(DEPDIR)/write.Tpo -c -o write.lo `test -f 'io/write.c' || echo '$(srcdir)/'`io/write.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/write.Tpo $(DEPDIR)/write.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/write.c' object='write.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o write.lo `test -f 'io/write.c' || echo '$(srcdir)/'`io/write.c
+
+fbuf.lo: io/fbuf.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbuf.lo -MD -MP -MF $(DEPDIR)/fbuf.Tpo -c -o fbuf.lo `test -f 'io/fbuf.c' || echo '$(srcdir)/'`io/fbuf.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/fbuf.Tpo $(DEPDIR)/fbuf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='io/fbuf.c' object='fbuf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbuf.lo `test -f 'io/fbuf.c' || echo '$(srcdir)/'`io/fbuf.c
+
+associated.lo: intrinsics/associated.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT associated.lo -MD -MP -MF $(DEPDIR)/associated.Tpo -c -o associated.lo `test -f 'intrinsics/associated.c' || echo '$(srcdir)/'`intrinsics/associated.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/associated.Tpo $(DEPDIR)/associated.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/associated.c' object='associated.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o associated.lo `test -f 'intrinsics/associated.c' || echo '$(srcdir)/'`intrinsics/associated.c
+
+abort.lo: intrinsics/abort.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT abort.lo -MD -MP -MF $(DEPDIR)/abort.Tpo -c -o abort.lo `test -f 'intrinsics/abort.c' || echo '$(srcdir)/'`intrinsics/abort.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/abort.Tpo $(DEPDIR)/abort.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/abort.c' object='abort.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o abort.lo `test -f 'intrinsics/abort.c' || echo '$(srcdir)/'`intrinsics/abort.c
+
+access.lo: intrinsics/access.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT access.lo -MD -MP -MF $(DEPDIR)/access.Tpo -c -o access.lo `test -f 'intrinsics/access.c' || echo '$(srcdir)/'`intrinsics/access.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/access.Tpo $(DEPDIR)/access.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/access.c' object='access.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o access.lo `test -f 'intrinsics/access.c' || echo '$(srcdir)/'`intrinsics/access.c
+
+args.lo: intrinsics/args.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT args.lo -MD -MP -MF $(DEPDIR)/args.Tpo -c -o args.lo `test -f 'intrinsics/args.c' || echo '$(srcdir)/'`intrinsics/args.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/args.Tpo $(DEPDIR)/args.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/args.c' object='args.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o args.lo `test -f 'intrinsics/args.c' || echo '$(srcdir)/'`intrinsics/args.c
+
+bit_intrinsics.lo: intrinsics/bit_intrinsics.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bit_intrinsics.lo -MD -MP -MF $(DEPDIR)/bit_intrinsics.Tpo -c -o bit_intrinsics.lo `test -f 'intrinsics/bit_intrinsics.c' || echo '$(srcdir)/'`intrinsics/bit_intrinsics.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/bit_intrinsics.Tpo $(DEPDIR)/bit_intrinsics.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/bit_intrinsics.c' object='bit_intrinsics.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bit_intrinsics.lo `test -f 'intrinsics/bit_intrinsics.c' || echo '$(srcdir)/'`intrinsics/bit_intrinsics.c
+
+c99_functions.lo: intrinsics/c99_functions.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT c99_functions.lo -MD -MP -MF $(DEPDIR)/c99_functions.Tpo -c -o c99_functions.lo `test -f 'intrinsics/c99_functions.c' || echo '$(srcdir)/'`intrinsics/c99_functions.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/c99_functions.Tpo $(DEPDIR)/c99_functions.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/c99_functions.c' object='c99_functions.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o c99_functions.lo `test -f 'intrinsics/c99_functions.c' || echo '$(srcdir)/'`intrinsics/c99_functions.c
+
+chdir.lo: intrinsics/chdir.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chdir.lo -MD -MP -MF $(DEPDIR)/chdir.Tpo -c -o chdir.lo `test -f 'intrinsics/chdir.c' || echo '$(srcdir)/'`intrinsics/chdir.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/chdir.Tpo $(DEPDIR)/chdir.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/chdir.c' object='chdir.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chdir.lo `test -f 'intrinsics/chdir.c' || echo '$(srcdir)/'`intrinsics/chdir.c
+
+chmod.lo: intrinsics/chmod.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmod.lo -MD -MP -MF $(DEPDIR)/chmod.Tpo -c -o chmod.lo `test -f 'intrinsics/chmod.c' || echo '$(srcdir)/'`intrinsics/chmod.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/chmod.Tpo $(DEPDIR)/chmod.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/chmod.c' object='chmod.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmod.lo `test -f 'intrinsics/chmod.c' || echo '$(srcdir)/'`intrinsics/chmod.c
+
+clock.lo: intrinsics/clock.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT clock.lo -MD -MP -MF $(DEPDIR)/clock.Tpo -c -o clock.lo `test -f 'intrinsics/clock.c' || echo '$(srcdir)/'`intrinsics/clock.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/clock.Tpo $(DEPDIR)/clock.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/clock.c' object='clock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o clock.lo `test -f 'intrinsics/clock.c' || echo '$(srcdir)/'`intrinsics/clock.c
+
+cpu_time.lo: intrinsics/cpu_time.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpu_time.lo -MD -MP -MF $(DEPDIR)/cpu_time.Tpo -c -o cpu_time.lo `test -f 'intrinsics/cpu_time.c' || echo '$(srcdir)/'`intrinsics/cpu_time.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cpu_time.Tpo $(DEPDIR)/cpu_time.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/cpu_time.c' object='cpu_time.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpu_time.lo `test -f 'intrinsics/cpu_time.c' || echo '$(srcdir)/'`intrinsics/cpu_time.c
+
+cshift0.lo: intrinsics/cshift0.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0.lo -MD -MP -MF $(DEPDIR)/cshift0.Tpo -c -o cshift0.lo `test -f 'intrinsics/cshift0.c' || echo '$(srcdir)/'`intrinsics/cshift0.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cshift0.Tpo $(DEPDIR)/cshift0.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/cshift0.c' object='cshift0.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0.lo `test -f 'intrinsics/cshift0.c' || echo '$(srcdir)/'`intrinsics/cshift0.c
+
+ctime.lo: intrinsics/ctime.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ctime.lo -MD -MP -MF $(DEPDIR)/ctime.Tpo -c -o ctime.lo `test -f 'intrinsics/ctime.c' || echo '$(srcdir)/'`intrinsics/ctime.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/ctime.Tpo $(DEPDIR)/ctime.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/ctime.c' object='ctime.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ctime.lo `test -f 'intrinsics/ctime.c' || echo '$(srcdir)/'`intrinsics/ctime.c
+
+date_and_time.lo: intrinsics/date_and_time.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT date_and_time.lo -MD -MP -MF $(DEPDIR)/date_and_time.Tpo -c -o date_and_time.lo `test -f 'intrinsics/date_and_time.c' || echo '$(srcdir)/'`intrinsics/date_and_time.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/date_and_time.Tpo $(DEPDIR)/date_and_time.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/date_and_time.c' object='date_and_time.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o date_and_time.lo `test -f 'intrinsics/date_and_time.c' || echo '$(srcdir)/'`intrinsics/date_and_time.c
+
+dtime.lo: intrinsics/dtime.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dtime.lo -MD -MP -MF $(DEPDIR)/dtime.Tpo -c -o dtime.lo `test -f 'intrinsics/dtime.c' || echo '$(srcdir)/'`intrinsics/dtime.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/dtime.Tpo $(DEPDIR)/dtime.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/dtime.c' object='dtime.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dtime.lo `test -f 'intrinsics/dtime.c' || echo '$(srcdir)/'`intrinsics/dtime.c
+
+env.lo: intrinsics/env.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT env.lo -MD -MP -MF $(DEPDIR)/env.Tpo -c -o env.lo `test -f 'intrinsics/env.c' || echo '$(srcdir)/'`intrinsics/env.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/env.Tpo $(DEPDIR)/env.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/env.c' object='env.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o env.lo `test -f 'intrinsics/env.c' || echo '$(srcdir)/'`intrinsics/env.c
+
+eoshift0.lo: intrinsics/eoshift0.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eoshift0.lo -MD -MP -MF $(DEPDIR)/eoshift0.Tpo -c -o eoshift0.lo `test -f 'intrinsics/eoshift0.c' || echo '$(srcdir)/'`intrinsics/eoshift0.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/eoshift0.Tpo $(DEPDIR)/eoshift0.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/eoshift0.c' object='eoshift0.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eoshift0.lo `test -f 'intrinsics/eoshift0.c' || echo '$(srcdir)/'`intrinsics/eoshift0.c
+
+eoshift2.lo: intrinsics/eoshift2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eoshift2.lo -MD -MP -MF $(DEPDIR)/eoshift2.Tpo -c -o eoshift2.lo `test -f 'intrinsics/eoshift2.c' || echo '$(srcdir)/'`intrinsics/eoshift2.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/eoshift2.Tpo $(DEPDIR)/eoshift2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/eoshift2.c' object='eoshift2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eoshift2.lo `test -f 'intrinsics/eoshift2.c' || echo '$(srcdir)/'`intrinsics/eoshift2.c
+
+erfc_scaled.lo: intrinsics/erfc_scaled.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT erfc_scaled.lo -MD -MP -MF $(DEPDIR)/erfc_scaled.Tpo -c -o erfc_scaled.lo `test -f 'intrinsics/erfc_scaled.c' || echo '$(srcdir)/'`intrinsics/erfc_scaled.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/erfc_scaled.Tpo $(DEPDIR)/erfc_scaled.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/erfc_scaled.c' object='erfc_scaled.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o erfc_scaled.lo `test -f 'intrinsics/erfc_scaled.c' || echo '$(srcdir)/'`intrinsics/erfc_scaled.c
+
+etime.lo: intrinsics/etime.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT etime.lo -MD -MP -MF $(DEPDIR)/etime.Tpo -c -o etime.lo `test -f 'intrinsics/etime.c' || echo '$(srcdir)/'`intrinsics/etime.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/etime.Tpo $(DEPDIR)/etime.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/etime.c' object='etime.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o etime.lo `test -f 'intrinsics/etime.c' || echo '$(srcdir)/'`intrinsics/etime.c
+
+execute_command_line.lo: intrinsics/execute_command_line.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT execute_command_line.lo -MD -MP -MF $(DEPDIR)/execute_command_line.Tpo -c -o execute_command_line.lo `test -f 'intrinsics/execute_command_line.c' || echo '$(srcdir)/'`intrinsics/execute_command_line.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/execute_command_line.Tpo $(DEPDIR)/execute_command_line.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/execute_command_line.c' object='execute_command_line.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o execute_command_line.lo `test -f 'intrinsics/execute_command_line.c' || echo '$(srcdir)/'`intrinsics/execute_command_line.c
+
+exit.lo: intrinsics/exit.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT exit.lo -MD -MP -MF $(DEPDIR)/exit.Tpo -c -o exit.lo `test -f 'intrinsics/exit.c' || echo '$(srcdir)/'`intrinsics/exit.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/exit.Tpo $(DEPDIR)/exit.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/exit.c' object='exit.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o exit.lo `test -f 'intrinsics/exit.c' || echo '$(srcdir)/'`intrinsics/exit.c
+
+extends_type_of.lo: intrinsics/extends_type_of.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extends_type_of.lo -MD -MP -MF $(DEPDIR)/extends_type_of.Tpo -c -o extends_type_of.lo `test -f 'intrinsics/extends_type_of.c' || echo '$(srcdir)/'`intrinsics/extends_type_of.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/extends_type_of.Tpo $(DEPDIR)/extends_type_of.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/extends_type_of.c' object='extends_type_of.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extends_type_of.lo `test -f 'intrinsics/extends_type_of.c' || echo '$(srcdir)/'`intrinsics/extends_type_of.c
+
+fnum.lo: intrinsics/fnum.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fnum.lo -MD -MP -MF $(DEPDIR)/fnum.Tpo -c -o fnum.lo `test -f 'intrinsics/fnum.c' || echo '$(srcdir)/'`intrinsics/fnum.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/fnum.Tpo $(DEPDIR)/fnum.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/fnum.c' object='fnum.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fnum.lo `test -f 'intrinsics/fnum.c' || echo '$(srcdir)/'`intrinsics/fnum.c
+
+gerror.lo: intrinsics/gerror.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gerror.lo -MD -MP -MF $(DEPDIR)/gerror.Tpo -c -o gerror.lo `test -f 'intrinsics/gerror.c' || echo '$(srcdir)/'`intrinsics/gerror.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/gerror.Tpo $(DEPDIR)/gerror.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/gerror.c' object='gerror.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gerror.lo `test -f 'intrinsics/gerror.c' || echo '$(srcdir)/'`intrinsics/gerror.c
+
+getcwd.lo: intrinsics/getcwd.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getcwd.lo -MD -MP -MF $(DEPDIR)/getcwd.Tpo -c -o getcwd.lo `test -f 'intrinsics/getcwd.c' || echo '$(srcdir)/'`intrinsics/getcwd.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/getcwd.Tpo $(DEPDIR)/getcwd.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/getcwd.c' object='getcwd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getcwd.lo `test -f 'intrinsics/getcwd.c' || echo '$(srcdir)/'`intrinsics/getcwd.c
+
+getlog.lo: intrinsics/getlog.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getlog.lo -MD -MP -MF $(DEPDIR)/getlog.Tpo -c -o getlog.lo `test -f 'intrinsics/getlog.c' || echo '$(srcdir)/'`intrinsics/getlog.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/getlog.Tpo $(DEPDIR)/getlog.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/getlog.c' object='getlog.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getlog.lo `test -f 'intrinsics/getlog.c' || echo '$(srcdir)/'`intrinsics/getlog.c
+
+getXid.lo: intrinsics/getXid.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getXid.lo -MD -MP -MF $(DEPDIR)/getXid.Tpo -c -o getXid.lo `test -f 'intrinsics/getXid.c' || echo '$(srcdir)/'`intrinsics/getXid.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/getXid.Tpo $(DEPDIR)/getXid.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/getXid.c' object='getXid.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getXid.lo `test -f 'intrinsics/getXid.c' || echo '$(srcdir)/'`intrinsics/getXid.c
+
+hostnm.lo: intrinsics/hostnm.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hostnm.lo -MD -MP -MF $(DEPDIR)/hostnm.Tpo -c -o hostnm.lo `test -f 'intrinsics/hostnm.c' || echo '$(srcdir)/'`intrinsics/hostnm.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/hostnm.Tpo $(DEPDIR)/hostnm.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/hostnm.c' object='hostnm.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hostnm.lo `test -f 'intrinsics/hostnm.c' || echo '$(srcdir)/'`intrinsics/hostnm.c
+
+ierrno.lo: intrinsics/ierrno.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ierrno.lo -MD -MP -MF $(DEPDIR)/ierrno.Tpo -c -o ierrno.lo `test -f 'intrinsics/ierrno.c' || echo '$(srcdir)/'`intrinsics/ierrno.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/ierrno.Tpo $(DEPDIR)/ierrno.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/ierrno.c' object='ierrno.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ierrno.lo `test -f 'intrinsics/ierrno.c' || echo '$(srcdir)/'`intrinsics/ierrno.c
+
+ishftc.lo: intrinsics/ishftc.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ishftc.lo -MD -MP -MF $(DEPDIR)/ishftc.Tpo -c -o ishftc.lo `test -f 'intrinsics/ishftc.c' || echo '$(srcdir)/'`intrinsics/ishftc.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/ishftc.Tpo $(DEPDIR)/ishftc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/ishftc.c' object='ishftc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ishftc.lo `test -f 'intrinsics/ishftc.c' || echo '$(srcdir)/'`intrinsics/ishftc.c
+
+iso_c_generated_procs.lo: intrinsics/iso_c_generated_procs.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_c_generated_procs.lo -MD -MP -MF $(DEPDIR)/iso_c_generated_procs.Tpo -c -o iso_c_generated_procs.lo `test -f 'intrinsics/iso_c_generated_procs.c' || echo '$(srcdir)/'`intrinsics/iso_c_generated_procs.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iso_c_generated_procs.Tpo $(DEPDIR)/iso_c_generated_procs.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/iso_c_generated_procs.c' object='iso_c_generated_procs.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_c_generated_procs.lo `test -f 'intrinsics/iso_c_generated_procs.c' || echo '$(srcdir)/'`intrinsics/iso_c_generated_procs.c
+
+iso_c_binding.lo: intrinsics/iso_c_binding.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_c_binding.lo -MD -MP -MF $(DEPDIR)/iso_c_binding.Tpo -c -o iso_c_binding.lo `test -f 'intrinsics/iso_c_binding.c' || echo '$(srcdir)/'`intrinsics/iso_c_binding.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/iso_c_binding.Tpo $(DEPDIR)/iso_c_binding.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/iso_c_binding.c' object='iso_c_binding.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_c_binding.lo `test -f 'intrinsics/iso_c_binding.c' || echo '$(srcdir)/'`intrinsics/iso_c_binding.c
+
+kill.lo: intrinsics/kill.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kill.lo -MD -MP -MF $(DEPDIR)/kill.Tpo -c -o kill.lo `test -f 'intrinsics/kill.c' || echo '$(srcdir)/'`intrinsics/kill.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/kill.Tpo $(DEPDIR)/kill.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/kill.c' object='kill.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kill.lo `test -f 'intrinsics/kill.c' || echo '$(srcdir)/'`intrinsics/kill.c
+
+link.lo: intrinsics/link.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT link.lo -MD -MP -MF $(DEPDIR)/link.Tpo -c -o link.lo `test -f 'intrinsics/link.c' || echo '$(srcdir)/'`intrinsics/link.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/link.Tpo $(DEPDIR)/link.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/link.c' object='link.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o link.lo `test -f 'intrinsics/link.c' || echo '$(srcdir)/'`intrinsics/link.c
+
+malloc.lo: intrinsics/malloc.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT malloc.lo -MD -MP -MF $(DEPDIR)/malloc.Tpo -c -o malloc.lo `test -f 'intrinsics/malloc.c' || echo '$(srcdir)/'`intrinsics/malloc.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/malloc.Tpo $(DEPDIR)/malloc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/malloc.c' object='malloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o malloc.lo `test -f 'intrinsics/malloc.c' || echo '$(srcdir)/'`intrinsics/malloc.c
+
+mvbits.lo: intrinsics/mvbits.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mvbits.lo -MD -MP -MF $(DEPDIR)/mvbits.Tpo -c -o mvbits.lo `test -f 'intrinsics/mvbits.c' || echo '$(srcdir)/'`intrinsics/mvbits.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/mvbits.Tpo $(DEPDIR)/mvbits.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/mvbits.c' object='mvbits.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mvbits.lo `test -f 'intrinsics/mvbits.c' || echo '$(srcdir)/'`intrinsics/mvbits.c
+
+move_alloc.lo: intrinsics/move_alloc.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT move_alloc.lo -MD -MP -MF $(DEPDIR)/move_alloc.Tpo -c -o move_alloc.lo `test -f 'intrinsics/move_alloc.c' || echo '$(srcdir)/'`intrinsics/move_alloc.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/move_alloc.Tpo $(DEPDIR)/move_alloc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/move_alloc.c' object='move_alloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o move_alloc.lo `test -f 'intrinsics/move_alloc.c' || echo '$(srcdir)/'`intrinsics/move_alloc.c
+
+pack_generic.lo: intrinsics/pack_generic.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_generic.lo -MD -MP -MF $(DEPDIR)/pack_generic.Tpo -c -o pack_generic.lo `test -f 'intrinsics/pack_generic.c' || echo '$(srcdir)/'`intrinsics/pack_generic.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pack_generic.Tpo $(DEPDIR)/pack_generic.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/pack_generic.c' object='pack_generic.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_generic.lo `test -f 'intrinsics/pack_generic.c' || echo '$(srcdir)/'`intrinsics/pack_generic.c
+
+perror.lo: intrinsics/perror.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT perror.lo -MD -MP -MF $(DEPDIR)/perror.Tpo -c -o perror.lo `test -f 'intrinsics/perror.c' || echo '$(srcdir)/'`intrinsics/perror.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/perror.Tpo $(DEPDIR)/perror.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/perror.c' object='perror.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o perror.lo `test -f 'intrinsics/perror.c' || echo '$(srcdir)/'`intrinsics/perror.c
+
+selected_char_kind.lo: intrinsics/selected_char_kind.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT selected_char_kind.lo -MD -MP -MF $(DEPDIR)/selected_char_kind.Tpo -c -o selected_char_kind.lo `test -f 'intrinsics/selected_char_kind.c' || echo '$(srcdir)/'`intrinsics/selected_char_kind.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/selected_char_kind.Tpo $(DEPDIR)/selected_char_kind.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/selected_char_kind.c' object='selected_char_kind.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o selected_char_kind.lo `test -f 'intrinsics/selected_char_kind.c' || echo '$(srcdir)/'`intrinsics/selected_char_kind.c
+
+signal.lo: intrinsics/signal.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signal.lo -MD -MP -MF $(DEPDIR)/signal.Tpo -c -o signal.lo `test -f 'intrinsics/signal.c' || echo '$(srcdir)/'`intrinsics/signal.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/signal.Tpo $(DEPDIR)/signal.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/signal.c' object='signal.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signal.lo `test -f 'intrinsics/signal.c' || echo '$(srcdir)/'`intrinsics/signal.c
+
+size.lo: intrinsics/size.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT size.lo -MD -MP -MF $(DEPDIR)/size.Tpo -c -o size.lo `test -f 'intrinsics/size.c' || echo '$(srcdir)/'`intrinsics/size.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/size.Tpo $(DEPDIR)/size.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/size.c' object='size.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o size.lo `test -f 'intrinsics/size.c' || echo '$(srcdir)/'`intrinsics/size.c
+
+sleep.lo: intrinsics/sleep.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sleep.lo -MD -MP -MF $(DEPDIR)/sleep.Tpo -c -o sleep.lo `test -f 'intrinsics/sleep.c' || echo '$(srcdir)/'`intrinsics/sleep.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/sleep.Tpo $(DEPDIR)/sleep.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/sleep.c' object='sleep.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sleep.lo `test -f 'intrinsics/sleep.c' || echo '$(srcdir)/'`intrinsics/sleep.c
+
+spread_generic.lo: intrinsics/spread_generic.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spread_generic.lo -MD -MP -MF $(DEPDIR)/spread_generic.Tpo -c -o spread_generic.lo `test -f 'intrinsics/spread_generic.c' || echo '$(srcdir)/'`intrinsics/spread_generic.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/spread_generic.Tpo $(DEPDIR)/spread_generic.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/spread_generic.c' object='spread_generic.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_generic.lo `test -f 'intrinsics/spread_generic.c' || echo '$(srcdir)/'`intrinsics/spread_generic.c
+
+string_intrinsics.lo: intrinsics/string_intrinsics.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT string_intrinsics.lo -MD -MP -MF $(DEPDIR)/string_intrinsics.Tpo -c -o string_intrinsics.lo `test -f 'intrinsics/string_intrinsics.c' || echo '$(srcdir)/'`intrinsics/string_intrinsics.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/string_intrinsics.Tpo $(DEPDIR)/string_intrinsics.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/string_intrinsics.c' object='string_intrinsics.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o string_intrinsics.lo `test -f 'intrinsics/string_intrinsics.c' || echo '$(srcdir)/'`intrinsics/string_intrinsics.c
+
+system.lo: intrinsics/system.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT system.lo -MD -MP -MF $(DEPDIR)/system.Tpo -c -o system.lo `test -f 'intrinsics/system.c' || echo '$(srcdir)/'`intrinsics/system.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/system.Tpo $(DEPDIR)/system.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/system.c' object='system.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o system.lo `test -f 'intrinsics/system.c' || echo '$(srcdir)/'`intrinsics/system.c
+
+rand.lo: intrinsics/rand.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rand.lo -MD -MP -MF $(DEPDIR)/rand.Tpo -c -o rand.lo `test -f 'intrinsics/rand.c' || echo '$(srcdir)/'`intrinsics/rand.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/rand.Tpo $(DEPDIR)/rand.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/rand.c' object='rand.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rand.lo `test -f 'intrinsics/rand.c' || echo '$(srcdir)/'`intrinsics/rand.c
+
+random.lo: intrinsics/random.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT random.lo -MD -MP -MF $(DEPDIR)/random.Tpo -c -o random.lo `test -f 'intrinsics/random.c' || echo '$(srcdir)/'`intrinsics/random.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/random.Tpo $(DEPDIR)/random.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/random.c' object='random.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o random.lo `test -f 'intrinsics/random.c' || echo '$(srcdir)/'`intrinsics/random.c
+
+rename.lo: intrinsics/rename.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rename.lo -MD -MP -MF $(DEPDIR)/rename.Tpo -c -o rename.lo `test -f 'intrinsics/rename.c' || echo '$(srcdir)/'`intrinsics/rename.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/rename.Tpo $(DEPDIR)/rename.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/rename.c' object='rename.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rename.lo `test -f 'intrinsics/rename.c' || echo '$(srcdir)/'`intrinsics/rename.c
+
+reshape_generic.lo: intrinsics/reshape_generic.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_generic.lo -MD -MP -MF $(DEPDIR)/reshape_generic.Tpo -c -o reshape_generic.lo `test -f 'intrinsics/reshape_generic.c' || echo '$(srcdir)/'`intrinsics/reshape_generic.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_generic.Tpo $(DEPDIR)/reshape_generic.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/reshape_generic.c' object='reshape_generic.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_generic.lo `test -f 'intrinsics/reshape_generic.c' || echo '$(srcdir)/'`intrinsics/reshape_generic.c
+
+reshape_packed.lo: intrinsics/reshape_packed.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reshape_packed.lo -MD -MP -MF $(DEPDIR)/reshape_packed.Tpo -c -o reshape_packed.lo `test -f 'intrinsics/reshape_packed.c' || echo '$(srcdir)/'`intrinsics/reshape_packed.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/reshape_packed.Tpo $(DEPDIR)/reshape_packed.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/reshape_packed.c' object='reshape_packed.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_packed.lo `test -f 'intrinsics/reshape_packed.c' || echo '$(srcdir)/'`intrinsics/reshape_packed.c
+
+stat.lo: intrinsics/stat.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stat.lo -MD -MP -MF $(DEPDIR)/stat.Tpo -c -o stat.lo `test -f 'intrinsics/stat.c' || echo '$(srcdir)/'`intrinsics/stat.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/stat.Tpo $(DEPDIR)/stat.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/stat.c' object='stat.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stat.lo `test -f 'intrinsics/stat.c' || echo '$(srcdir)/'`intrinsics/stat.c
+
+symlnk.lo: intrinsics/symlnk.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT symlnk.lo -MD -MP -MF $(DEPDIR)/symlnk.Tpo -c -o symlnk.lo `test -f 'intrinsics/symlnk.c' || echo '$(srcdir)/'`intrinsics/symlnk.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/symlnk.Tpo $(DEPDIR)/symlnk.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/symlnk.c' object='symlnk.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o symlnk.lo `test -f 'intrinsics/symlnk.c' || echo '$(srcdir)/'`intrinsics/symlnk.c
+
+system_clock.lo: intrinsics/system_clock.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT system_clock.lo -MD -MP -MF $(DEPDIR)/system_clock.Tpo -c -o system_clock.lo `test -f 'intrinsics/system_clock.c' || echo '$(srcdir)/'`intrinsics/system_clock.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/system_clock.Tpo $(DEPDIR)/system_clock.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/system_clock.c' object='system_clock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o system_clock.lo `test -f 'intrinsics/system_clock.c' || echo '$(srcdir)/'`intrinsics/system_clock.c
+
+time.lo: intrinsics/time.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT time.lo -MD -MP -MF $(DEPDIR)/time.Tpo -c -o time.lo `test -f 'intrinsics/time.c' || echo '$(srcdir)/'`intrinsics/time.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/time.Tpo $(DEPDIR)/time.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/time.c' object='time.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o time.lo `test -f 'intrinsics/time.c' || echo '$(srcdir)/'`intrinsics/time.c
+
+transpose_generic.lo: intrinsics/transpose_generic.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT transpose_generic.lo -MD -MP -MF $(DEPDIR)/transpose_generic.Tpo -c -o transpose_generic.lo `test -f 'intrinsics/transpose_generic.c' || echo '$(srcdir)/'`intrinsics/transpose_generic.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/transpose_generic.Tpo $(DEPDIR)/transpose_generic.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/transpose_generic.c' object='transpose_generic.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o transpose_generic.lo `test -f 'intrinsics/transpose_generic.c' || echo '$(srcdir)/'`intrinsics/transpose_generic.c
+
+umask.lo: intrinsics/umask.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT umask.lo -MD -MP -MF $(DEPDIR)/umask.Tpo -c -o umask.lo `test -f 'intrinsics/umask.c' || echo '$(srcdir)/'`intrinsics/umask.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/umask.Tpo $(DEPDIR)/umask.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/umask.c' object='umask.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o umask.lo `test -f 'intrinsics/umask.c' || echo '$(srcdir)/'`intrinsics/umask.c
+
+unlink.lo: intrinsics/unlink.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unlink.lo -MD -MP -MF $(DEPDIR)/unlink.Tpo -c -o unlink.lo `test -f 'intrinsics/unlink.c' || echo '$(srcdir)/'`intrinsics/unlink.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unlink.Tpo $(DEPDIR)/unlink.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/unlink.c' object='unlink.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unlink.lo `test -f 'intrinsics/unlink.c' || echo '$(srcdir)/'`intrinsics/unlink.c
+
+unpack_generic.lo: intrinsics/unpack_generic.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unpack_generic.lo -MD -MP -MF $(DEPDIR)/unpack_generic.Tpo -c -o unpack_generic.lo `test -f 'intrinsics/unpack_generic.c' || echo '$(srcdir)/'`intrinsics/unpack_generic.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/unpack_generic.Tpo $(DEPDIR)/unpack_generic.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='intrinsics/unpack_generic.c' object='unpack_generic.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unpack_generic.lo `test -f 'intrinsics/unpack_generic.c' || echo '$(srcdir)/'`intrinsics/unpack_generic.c
+
+in_pack_generic.lo: runtime/in_pack_generic.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_generic.lo -MD -MP -MF $(DEPDIR)/in_pack_generic.Tpo -c -o in_pack_generic.lo `test -f 'runtime/in_pack_generic.c' || echo '$(srcdir)/'`runtime/in_pack_generic.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_pack_generic.Tpo $(DEPDIR)/in_pack_generic.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/in_pack_generic.c' object='in_pack_generic.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_generic.lo `test -f 'runtime/in_pack_generic.c' || echo '$(srcdir)/'`runtime/in_pack_generic.c
+
+in_unpack_generic.lo: runtime/in_unpack_generic.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_generic.lo -MD -MP -MF $(DEPDIR)/in_unpack_generic.Tpo -c -o in_unpack_generic.lo `test -f 'runtime/in_unpack_generic.c' || echo '$(srcdir)/'`runtime/in_unpack_generic.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/in_unpack_generic.Tpo $(DEPDIR)/in_unpack_generic.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/in_unpack_generic.c' object='in_unpack_generic.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_generic.lo `test -f 'runtime/in_unpack_generic.c' || echo '$(srcdir)/'`runtime/in_unpack_generic.c
+
+.f90.o:
+       $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+       $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+       $(LTFCCOMPILE) -c -o $@ $<
+
+selected_int_kind.lo: intrinsics/selected_int_kind.f90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o selected_int_kind.lo `test -f 'intrinsics/selected_int_kind.f90' || echo '$(srcdir)/'`intrinsics/selected_int_kind.f90
+
+selected_real_kind.lo: intrinsics/selected_real_kind.f90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o selected_real_kind.lo `test -f 'intrinsics/selected_real_kind.f90' || echo '$(srcdir)/'`intrinsics/selected_real_kind.f90
+
+dprod_r8.lo: intrinsics/dprod_r8.f90
+       $(LIBTOOL)  --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o dprod_r8.lo `test -f 'intrinsics/dprod_r8.f90' || echo '$(srcdir)/'`intrinsics/dprod_r8.f90
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool config.lt
+
+# GNU Make needs to see an explicit $(MAKE) variable in the command it
+# runs to enable its job server during parallel builds.  Hence the
+# comments below.
+all-multi:
+       $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
+install-multi:
+       $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
+
+mostlyclean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
+clean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
+distclean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
+maintainer-clean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
+install-toolexeclibDATA: $(toolexeclib_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)"
+       @list='$(toolexeclib_DATA)'; test -n "$(toolexeclibdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibdir)" || exit $$?; \
+       done
+
+uninstall-toolexeclibDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(toolexeclib_DATA)'; test -n "$(toolexeclibdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(toolexeclibdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(toolexeclibdir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+check-am: all-am
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES) all-multi $(DATA) config.h
+installdirs:
+       for dir in "$(DESTDIR)$(cafexeclibdir)" "$(DESTDIR)$(myexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am clean-multi
+
+clean-am: clean-cafexeclibLTLIBRARIES clean-generic clean-libtool \
+       clean-myexeclibLTLIBRARIES clean-toolexeclibLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am distclean-multi
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-cafexeclibLTLIBRARIES install-multi \
+       install-myexeclibLTLIBRARIES install-toolexeclibDATA \
+       install-toolexeclibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am maintainer-clean-multi
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am mostlyclean-multi
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-cafexeclibLTLIBRARIES \
+       uninstall-myexeclibLTLIBRARIES uninstall-toolexeclibDATA \
+       uninstall-toolexeclibLTLIBRARIES
+
+.MAKE: all all-multi check clean-multi distclean-multi install \
+       install-am install-multi install-strip maintainer-clean-multi \
+       mostlyclean-multi
+
+.PHONY: CTAGS GTAGS all all-am all-multi am--refresh check check-am \
+       clean clean-cafexeclibLTLIBRARIES clean-generic clean-libtool \
+       clean-multi clean-myexeclibLTLIBRARIES \
+       clean-toolexeclibLTLIBRARIES ctags distclean distclean-compile \
+       distclean-generic distclean-hdr distclean-libtool \
+       distclean-multi distclean-tags dvi dvi-am html html-am info \
+       info-am install install-am install-cafexeclibLTLIBRARIES \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-multi \
+       install-myexeclibLTLIBRARIES install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip install-toolexeclibDATA \
+       install-toolexeclibLTLIBRARIES installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       maintainer-clean-multi mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool mostlyclean-multi pdf \
+       pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-cafexeclibLTLIBRARIES uninstall-myexeclibLTLIBRARIES \
+       uninstall-toolexeclibDATA uninstall-toolexeclibLTLIBRARIES
+
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@gfortran.map-sun : $(srcdir)/gfortran.map \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@         $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@         $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ perl $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@   $(srcdir)/gfortran.map \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@   $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@  `echo $(libgfortran_la_LIBADD) | \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@     sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@  > $@ || (rm -f $@ ; exit 1)
+
+# Turn on vectorization and loop unrolling for matmul.
+$(patsubst %.c,%.lo,$(notdir $(i_matmul_c))): AM_CFLAGS += -ftree-vectorize -funroll-loops
+# Logical matmul doesn't vectorize.
+$(patsubst %.c,%.lo,$(notdir $(i_matmull_c))): AM_CFLAGS += -funroll-loops
+
+# Add the -fallow-leading-underscore option when needed
+$(patsubst %.F90,%.lo,$(patsubst %.f90,%.lo,$(notdir $(gfor_specific_src)))): AM_FCFLAGS += -fallow-leading-underscore
+selected_real_kind.lo selected_int_kind.lo: AM_FCFLAGS += -fallow-leading-underscore
+@onestep_TRUE@libgfortran_c.c libgfortran_f.f90 libgfortran_F.F90:
+@onestep_TRUE@ echo > $@
+# overrides for libtool perusing the dummy sources
+@onestep_TRUE@libgfortran_c.o: $(filter %.c,$(prereq_SRC))
+@onestep_TRUE@ $(COMPILE) -c $^ -o $@ -combine
+
+@onestep_TRUE@libgfortran_c.lo: $(filter %.c,$(prereq_SRC))
+@onestep_TRUE@ $(LTCOMPILE) -c -o $@ $^ -combine
+
+kinds.h: $(srcdir)/mk-kinds-h.sh
+       $(SHELL) $(srcdir)/mk-kinds-h.sh '$(FCCOMPILE)' > $@ || rm $@
+
+kinds.inc: kinds.h
+       grep '^#' < kinds.h > $@
+
+c99_protos.inc: $(srcdir)/c99_protos.h
+       grep '^#' < $(srcdir)/c99_protos.h > $@
+
+selected_int_kind.inc: $(srcdir)/mk-sik-inc.sh
+       $(SHELL) $(srcdir)/mk-sik-inc.sh '$(FCCOMPILE)' > $@ || rm $@
+
+selected_real_kind.inc: $(srcdir)/mk-srk-inc.sh
+       $(SHELL) $(srcdir)/mk-srk-inc.sh '$(FCCOMPILE)' > $@ || rm $@
+
+fpu-target.h: $(srcdir)/$(FPU_HOST_HEADER)
+       cp $(srcdir)/$(FPU_HOST_HEADER) $@
+
+@MAINTAINER_MODE_TRUE@$(i_all_c): m4/all.m4 $(I_M4_DEPS2)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 all.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_bessel_c): m4/bessel.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 bessel.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_any_c): m4/any.m4 $(I_M4_DEPS2)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 any.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_count_c): m4/count.m4 $(I_M4_DEPS2)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 count.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_iall_c): m4/iall.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 iall.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_iany_c): m4/iany.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 iany.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_iparity_c): m4/iparity.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 iparity.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_maxloc0_c): m4/maxloc0.m4 $(I_M4_DEPS0)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 maxloc0.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_maxloc1_c): m4/maxloc1.m4 $(I_M4_DEPS1)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 maxloc1.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_maxval_c): m4/maxval.m4 $(I_M4_DEPS1)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 maxval.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_minloc0_c): m4/minloc0.m4 $(I_M4_DEPS0)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 minloc0.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_minloc1_c): m4/minloc1.m4 $(I_M4_DEPS1)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 minloc1.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_minval_c): m4/minval.m4 $(I_M4_DEPS1)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 minval.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_product_c): m4/product.m4 $(I_M4_DEPS1)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 product.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_sum_c): m4/sum.m4 $(I_M4_DEPS1)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 sum.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_matmul_c): m4/matmul.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 matmul.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_matmull_c): m4/matmull.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 matmull.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_norm2_c): m4/norm2.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 norm2.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_parity_c): m4/parity.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 parity.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_transpose_c): m4/transpose.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 transpose.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_shape_c): m4/shape.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 shape.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_reshape_c): m4/reshape.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 reshape.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_eoshift1_c): m4/eoshift1.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 eoshift1.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_eoshift3_c): m4/eoshift3.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 eoshift3.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_cshift0_c): m4/cshift0.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 cshift0.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_cshift1_c): m4/cshift1.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 cshift1.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(in_pack_c): m4/in_pack.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 in_pack.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(in_unpack_c): m4/in_unpack.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 in_unpack.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_exponent_c): m4/exponent.m4 m4/mtype.m4
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 exponent.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_rrspacing_c): m4/rrspacing.m4 m4/mtype.m4
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 rrspacing.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_spacing_c): m4/spacing.m4 m4/mtype.m4
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 spacing.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_fraction_c): m4/fraction.m4 m4/mtype.m4
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 fraction.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_nearest_c): m4/nearest.m4 m4/mtype.m4
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 nearest.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_set_exponent_c): m4/set_exponent.m4 m4/mtype.m4
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 set_exponent.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_pow_c): m4/pow.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 pow.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_pack_c): m4/pack.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 pack.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_unpack_c): m4/unpack.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 unpack.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(i_spread_c): m4/spread.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 spread.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(gfor_built_specific_src): m4/specific.m4 m4/head.m4
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 specific.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(gfor_built_specific2_src): m4/specific2.m4 m4/head.m4
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 specific2.m4 > $@
+
+@MAINTAINER_MODE_TRUE@$(gfor_misc_specifics): m4/misc_specifics.m4 m4/head.m4
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 misc_specifics.m4 > $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/l4/pkg/libgfortran/lib/contrib/acinclude.m4 b/l4/pkg/libgfortran/lib/contrib/acinclude.m4
new file mode 100644 (file)
index 0000000..645b248
--- /dev/null
@@ -0,0 +1,363 @@
+m4_include(../config/acx.m4)
+m4_include(../config/no-executables.m4)
+
+dnl Check that we have a working GNU Fortran compiler
+AC_DEFUN([LIBGFOR_WORKING_GFORTRAN], [
+AC_MSG_CHECKING([whether the GNU Fortran compiler is working])
+AC_LANG_PUSH([Fortran])
+AC_COMPILE_IFELSE([[
+      program foo
+      real, parameter :: bar = sin (12.34 / 2.5)
+      end program foo]],
+    [AC_MSG_RESULT([yes])],
+    [AC_MSG_RESULT([no])
+     AC_MSG_ERROR([GNU Fortran is not working; please report a bug in http://gcc.gnu.org/bugzilla, attaching $PWD/config.log])
+    ])
+AC_LANG_POP([Fortran])
+])
+
+
+sinclude(../libtool.m4)
+dnl The lines below arrange for aclocal not to bring an installed
+dnl libtool.m4 into aclocal.m4, while still arranging for automake to
+dnl add a definition of LIBTOOL to Makefile.in.
+ifelse(,,,[AC_SUBST(LIBTOOL)
+AC_DEFUN([AM_PROG_LIBTOOL])
+AC_DEFUN([AC_LIBTOOL_DLOPEN])
+AC_DEFUN([AC_PROG_LD])
+])
+
+dnl Check whether the target supports hidden visibility.
+AC_DEFUN([LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY], [
+  AC_CACHE_CHECK([whether the target supports hidden visibility],
+                libgfor_cv_have_attribute_visibility, [
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Werror"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void __attribute__((visibility("hidden"))) foo(void) { }]], [])],
+                   libgfor_cv_have_attribute_visibility=yes,
+                   libgfor_cv_have_attribute_visibility=no)
+  CFLAGS="$save_CFLAGS"])
+  if test $libgfor_cv_have_attribute_visibility = yes; then
+    AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1,
+      [Define to 1 if the target supports __attribute__((visibility(...))).])
+  fi])
+
+dnl Check whether the target supports dllexport
+AC_DEFUN([LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT], [
+  AC_CACHE_CHECK([whether the target supports dllexport],
+                libgfor_cv_have_attribute_dllexport, [
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Werror"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void __attribute__((dllexport)) foo(void) { }]], [])],
+                   libgfor_cv_have_attribute_dllexport=yes,
+                   libgfor_cv_have_attribute_dllexport=no)
+  CFLAGS="$save_CFLAGS"])
+  if test $libgfor_cv_have_attribute_dllexport = yes; then
+    AC_DEFINE(HAVE_ATTRIBUTE_DLLEXPORT, 1,
+      [Define to 1 if the target supports __attribute__((dllexport)).])
+  fi])
+
+dnl Check whether the target supports symbol aliases.
+AC_DEFUN([LIBGFOR_CHECK_ATTRIBUTE_ALIAS], [
+  AC_CACHE_CHECK([whether the target supports symbol aliases],
+                libgfor_cv_have_attribute_alias, [
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+void foo(void) { }
+extern void bar(void) __attribute__((alias("foo")));]],
+    [[bar();]])], libgfor_cv_have_attribute_alias=yes, libgfor_cv_have_attribute_alias=no)])
+  if test $libgfor_cv_have_attribute_alias = yes; then
+    AC_DEFINE(HAVE_ATTRIBUTE_ALIAS, 1,
+      [Define to 1 if the target supports __attribute__((alias(...))).])
+  fi])
+
+dnl Check whether the target supports __sync_fetch_and_add.
+AC_DEFUN([LIBGFOR_CHECK_SYNC_FETCH_AND_ADD], [
+  AC_CACHE_CHECK([whether the target supports __sync_fetch_and_add],
+                libgfor_cv_have_sync_fetch_and_add, [
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foovar = 0;]], [[
+if (foovar <= 0) return __sync_fetch_and_add (&foovar, 1);
+if (foovar > 10) return __sync_add_and_fetch (&foovar, -1);]])],
+             libgfor_cv_have_sync_fetch_and_add=yes, libgfor_cv_have_sync_fetch_and_add=no)])
+  if test $libgfor_cv_have_sync_fetch_and_add = yes; then
+    AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD, 1,
+             [Define to 1 if the target supports __sync_fetch_and_add])
+  fi])
+
+dnl Check for pragma weak.
+AC_DEFUN([LIBGFOR_GTHREAD_WEAK], [
+  AC_CACHE_CHECK([whether pragma weak works],
+                libgfor_cv_have_pragma_weak, [
+  gfor_save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Wunknown-pragmas"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+void foo (void);
+#pragma weak foo
+]], [[if (foo) foo ();]])],
+                   libgfor_cv_have_pragma_weak=yes, libgfor_cv_have_pragma_weak=no)])
+  if test $libgfor_cv_have_pragma_weak = yes; then
+    AC_DEFINE(SUPPORTS_WEAK, 1,
+             [Define to 1 if the target supports #pragma weak])
+  fi
+  case "$host" in
+    *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* )
+      AC_DEFINE(GTHREAD_USE_WEAK, 0,
+               [Define to 0 if the target shouldn't use #pragma weak])
+      ;;
+  esac])
+
+dnl Check whether target can unlink a file still open.
+AC_DEFUN([LIBGFOR_CHECK_UNLINK_OPEN_FILE], [
+  AC_CACHE_CHECK([whether the target can unlink an open file],
+                  libgfor_cv_have_unlink_open_file, [
+  AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+int main ()
+{
+  int fd;
+
+  fd = open ("testfile", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR);
+  if (fd <= 0)
+    return 0;
+  if (unlink ("testfile") == -1)
+    return 1;
+  write (fd, "This is a test\n", 15);
+  close (fd);
+
+  if (open ("testfile", O_RDONLY) == -1 && errno == ENOENT)
+    return 0;
+  else
+    return 1;
+}]])], libgfor_cv_have_unlink_open_file=yes, libgfor_cv_have_unlink_open_file=no, [
+case "${target}" in
+  *mingw*) libgfor_cv_have_unlink_open_file=no ;;
+  *) libgfor_cv_have_unlink_open_file=yes;;
+esac])])
+if test x"$libgfor_cv_have_unlink_open_file" = xyes; then
+  AC_DEFINE(HAVE_UNLINK_OPEN_FILE, 1, [Define if target can unlink open files.])
+fi])
+
+dnl Check whether CRLF is the line terminator
+AC_DEFUN([LIBGFOR_CHECK_CRLF], [
+  AC_CACHE_CHECK([whether the target has CRLF as line terminator],
+                  libgfor_cv_have_crlf, [
+  AC_RUN_IFELSE([AC_LANG_SOURCE([[
+/* This test program should exit with status 0 if system uses a CRLF as
+   line terminator, and status 1 otherwise.  
+   Since it is used to check for mingw systems, and should return 0 in any
+   other case, in case of a failure we will not use CRLF.  */
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+int main ()
+{
+#ifndef O_BINARY
+  exit(1);
+#else
+  int fd, bytes;
+  char buff[5];
+
+  fd = open ("foo", O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU);
+  if (fd < 0)
+    exit(1);
+  if (write (fd, "\n", 1) < 0)
+    perror ("write");
+  
+  close (fd);
+  
+  if ((fd = open ("foo", O_RDONLY | O_BINARY, S_IRWXU)) < 0)
+    exit(1);
+  bytes = read (fd, buff, 5);
+  if (bytes == 2 && buff[0] == '\r' && buff[1] == '\n')
+    exit(0);
+  else
+    exit(1);
+#endif
+}]])], libgfor_cv_have_crlf=yes, libgfor_cv_have_crlf=no, [
+case "${target}" in
+  *mingw*) libgfor_cv_have_crlf=yes ;;
+  *) libgfor_cv_have_crlf=no;;
+esac])])
+if test x"$libgfor_cv_have_crlf" = xyes; then
+  AC_DEFINE(HAVE_CRLF, 1, [Define if CRLF is line terminator.])
+fi])
+
+dnl Check whether the st_ino and st_dev stat fields taken together uniquely
+dnl identify the file within the system. This is should be true for POSIX
+dnl systems; it is known to be false on mingw32.
+AC_DEFUN([LIBGFOR_CHECK_WORKING_STAT], [
+  AC_CACHE_CHECK([whether the target stat is reliable],
+                  libgfor_cv_have_working_stat, [
+  AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+int main ()
+{ 
+  FILE *f, *g;
+  struct stat st1, st2;
+
+  f = fopen ("foo", "w");
+  g = fopen ("bar", "w");
+  if (stat ("foo", &st1) != 0 || stat ("bar", &st2))
+    return 1;
+  if (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino)
+    return 1;
+  fclose(f);
+  fclose(g);
+  return 0;
+}]])], libgfor_cv_have_working_stat=yes, libgfor_cv_have_working_stat=no, [
+case "${target}" in
+  *mingw*) libgfor_cv_have_working_stat=no ;;
+  *) libgfor_cv_have_working_stat=yes;;
+esac])])
+if test x"$libgfor_cv_have_working_stat" = xyes; then
+  AC_DEFINE(HAVE_WORKING_STAT, 1, [Define if target has a reliable stat.])
+fi])
+
+dnl Checks for fpsetmask function.
+AC_DEFUN([LIBGFOR_CHECK_FPSETMASK], [
+  AC_CACHE_CHECK([whether fpsetmask is present], libgfor_cv_have_fpsetmask, [
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#if HAVE_FLOATINGPOINT_H
+# include <floatingpoint.h>
+#endif /* HAVE_FLOATINGPOINT_H */
+#if HAVE_IEEEFP_H
+# include <ieeefp.h>
+#endif /* HAVE_IEEEFP_H */]],[[fpsetmask(0);]])],
+    eval "libgfor_cv_have_fpsetmask=yes", eval "libgfor_cv_have_fpsetmask=no")
+  ])
+  if test x"$libgfor_cv_have_fpsetmask" = xyes; then
+    have_fpsetmask=yes
+    AC_DEFINE(HAVE_FPSETMASK, 1, [Define if you have fpsetmask.])
+  fi
+])
+
+dnl Check whether we have a mingw that provides a __mingw_snprintf function
+AC_DEFUN([LIBGFOR_CHECK_MINGW_SNPRINTF], [
+  AC_CACHE_CHECK([whether __mingw_snprintf is present], libgfor_cv_have_mingw_snprintf, [
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+extern int __mingw_snprintf (char *, size_t, const char *, ...);
+]],[[
+__mingw_snprintf (NULL, 0, "%d\n", 1);
+]])],
+    eval "libgfor_cv_have_mingw_snprintf=yes", eval "libgfor_cv_have_mingw_snprintf=no")
+  ])
+  if test x"$libgfor_cv_have_mingw_snprintf" = xyes; then
+    AC_DEFINE(HAVE_MINGW_SNPRINTF, 1, [Define if you have __mingw_snprintf.])
+  fi
+])
+
+dnl Check whether we have a broken powf implementation
+AC_DEFUN([LIBGFOR_CHECK_FOR_BROKEN_POWF], [
+  AC_CACHE_CHECK([whether powf is broken], libgfor_cv_have_broken_powf, [
+case "${target}" in
+  hppa*64*-*-hpux*) libgfor_cv_have_broken_powf=yes ;;
+  *) libgfor_cv_have_broken_powf=no;;
+esac])
+  if test x"$libgfor_cv_have_broken_powf" = xyes; then
+    AC_DEFINE(HAVE_BROKEN_POWF, 1, [Define if powf is broken.])
+  fi
+])
+
+dnl Check whether we have a __float128 type
+AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
+  LIBQUADSPEC=
+
+  if test "x$enable_libquadmath_support" != xno; then
+
+  AC_CACHE_CHECK([whether we have a usable __float128 type],
+                 libgfor_cv_have_float128, [
+   GCC_TRY_COMPILE_OR_LINK([
+    typedef _Complex float __attribute__((mode(TC))) __complex128;
+
+    __float128 foo (__float128 x)
+    {
+
+     __complex128 z1, z2;
+
+     z1 = x;
+     z2 = x / 7.Q;
+     z2 /= z1;
+
+     return (__float128) z2;
+    }
+
+    __float128 bar (__float128 x)
+    {
+      return x * __builtin_huge_valq ();
+    }
+  ],[
+    foo (1.2Q);
+    bar (1.2Q);
+  ],[
+    libgfor_cv_have_float128=yes
+  ],[
+    libgfor_cv_have_float128=no
+])])
+
+  if test "x$libgfor_cv_have_float128" = xyes; then
+    AC_DEFINE(HAVE_FLOAT128, 1, [Define if have a usable __float128 type.])
+
+    dnl Check whether -Wl,--as-needed is supported
+    dnl 
+    dnl Turn warnings into error to avoid testsuite breakage.  So enable
+    dnl AC_LANG_WERROR, but there's currently (autoconf 2.64) no way to turn
+    dnl it off again.  As a workaround, save and restore werror flag like
+    dnl AC_PATH_XTRA.
+    dnl Cf. http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01889.html
+    ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag
+    AC_CACHE_CHECK([whether --as-needed works],
+      [libgfor_cv_have_as_needed],
+      [
+      save_LDFLAGS="$LDFLAGS"
+      LDFLAGS="$LDFLAGS -Wl,--as-needed -lm -Wl,--no-as-needed"
+      libgfor_cv_have_as_needed=no
+      AC_LANG_WERROR
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+                    [libgfor_cv_have_as_needed=yes],
+                    [libgfor_cv_have_as_needed=no])
+      LDFLAGS="$save_LDFLAGS"
+      ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag
+    ])
+
+    dnl For static libgfortran linkage, depend on libquadmath only if needed.
+    if test "x$libgfor_cv_have_as_needed" = xyes; then
+      LIBQUADSPEC="%{static-libgfortran:--as-needed} -lquadmath %{static-libgfortran:--no-as-needed}"
+    else
+      LIBQUADSPEC="-lquadmath"
+    fi
+    if test -f ../libquadmath/libquadmath.la; then
+      LIBQUADLIB=../libquadmath/libquadmath.la
+      LIBQUADLIB_DEP=../libquadmath/libquadmath.la
+      LIBQUADINCLUDE='-I$(srcdir)/../libquadmath'
+    else
+      LIBQUADLIB="-lquadmath"
+      LIBQUADLIB_DEP=
+      LIBQUADINCLUDE=
+    fi
+  fi
+  else
+    # for --disable-quadmath
+    LIBQUADLIB=
+    LIBQUADLIB_DEP=
+    LIBQUADINCLUDE=
+  fi
+
+  dnl For the spec file
+  AC_SUBST(LIBQUADSPEC)
+  AC_SUBST(LIBQUADLIB)
+  AC_SUBST(LIBQUADLIB_DEP)
+  AC_SUBST(LIBQUADINCLUDE)
+
+  dnl We need a conditional for the Makefile
+  AM_CONDITIONAL(LIBGFOR_BUILD_QUAD, [test "x$libgfor_cv_have_float128" = xyes])
+])
diff --git a/l4/pkg/libgfortran/lib/contrib/aclocal.m4 b/l4/pkg/libgfortran/lib/contrib/aclocal.m4
new file mode 100644 (file)
index 0000000..8673daa
--- /dev/null
@@ -0,0 +1,1017 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
+[m4_warning([this file was generated for autoconf 2.64.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+             [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                 [_AM_DEPENDENCIES(CC)],
+                 [define([AC_PROG_CC],
+                         defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                 [_AM_DEPENDENCIES(CXX)],
+                 [define([AC_PROG_CXX],
+                         defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST(install_sh)])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST([MAINT])dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([../config/depstand.m4])
+m4_include([../config/lead-dot.m4])
+m4_include([../config/lthostflags.m4])
+m4_include([../config/multi.m4])
+m4_include([../config/override.m4])
+m4_include([../config/stdint.m4])
+m4_include([../config/unwind_ipinfo.m4])
+m4_include([../ltoptions.m4])
+m4_include([../ltsugar.m4])
+m4_include([../ltversion.m4])
+m4_include([../lt~obsolete.m4])
+m4_include([acinclude.m4])
diff --git a/l4/pkg/libgfortran/lib/contrib/c99_protos.h b/l4/pkg/libgfortran/lib/contrib/c99_protos.h
new file mode 100644 (file)
index 0000000..73a22c3
--- /dev/null
@@ -0,0 +1,633 @@
+/* Declarations of various C99 functions 
+   Copyright (C) 2004, 2006, 2007, 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef C99_PROTOS_H
+#define C99_PROTOS_H 1
+
+/* float variants of libm functions */
+#ifndef HAVE_ACOSF
+#define HAVE_ACOSF 1
+extern float acosf(float);
+#endif
+
+#if HAVE_ACOSH && !HAVE_ACOSHF
+#define HAVE_ACOSHF 1
+extern float acoshf(float);
+#endif
+
+#ifndef HAVE_ASINF
+#define HAVE_ASINF 1
+extern float asinf(float);
+#endif
+
+#if HAVE_ASINH && !HAVE_ASINHF
+#define HAVE_ASINHF 1
+extern float asinhf(float);
+#endif
+
+#ifndef HAVE_ATAN2F
+#define HAVE_ATAN2F 1
+extern float atan2f(float, float);
+#endif
+
+#ifndef HAVE_ATANF
+#define HAVE_ATANF 1
+extern float atanf(float);
+#endif
+
+#if HAVE_ATANH && !HAVE_ATANHF
+#define HAVE_ATANHF 1
+extern float atanhf(float);
+#endif
+
+#ifndef HAVE_CEILF
+#define HAVE_CEILF 1
+extern float ceilf(float);
+#endif
+
+#ifndef HAVE_COPYSIGNF
+#define HAVE_COPYSIGNF 1
+extern float copysignf(float, float);
+#endif
+
+#ifndef HAVE_COSF
+#define HAVE_COSF 1
+extern float cosf(float);
+#endif
+
+#ifndef HAVE_COSHF
+#define HAVE_COSHF 1
+extern float coshf(float);
+#endif
+
+#ifndef HAVE_EXPF
+#define HAVE_EXPF 1
+extern float expf(float);
+#endif
+
+#ifndef HAVE_FABSF
+#define HAVE_FABSF 1
+extern float fabsf(float);
+#endif
+
+#ifndef HAVE_FLOORF
+#define HAVE_FLOORF 1
+extern float floorf(float);
+#endif
+
+#ifndef HAVE_FLOORL
+#define HAVE_FLOORL 1
+extern long double floorl (long double x);
+#endif
+
+#ifndef HAVE_FMODF
+#define HAVE_FMODF 1
+extern float fmodf (float x, float y);
+#endif
+
+#ifndef HAVE_FMODL
+#define HAVE_FMODL 1
+extern long double fmodl (long double x, long double y);
+#endif
+
+#ifndef HAVE_FREXPF
+#define HAVE_FREXPF 1
+extern float frexpf(float, int *);
+#endif
+
+#ifndef HAVE_HYPOTF
+#define HAVE_HYPOTF 1
+extern float hypotf(float, float);
+#endif
+
+#ifndef HAVE_LOGF
+#define HAVE_LOGF 1
+extern float logf(float);
+#endif
+
+#ifndef HAVE_LOG10F
+#define HAVE_LOG10F 1
+extern float log10f(float);
+#endif
+
+#ifndef HAVE_SCALBN
+#define HAVE_SCALBN 1
+extern double scalbn(double, int);
+#endif
+
+#ifndef HAVE_SCALBNF
+#define HAVE_SCALBNF 1
+extern float scalbnf(float, int);
+#endif
+
+#ifndef HAVE_SINF
+#define HAVE_SINF 1
+extern float sinf(float);
+#endif
+
+#ifndef HAVE_SINHF
+#define HAVE_SINHF 1
+extern float sinhf(float);
+#endif
+
+#ifndef HAVE_SQRTF
+#define HAVE_SQRTF 1
+extern float sqrtf(float);
+#endif
+
+#ifndef HAVE_TANF
+#define HAVE_TANF 1
+extern float tanf(float);
+#endif
+
+#ifndef HAVE_TANHF
+#define HAVE_TANHF 1
+extern float tanhf(float);
+#endif
+
+#ifndef HAVE_TRUNC
+#define HAVE_TRUNC 1
+extern double trunc(double);
+#endif
+
+#ifndef HAVE_TRUNCF
+#define HAVE_TRUNCF 1
+extern float truncf(float);
+#endif
+
+#ifndef HAVE_NEXTAFTERF
+#define HAVE_NEXTAFTERF 1
+extern float nextafterf(float, float);
+#endif
+
+#ifndef HAVE_POWF
+#define HAVE_POWF 1
+extern float powf(float, float);
+#endif
+
+#ifndef HAVE_ROUND
+#define HAVE_ROUND 1
+extern double round(double);
+#endif
+
+#ifndef HAVE_ROUNDF
+#define HAVE_ROUNDF 1
+extern float roundf(float);
+#endif
+
+#if !defined(HAVE_ROUNDL)
+#define HAVE_ROUNDL 1
+extern long double roundl(long double);
+#endif
+
+
+
+#if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
+#define HAVE_LROUNDF 1
+long int lroundf (float);
+#endif
+
+#if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
+#define HAVE_LROUND 1
+long int lround (double);
+#endif
+
+#if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
+#define HAVE_LROUNDL 1
+long int lroundl (long double);
+#endif
+
+#if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
+#define HAVE_LLROUNDF 1
+long long int llroundf (float);
+#endif
+
+#if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
+#define HAVE_LLROUND 1
+long long int llround (double);
+#endif
+
+#if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
+#define HAVE_LLROUNDL 1
+long long int llroundl (long double);
+#endif
+
+/* Wrappers for systems without the various C99 single precision Bessel
+   functions.  */
+
+#if defined(HAVE_J0) && ! defined(HAVE_J0F)
+#define HAVE_J0F 1
+extern float j0f (float);
+#endif
+
+#if defined(HAVE_J1) && !defined(HAVE_J1F)
+#define HAVE_J1F 1
+extern float j1f (float);
+#endif
+
+#if defined(HAVE_JN) && !defined(HAVE_JNF)
+#define HAVE_JNF 1
+extern float jnf (int, float);
+#endif
+
+#if defined(HAVE_Y0) && !defined(HAVE_Y0F)
+#define HAVE_Y0F 1
+extern float y0f (float);
+#endif
+
+#if defined(HAVE_Y1) && !defined(HAVE_Y1F)
+#define HAVE_Y1F 1
+extern float y1f (float);
+#endif
+
+#if defined(HAVE_YN) && !defined(HAVE_YNF)
+#define HAVE_YNF 1
+extern float ynf (int, float);
+#endif
+
+
+/* Wrappers for systems without the C99 erff() and erfcf() functions.  */
+
+#if defined(HAVE_ERF) && !defined(HAVE_ERFF)
+#define HAVE_ERFF 1
+extern float erff (float);
+#endif
+
+#if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
+#define HAVE_ERFCF 1
+extern float erfcf (float);
+#endif
+
+
+
+/* log10l is needed on all platforms for decimal I/O */
+#ifndef HAVE_LOG10L
+#define HAVE_LOG10L 1
+extern long double log10l(long double);
+#endif
+
+
+/* complex math functions */
+
+#if !defined(HAVE_CABSF)
+#define HAVE_CABSF 1
+extern float cabsf (float complex);
+#endif
+
+#if !defined(HAVE_CABS)
+#define HAVE_CABS 1
+extern double cabs (double complex);
+#endif
+
+#if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
+#define HAVE_CABSL 1
+extern long double cabsl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CARGF)
+#define HAVE_CARGF 1
+extern float cargf (float complex);
+#endif
+
+#if !defined(HAVE_CARG)
+#define HAVE_CARG 1
+extern double carg (double complex);
+#endif
+
+#if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
+#define HAVE_CARGL 1
+extern long double cargl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CEXPF)
+#define HAVE_CEXPF 1
+extern float complex cexpf (float complex);
+#endif
+
+#if !defined(HAVE_CEXP)
+#define HAVE_CEXP 1
+extern double complex cexp (double complex);
+#endif
+
+#if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(EXPL)
+#define HAVE_CEXPL 1
+extern long double complex cexpl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CLOGF)
+#define HAVE_CLOGF 1
+extern float complex clogf (float complex);
+#endif
+
+#if !defined(HAVE_CLOG)
+#define HAVE_CLOG 1
+extern double complex clog (double complex);
+#endif
+
+#if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
+#define HAVE_CLOGL 1
+extern long double complex clogl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CLOG10F)
+#define HAVE_CLOG10F 1
+extern float complex clog10f (float complex);
+#endif
+
+#if !defined(HAVE_CLOG10)
+#define HAVE_CLOG10 1
+extern double complex clog10 (double complex);
+#endif
+
+#if !defined(HAVE_CLOG10L) && defined(HAVE_LOG10L) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
+#define HAVE_CLOG10L 1
+extern long double complex clog10l (long double complex);
+#endif
+
+
+#if !defined(HAVE_CPOWF)
+#define HAVE_CPOWF 1
+extern float complex cpowf (float complex, float complex);
+#endif
+
+#if !defined(HAVE_CPOW)
+#define HAVE_CPOW 1
+extern double complex cpow (double complex, double complex);
+#endif
+
+#if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
+#define HAVE_CPOWL 1
+extern long double complex cpowl (long double complex, long double complex);
+#endif
+
+
+#if !defined(HAVE_CSQRTF)
+#define HAVE_CSQRTF 1 
+extern float complex csqrtf (float complex);
+#endif
+
+#if !defined(HAVE_CSQRT)
+#define HAVE_CSQRT 1
+extern double complex csqrt (double complex);
+#endif
+
+#if !defined(HAVE_CSQRTL) && defined(HAVE_COPYSIGNL) && defined(HAVE_SQRTL) && defined(HAVE_FABSL) && defined(HAVE_HYPOTL)
+#define HAVE_CSQRTL 1
+extern long double complex csqrtl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CSINHF)
+#define HAVE_CSINHF 1
+extern float complex csinhf (float complex);
+#endif
+
+#if !defined(HAVE_CSINH)
+#define HAVE_CSINH 1
+extern double complex csinh (double complex);
+#endif
+
+#if !defined(HAVE_CSINHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CSINHL 1
+extern long double complex csinhl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CCOSHF)
+#define HAVE_CCOSHF 1
+extern float complex ccoshf (float complex);
+#endif
+
+#if !defined(HAVE_CCOSH)
+#define HAVE_CCOSH 1
+extern double complex ccosh (double complex);
+#endif
+
+#if !defined(HAVE_CCOSHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CCOSHL 1
+extern long double complex ccoshl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CTANHF)
+#define HAVE_CTANHF 1
+extern float complex ctanhf (float complex);
+#endif
+
+#if !defined(HAVE_CTANH)
+#define HAVE_CTANH 1
+extern double complex ctanh (double complex);
+#endif
+
+#if !defined(HAVE_CTANHL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
+#define HAVE_CTANHL 1
+extern long double complex ctanhl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CSINF)
+#define HAVE_CSINF 1
+extern float complex csinf (float complex);
+#endif
+
+#if !defined(HAVE_CSIN)
+#define HAVE_CSIN 1
+extern double complex csin (double complex);
+#endif
+
+#if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CSINL 1
+extern long double complex csinl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CCOSF)
+#define HAVE_CCOSF 1
+extern float complex ccosf (float complex);
+#endif
+
+#if !defined(HAVE_CCOS)
+#define HAVE_CCOS 1
+extern double complex ccos (double complex);
+#endif
+
+#if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CCOSL 1
+extern long double complex ccosl (long double complex);
+#endif
+
+
+#if !defined(HAVE_CTANF)
+#define HAVE_CTANF 1
+extern float complex ctanf (float complex);
+#endif
+
+#if !defined(HAVE_CTAN)
+#define HAVE_CTAN 1
+extern double complex ctan (double complex);
+#endif
+
+#if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
+#define HAVE_CTANL 1
+extern long double complex ctanl (long double complex);
+#endif
+
+
+/* Complex ACOS.  */
+
+#if !defined(HAVE_CACOSF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CACOSF 1
+extern complex float cacosf (complex float z);
+#endif
+
+#if !defined(HAVE_CACOS) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CACOS 1
+extern complex double cacos (complex double z);
+#endif
+
+#if !defined(HAVE_CACOSL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CACOSL 1
+extern complex long double cacosl (complex long double z);
+#endif
+
+
+/* Complex ASIN.  */
+
+#if !defined(HAVE_CASINF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CASINF 1
+extern complex float casinf (complex float z);
+#endif
+
+#if !defined(HAVE_CASIN) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CASIN 1
+extern complex double casin (complex double z);
+#endif
+
+#if !defined(HAVE_CASINL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CASINL 1
+extern complex long double casinl (complex long double z);
+#endif
+
+
+/* Complex ATAN.  */
+
+#if !defined(HAVE_CATANF) && defined(HAVE_CLOGF)
+#define HAVE_CATANF 1
+extern complex float catanf (complex float z);
+#endif
+
+#if !defined(HAVE_CATAN) && defined(HAVE_CLOG)
+#define HAVE_CATAN 1
+extern complex double catan (complex double z);
+#endif
+
+#if !defined(HAVE_CATANL) && defined(HAVE_CLOGL)
+#define HAVE_CATANL 1
+extern complex long double catanl (complex long double z);
+#endif
+
+
+/* Complex ASINH.  */
+
+#if !defined(HAVE_CASINHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CASINHF 1
+extern complex float casinhf (complex float z);
+#endif
+
+
+#if !defined(HAVE_CASINH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CASINH 1
+extern complex double casinh (complex double z);
+#endif
+
+#if !defined(HAVE_CASINHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CASINHL 1
+extern complex long double casinhl (complex long double z);
+#endif
+
+
+/* Complex ACOSH.  */
+
+#if !defined(HAVE_CACOSHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CACOSHF 1
+extern complex float cacoshf (complex float z);
+#endif
+
+#if !defined(HAVE_CACOSH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CACOSH 1
+extern complex double cacosh (complex double z);
+#endif
+
+#if !defined(HAVE_CACOSHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CACOSHL 1
+extern complex long double cacoshl (complex long double z);
+#endif
+
+
+/* Complex ATANH.  */
+
+#if !defined(HAVE_CATANHF) && defined(HAVE_CLOGF)
+#define HAVE_CATANHF 1
+extern complex float catanhf (complex float z);
+#endif
+
+#if !defined(HAVE_CATANH) && defined(HAVE_CLOG)
+#define HAVE_CATANH 1
+extern complex double catanh (complex double z);
+#endif
+
+#if !defined(HAVE_CATANHL) && defined(HAVE_CLOGL)
+#define HAVE_CATANHL 1
+extern complex long double catanhl (complex long double z);
+#endif
+
+
+/* Gamma-related prototypes.  */
+#if !defined(HAVE_TGAMMA)
+#define HAVE_TGAMMA 1
+extern double tgamma (double);
+#endif
+
+#if !defined(HAVE_LGAMMA)
+#define HAVE_LGAMMA 1
+extern double lgamma (double);
+#endif
+
+#if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
+#define HAVE_TGAMMAF 1
+extern float tgammaf (float);
+#endif
+
+#if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
+#define HAVE_LGAMMAF 1
+extern float lgammaf (float);
+#endif
+
+
+#endif  /* C99_PROTOS_H  */
+
diff --git a/l4/pkg/libgfortran/lib/contrib/caf/libcaf.h b/l4/pkg/libgfortran/lib/contrib/caf/libcaf.h
new file mode 100644 (file)
index 0000000..caffe17
--- /dev/null
@@ -0,0 +1,88 @@
+/* Common declarations for all of GNU Fortran libcaf implementations.
+   Copyright (C) 2011, 2012
+   Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran Coarray Runtime Library (libcaf).
+
+Libcaf is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libcaf 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef LIBCAF_H
+#define LIBCAF_H
+
+#include <stdint.h>    /* For int32_t.  */
+#include <stddef.h>    /* For ptrdiff_t.  */
+
+#ifndef __GNUC__
+#define __attribute__(x)
+#define likely(x)       (x)
+#define unlikely(x)     (x)
+#else
+#define likely(x)       __builtin_expect(!!(x), 1)
+#define unlikely(x)     __builtin_expect(!!(x), 0)
+#endif
+
+/* Definitions of the Fortran 2008 standard; need to kept in sync with
+   ISO_FORTRAN_ENV, cf. libgfortran.h.  */
+#define STAT_UNLOCKED          0
+#define STAT_LOCKED            1
+#define STAT_LOCKED_OTHER_IMAGE        2
+#define STAT_STOPPED_IMAGE     6000
+
+/* Describes what type of array we are registerring. Keep in sync with
+   gcc/fortran/trans.h.  */
+typedef enum caf_register_t {
+  CAF_REGTYPE_COARRAY_STATIC,
+  CAF_REGTYPE_COARRAY_ALLOC,
+  CAF_REGTYPE_LOCK,
+  CAF_REGTYPE_LOCK_COMP
+}
+caf_register_t;
+
+/* Linked list of static coarrays registered.  */
+typedef struct caf_static_t {
+  void **token;
+  struct caf_static_t *prev;
+}
+caf_static_t;
+
+
+void _gfortran_caf_init (int *, char ***, int *, int *);
+void _gfortran_caf_finalize (void);
+
+void * _gfortran_caf_register (ptrdiff_t, caf_register_t, void ***, int *,
+                              char *, int);
+void _gfortran_caf_deregister (void ***, int *, char *, int);
+
+
+void _gfortran_caf_sync_all (int *, char *, int);
+void _gfortran_caf_sync_images (int, int[], int *, char *, int);
+
+/* FIXME: The CRITICAL functions should be removed;
+   the functionality is better represented using Coarray's lock feature.  */
+void _gfortran_caf_critical (void)  { }
+void _gfortran_caf_end_critical (void)  { }
+
+
+void _gfortran_caf_error_stop_str (const char *, int32_t)
+     __attribute__ ((noreturn));
+void _gfortran_caf_error_stop (int32_t) __attribute__ ((noreturn));
+
+#endif  /* LIBCAF_H  */
diff --git a/l4/pkg/libgfortran/lib/contrib/caf/mpi.c b/l4/pkg/libgfortran/lib/contrib/caf/mpi.c
new file mode 100644 (file)
index 0000000..8c9f07b
--- /dev/null
@@ -0,0 +1,367 @@
+/* MPI implementation of GNU Fortran Coarray Library
+   Copyright (C) 2011, 2012
+   Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran Coarray Runtime Library (libcaf).
+
+Libcaf is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libcaf 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libcaf.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>    /* For memcpy.  */
+#include <stdarg.h>    /* For variadic arguments.  */
+#include <mpi.h>
+
+
+/* Define GFC_CAF_CHECK to enable run-time checking.  */
+/* #define GFC_CAF_CHECK  1  */
+
+
+static void error_stop (int error) __attribute__ ((noreturn));
+
+/* Global variables.  */
+static int caf_mpi_initialized;
+static int caf_this_image;
+static int caf_num_images;
+static int caf_is_finalized;
+
+caf_static_t *caf_static_list = NULL;
+
+
+/* Keep in sync with single.c.  */
+static void
+caf_runtime_error (const char *message, ...)
+{
+  va_list ap;
+  fprintf (stderr, "Fortran runtime error on image %d: ", caf_this_image);
+  va_start (ap, message);
+  vfprintf (stderr, message, ap);
+  va_end (ap);
+  fprintf (stderr, "\n");
+
+  /* FIXME: Shutdown the Fortran RTL to flush the buffer.  PR 43849.  */
+  /* FIXME: Do some more effort than just MPI_ABORT.  */
+  MPI_Abort (MPI_COMM_WORLD, EXIT_FAILURE);
+
+  /* Should be unreachable, but to make sure also call exit.  */
+  exit (EXIT_FAILURE);
+}
+
+
+/* Initialize coarray program.  This routine assumes that no other
+   MPI initialization happened before; otherwise MPI_Initialized
+   had to be used.  As the MPI library might modify the command-line
+   arguments, the routine should be called before the run-time
+   libaray is initialized.  */
+
+void
+_gfortran_caf_init (int *argc, char ***argv, int *this_image, int *num_images)
+{
+  if (caf_num_images == 0)
+    {
+      /* caf_mpi_initialized is only true if the main program is
+       not written in Fortran.  */
+      MPI_Initialized (&caf_mpi_initialized);
+      if (!caf_mpi_initialized)
+       MPI_Init (argc, argv);
+
+      MPI_Comm_size (MPI_COMM_WORLD, &caf_num_images);
+      MPI_Comm_rank (MPI_COMM_WORLD, &caf_this_image);
+      caf_this_image++;
+    }
+
+  if (this_image)
+    *this_image = caf_this_image;
+  if (num_images)
+    *num_images = caf_num_images;
+}
+
+
+/* Finalize coarray program.   */
+
+void
+_gfortran_caf_finalize (void)
+{
+  while (caf_static_list != NULL)
+    {
+      caf_static_t *tmp = caf_static_list->prev;
+
+      free (caf_static_list->token[caf_this_image-1]);
+      free (caf_static_list->token);
+      free (caf_static_list);
+      caf_static_list = tmp;
+    }
+
+  if (!caf_mpi_initialized)
+    MPI_Finalize ();
+
+  caf_is_finalized = 1;
+}
+
+
+void *
+_gfortran_caf_register (ptrdiff_t size, caf_register_t type, void ***token,
+                       int *stat, char *errmsg, int errmsg_len)
+{
+  void *local;
+  int err;
+
+  if (unlikely (caf_is_finalized))
+    goto error;
+
+  /* Start MPI if not already started.  */
+  if (caf_num_images == 0)
+    _gfortran_caf_init (NULL, NULL, NULL, NULL);
+
+  /* Token contains only a list of pointers.  */
+  local = malloc (size);
+  *token = malloc (sizeof (void*) * caf_num_images);
+
+  if (unlikely (local == NULL || *token == NULL))
+    goto error;
+
+  /* token[img-1] is the address of the token in image "img".  */
+  err = MPI_Allgather (&local, sizeof (void*), MPI_BYTE, *token,
+                      sizeof (void*), MPI_BYTE, MPI_COMM_WORLD);
+
+  if (unlikely (err))
+    {
+      free (local);
+      free (*token);
+      goto error;
+    }
+
+  if (type == CAF_REGTYPE_COARRAY_STATIC)
+    {
+      caf_static_t *tmp = malloc (sizeof (caf_static_t));
+      tmp->prev  = caf_static_list;
+      tmp->token = *token;
+      caf_static_list = tmp;
+    }
+
+  if (stat)
+    *stat = 0;
+
+  return local;
+
+error:
+  {
+    char *msg;
+
+    if (caf_is_finalized)
+      msg = "Failed to allocate coarray - there are stopped images";
+    else
+      msg = "Failed to allocate coarray";
+
+    if (stat)
+      {
+       *stat = caf_is_finalized ? STAT_STOPPED_IMAGE : 1;
+       if (errmsg_len > 0)
+         {
+           int len = ((int) strlen (msg) > errmsg_len) ? errmsg_len
+                                                       : (int) strlen (msg);
+           memcpy (errmsg, msg, len);
+           if (errmsg_len > len)
+             memset (&errmsg[len], ' ', errmsg_len-len);
+         }
+      }
+    else
+      caf_runtime_error (msg);
+  }
+
+  return NULL;
+}
+
+
+void
+_gfortran_caf_deregister (void ***token, int *stat, char *errmsg, int errmsg_len)
+{
+  if (unlikely (caf_is_finalized))
+    {
+      const char msg[] = "Failed to deallocate coarray - "
+                         "there are stopped images";
+      if (stat)
+       {
+         *stat = STAT_STOPPED_IMAGE;
+       
+         if (errmsg_len > 0)
+           {
+             int len = ((int) sizeof (msg) - 1 > errmsg_len)
+                       ? errmsg_len : (int) sizeof (msg) - 1;
+             memcpy (errmsg, msg, len);
+             if (errmsg_len > len)
+               memset (&errmsg[len], ' ', errmsg_len-len);
+           }
+         return;
+       }
+      caf_runtime_error (msg);
+    }
+
+  _gfortran_caf_sync_all (NULL, NULL, 0);
+
+  if (stat)
+    *stat = 0;
+
+  free ((*token)[caf_this_image-1]);
+  free (*token);
+}
+
+
+void
+_gfortran_caf_sync_all (int *stat, char *errmsg, int errmsg_len)
+{
+  int ierr;
+
+  if (unlikely (caf_is_finalized))
+    ierr = STAT_STOPPED_IMAGE;
+  else
+    ierr = MPI_Barrier (MPI_COMM_WORLD);
+  if (stat)
+    *stat = ierr;
+
+  if (ierr)
+    {
+      char *msg;
+      if (caf_is_finalized)
+       msg = "SYNC ALL failed - there are stopped images";
+      else
+       msg = "SYNC ALL failed";
+
+      if (errmsg_len > 0)
+       {
+         int len = ((int) strlen (msg) > errmsg_len) ? errmsg_len
+                                                     : (int) strlen (msg);
+         memcpy (errmsg, msg, len);
+         if (errmsg_len > len)
+           memset (&errmsg[len], ' ', errmsg_len-len);
+       }
+      else
+       caf_runtime_error (msg);
+    }
+}
+
+
+/* SYNC IMAGES. Note: SYNC IMAGES(*) is passed as count == -1 while
+   SYNC IMAGES([]) has count == 0. Note further that SYNC IMAGES(*)
+   is not equivalent to SYNC ALL. */
+void
+_gfortran_caf_sync_images (int count, int images[], int *stat, char *errmsg,
+                          int errmsg_len)
+{
+  int ierr;
+  if (count == 0 || (count == 1 && images[0] == caf_this_image))
+    {
+      if (stat)
+       *stat = 0;
+      return;
+    }
+
+#ifdef GFC_CAF_CHECK
+  {
+    int i;
+
+    for (i = 0; i < count; i++)
+      if (images[i] < 1 || images[i] > caf_num_images)
+       {
+         fprintf (stderr, "COARRAY ERROR: Invalid image index %d to SYNC "
+                  "IMAGES", images[i]);
+         error_stop (1);
+       }
+  }
+#endif
+
+  /* FIXME: SYNC IMAGES with a nontrivial argument cannot easily be
+     mapped to MPI communicators. Thus, exist early with an error message.  */
+  if (count > 0)
+    {
+      fprintf (stderr, "COARRAY ERROR: SYNC IMAGES not yet implemented");
+      error_stop (1);
+    }
+
+  /* Handle SYNC IMAGES(*).  */
+  if (unlikely (caf_is_finalized))
+    ierr = STAT_STOPPED_IMAGE;
+  else
+    ierr = MPI_Barrier (MPI_COMM_WORLD);
+
+  if (stat)
+    *stat = ierr;
+
+  if (ierr)
+    {
+      char *msg;
+      if (caf_is_finalized)
+       msg = "SYNC IMAGES failed - there are stopped images";
+      else
+       msg = "SYNC IMAGES failed";
+
+      if (errmsg_len > 0)
+       {
+         int len = ((int) strlen (msg) > errmsg_len) ? errmsg_len
+                                                     : (int) strlen (msg);
+         memcpy (errmsg, msg, len);
+         if (errmsg_len > len)
+           memset (&errmsg[len], ' ', errmsg_len-len);
+       }
+      else
+       caf_runtime_error (msg);
+    }
+}
+
+
+/* ERROR STOP the other images.  */
+
+static void
+error_stop (int error)
+{
+  /* FIXME: Shutdown the Fortran RTL to flush the buffer.  PR 43849.  */
+  /* FIXME: Do some more effort than just MPI_ABORT.  */
+  MPI_Abort (MPI_COMM_WORLD, error);
+
+  /* Should be unreachable, but to make sure also call exit.  */
+  exit (error);
+}
+
+
+/* ERROR STOP function for string arguments.  */
+
+void
+_gfortran_caf_error_stop_str (const char *string, int32_t len)
+{
+  fputs ("ERROR STOP ", stderr);
+  while (len--)
+    fputc (*(string++), stderr);
+  fputs ("\n", stderr);
+
+  error_stop (1);
+}
+
+
+/* ERROR STOP function for numerical arguments.  */
+
+void
+_gfortran_caf_error_stop (int32_t error)
+{
+  fprintf (stderr, "ERROR STOP %d\n", error);
+  error_stop (error);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/caf/single.c b/l4/pkg/libgfortran/lib/contrib/caf/single.c
new file mode 100644 (file)
index 0000000..4242fad
--- /dev/null
@@ -0,0 +1,191 @@
+/* Single-image implementation of GNU Fortran Coarray Library
+   Copyright (C) 2011, 2012
+   Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran Coarray Runtime Library (libcaf).
+
+Libcaf is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libcaf 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libcaf.h"
+#include <stdio.h>  /* For fputs and fprintf.  */
+#include <stdlib.h> /* For exit and malloc.  */
+#include <string.h> /* For memcpy and memset.  */
+#include <stdarg.h> /* For variadic arguments.  */
+
+/* Define GFC_CAF_CHECK to enable run-time checking.  */
+/* #define GFC_CAF_CHECK  1  */
+
+/* Single-image implementation of the CAF library.
+   Note: For performance reasons -fcoarry=single should be used
+   rather than this library.  */
+
+/* Global variables.  */
+caf_static_t *caf_static_list = NULL;
+
+
+/* Keep in sync with mpi.c.  */
+static void
+caf_runtime_error (const char *message, ...)
+{
+  va_list ap;
+  fprintf (stderr, "Fortran runtime error: ");
+  va_start (ap, message);
+  vfprintf (stderr, message, ap);
+  va_end (ap);
+  fprintf (stderr, "\n");
+
+  /* FIXME: Shutdown the Fortran RTL to flush the buffer.  PR 43849.  */
+  exit (EXIT_FAILURE);
+}
+
+void
+_gfortran_caf_init (int *argc __attribute__ ((unused)),
+                   char ***argv __attribute__ ((unused)),
+                   int *this_image, int *num_images)
+{
+  *this_image = 1;
+  *num_images = 1;
+}
+
+
+void
+_gfortran_caf_finalize (void)
+{
+  while (caf_static_list != NULL)
+    {
+      caf_static_t *tmp = caf_static_list->prev;
+      free (caf_static_list->token[0]);
+      free (caf_static_list->token);
+      free (caf_static_list);
+      caf_static_list = tmp;
+    }
+}
+
+
+void *
+_gfortran_caf_register (ptrdiff_t size, caf_register_t type, void ***token,
+                       int *stat, char *errmsg, int errmsg_len)
+{
+  void *local;
+
+  local = malloc (size);
+  *token = malloc (sizeof (void*) * 1);
+  (*token)[0] = local;
+
+  if (unlikely (local == NULL || token == NULL))
+    {
+      const char msg[] = "Failed to allocate coarray";
+      if (stat)
+       {
+         *stat = 1;
+         if (errmsg_len > 0)
+           {
+             int len = ((int) sizeof (msg) > errmsg_len) ? errmsg_len
+                                                         : (int) sizeof (msg);
+             memcpy (errmsg, msg, len);
+             if (errmsg_len > len)
+               memset (&errmsg[len], ' ', errmsg_len-len);
+           }
+         return NULL;
+       }
+      else
+         caf_runtime_error (msg);
+    }
+
+  if (stat)
+    *stat = 0;
+
+  if (type == CAF_REGTYPE_COARRAY_STATIC)
+    {
+      caf_static_t *tmp = malloc (sizeof (caf_static_t));
+      tmp->prev  = caf_static_list;
+      tmp->token = *token;
+      caf_static_list = tmp;
+    }
+  return local;
+}
+
+
+void
+_gfortran_caf_deregister (void ***token, int *stat,
+                         char *errmsg __attribute__ ((unused)),
+                         int errmsg_len __attribute__ ((unused)))
+{
+  free ((*token)[0]);
+  free (*token);
+
+  if (stat)
+    *stat = 0;
+}
+
+
+void
+_gfortran_caf_sync_all (int *stat,
+                       char *errmsg __attribute__ ((unused)),
+                       int errmsg_len __attribute__ ((unused)))
+{
+  if (stat)
+    *stat = 0;
+}
+
+
+void
+_gfortran_caf_sync_images (int count __attribute__ ((unused)),
+                          int images[] __attribute__ ((unused)),
+                          int *stat,
+                          char *errmsg __attribute__ ((unused)),
+                          int errmsg_len __attribute__ ((unused)))
+{
+#ifdef GFC_CAF_CHECK
+  int i;
+
+  for (i = 0; i < count; i++)
+    if (images[i] != 1)
+      {
+       fprintf (stderr, "COARRAY ERROR: Invalid image index %d to SYNC "
+                "IMAGES", images[i]);
+       exit (EXIT_FAILURE);
+      }
+#endif
+
+  if (stat)
+    *stat = 0;
+}
+
+
+void
+_gfortran_caf_error_stop_str (const char *string, int32_t len)
+{
+  fputs ("ERROR STOP ", stderr);
+  while (len--)
+    fputc (*(string++), stderr);
+  fputs ("\n", stderr);
+
+  exit (1);
+}
+
+
+void
+_gfortran_caf_error_stop (int32_t error)
+{
+  fprintf (stderr, "ERROR STOP %d\n", error);
+  exit (error);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/config.h.in b/l4/pkg/libgfortran/lib/contrib/config.h.in
new file mode 100644 (file)
index 0000000..3739309
--- /dev/null
@@ -0,0 +1,924 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 0 if the target shouldn't use #pragma weak */
+#undef GTHREAD_USE_WEAK
+
+/* Define to 1 if you have the `access' function. */
+#undef HAVE_ACCESS
+
+/* libm includes acos */
+#undef HAVE_ACOS
+
+/* libm includes acosf */
+#undef HAVE_ACOSF
+
+/* libm includes acosh */
+#undef HAVE_ACOSH
+
+/* libm includes acoshf */
+#undef HAVE_ACOSHF
+
+/* libm includes acoshl */
+#undef HAVE_ACOSHL
+
+/* libm includes acosl */
+#undef HAVE_ACOSL
+
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
+
+/* libm includes asin */
+#undef HAVE_ASIN
+
+/* libm includes asinf */
+#undef HAVE_ASINF
+
+/* libm includes asinh */
+#undef HAVE_ASINH
+
+/* libm includes asinhf */
+#undef HAVE_ASINHF
+
+/* libm includes asinhl */
+#undef HAVE_ASINHL
+
+/* libm includes asinl */
+#undef HAVE_ASINL
+
+/* libm includes atan */
+#undef HAVE_ATAN
+
+/* libm includes atan2 */
+#undef HAVE_ATAN2
+
+/* libm includes atan2f */
+#undef HAVE_ATAN2F
+
+/* libm includes atan2l */
+#undef HAVE_ATAN2L
+
+/* libm includes atanf */
+#undef HAVE_ATANF
+
+/* libm includes atanh */
+#undef HAVE_ATANH
+
+/* libm includes atanhf */
+#undef HAVE_ATANHF
+
+/* libm includes atanhl */
+#undef HAVE_ATANHL
+
+/* libm includes atanl */
+#undef HAVE_ATANL
+
+/* Define to 1 if the target supports __attribute__((alias(...))). */
+#undef HAVE_ATTRIBUTE_ALIAS
+
+/* Define to 1 if the target supports __attribute__((dllexport)). */
+#undef HAVE_ATTRIBUTE_DLLEXPORT
+
+/* Define to 1 if the target supports __attribute__((visibility(...))). */
+#undef HAVE_ATTRIBUTE_VISIBILITY
+
+/* Define if powf is broken. */
+#undef HAVE_BROKEN_POWF
+
+/* libm includes cabs */
+#undef HAVE_CABS
+
+/* libm includes cabsf */
+#undef HAVE_CABSF
+
+/* libm includes cabsl */
+#undef HAVE_CABSL
+
+/* libm includes cacos */
+#undef HAVE_CACOS
+
+/* libm includes cacosf */
+#undef HAVE_CACOSF
+
+/* libm includes cacosh */
+#undef HAVE_CACOSH
+
+/* libm includes cacoshf */
+#undef HAVE_CACOSHF
+
+/* libm includes cacoshl */
+#undef HAVE_CACOSHL
+
+/* libm includes cacosl */
+#undef HAVE_CACOSL
+
+/* libm includes carg */
+#undef HAVE_CARG
+
+/* libm includes cargf */
+#undef HAVE_CARGF
+
+/* libm includes cargl */
+#undef HAVE_CARGL
+
+/* libm includes casin */
+#undef HAVE_CASIN
+
+/* libm includes casinf */
+#undef HAVE_CASINF
+
+/* libm includes casinh */
+#undef HAVE_CASINH
+
+/* libm includes casinhf */
+#undef HAVE_CASINHF
+
+/* libm includes casinhl */
+#undef HAVE_CASINHL
+
+/* libm includes casinl */
+#undef HAVE_CASINL
+
+/* libm includes catan */
+#undef HAVE_CATAN
+
+/* libm includes catanf */
+#undef HAVE_CATANF
+
+/* libm includes catanh */
+#undef HAVE_CATANH
+
+/* libm includes catanhf */
+#undef HAVE_CATANHF
+
+/* libm includes catanhl */
+#undef HAVE_CATANHL
+
+/* libm includes catanl */
+#undef HAVE_CATANL
+
+/* libm includes ccos */
+#undef HAVE_CCOS
+
+/* libm includes ccosf */
+#undef HAVE_CCOSF
+
+/* libm includes ccosh */
+#undef HAVE_CCOSH
+
+/* libm includes ccoshf */
+#undef HAVE_CCOSHF
+
+/* libm includes ccoshl */
+#undef HAVE_CCOSHL
+
+/* libm includes ccosl */
+#undef HAVE_CCOSL
+
+/* libm includes ceil */
+#undef HAVE_CEIL
+
+/* libm includes ceilf */
+#undef HAVE_CEILF
+
+/* libm includes ceill */
+#undef HAVE_CEILL
+
+/* libm includes cexp */
+#undef HAVE_CEXP
+
+/* libm includes cexpf */
+#undef HAVE_CEXPF
+
+/* libm includes cexpl */
+#undef HAVE_CEXPL
+
+/* Define to 1 if you have the `chdir' function. */
+#undef HAVE_CHDIR
+
+/* Define to 1 if you have the `chsize' function. */
+#undef HAVE_CHSIZE
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the `clock_gettime' function in librt. */
+#undef HAVE_CLOCK_GETTIME_LIBRT
+
+/* libm includes clog */
+#undef HAVE_CLOG
+
+/* libm includes clog10 */
+#undef HAVE_CLOG10
+
+/* libm includes clog10f */
+#undef HAVE_CLOG10F
+
+/* libm includes clog10l */
+#undef HAVE_CLOG10L
+
+/* libm includes clogf */
+#undef HAVE_CLOGF
+
+/* libm includes clogl */
+#undef HAVE_CLOGL
+
+/* Define to 1 if you have the `close' function. */
+#undef HAVE_CLOSE
+
+/* Define to 1 if you have the <complex.h> header file. */
+#undef HAVE_COMPLEX_H
+
+/* libm includes copysign */
+#undef HAVE_COPYSIGN
+
+/* libm includes copysignf */
+#undef HAVE_COPYSIGNF
+
+/* libm includes copysignl */
+#undef HAVE_COPYSIGNL
+
+/* libm includes cos */
+#undef HAVE_COS
+
+/* libm includes cosf */
+#undef HAVE_COSF
+
+/* libm includes cosh */
+#undef HAVE_COSH
+
+/* libm includes coshf */
+#undef HAVE_COSHF
+
+/* libm includes coshl */
+#undef HAVE_COSHL
+
+/* libm includes cosl */
+#undef HAVE_COSL
+
+/* libm includes cpow */
+#undef HAVE_CPOW
+
+/* libm includes cpowf */
+#undef HAVE_CPOWF
+
+/* libm includes cpowl */
+#undef HAVE_CPOWL
+
+/* Define if CRLF is line terminator. */
+#undef HAVE_CRLF
+
+/* libm includes csin */
+#undef HAVE_CSIN
+
+/* libm includes csinf */
+#undef HAVE_CSINF
+
+/* libm includes csinh */
+#undef HAVE_CSINH
+
+/* libm includes csinhf */
+#undef HAVE_CSINHF
+
+/* libm includes csinhl */
+#undef HAVE_CSINHL
+
+/* libm includes csinl */
+#undef HAVE_CSINL
+
+/* libm includes csqrt */
+#undef HAVE_CSQRT
+
+/* libm includes csqrtf */
+#undef HAVE_CSQRTF
+
+/* libm includes csqrtl */
+#undef HAVE_CSQRTL
+
+/* libm includes ctan */
+#undef HAVE_CTAN
+
+/* libm includes ctanf */
+#undef HAVE_CTANF
+
+/* libm includes ctanh */
+#undef HAVE_CTANH
+
+/* libm includes ctanhf */
+#undef HAVE_CTANHF
+
+/* libm includes ctanhl */
+#undef HAVE_CTANHL
+
+/* libm includes ctanl */
+#undef HAVE_CTANL
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `dup' function. */
+#undef HAVE_DUP
+
+/* Define to 1 if you have the `dup2' function. */
+#undef HAVE_DUP2
+
+/* libm includes erf */
+#undef HAVE_ERF
+
+/* libm includes erfc */
+#undef HAVE_ERFC
+
+/* libm includes erfcf */
+#undef HAVE_ERFCF
+
+/* libm includes erfcl */
+#undef HAVE_ERFCL
+
+/* libm includes erff */
+#undef HAVE_ERFF
+
+/* libm includes erfl */
+#undef HAVE_ERFL
+
+/* Define to 1 if you have the `execl' function. */
+#undef HAVE_EXECL
+
+/* Define to 1 if you have the `execve' function. */
+#undef HAVE_EXECVE
+
+/* libm includes exp */
+#undef HAVE_EXP
+
+/* libm includes expf */
+#undef HAVE_EXPF
+
+/* libm includes expl */
+#undef HAVE_EXPL
+
+/* libm includes fabs */
+#undef HAVE_FABS
+
+/* libm includes fabsf */
+#undef HAVE_FABSF
+
+/* libm includes fabsl */
+#undef HAVE_FABSL
+
+/* libm includes feenableexcept */
+#undef HAVE_FEENABLEEXCEPT
+
+/* Define to 1 if you have the <fenv.h> header file. */
+#undef HAVE_FENV_H
+
+/* Define if have a usable __float128 type. */
+#undef HAVE_FLOAT128
+
+/* Define to 1 if you have the <floatingpoint.h> header file. */
+#undef HAVE_FLOATINGPOINT_H
+
+/* libm includes floor */
+#undef HAVE_FLOOR
+
+/* libm includes floorf */
+#undef HAVE_FLOORF
+
+/* libm includes floorl */
+#undef HAVE_FLOORL
+
+/* libm includes fmod */
+#undef HAVE_FMOD
+
+/* libm includes fmodf */
+#undef HAVE_FMODF
+
+/* libm includes fmodl */
+#undef HAVE_FMODL
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define if you have fpsetmask. */
+#undef HAVE_FPSETMASK
+
+/* Define to 1 if you have the <fptrap.h> header file. */
+#undef HAVE_FPTRAP_H
+
+/* fp_enable is present */
+#undef HAVE_FP_ENABLE
+
+/* fp_trap is present */
+#undef HAVE_FP_TRAP
+
+/* libm includes frexp */
+#undef HAVE_FREXP
+
+/* libm includes frexpf */
+#undef HAVE_FREXPF
+
+/* libm includes frexpl */
+#undef HAVE_FREXPL
+
+/* Define to 1 if you have the `fstat' function. */
+#undef HAVE_FSTAT
+
+/* Define to 1 if you have the `ftruncate' function. */
+#undef HAVE_FTRUNCATE
+
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
+
+/* Define to 1 if you have the `getgid' function. */
+#undef HAVE_GETGID
+
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
+/* Define if _Unwind_GetIPInfo is available. */
+#undef HAVE_GETIPINFO
+
+/* Define to 1 if you have the `getlogin' function. */
+#undef HAVE_GETLOGIN
+
+/* Define to 1 if you have the `getpid' function. */
+#undef HAVE_GETPID
+
+/* Define to 1 if you have the `getppid' function. */
+#undef HAVE_GETPPID
+
+/* Define to 1 if you have the `getpwuid' function. */
+#undef HAVE_GETPWUID
+
+/* Define to 1 if you have the `getpwuid_r' function. */
+#undef HAVE_GETPWUID_R
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#undef HAVE_GMTIME_R
+
+/* libm includes hypot */
+#undef HAVE_HYPOT
+
+/* libm includes hypotf */
+#undef HAVE_HYPOTF
+
+/* libm includes hypotl */
+#undef HAVE_HYPOTL
+
+/* Define to 1 if you have the <ieeefp.h> header file. */
+#undef HAVE_IEEEFP_H
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#undef HAVE_INTPTR_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* libm includes j0 */
+#undef HAVE_J0
+
+/* libm includes j0f */
+#undef HAVE_J0F
+
+/* libm includes j0l */
+#undef HAVE_J0L
+
+/* libm includes j1 */
+#undef HAVE_J1
+
+/* libm includes j1f */
+#undef HAVE_J1F
+
+/* libm includes j1l */
+#undef HAVE_J1L
+
+/* libm includes jn */
+#undef HAVE_JN
+
+/* libm includes jnf */
+#undef HAVE_JNF
+
+/* libm includes jnl */
+#undef HAVE_JNL
+
+/* Define to 1 if you have the `kill' function. */
+#undef HAVE_KILL
+
+/* libm includes ldexp */
+#undef HAVE_LDEXP
+
+/* libm includes ldexpf */
+#undef HAVE_LDEXPF
+
+/* libm includes ldexpl */
+#undef HAVE_LDEXPL
+
+/* libm includes lgamma */
+#undef HAVE_LGAMMA
+
+/* libm includes lgammaf */
+#undef HAVE_LGAMMAF
+
+/* libm includes lgammal */
+#undef HAVE_LGAMMAL
+
+/* Define to 1 if you have the `link' function. */
+#undef HAVE_LINK
+
+/* libm includes llround */
+#undef HAVE_LLROUND
+
+/* libm includes llroundf */
+#undef HAVE_LLROUNDF
+
+/* libm includes llroundl */
+#undef HAVE_LLROUNDL
+
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
+/* libm includes log */
+#undef HAVE_LOG
+
+/* libm includes log10 */
+#undef HAVE_LOG10
+
+/* libm includes log10f */
+#undef HAVE_LOG10F
+
+/* libm includes log10l */
+#undef HAVE_LOG10L
+
+/* libm includes logf */
+#undef HAVE_LOGF
+
+/* libm includes logl */
+#undef HAVE_LOGL
+
+/* libm includes lround */
+#undef HAVE_LROUND
+
+/* libm includes lroundf */
+#undef HAVE_LROUNDF
+
+/* libm includes lroundl */
+#undef HAVE_LROUNDL
+
+/* Define to 1 if you have the `lstat' function. */
+#undef HAVE_LSTAT
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have __mingw_snprintf. */
+#undef HAVE_MINGW_SNPRINTF
+
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* libm includes nextafter */
+#undef HAVE_NEXTAFTER
+
+/* libm includes nextafterf */
+#undef HAVE_NEXTAFTERF
+
+/* libm includes nextafterl */
+#undef HAVE_NEXTAFTERL
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if we have POSIX getpwuid_r which takes 5 arguments. */
+#undef HAVE_POSIX_GETPWUID_R
+
+/* libm includes pow */
+#undef HAVE_POW
+
+/* libm includes powf */
+#undef HAVE_POWF
+
+/* libm includes powl */
+#undef HAVE_POWL
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#undef HAVE_PTRDIFF_T
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* Define to 1 if you have the `readlink' function. */
+#undef HAVE_READLINK
+
+/* libm includes round */
+#undef HAVE_ROUND
+
+/* libm includes roundf */
+#undef HAVE_ROUNDF
+
+/* libm includes roundl */
+#undef HAVE_ROUNDL
+
+/* libm includes scalbn */
+#undef HAVE_SCALBN
+
+/* libm includes scalbnf */
+#undef HAVE_SCALBNF
+
+/* libm includes scalbnl */
+#undef HAVE_SCALBNL
+
+/* Define to 1 if you have the `setmode' function. */
+#undef HAVE_SETMODE
+
+/* libm includes sin */
+#undef HAVE_SIN
+
+/* libm includes sinf */
+#undef HAVE_SINF
+
+/* libm includes sinh */
+#undef HAVE_SINH
+
+/* libm includes sinhf */
+#undef HAVE_SINHF
+
+/* libm includes sinhl */
+#undef HAVE_SINHL
+
+/* libm includes sinl */
+#undef HAVE_SINL
+
+/* Define to 1 if you have the `sleep' function. */
+#undef HAVE_SLEEP
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* libm includes sqrt */
+#undef HAVE_SQRT
+
+/* libm includes sqrtf */
+#undef HAVE_SQRTF
+
+/* libm includes sqrtl */
+#undef HAVE_SQRTL
+
+/* Define to 1 if you have the `stat' function. */
+#undef HAVE_STAT
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasestr' function. */
+#undef HAVE_STRCASESTR
+
+/* Define to 1 if you have the `strerror_r' function. */
+#undef HAVE_STRERROR_R
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strtof' function. */
+#undef HAVE_STRTOF
+
+/* Define to 1 if you have the `strtold' function. */
+#undef HAVE_STRTOLD
+
+/* Define to 1 if `struct stat' is a member of `st_blksize'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `struct stat' is a member of `st_blocks'. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
+
+/* Define to 1 if `struct stat' is a member of `st_rdev'. */
+#undef HAVE_STRUCT_STAT_ST_RDEV
+
+/* Define to 1 if you have the `symlink' function. */
+#undef HAVE_SYMLINK
+
+/* Define to 1 if the target supports __sync_fetch_and_add */
+#undef HAVE_SYNC_FETCH_AND_ADD
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+#undef HAVE_SYS_TIMES_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* libm includes tan */
+#undef HAVE_TAN
+
+/* libm includes tanf */
+#undef HAVE_TANF
+
+/* libm includes tanh */
+#undef HAVE_TANH
+
+/* libm includes tanhf */
+#undef HAVE_TANHF
+
+/* libm includes tanhl */
+#undef HAVE_TANHL
+
+/* libm includes tanl */
+#undef HAVE_TANL
+
+/* libm includes tgamma */
+#undef HAVE_TGAMMA
+
+/* libm includes tgammaf */
+#undef HAVE_TGAMMAF
+
+/* libm includes tgammal */
+#undef HAVE_TGAMMAL
+
+/* Define to 1 if you have the `times' function. */
+#undef HAVE_TIMES
+
+/* libm includes trunc */
+#undef HAVE_TRUNC
+
+/* libm includes truncf */
+#undef HAVE_TRUNCF
+
+/* libm includes truncl */
+#undef HAVE_TRUNCL
+
+/* Define to 1 if you have the `ttyname' function. */
+#undef HAVE_TTYNAME
+
+/* Define to 1 if you have the `ttyname_r' function. */
+#undef HAVE_TTYNAME_R
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#undef HAVE_UINTPTR_T
+
+/* Define to 1 if you have the `umask' function. */
+#undef HAVE_UMASK
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if target can unlink open files. */
+#undef HAVE_UNLINK_OPEN_FILE
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 if you have the `wait' function. */
+#undef HAVE_WAIT
+
+/* Define if target has a reliable stat. */
+#undef HAVE_WORKING_STAT
+
+/* libm includes y0 */
+#undef HAVE_Y0
+
+/* libm includes y0f */
+#undef HAVE_Y0F
+
+/* libm includes y0l */
+#undef HAVE_Y0L
+
+/* libm includes y1 */
+#undef HAVE_Y1
+
+/* libm includes y1f */
+#undef HAVE_Y1F
+
+/* libm includes y1l */
+#undef HAVE_Y1L
+
+/* libm includes yn */
+#undef HAVE_YN
+
+/* libm includes ynf */
+#undef HAVE_YNF
+
+/* libm includes ynl */
+#undef HAVE_YNL
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of `char', as computed by sizeof. */
+#undef SIZEOF_CHAR
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if the target supports #pragma weak */
+#undef SUPPORTS_WEAK
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to the type of a signed integer type wide enough to hold a pointer,
+   if such a type exists, and if the system does not define it. */
+#undef intptr_t
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to the type of an unsigned integer type wide enough to hold a
+   pointer, if such a type exists, and if the system does not define it. */
+#undef uintptr_t
diff --git a/l4/pkg/libgfortran/lib/contrib/config/fpu-387.h b/l4/pkg/libgfortran/lib/contrib/config/fpu-387.h
new file mode 100644 (file)
index 0000000..d2b7a05
--- /dev/null
@@ -0,0 +1,136 @@
+/* FPU-related code for x86 and x86_64 processors.
+   Copyright 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef __x86_64__
+#include "cpuid.h"
+#endif
+
+#if defined(__sun__) && defined(__svr4__)
+#include <signal.h>
+#include <ucontext.h>
+
+static volatile sig_atomic_t sigill_caught;
+
+static void
+sigill_hdlr (int sig __attribute((unused)),
+            siginfo_t *sip __attribute__((unused)),
+            ucontext_t *ucp)
+{
+  sigill_caught = 1;
+  /* Set PC to the instruction after the faulting one to skip over it,
+     otherwise we enter an infinite loop.  3 is the size of the movaps
+     instruction.  */
+  ucp->uc_mcontext.gregs[EIP] += 3;
+  setcontext (ucp);
+}
+#endif
+
+static int
+has_sse (void)
+{
+#ifndef __x86_64__
+  unsigned int eax, ebx, ecx, edx;
+
+  if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+    return 0;
+
+#if defined(__sun__) && defined(__svr4__)
+  /* Solaris 2 before Solaris 9 4/04 cannot execute SSE instructions even
+     if the CPU supports them.  Programs receive SIGILL instead, so check
+     for that at runtime.  */
+
+  if (edx & bit_SSE)
+    {
+      struct sigaction act, oact;
+
+      act.sa_handler = sigill_hdlr;
+      sigemptyset (&act.sa_mask);
+      /* Need to set SA_SIGINFO so a ucontext_t * is passed to the handler.  */
+      act.sa_flags = SA_SIGINFO;
+      sigaction (SIGILL, &act, &oact);
+
+      /* We need a single SSE instruction here so the handler can safely skip
+        over it.  */
+      __asm__ volatile ("movaps %xmm0,%xmm0");
+
+      sigaction (SIGILL, &oact, NULL);
+
+      if (sigill_caught)
+       return 0;
+    }
+#endif /* __sun__ && __svr4__ */
+
+  return edx & bit_SSE;
+#else
+  return 1;
+#endif
+}
+
+/* i387 -- see linux <fpu_control.h> header file for details.  */
+#define _FPU_MASK_IM  0x01
+#define _FPU_MASK_DM  0x02
+#define _FPU_MASK_ZM  0x04
+#define _FPU_MASK_OM  0x08
+#define _FPU_MASK_UM  0x10
+#define _FPU_MASK_PM  0x20
+
+void set_fpu (void)
+{
+  unsigned short cw;
+
+  asm volatile ("fnstcw %0" : "=m" (cw));
+
+  cw |= (_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM
+        | _FPU_MASK_UM | _FPU_MASK_PM);
+
+  if (options.fpe & GFC_FPE_INVALID) cw &= ~_FPU_MASK_IM;
+  if (options.fpe & GFC_FPE_DENORMAL) cw &= ~_FPU_MASK_DM;
+  if (options.fpe & GFC_FPE_ZERO) cw &= ~_FPU_MASK_ZM;
+  if (options.fpe & GFC_FPE_OVERFLOW) cw &= ~_FPU_MASK_OM;
+  if (options.fpe & GFC_FPE_UNDERFLOW) cw &= ~_FPU_MASK_UM;
+  if (options.fpe & GFC_FPE_INEXACT) cw &= ~_FPU_MASK_PM;
+
+  asm volatile ("fldcw %0" : : "m" (cw));
+
+  if (has_sse())
+    {
+      unsigned int cw_sse;
+
+      asm volatile ("%vstmxcsr %0" : "=m" (cw_sse));
+
+      cw_sse &= 0xffff0000;
+      cw_sse |= (_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM
+                | _FPU_MASK_UM | _FPU_MASK_PM ) << 7;
+
+      if (options.fpe & GFC_FPE_INVALID) cw_sse &= ~(_FPU_MASK_IM << 7);
+      if (options.fpe & GFC_FPE_DENORMAL) cw_sse &= ~(_FPU_MASK_DM << 7);
+      if (options.fpe & GFC_FPE_ZERO) cw_sse &= ~(_FPU_MASK_ZM << 7);
+      if (options.fpe & GFC_FPE_OVERFLOW) cw_sse &= ~(_FPU_MASK_OM << 7);
+      if (options.fpe & GFC_FPE_UNDERFLOW) cw_sse &= ~(_FPU_MASK_UM << 7);
+      if (options.fpe & GFC_FPE_INEXACT) cw_sse &= ~(_FPU_MASK_PM << 7);
+
+      asm volatile ("%vldmxcsr %0" : : "m" (cw_sse));
+    }
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/config/fpu-aix.h b/l4/pkg/libgfortran/lib/contrib/config/fpu-aix.h
new file mode 100644 (file)
index 0000000..1348976
--- /dev/null
@@ -0,0 +1,83 @@
+/* AIX FPU-related code.
+   Copyright 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* FPU-related code for AIX.  */
+#ifdef HAVE_FPTRAP_H
+#include <fptrap.h>
+#endif
+
+void
+set_fpu (void)
+{
+  fptrap_t mode = 0;
+
+  if (options.fpe & GFC_FPE_INVALID)
+#ifdef TRP_INVALID
+    mode |= TRP_INVALID;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'invalid operation' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_DENORMAL)
+    estr_write ("Fortran runtime warning: Floating point 'denormal operand' "
+               "exception not supported.\n");
+
+  if (options.fpe & GFC_FPE_ZERO)
+#ifdef TRP_DIV_BY_ZERO
+    mode |= TRP_DIV_BY_ZERO;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'division by zero' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_OVERFLOW)
+#ifdef TRP_OVERFLOW
+    mode |= TRP_OVERFLOW;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'overflow' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_UNDERFLOW)
+#ifdef TRP_UNDERFLOW
+    mode |= TRP_UNDERFLOW;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'underflow' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_INEXACT)
+#ifdef TRP_INEXACT
+    mode |= TRP_INEXACT;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'inexact' "
+               "exception not supported.\n");
+#endif
+
+  fp_trap(FP_TRAP_SYNC);
+  fp_enable(mode);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/config/fpu-generic.h b/l4/pkg/libgfortran/lib/contrib/config/fpu-generic.h
new file mode 100644 (file)
index 0000000..b64f90c
--- /dev/null
@@ -0,0 +1,52 @@
+/* Fallback FPU-related code (for systems not otherwise supported).
+   Copyright 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* Fallback FPU-related code for systems not otherwise supported. This
+   is mainly telling the user that we will not be able to do what he
+   requested.  */
+
+void
+set_fpu (void)
+{
+  if (options.fpe & GFC_FPE_INVALID)
+    estr_write ("Fortran runtime warning: IEEE 'invalid operation' "
+               "exception not supported.\n");
+  if (options.fpe & GFC_FPE_DENORMAL)
+    estr_write ("Fortran runtime warning: Floating point 'denormal operand' "
+               "exception not supported.\n");
+  if (options.fpe & GFC_FPE_ZERO)
+    estr_write ("Fortran runtime warning: IEEE 'division by zero' "
+               "exception not supported.\n");
+  if (options.fpe & GFC_FPE_OVERFLOW)
+    estr_write ("Fortran runtime warning: IEEE 'overflow' "
+               "exception not supported.\n");
+  if (options.fpe & GFC_FPE_UNDERFLOW)
+    estr_write ("Fortran runtime warning: IEEE 'underflow' "
+               "exception not supported.\n");
+  if (options.fpe & GFC_FPE_INEXACT)
+    estr_write ("Fortran runtime warning: IEEE 'inexact' "
+               "exception not supported.\n");
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/config/fpu-glibc.h b/l4/pkg/libgfortran/lib/contrib/config/fpu-glibc.h
new file mode 100644 (file)
index 0000000..7bdb7b7
--- /dev/null
@@ -0,0 +1,87 @@
+/* FPU-related code for systems with GNU libc.
+   Copyright 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* FPU-related code for systems with the GNU libc, providing the
+   feenableexcept function in fenv.h to set individual exceptions
+   (there's nothing to do that in C99).  */
+
+#ifdef HAVE_FENV_H
+#include <fenv.h>
+#endif
+
+void set_fpu (void)
+{
+  if (FE_ALL_EXCEPT != 0)
+    fedisableexcept (FE_ALL_EXCEPT);
+
+  if (options.fpe & GFC_FPE_INVALID)
+#ifdef FE_INVALID
+    feenableexcept (FE_INVALID);
+#else
+    estr_write ("Fortran runtime warning: IEEE 'invalid operation' "
+               "exception not supported.\n");
+#endif
+
+/* glibc does never have a FE_DENORMAL.  */
+  if (options.fpe & GFC_FPE_DENORMAL)
+#ifdef FE_DENORMAL
+    feenableexcept (FE_DENORMAL);
+#else
+    estr_write ("Fortran runtime warning: Floating point 'denormal operand' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_ZERO)
+#ifdef FE_DIVBYZERO
+    feenableexcept (FE_DIVBYZERO);
+#else
+    estr_write ("Fortran runtime warning: IEEE 'division by zero' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_OVERFLOW)
+#ifdef FE_OVERFLOW
+    feenableexcept (FE_OVERFLOW);
+#else
+    estr_write ("Fortran runtime warning: IEEE 'overflow' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_UNDERFLOW)
+#ifdef FE_UNDERFLOW
+    feenableexcept (FE_UNDERFLOW);
+#else
+    estr_write ("Fortran runtime warning: IEEE 'underflow' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_INEXACT)
+#ifdef FE_INEXACT
+    feenableexcept (FE_INEXACT);
+#else
+    estr_write ("Fortran runtime warning: IEEE 'inexact' "
+               "exception not supported.\n");
+#endif
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/config/fpu-sysv.h b/l4/pkg/libgfortran/lib/contrib/config/fpu-sysv.h
new file mode 100644 (file)
index 0000000..8838f13
--- /dev/null
@@ -0,0 +1,82 @@
+/* SysV FPU-related code (for systems not otherwise supported).
+   Copyright 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* FPU-related code for SysV platforms with fpsetmask().  */
+
+void
+set_fpu (void)
+{
+  int cw = 0;
+
+  if (options.fpe & GFC_FPE_INVALID)
+#ifdef FP_X_INV
+    cw |= FP_X_INV;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'invalid operation' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_DENORMAL)
+#ifdef FP_X_DNML
+    cw |= FP_X_DNML;
+#else
+    estr_write ("Fortran runtime warning: Floating point 'denormal operand' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_ZERO)
+#ifdef FP_X_DZ
+    cw |= FP_X_DZ;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'division by zero' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_OVERFLOW)
+#ifdef FP_X_OFL
+    cw |= FP_X_OFL;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'overflow' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_UNDERFLOW)
+#ifdef FP_X_UFL
+    cw |= FP_X_UFL;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'underflow' "
+               "exception not supported.\n");
+#endif
+
+  if (options.fpe & GFC_FPE_INEXACT)
+#ifdef FP_X_IMP
+    cw |= FP_X_IMP;
+#else
+    estr_write ("Fortran runtime warning: IEEE 'inexact' "
+               "exception not supported.\n");
+#endif
+
+  fpsetmask(cw);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/configure b/l4/pkg/libgfortran/lib/contrib/configure
new file mode 100755 (executable)
index 0000000..227f556
--- /dev/null
@@ -0,0 +1,28867 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.64 for GNU Fortran Runtime Library 0.3.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+# Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='GNU Fortran Runtime Library'
+PACKAGE_TARNAME='libgfortran'
+PACKAGE_VERSION='0.3'
+PACKAGE_STRING='GNU Fortran Runtime Library 0.3'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL='http://www.gnu.org/software/libgfortran/'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+ac_func_list=
+ac_c_werror_flag=
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+IEEE_FLAGS
+FPU_HOST_HEADER
+LIBGFOR_BUILD_QUAD_FALSE
+LIBGFOR_BUILD_QUAD_TRUE
+LIBQUADINCLUDE
+LIBQUADLIB_DEP
+LIBQUADLIB
+LIBQUADSPEC
+extra_ldflags_libgfortran
+ac_ct_FC
+FCFLAGS
+FC
+enable_static
+enable_shared
+lt_host_flags
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
+LIBTOOL
+RANLIB
+AR
+AS
+SECTION_FLAGS
+LIBGFOR_USE_SYMVER_SUN_FALSE
+LIBGFOR_USE_SYMVER_SUN_TRUE
+LIBGFOR_USE_SYMVER_GNU_FALSE
+LIBGFOR_USE_SYMVER_GNU_TRUE
+LIBGFOR_USE_SYMVER_FALSE
+LIBGFOR_USE_SYMVER_TRUE
+AM_CFLAGS
+AM_FCFLAGS
+toolexeclibdir
+toolexecdir
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+multi_basedir
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_noncanonical
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+onestep
+onestep_FALSE
+onestep_TRUE
+target_subdir
+host_subdir
+build_subdir
+build_libsubdir
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_build_libsubdir
+enable_version_specific_runtime_libs
+enable_intermodule
+enable_maintainer_mode
+enable_multilib
+enable_dependency_tracking
+enable_symvers
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+enable_largefile
+enable_libquadmath_support
+with_system_libunwind
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+FC
+FCFLAGS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures GNU Fortran Runtime Library 0.3 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/libgfortran]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of GNU Fortran Runtime Library 0.3:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-version-specific-runtime-libs
+                          specify that runtime libraries should be installed
+                          in a compiler-specific directory
+  --enable-intermodule    build the library in one step
+  --enable-maintainer-mode  enable make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer
+  --enable-multilib       build many library versions (default)
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --disable-symvers       disable symbol versioning for libgfortran
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --disable-largefile     omit support for large files
+  --disable-libquadmath-support
+                          disable libquadmath support for Fortran
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-build-libsubdir=DIR  Directory where to find libraries for build system
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-system-libunwind use installed libunwind
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  FC          Fortran compiler command
+  FCFLAGS     Fortran compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+GNU Fortran Runtime Library home page: <http://www.gnu.org/software/libgfortran/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+GNU Fortran Runtime Library configure 0.3
+generated by GNU Autoconf 2.64
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+
+# ac_fn_fc_try_compile LINENO
+# ---------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_fc_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_fc_try_compile
+
+# ac_fn_fc_try_link LINENO
+# ------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_fc_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_fc_try_link
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+        return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+           return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if test "$cross_compiling" = yes; then
+    # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid; break
+else
+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=$ac_mid; break
+else
+  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid
+else
+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (($2) < 0)
+    {
+      long int i = longval ();
+      if (i != ($2))
+       return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ($2))
+       return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+  ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+  fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_compute_int
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_member
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by GNU Fortran Runtime Library $as_me 0.3, which was
+generated by GNU Autoconf 2.64.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_header_list " sys/time.h"
+as_fn_append ac_header_list " sys/times.h"
+as_fn_append ac_header_list " sys/resource.h"
+as_fn_append ac_header_list " sys/types.h"
+as_fn_append ac_header_list " sys/stat.h"
+as_fn_append ac_header_list " sys/wait.h"
+as_fn_append ac_header_list " floatingpoint.h"
+as_fn_append ac_header_list " ieeefp.h"
+as_fn_append ac_header_list " fenv.h"
+as_fn_append ac_header_list " fptrap.h"
+as_fn_append ac_header_list " pwd.h"
+as_fn_append ac_header_list " complex.h"
+as_fn_append ac_func_list " getrusage"
+as_fn_append ac_func_list " times"
+as_fn_append ac_func_list " mkstemp"
+as_fn_append ac_func_list " strtof"
+as_fn_append ac_func_list " strtold"
+as_fn_append ac_func_list " snprintf"
+as_fn_append ac_func_list " ftruncate"
+as_fn_append ac_func_list " chsize"
+as_fn_append ac_func_list " chdir"
+as_fn_append ac_func_list " getlogin"
+as_fn_append ac_func_list " gethostname"
+as_fn_append ac_func_list " kill"
+as_fn_append ac_func_list " link"
+as_fn_append ac_func_list " symlink"
+as_fn_append ac_func_list " sleep"
+as_fn_append ac_func_list " ttyname"
+as_fn_append ac_func_list " alarm"
+as_fn_append ac_func_list " access"
+as_fn_append ac_func_list " fork"
+as_fn_append ac_func_list " execl"
+as_fn_append ac_func_list " wait"
+as_fn_append ac_func_list " setmode"
+as_fn_append ac_func_list " execve"
+as_fn_append ac_func_list " pipe"
+as_fn_append ac_func_list " dup2"
+as_fn_append ac_func_list " close"
+as_fn_append ac_func_list " strcasestr"
+as_fn_append ac_func_list " getrlimit"
+as_fn_append ac_func_list " gettimeofday"
+as_fn_append ac_func_list " stat"
+as_fn_append ac_func_list " fstat"
+as_fn_append ac_func_list " lstat"
+as_fn_append ac_func_list " getpwuid"
+as_fn_append ac_func_list " vsnprintf"
+as_fn_append ac_func_list " dup"
+as_fn_append ac_func_list " getcwd"
+as_fn_append ac_func_list " localtime_r"
+as_fn_append ac_func_list " gmtime_r"
+as_fn_append ac_func_list " strerror_r"
+as_fn_append ac_func_list " getpwuid_r"
+as_fn_append ac_func_list " ttyname_r"
+as_fn_append ac_func_list " clock_gettime"
+as_fn_append ac_func_list " readlink"
+as_fn_append ac_func_list " getgid"
+as_fn_append ac_func_list " getpid"
+as_fn_append ac_func_list " getppid"
+as_fn_append ac_func_list " getuid"
+as_fn_append ac_func_list " geteuid"
+as_fn_append ac_func_list " umask"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  for ac_t in install-sh install.sh shtool; do
+    if test -f "$ac_dir/$ac_t"; then
+      ac_aux_dir=$ac_dir
+      ac_install_sh="$ac_aux_dir/$ac_t -c"
+      break 2
+    fi
+  done
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+ case ${build_alias} in
+  "") build_noncanonical=${build} ;;
+  *) build_noncanonical=${build_alias} ;;
+esac
+
+ case ${host_alias} in
+  "") host_noncanonical=${build_noncanonical} ;;
+  *) host_noncanonical=${host_alias} ;;
+esac
+
+ case ${target_alias} in
+  "") target_noncanonical=${host_noncanonical} ;;
+  *) target_noncanonical=${target_alias} ;;
+esac
+
+
+# post-stage1 host modules use a different CC_FOR_BUILD so, in order to
+# have matching libraries, they should use host libraries: Makefile.tpl
+# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR).
+# However, they still use the build modules, because the corresponding
+# host modules (e.g. bison) are only built for the host when bootstrap
+# finishes. So:
+# - build_subdir is where we find build modules, and never changes.
+# - build_libsubdir is where we find build libraries, and can be overridden.
+
+# Prefix 'build-' so this never conflicts with target_subdir.
+build_subdir="build-${build_noncanonical}"
+
+# Check whether --with-build-libsubdir was given.
+if test "${with_build_libsubdir+set}" = set; then :
+  withval=$with_build_libsubdir; build_libsubdir="$withval"
+else
+  build_libsubdir="$build_subdir"
+fi
+
+# --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
+if ( test $srcdir = . && test -d gcc ) \
+   || test -d $srcdir/../host-${host_noncanonical}; then
+  host_subdir="host-${host_noncanonical}"
+else
+  host_subdir=.
+fi
+# No prefix.
+target_subdir=${target_noncanonical}
+
+
+# -------
+# Options
+# -------
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-version-specific-runtime-libs" >&5
+$as_echo_n "checking for --enable-version-specific-runtime-libs... " >&6; }
+# Check whether --enable-version-specific-runtime-libs was given.
+if test "${enable_version_specific_runtime_libs+set}" = set; then :
+  enableval=$enable_version_specific_runtime_libs; case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no)  version_specific_libs=no ;;
+ *)   as_fn_error "Unknown argument to enable/disable version-specific libs" "$LINENO" 5;;
+ esac
+else
+  version_specific_libs=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $version_specific_libs" >&5
+$as_echo "$version_specific_libs" >&6; }
+
+# Build with intermodule optimisations
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-intermodule" >&5
+$as_echo_n "checking for --enable-intermodule... " >&6; }
+# Check whether --enable-intermodule was given.
+if test "${enable_intermodule+set}" = set; then :
+  enableval=$enable_intermodule; case "$enable_intermodule" in
+  yes) onestep="-onestep";;
+    *) onestep="";;
+esac
+else
+  onestep=""
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_intermodule" >&5
+$as_echo "$enable_intermodule" >&6; }
+ if test x$onestep = x-onestep; then
+  onestep_TRUE=
+  onestep_FALSE='#'
+else
+  onestep_TRUE='#'
+  onestep_FALSE=
+fi
+
+
+
+# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
+#
+# You will slowly go insane if you do not grok the following fact:  when
+# building this library, the top-level /target/ becomes the library's /host/.
+#
+# configure then causes --target to default to --host, exactly like any
+# other package using autoconf.  Therefore, 'target' and 'host' will
+# always be the same.  This makes sense both for native and cross compilers
+# just think about it for a little while.  :-)
+#
+# Also, if this library is being configured as part of a cross compiler, the
+# top-level configure script will pass the "real" host as $with_cross_host.
+#
+# Do not delete or change the following two lines.  For why, see
+# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+
+
+
+target_alias=${target_alias-$host_alias}
+
+
+# Sets up automake.  Must come after AC_CANONICAL_SYSTEM.  Each of the
+# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
+#  1.9.6:  minimum required version
+#  no-define:  PACKAGE and VERSION will not be #define'd in config.h (a bunch
+#              of other PACKAGE_* variables will, however, and there's nothing
+#              we can do about that; they come from AC_INIT).
+#  foreign:  we don't follow the normal rules for GNU packages (no COPYING
+#            file in the top srcdir, etc, etc), so stop complaining.
+#  no-dist:  we don't want 'dist' and related rules.
+#  -Wall:  turns on all automake warnings...
+#  -Wno-portability:  ...except this one, since GNU make is required.
+am__api_version='1.11'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      as_fn_error "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='libgfortran'
+ VERSION='0.3'
+
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+# Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+  enableval=$enable_multilib; case "$enableval" in
+  yes) multilib=yes ;;
+  no)  multilib=no ;;
+  *)   as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+  multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+  if test "$with_target_subdir" != "."; then
+    multi_basedir="$srcdir/$with_multisrctop../.."
+  else
+    multi_basedir="$srcdir/$with_multisrctop.."
+  fi
+else
+  multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+   && test "x${with_multisubdir}" != x ; then
+   cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+
+# Handy for debugging:
+#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
+
+# Are we being configured with some form of cross compiler?
+# NB: We don't actually need to know this just now, but when, say, a test
+#     suite is included, we'll have to know.
+if test "$build" != "$host"; then
+  LIBGFOR_IS_NATIVE=false
+
+else
+  LIBGFOR_IS_NATIVE=true
+fi
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    rm -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# FIXME: Cleanup?
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  gcc_no_link=no
+else
+  gcc_no_link=yes
+fi
+if test x$gcc_no_link = xyes; then
+  # Setting cross_compile will disable run tests; it will
+  # also disable AC_CHECK_FILE but that's generally
+  # correct if we can't link.
+  cross_compiling=yes
+  EXEEXT=
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then :
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+fi
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = x""yes; then :
+  MINIX=yes
+else
+  MINIX=
+fi
+
+
+  if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+  fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#        define __EXTENSIONS__ 1
+         $ac_includes_default
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_safe_to_define___extensions__=yes
+else
+  ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${version_specific_libs} in
+  yes)
+    # Need the gcc compiler version to know where to install libraries
+    # and header files if --enable-version-specific-runtime-libs option
+    # is selected.
+    toolexecdir='$(libdir)/gcc/$(target_alias)'
+    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+    ;;
+  no)
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      # Install a library built with a cross compiler in tooldir, not libdir.
+      toolexecdir='$(exec_prefix)/$(target_alias)'
+      toolexeclibdir='$(toolexecdir)/lib'
+    else
+      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+      toolexeclibdir='$(libdir)'
+    fi
+    multi_os_directory=`$CC -print-multi-os-directory`
+    case $multi_os_directory in
+      .) ;; # Avoid trailing /.
+      *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+    esac
+    ;;
+esac
+
+
+
+# Create a spec file, so that compile/link tests don't fail
+test -f libgfortran.spec || touch libgfortran.spec
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# Check the compiler.
+# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+# We must force CC to /not/ be precious variables; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    rm -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+
+
+
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+                     sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+   test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+        test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+      then
+       # cc works too.
+       :
+      else
+       # cc exists but doesn't like -o.
+       eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+# Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
+if test "x$GCC" = "xyes"; then
+  AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
+  ## We like to use C99 routines when available.  This makes sure that
+  ## __STDC_VERSION__ is set such that libc includes make them available.
+  AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
+  ## Compile the following tests with the same system header contents
+  ## that we'll encounter when compiling our own source files.
+  CFLAGS="-std=gnu99 $CFLAGS"
+fi
+
+
+
+
+# Check for symbol versioning (copied from libssp).
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbol versioning is supported" >&5
+$as_echo_n "checking whether symbol versioning is supported... " >&6; }
+# Check whether --enable-symvers was given.
+if test "${enable_symvers+set}" = set; then :
+  enableval=$enable_symvers; gfortran_use_symver=$enableval
+else
+  gfortran_use_symver=yes
+fi
+
+if test "x$gfortran_use_symver" != xno; then
+  save_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
+  cat > conftest.map <<EOF
+FOO_1.0 {
+  global: *foo*; bar; local: *;
+};
+EOF
+  if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo;
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gfortran_use_symver=gnu
+else
+  gfortran_use_symver=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test x$gfortran_use_symver = xno; then
+    case "$target_os" in
+      solaris2*)
+        LDFLAGS="$save_LDFLAGS"
+        LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+        # Sun ld cannot handle wildcards and treats all entries as undefined.
+        cat > conftest.map <<EOF
+FOO_1.0 {
+  global: foo; local: *;
+};
+EOF
+        if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo;
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gfortran_use_symver=sun
+else
+  gfortran_use_symver=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        ;;
+    esac
+  fi
+  LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gfortran_use_symver" >&5
+$as_echo "$gfortran_use_symver" >&6; }
+ if test "x$gfortran_use_symver" != xno; then
+  LIBGFOR_USE_SYMVER_TRUE=
+  LIBGFOR_USE_SYMVER_FALSE='#'
+else
+  LIBGFOR_USE_SYMVER_TRUE='#'
+  LIBGFOR_USE_SYMVER_FALSE=
+fi
+
+ if test "x$gfortran_use_symver" = xgnu; then
+  LIBGFOR_USE_SYMVER_GNU_TRUE=
+  LIBGFOR_USE_SYMVER_GNU_FALSE='#'
+else
+  LIBGFOR_USE_SYMVER_GNU_TRUE='#'
+  LIBGFOR_USE_SYMVER_GNU_FALSE=
+fi
+
+ if test "x$gfortran_use_symver" = xsun; then
+  LIBGFOR_USE_SYMVER_SUN_TRUE=
+  LIBGFOR_USE_SYMVER_SUN_FALSE='#'
+else
+  LIBGFOR_USE_SYMVER_SUN_TRUE='#'
+  LIBGFOR_USE_SYMVER_SUN_FALSE=
+fi
+
+
+# Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
+# similarly to how libstdc++ does it
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+
+# Check for -ffunction-sections -fdata-sections
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc that supports -ffunction-sections -fdata-sections" >&5
+$as_echo_n "checking for gcc that supports -ffunction-sections -fdata-sections... " >&6; }
+CFLAGS='-Werror -ffunction-sections -fdata-sections'
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+int foo;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_fdsections=yes
+else
+  ac_fdsections=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+else
+  # this is the suspicious part
+  CFLAGS=""
+fi
+if test x"$ac_fdsections" = x"yes"; then
+  SECTION_FLAGS='-ffunction-sections -fdata-sections'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_fdsections" >&5
+$as_echo "$ac_fdsections" >&6; }
+
+
+# Find other programs we need.
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AS+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AS="${ac_tool_prefix}as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+$as_echo "$AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+  ac_ct_AS=$AS
+  # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AS+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AS"; then
+  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AS="as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AS" = x; then
+    AS=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AS=$ac_ct_AS
+  fi
+else
+  AS="$ac_cv_prog_AS"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB="ranlib-not-found-in-path-error"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+
+# Configure libtool
+#AC_MSG_NOTICE([====== Starting libtool configuration])
+enable_dlopen=yes
+
+
+
+case `pwd` in
+  *\ * | *\    *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.2.7a'
+macro_revision='1.3134'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_i386"
+           ;;
+         ppc64-*linux*|powerpc64-*linux*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         ppc*-*linux*|powerpc*-*linux*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+         LD="${LD-ld} -64"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+         lt_cv_apple_cc_single_mod=yes
+       else
+         cat conftest.err >&5
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if test "${lt_cv_ld_force_load+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+       lt_cv_ld_force_load=yes
+      else
+       cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[012]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      lt_prog_compiler_pic='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      else
+       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='--shared'
+       lt_prog_compiler_static='--static'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fpic'
+       lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-qpic'
+       lt_prog_compiler_static='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ F* | *Sun*Fortran*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl=''
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # 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.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         whole_archive_flag_spec=
+         tmp_sharedflag='--shared' ;;
+       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+         hardcode_libdir_flag_spec=
+         hardcode_libdir_flag_spec_ld='-rpath $libdir'
+         archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+         if test "x$supports_anon_versioning" = xyes; then
+           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&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.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           ld_shlibs=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         hardcode_direct=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L=yes
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_libdir_separator=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag="-z nodefs"
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag=' ${wl}-bernotok'
+         allow_undefined_flag=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           whole_archive_flag_spec='$convenience'
+         fi
+         archive_cmds_need_lc=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_from_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec=''
+  fi
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_flag_spec_ld='+b $libdir'
+       hardcode_libdir_separator=:
+       hardcode_direct=yes
+       hardcode_direct_absolute=yes
+       export_dynamic_flag_spec='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if test "${lt_cv_prog_compiler__b+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       *)
+         hardcode_direct=yes
+         hardcode_direct_absolute=yes
+         export_dynamic_flag_spec='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo(void) {}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LDFLAGS="$save_LDFLAGS"
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+       hardcode_direct_absolute=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+         export_dynamic_flag_spec='${wl}-E'
+       else
+         case $host_os in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            hardcode_libdir_flag_spec='-R$libdir'
+            ;;
+          *)
+            archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds='$CC -r -o $output$reload_objs'
+         hardcode_direct=no
+        ;;
+       motorola)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       export_dynamic_flag_spec='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if test "${lt_cv_archive_cmds_need_lc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl
+         pic_flag=$lt_prog_compiler_pic
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag
+         allow_undefined_flag=
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+         then
+           lt_cv_archive_cmds_need_lc=no
+         else
+           lt_cv_archive_cmds_need_lc=yes
+         fi
+         allow_undefined_flag=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = x""yes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 12321 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 12427 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+
+case $host in
+  *-cygwin* | *-mingw*)
+    # 'host' will be top-level target in the case of a target lib,
+    # we must compare to with_cross_host to decide if this is a native
+    # or cross-compiler and select where to install dlls appropriately.
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      lt_host_flags='-no-undefined -bindir "$(toolexeclibdir)"';
+    else
+      lt_host_flags='-no-undefined -bindir "$(bindir)"';
+    fi
+    ;;
+  *)
+    lt_host_flags=
+    ;;
+esac
+
+
+
+
+
+#AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
+
+# We need gfortran to compile parts of the library
+#AC_PROG_FC(gfortran)
+FC="$GFORTRAN"
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in gfortran
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$FC"; then
+  ac_cv_prog_FC="$FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+FC=$ac_cv_prog_FC
+if test -n "$FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5
+$as_echo "$FC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$FC" && break
+  done
+fi
+if test -z "$FC"; then
+  ac_ct_FC=$FC
+  for ac_prog in gfortran
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_FC"; then
+  ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_FC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_FC=$ac_cv_prog_ac_ct_FC
+if test -n "$ac_ct_FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5
+$as_echo "$ac_ct_FC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_FC" && break
+done
+
+  if test "x$ac_ct_FC" = x; then
+    FC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    FC=$ac_ct_FC
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    rm -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; }
+if test "${ac_cv_fc_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_fc_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5
+$as_echo "$ac_cv_fc_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FCFLAGS=${FCFLAGS+set}
+ac_save_FCFLAGS=$FCFLAGS
+FCFLAGS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5
+$as_echo_n "checking whether $FC accepts -g... " >&6; }
+if test "${ac_cv_prog_fc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  FCFLAGS=-g
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  ac_cv_prog_fc_g=yes
+else
+  ac_cv_prog_fc_g=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5
+$as_echo "$ac_cv_prog_fc_g" >&6; }
+if test "$ac_test_FCFLAGS" = set; then
+  FCFLAGS=$ac_save_FCFLAGS
+elif test $ac_cv_prog_fc_g = yes; then
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-g -O2"
+  else
+    FCFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-O2"
+  else
+    FCFLAGS=
+  fi
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+      ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+archive_cmds_need_lc_FC=no
+allow_undefined_flag_FC=
+always_export_symbols_FC=no
+archive_expsym_cmds_FC=
+export_dynamic_flag_spec_FC=
+hardcode_direct_FC=no
+hardcode_direct_absolute_FC=no
+hardcode_libdir_flag_spec_FC=
+hardcode_libdir_flag_spec_ld_FC=
+hardcode_libdir_separator_FC=
+hardcode_minus_L_FC=no
+hardcode_automatic_FC=no
+inherit_rpath_FC=no
+module_cmds_FC=
+module_expsym_cmds_FC=
+link_all_deplibs_FC=unknown
+old_archive_cmds_FC=$old_archive_cmds
+reload_flag_FC=$reload_flag
+reload_cmds_FC=$reload_cmds
+no_undefined_flag_FC=
+whole_archive_flag_spec_FC=
+enable_shared_with_static_runtimes_FC=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+objext_FC=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${FC-"f95"}
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  compiler_FC=$CC
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+  if test -n "$compiler"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[4-9]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+    GCC_FC="$ac_cv_fc_compiler_gnu"
+    LD_FC="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_FC=
+postdep_objects_FC=
+predeps_FC=
+postdeps_FC=
+compiler_lib_search_path_FC=
+
+cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+        prev=$p
+        continue
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$compiler_lib_search_path_FC"; then
+            compiler_lib_search_path_FC="${prev}${p}"
+          else
+            compiler_lib_search_path_FC="${compiler_lib_search_path_FC} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$postdeps_FC"; then
+          postdeps_FC="${prev}${p}"
+        else
+          postdeps_FC="${postdeps_FC} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$predep_objects_FC"; then
+          predep_objects_FC="$p"
+        else
+          predep_objects_FC="$predep_objects_FC $p"
+        fi
+       else
+        if test -z "$postdep_objects_FC"; then
+          postdep_objects_FC="$p"
+        else
+          postdep_objects_FC="$postdep_objects_FC $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling FC test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+
+
+case " $postdeps_FC " in
+*" -lc "*) archive_cmds_need_lc_FC=no ;;
+esac
+ compiler_lib_search_dirs_FC=
+if test -n "${compiler_lib_search_path_FC}"; then
+ compiler_lib_search_dirs_FC=`echo " ${compiler_lib_search_path_FC}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_FC=
+lt_prog_compiler_pic_FC=
+lt_prog_compiler_static_FC=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_FC='-Wl,'
+    lt_prog_compiler_static_FC='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_FC='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_FC='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic_FC='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_FC='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_FC=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_FC='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_FC=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_FC='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_FC=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic_FC='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl_FC='-Xlinker '
+      lt_prog_compiler_pic_FC='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_FC='-Bstatic'
+      else
+       lt_prog_compiler_static_FC='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_FC='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_FC='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='-KPIC'
+       lt_prog_compiler_static_FC='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='-fPIC'
+       lt_prog_compiler_static_FC='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='--shared'
+       lt_prog_compiler_static_FC='--static'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='-fpic'
+       lt_prog_compiler_static_FC='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_FC='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_FC='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='-qpic'
+       lt_prog_compiler_static_FC='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ F* | *Sun*Fortran*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         lt_prog_compiler_pic_FC='-KPIC'
+         lt_prog_compiler_static_FC='-Bstatic'
+         lt_prog_compiler_wl_FC=''
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         lt_prog_compiler_pic_FC='-KPIC'
+         lt_prog_compiler_static_FC='-Bstatic'
+         lt_prog_compiler_wl_FC='-Wl,'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_FC='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl_FC='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl_FC='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_FC='-Qoption ld '
+      lt_prog_compiler_pic_FC='-PIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic_FC='-Kconform_pic'
+       lt_prog_compiler_static_FC='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_can_build_shared_FC=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_FC='-pic'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_FC=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_FC=
+    ;;
+  *)
+    lt_prog_compiler_pic_FC="$lt_prog_compiler_pic_FC"
+    ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_FC" >&5
+$as_echo "$lt_prog_compiler_pic_FC" >&6; }
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_FC works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_FC works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_FC=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_FC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_FC=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_FC" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_FC" = xyes; then
+    case $lt_prog_compiler_pic_FC in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_FC=" $lt_prog_compiler_pic_FC" ;;
+     esac
+else
+    lt_prog_compiler_pic_FC=
+     lt_prog_compiler_can_build_shared_FC=no
+fi
+
+fi
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_FC eval lt_tmp_static_flag=\"$lt_prog_compiler_static_FC\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_FC=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_FC=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_FC=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_FC" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_FC" = xyes; then
+    :
+else
+    lt_prog_compiler_static_FC=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_FC=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_FC=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_FC=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_FC=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_FC" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag_FC=
+  always_export_symbols_FC=no
+  archive_cmds_FC=
+  archive_expsym_cmds_FC=
+  compiler_needs_object_FC=no
+  enable_shared_with_static_runtimes_FC=no
+  export_dynamic_flag_spec_FC=
+  export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic_FC=no
+  hardcode_direct_FC=no
+  hardcode_direct_absolute_FC=no
+  hardcode_libdir_flag_spec_FC=
+  hardcode_libdir_flag_spec_ld_FC=
+  hardcode_libdir_separator_FC=
+  hardcode_minus_L_FC=no
+  hardcode_shlibpath_var_FC=unsupported
+  inherit_rpath_FC=no
+  link_all_deplibs_FC=unknown
+  module_cmds_FC=
+  module_expsym_cmds_FC=
+  old_archive_from_new_cmds_FC=
+  old_archive_from_expsyms_cmds_FC=
+  thread_safe_flag_spec_FC=
+  whole_archive_flag_spec_FC=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_FC=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_FC='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # 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.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_FC=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec_FC='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_FC="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_FC=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs_FC=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds_FC=''
+        ;;
+      m68k)
+            archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_FC='-L$libdir'
+            hardcode_minus_L_FC=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag_FC=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds_FC='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, FC) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      export_dynamic_flag_spec_FC='${wl}--export-all-symbols'
+      allow_undefined_flag_FC=unsupported
+      always_export_symbols_FC=no
+      enable_shared_with_static_runtimes_FC=yes
+      export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs_FC=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct_FC=no
+      hardcode_shlibpath_var_FC=no
+      hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_FC='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_FC='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         whole_archive_flag_spec_FC=
+         tmp_sharedflag='--shared' ;;
+       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object_FC=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         whole_archive_flag_spec_FC='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object_FC=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       archive_cmds_FC='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         whole_archive_flag_spec_FC='--whole-archive$convenience --no-whole-archive'
+         hardcode_libdir_flag_spec_FC=
+         hardcode_libdir_flag_spec_ld_FC='-rpath $libdir'
+         archive_cmds_FC='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+         if test "x$supports_anon_versioning" = xyes; then
+           archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        ld_shlibs_FC=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds_FC='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       ld_shlibs_FC=no
+       cat <<_LT_EOF 1>&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.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs_FC=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+           archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           ld_shlibs_FC=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_FC='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_FC" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_FC=
+      export_dynamic_flag_spec_FC=
+      whole_archive_flag_spec_FC=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_FC=unsupported
+      always_export_symbols_FC=yes
+      archive_expsym_cmds_FC='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_FC=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct_FC=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_FC=''
+      hardcode_direct_FC=yes
+      hardcode_direct_absolute_FC=yes
+      hardcode_libdir_separator_FC=':'
+      link_all_deplibs_FC=yes
+      file_list_spec_FC='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         hardcode_direct_FC=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_FC=yes
+         hardcode_libdir_flag_spec_FC='-L$libdir'
+         hardcode_libdir_separator_FC=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      export_dynamic_flag_spec_FC='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_FC=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag_FC='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds_FC='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec_FC='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag_FC="-z nodefs"
+         archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag_FC=' ${wl}-bernotok'
+         allow_undefined_flag_FC=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           whole_archive_flag_spec_FC='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           whole_archive_flag_spec_FC='$convenience'
+         fi
+         archive_cmds_need_lc_FC=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds_FC=''
+        ;;
+      m68k)
+            archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_FC='-L$libdir'
+            hardcode_minus_L_FC=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_FC=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_FC=' '
+      allow_undefined_flag_FC=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_FC='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_from_new_cmds_FC='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_FC='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_FC='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_FC=yes
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_FC=no
+  hardcode_direct_FC=no
+  hardcode_automatic_FC=yes
+  hardcode_shlibpath_var_FC=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_FC='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec_FC=''
+  fi
+  link_all_deplibs_FC=yes
+  allow_undefined_flag_FC="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_FC="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds_FC="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds_FC="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds_FC="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs_FC=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_FC=yes
+      hardcode_minus_L_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds_FC='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds_FC='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds_FC='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      hardcode_direct_FC=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_FC=yes
+      export_dynamic_flag_spec_FC='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       archive_cmds_FC='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_FC='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+       hardcode_libdir_flag_spec_ld_FC='+b $libdir'
+       hardcode_libdir_separator_FC=:
+       hardcode_direct_FC=yes
+       hardcode_direct_absolute_FC=yes
+       export_dynamic_flag_spec_FC='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L_FC=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds_FC='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds_FC='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_FC='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+       archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator_FC=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_direct_FC=no
+         hardcode_shlibpath_var_FC=no
+         ;;
+       *)
+         hardcode_direct_FC=yes
+         hardcode_direct_absolute_FC=yes
+         export_dynamic_flag_spec_FC='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_FC=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat > conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+  archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LDFLAGS="$save_LDFLAGS"
+      else
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      inherit_rpath_FC=yes
+      link_all_deplibs_FC=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds_FC='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    newsos6)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_FC=yes
+      hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       hardcode_direct_FC=yes
+       hardcode_shlibpath_var_FC=no
+       hardcode_direct_absolute_FC=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+         export_dynamic_flag_spec_FC='${wl}-E'
+       else
+         case $host_os in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            hardcode_libdir_flag_spec_FC='-R$libdir'
+            ;;
+          *)
+            archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_minus_L_FC=yes
+      allow_undefined_flag_FC=unsupported
+      archive_cmds_FC='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds_FC='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag_FC=' -expect_unresolved \*'
+       archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag_FC=' -expect_unresolved \*'
+       archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_FC='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec_FC='-rpath $libdir'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_separator_FC=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_FC=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds_FC='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         archive_cmds_FC='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         archive_cmds_FC='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_shlibpath_var_FC=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         whole_archive_flag_spec_FC='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         whole_archive_flag_spec_FC='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      link_all_deplibs_FC=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds_FC='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_FC='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_direct_FC=yes
+      hardcode_minus_L_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_FC=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds_FC='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds_FC='$CC -r -o $output$reload_objs'
+         hardcode_direct_FC=no
+        ;;
+       motorola)
+         archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_FC=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_FC=no
+      export_dynamic_flag_spec_FC='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var_FC=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs_FC=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_FC='${wl}-z,text'
+      archive_cmds_need_lc_FC=no
+      hardcode_shlibpath_var_FC=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_FC='${wl}-z,text'
+      allow_undefined_flag_FC='${wl}-z,nodefs'
+      archive_cmds_need_lc_FC=no
+      hardcode_shlibpath_var_FC=no
+      hardcode_libdir_flag_spec_FC='${wl}-R,$libdir'
+      hardcode_libdir_separator_FC=':'
+      link_all_deplibs_FC=yes
+      export_dynamic_flag_spec_FC='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *)
+      ld_shlibs_FC=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       export_dynamic_flag_spec_FC='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_FC" >&5
+$as_echo "$ld_shlibs_FC" >&6; }
+test "$ld_shlibs_FC" = no && can_build_shared=no
+
+with_gnu_ld_FC=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_FC" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_FC=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_FC in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if test "${lt_cv_archive_cmds_need_lc_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl_FC
+         pic_flag=$lt_prog_compiler_pic_FC
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag_FC
+         allow_undefined_flag_FC=
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+         then
+           lt_cv_archive_cmds_need_lc_FC=no
+         else
+           lt_cv_archive_cmds_need_lc_FC=yes
+         fi
+         allow_undefined_flag_FC=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_FC" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_FC" >&6; }
+      archive_cmds_need_lc_FC=$lt_cv_archive_cmds_need_lc_FC
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_FC\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_FC\""
+    if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_FC=
+if test -n "$hardcode_libdir_flag_spec_FC" ||
+   test -n "$runpath_var_FC" ||
+   test "X$hardcode_automatic_FC" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_FC" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" != no &&
+     test "$hardcode_minus_L_FC" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_FC=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_FC=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_FC=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_FC" >&5
+$as_echo "$hardcode_action_FC" >&6; }
+
+if test "$hardcode_action_FC" = relink ||
+   test "$inherit_rpath_FC" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# extra LD Flags which are required for targets
+case "${host}" in
+  *-darwin*)
+    # Darwin needs -single_module when linking libgfortran
+    extra_ldflags_libgfortran=-Wl,-single_module
+    ;;
+esac
+
+
+# We need a working compiler at that point, otherwise give a clear
+# error message and bail out.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the GNU Fortran compiler is working" >&5
+$as_echo_n "checking whether the GNU Fortran compiler is working... " >&6; }
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+cat > conftest.$ac_ext <<_ACEOF
+
+      program foo
+      real, parameter :: bar = sin (12.34 / 2.5)
+      end program foo
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+     as_fn_error "GNU Fortran is not working; please report a bug in http://gcc.gnu.org/bugzilla, attaching $PWD/config.log" "$LINENO" 5
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+        # IRIX 6.2 and later do not support large files by default,
+        # so use the C compiler's -n32 option if that helps.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+        if ac_fn_c_try_compile "$LINENO"; then :
+  break
+fi
+rm -f core conftest.err conftest.$ac_objext
+        CC="$CC -n32"
+        if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+        break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  fi
+fi
+
+
+# Types
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = x""yes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+
+  ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_intptr_t" = x""yes; then :
+
+$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
+
+else
+  for ac_type in 'int' 'long int' 'long long int'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define intptr_t $ac_type
+_ACEOF
+
+         ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       test -z "$ac_type" && break
+     done
+fi
+
+
+
+  ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = x""yes; then :
+
+$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+
+else
+  for ac_type in 'unsigned int' 'unsigned long int' \
+       'unsigned long long int'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $ac_type
+_ACEOF
+
+         ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       test -z "$ac_type" && break
+     done
+fi
+
+
+ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTRDIFF_T 1
+_ACEOF
+
+
+fi
+
+
+# check header files (we assume C89 is available, so don't check for that)
+
+
+
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+inttype_headers=`echo inttypes.h sys/inttypes.h  | sed -e 's/,/ /g'`
+
+acx_cv_header_stdint=stddef.h
+acx_cv_header_stdint_kind="(already complete)"
+for i in stdint.h $inttype_headers; do
+  unset ac_cv_type_uintptr_t
+  unset ac_cv_type_uintmax_t
+  unset ac_cv_type_int_least32_t
+  unset ac_cv_type_int_fast32_t
+  unset ac_cv_type_uint64_t
+  $as_echo_n "looking for a compliant stdint.h in $i, " >&6
+  ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uintmax_t" = x""yes; then :
+  acx_cv_header_stdint=$i
+else
+  continue
+fi
+
+  ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uintptr_t" = x""yes; then :
+
+else
+  acx_cv_header_stdint_kind="(mostly complete)"
+fi
+
+  ac_fn_c_check_type "$LINENO" "int_least32_t" "ac_cv_type_int_least32_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_int_least32_t" = x""yes; then :
+
+else
+  acx_cv_header_stdint_kind="(mostly complete)"
+fi
+
+  ac_fn_c_check_type "$LINENO" "int_fast32_t" "ac_cv_type_int_fast32_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_int_fast32_t" = x""yes; then :
+
+else
+  acx_cv_header_stdint_kind="(mostly complete)"
+fi
+
+  ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uint64_t" = x""yes; then :
+
+else
+  acx_cv_header_stdint_kind="(lacks uint64_t)"
+fi
+
+  break
+done
+if test "$acx_cv_header_stdint" = stddef.h; then
+  acx_cv_header_stdint_kind="(lacks uintmax_t)"
+  for i in stdint.h $inttype_headers; do
+    unset ac_cv_type_uintptr_t
+    unset ac_cv_type_uint32_t
+    unset ac_cv_type_uint64_t
+    $as_echo_n "looking for an incomplete stdint.h in $i, " >&6
+    ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uint32_t" = x""yes; then :
+  acx_cv_header_stdint=$i
+else
+  continue
+fi
+
+    ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uint64_t" = x""yes; then :
+
+fi
+
+    ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uintptr_t" = x""yes; then :
+
+fi
+
+    break
+  done
+fi
+if test "$acx_cv_header_stdint" = stddef.h; then
+  acx_cv_header_stdint_kind="(u_intXX_t style)"
+  for i in sys/types.h $inttype_headers; do
+    unset ac_cv_type_u_int32_t
+    unset ac_cv_type_u_int64_t
+    $as_echo_n "looking for u_intXX_t types in $i, " >&6
+    ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_u_int32_t" = x""yes; then :
+  acx_cv_header_stdint=$i
+else
+  continue
+fi
+
+    ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_u_int64_t" = x""yes; then :
+
+fi
+
+    break
+  done
+fi
+if test "$acx_cv_header_stdint" = stddef.h; then
+  acx_cv_header_stdint_kind="(using manual detection)"
+fi
+
+test -z "$ac_cv_type_uintptr_t" && ac_cv_type_uintptr_t=no
+test -z "$ac_cv_type_uint64_t" && ac_cv_type_uint64_t=no
+test -z "$ac_cv_type_u_int64_t" && ac_cv_type_u_int64_t=no
+test -z "$ac_cv_type_int_least32_t" && ac_cv_type_int_least32_t=no
+test -z "$ac_cv_type_int_fast32_t" && ac_cv_type_int_fast32_t=no
+
+# ----------------- Summarize what we found so far
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what to include in gstdint.h" >&5
+$as_echo_n "checking what to include in gstdint.h... " >&6; }
+
+case `$as_basename -- gstdint.h ||
+$as_expr X/gstdint.h : '.*/\([^/][^/]*\)/*$' \| \
+        Xgstdint.h : 'X\(//\)$' \| \
+        Xgstdint.h : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/gstdint.h |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'` in
+  stdint.h) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: are you sure you want it there?" >&5
+$as_echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;;
+  inttypes.h) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: are you sure you want it there?" >&5
+$as_echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;;
+  *) ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_header_stdint $acx_cv_header_stdint_kind" >&5
+$as_echo "$acx_cv_header_stdint $acx_cv_header_stdint_kind" >&6; }
+
+# ----------------- done included file, check C basic types --------
+
+# Lacking an uintptr_t?  Test size of void *
+case "$acx_cv_header_stdint:$ac_cv_type_uintptr_t" in
+  stddef.h:* | *:no) # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if test "${ac_cv_sizeof_void_p+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_void_p" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (void *)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_void_p=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+ ;;
+esac
+
+# Lacking an uint64_t?  Test size of long
+case "$acx_cv_header_stdint:$ac_cv_type_uint64_t:$ac_cv_type_u_int64_t" in
+  stddef.h:*:* | *:no:no) # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_long" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (long)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_long=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+ ;;
+esac
+
+if test $acx_cv_header_stdint = stddef.h; then
+  # Lacking a good header?  Test size of everything and deduce all types.
+  # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (int)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+  # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if test "${ac_cv_sizeof_short+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_short" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (short)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_short=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+  # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
+$as_echo_n "checking size of char... " >&6; }
+if test "${ac_cv_sizeof_char+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_char" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (char)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_char=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
+$as_echo "$ac_cv_sizeof_char" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_CHAR $ac_cv_sizeof_char
+_ACEOF
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to int8_t" >&5
+$as_echo_n "checking for type equivalent to int8_t... " >&6; }
+  case "$ac_cv_sizeof_char" in
+    1) acx_cv_type_int8_t=char ;;
+    *) as_fn_error "no 8-bit type, please report a bug" "$LINENO" 5
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_type_int8_t" >&5
+$as_echo "$acx_cv_type_int8_t" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to int16_t" >&5
+$as_echo_n "checking for type equivalent to int16_t... " >&6; }
+  case "$ac_cv_sizeof_int:$ac_cv_sizeof_short" in
+    2:*) acx_cv_type_int16_t=int ;;
+    *:2) acx_cv_type_int16_t=short ;;
+    *) as_fn_error "no 16-bit type, please report a bug" "$LINENO" 5
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_type_int16_t" >&5
+$as_echo "$acx_cv_type_int16_t" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to int32_t" >&5
+$as_echo_n "checking for type equivalent to int32_t... " >&6; }
+  case "$ac_cv_sizeof_int:$ac_cv_sizeof_long" in
+    4:*) acx_cv_type_int32_t=int ;;
+    *:4) acx_cv_type_int32_t=long ;;
+    *) as_fn_error "no 32-bit type, please report a bug" "$LINENO" 5
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_type_int32_t" >&5
+$as_echo "$acx_cv_type_int32_t" >&6; }
+fi
+
+# These tests are here to make the output prettier
+
+if test "$ac_cv_type_uint64_t" != yes && test "$ac_cv_type_u_int64_t" != yes; then
+  case "$ac_cv_sizeof_long" in
+    8) acx_cv_type_int64_t=long ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to int64_t" >&5
+$as_echo_n "checking for type equivalent to int64_t... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${acx_cv_type_int64_t-'using preprocessor symbols'}" >&5
+$as_echo "${acx_cv_type_int64_t-'using preprocessor symbols'}" >&6; }
+fi
+
+# Now we can use the above types
+
+if test "$ac_cv_type_uintptr_t" != yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to intptr_t" >&5
+$as_echo_n "checking for type equivalent to intptr_t... " >&6; }
+  case $ac_cv_sizeof_void_p in
+    2) acx_cv_type_intptr_t=int16_t ;;
+    4) acx_cv_type_intptr_t=int32_t ;;
+    8) acx_cv_type_intptr_t=int64_t ;;
+    *) as_fn_error "no equivalent for intptr_t, please report a bug" "$LINENO" 5
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_type_intptr_t" >&5
+$as_echo "$acx_cv_type_intptr_t" >&6; }
+fi
+
+# ----------------- done all checks, emit header -------------
+ac_config_commands="$ac_config_commands gstdint.h"
+
+
+
+
+ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLOCKS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+_ACEOF
+
+
+fi
+
+
+# Check for library functions.
+
+
+
+  for ac_func in $ac_func_list
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+eval as_val=\$$as_ac_var
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check for C99 (and other IEEE) math functions
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosf in -lm" >&5
+$as_echo_n "checking for acosf in -lm... " >&6; }
+if test "${ac_cv_lib_m_acosf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char acosf ();
+int
+main ()
+{
+return acosf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_acosf=yes
+else
+  ac_cv_lib_m_acosf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosf" >&5
+$as_echo "$ac_cv_lib_m_acosf" >&6; }
+if test "x$ac_cv_lib_m_acosf" = x""yes; then :
+
+$as_echo "#define HAVE_ACOSF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acos in -lm" >&5
+$as_echo_n "checking for acos in -lm... " >&6; }
+if test "${ac_cv_lib_m_acos+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char acos ();
+int
+main ()
+{
+return acos ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_acos=yes
+else
+  ac_cv_lib_m_acos=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acos" >&5
+$as_echo "$ac_cv_lib_m_acos" >&6; }
+if test "x$ac_cv_lib_m_acos" = x""yes; then :
+
+$as_echo "#define HAVE_ACOS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosl in -lm" >&5
+$as_echo_n "checking for acosl in -lm... " >&6; }
+if test "${ac_cv_lib_m_acosl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char acosl ();
+int
+main ()
+{
+return acosl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_acosl=yes
+else
+  ac_cv_lib_m_acosl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosl" >&5
+$as_echo "$ac_cv_lib_m_acosl" >&6; }
+if test "x$ac_cv_lib_m_acosl" = x""yes; then :
+
+$as_echo "#define HAVE_ACOSL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acoshf in -lm" >&5
+$as_echo_n "checking for acoshf in -lm... " >&6; }
+if test "${ac_cv_lib_m_acoshf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char acoshf ();
+int
+main ()
+{
+return acoshf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_acoshf=yes
+else
+  ac_cv_lib_m_acoshf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acoshf" >&5
+$as_echo "$ac_cv_lib_m_acoshf" >&6; }
+if test "x$ac_cv_lib_m_acoshf" = x""yes; then :
+
+$as_echo "#define HAVE_ACOSHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosh in -lm" >&5
+$as_echo_n "checking for acosh in -lm... " >&6; }
+if test "${ac_cv_lib_m_acosh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char acosh ();
+int
+main ()
+{
+return acosh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_acosh=yes
+else
+  ac_cv_lib_m_acosh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosh" >&5
+$as_echo "$ac_cv_lib_m_acosh" >&6; }
+if test "x$ac_cv_lib_m_acosh" = x""yes; then :
+
+$as_echo "#define HAVE_ACOSH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acoshl in -lm" >&5
+$as_echo_n "checking for acoshl in -lm... " >&6; }
+if test "${ac_cv_lib_m_acoshl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char acoshl ();
+int
+main ()
+{
+return acoshl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_acoshl=yes
+else
+  ac_cv_lib_m_acoshl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acoshl" >&5
+$as_echo "$ac_cv_lib_m_acoshl" >&6; }
+if test "x$ac_cv_lib_m_acoshl" = x""yes; then :
+
+$as_echo "#define HAVE_ACOSHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinf in -lm" >&5
+$as_echo_n "checking for asinf in -lm... " >&6; }
+if test "${ac_cv_lib_m_asinf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char asinf ();
+int
+main ()
+{
+return asinf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_asinf=yes
+else
+  ac_cv_lib_m_asinf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinf" >&5
+$as_echo "$ac_cv_lib_m_asinf" >&6; }
+if test "x$ac_cv_lib_m_asinf" = x""yes; then :
+
+$as_echo "#define HAVE_ASINF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asin in -lm" >&5
+$as_echo_n "checking for asin in -lm... " >&6; }
+if test "${ac_cv_lib_m_asin+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char asin ();
+int
+main ()
+{
+return asin ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_asin=yes
+else
+  ac_cv_lib_m_asin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asin" >&5
+$as_echo "$ac_cv_lib_m_asin" >&6; }
+if test "x$ac_cv_lib_m_asin" = x""yes; then :
+
+$as_echo "#define HAVE_ASIN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinl in -lm" >&5
+$as_echo_n "checking for asinl in -lm... " >&6; }
+if test "${ac_cv_lib_m_asinl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char asinl ();
+int
+main ()
+{
+return asinl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_asinl=yes
+else
+  ac_cv_lib_m_asinl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinl" >&5
+$as_echo "$ac_cv_lib_m_asinl" >&6; }
+if test "x$ac_cv_lib_m_asinl" = x""yes; then :
+
+$as_echo "#define HAVE_ASINL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinhf in -lm" >&5
+$as_echo_n "checking for asinhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_asinhf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char asinhf ();
+int
+main ()
+{
+return asinhf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_asinhf=yes
+else
+  ac_cv_lib_m_asinhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinhf" >&5
+$as_echo "$ac_cv_lib_m_asinhf" >&6; }
+if test "x$ac_cv_lib_m_asinhf" = x""yes; then :
+
+$as_echo "#define HAVE_ASINHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinh in -lm" >&5
+$as_echo_n "checking for asinh in -lm... " >&6; }
+if test "${ac_cv_lib_m_asinh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char asinh ();
+int
+main ()
+{
+return asinh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_asinh=yes
+else
+  ac_cv_lib_m_asinh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinh" >&5
+$as_echo "$ac_cv_lib_m_asinh" >&6; }
+if test "x$ac_cv_lib_m_asinh" = x""yes; then :
+
+$as_echo "#define HAVE_ASINH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinhl in -lm" >&5
+$as_echo_n "checking for asinhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_asinhl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char asinhl ();
+int
+main ()
+{
+return asinhl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_asinhl=yes
+else
+  ac_cv_lib_m_asinhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinhl" >&5
+$as_echo "$ac_cv_lib_m_asinhl" >&6; }
+if test "x$ac_cv_lib_m_asinhl" = x""yes; then :
+
+$as_echo "#define HAVE_ASINHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2f in -lm" >&5
+$as_echo_n "checking for atan2f in -lm... " >&6; }
+if test "${ac_cv_lib_m_atan2f+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char atan2f ();
+int
+main ()
+{
+return atan2f ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_atan2f=yes
+else
+  ac_cv_lib_m_atan2f=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2f" >&5
+$as_echo "$ac_cv_lib_m_atan2f" >&6; }
+if test "x$ac_cv_lib_m_atan2f" = x""yes; then :
+
+$as_echo "#define HAVE_ATAN2F 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2 in -lm" >&5
+$as_echo_n "checking for atan2 in -lm... " >&6; }
+if test "${ac_cv_lib_m_atan2+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char atan2 ();
+int
+main ()
+{
+return atan2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_atan2=yes
+else
+  ac_cv_lib_m_atan2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2" >&5
+$as_echo "$ac_cv_lib_m_atan2" >&6; }
+if test "x$ac_cv_lib_m_atan2" = x""yes; then :
+
+$as_echo "#define HAVE_ATAN2 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2l in -lm" >&5
+$as_echo_n "checking for atan2l in -lm... " >&6; }
+if test "${ac_cv_lib_m_atan2l+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char atan2l ();
+int
+main ()
+{
+return atan2l ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_atan2l=yes
+else
+  ac_cv_lib_m_atan2l=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2l" >&5
+$as_echo "$ac_cv_lib_m_atan2l" >&6; }
+if test "x$ac_cv_lib_m_atan2l" = x""yes; then :
+
+$as_echo "#define HAVE_ATAN2L 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanf in -lm" >&5
+$as_echo_n "checking for atanf in -lm... " >&6; }
+if test "${ac_cv_lib_m_atanf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char atanf ();
+int
+main ()
+{
+return atanf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_atanf=yes
+else
+  ac_cv_lib_m_atanf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanf" >&5
+$as_echo "$ac_cv_lib_m_atanf" >&6; }
+if test "x$ac_cv_lib_m_atanf" = x""yes; then :
+
+$as_echo "#define HAVE_ATANF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan in -lm" >&5
+$as_echo_n "checking for atan in -lm... " >&6; }
+if test "${ac_cv_lib_m_atan+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char atan ();
+int
+main ()
+{
+return atan ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_atan=yes
+else
+  ac_cv_lib_m_atan=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan" >&5
+$as_echo "$ac_cv_lib_m_atan" >&6; }
+if test "x$ac_cv_lib_m_atan" = x""yes; then :
+
+$as_echo "#define HAVE_ATAN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanl in -lm" >&5
+$as_echo_n "checking for atanl in -lm... " >&6; }
+if test "${ac_cv_lib_m_atanl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char atanl ();
+int
+main ()
+{
+return atanl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_atanl=yes
+else
+  ac_cv_lib_m_atanl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanl" >&5
+$as_echo "$ac_cv_lib_m_atanl" >&6; }
+if test "x$ac_cv_lib_m_atanl" = x""yes; then :
+
+$as_echo "#define HAVE_ATANL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanhf in -lm" >&5
+$as_echo_n "checking for atanhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_atanhf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char atanhf ();
+int
+main ()
+{
+return atanhf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_atanhf=yes
+else
+  ac_cv_lib_m_atanhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanhf" >&5
+$as_echo "$ac_cv_lib_m_atanhf" >&6; }
+if test "x$ac_cv_lib_m_atanhf" = x""yes; then :
+
+$as_echo "#define HAVE_ATANHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanh in -lm" >&5
+$as_echo_n "checking for atanh in -lm... " >&6; }
+if test "${ac_cv_lib_m_atanh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char atanh ();
+int
+main ()
+{
+return atanh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_atanh=yes
+else
+  ac_cv_lib_m_atanh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanh" >&5
+$as_echo "$ac_cv_lib_m_atanh" >&6; }
+if test "x$ac_cv_lib_m_atanh" = x""yes; then :
+
+$as_echo "#define HAVE_ATANH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanhl in -lm" >&5
+$as_echo_n "checking for atanhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_atanhl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char atanhl ();
+int
+main ()
+{
+return atanhl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_atanhl=yes
+else
+  ac_cv_lib_m_atanhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanhl" >&5
+$as_echo "$ac_cv_lib_m_atanhl" >&6; }
+if test "x$ac_cv_lib_m_atanhl" = x""yes; then :
+
+$as_echo "#define HAVE_ATANHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cargf in -lm" >&5
+$as_echo_n "checking for cargf in -lm... " >&6; }
+if test "${ac_cv_lib_m_cargf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cargf ();
+int
+main ()
+{
+return cargf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cargf=yes
+else
+  ac_cv_lib_m_cargf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cargf" >&5
+$as_echo "$ac_cv_lib_m_cargf" >&6; }
+if test "x$ac_cv_lib_m_cargf" = x""yes; then :
+
+$as_echo "#define HAVE_CARGF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for carg in -lm" >&5
+$as_echo_n "checking for carg in -lm... " >&6; }
+if test "${ac_cv_lib_m_carg+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char carg ();
+int
+main ()
+{
+return carg ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_carg=yes
+else
+  ac_cv_lib_m_carg=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_carg" >&5
+$as_echo "$ac_cv_lib_m_carg" >&6; }
+if test "x$ac_cv_lib_m_carg" = x""yes; then :
+
+$as_echo "#define HAVE_CARG 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cargl in -lm" >&5
+$as_echo_n "checking for cargl in -lm... " >&6; }
+if test "${ac_cv_lib_m_cargl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cargl ();
+int
+main ()
+{
+return cargl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cargl=yes
+else
+  ac_cv_lib_m_cargl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cargl" >&5
+$as_echo "$ac_cv_lib_m_cargl" >&6; }
+if test "x$ac_cv_lib_m_cargl" = x""yes; then :
+
+$as_echo "#define HAVE_CARGL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceilf in -lm" >&5
+$as_echo_n "checking for ceilf in -lm... " >&6; }
+if test "${ac_cv_lib_m_ceilf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ceilf ();
+int
+main ()
+{
+return ceilf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ceilf=yes
+else
+  ac_cv_lib_m_ceilf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceilf" >&5
+$as_echo "$ac_cv_lib_m_ceilf" >&6; }
+if test "x$ac_cv_lib_m_ceilf" = x""yes; then :
+
+$as_echo "#define HAVE_CEILF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5
+$as_echo_n "checking for ceil in -lm... " >&6; }
+if test "${ac_cv_lib_m_ceil+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ceil ();
+int
+main ()
+{
+return ceil ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ceil=yes
+else
+  ac_cv_lib_m_ceil=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceil" >&5
+$as_echo "$ac_cv_lib_m_ceil" >&6; }
+if test "x$ac_cv_lib_m_ceil" = x""yes; then :
+
+$as_echo "#define HAVE_CEIL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceill in -lm" >&5
+$as_echo_n "checking for ceill in -lm... " >&6; }
+if test "${ac_cv_lib_m_ceill+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ceill ();
+int
+main ()
+{
+return ceill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ceill=yes
+else
+  ac_cv_lib_m_ceill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceill" >&5
+$as_echo "$ac_cv_lib_m_ceill" >&6; }
+if test "x$ac_cv_lib_m_ceill" = x""yes; then :
+
+$as_echo "#define HAVE_CEILL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for copysignf in -lm" >&5
+$as_echo_n "checking for copysignf in -lm... " >&6; }
+if test "${ac_cv_lib_m_copysignf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char copysignf ();
+int
+main ()
+{
+return copysignf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_copysignf=yes
+else
+  ac_cv_lib_m_copysignf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_copysignf" >&5
+$as_echo "$ac_cv_lib_m_copysignf" >&6; }
+if test "x$ac_cv_lib_m_copysignf" = x""yes; then :
+
+$as_echo "#define HAVE_COPYSIGNF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for copysign in -lm" >&5
+$as_echo_n "checking for copysign in -lm... " >&6; }
+if test "${ac_cv_lib_m_copysign+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char copysign ();
+int
+main ()
+{
+return copysign ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_copysign=yes
+else
+  ac_cv_lib_m_copysign=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_copysign" >&5
+$as_echo "$ac_cv_lib_m_copysign" >&6; }
+if test "x$ac_cv_lib_m_copysign" = x""yes; then :
+
+$as_echo "#define HAVE_COPYSIGN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for copysignl in -lm" >&5
+$as_echo_n "checking for copysignl in -lm... " >&6; }
+if test "${ac_cv_lib_m_copysignl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char copysignl ();
+int
+main ()
+{
+return copysignl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_copysignl=yes
+else
+  ac_cv_lib_m_copysignl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_copysignl" >&5
+$as_echo "$ac_cv_lib_m_copysignl" >&6; }
+if test "x$ac_cv_lib_m_copysignl" = x""yes; then :
+
+$as_echo "#define HAVE_COPYSIGNL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosf in -lm" >&5
+$as_echo_n "checking for cosf in -lm... " >&6; }
+if test "${ac_cv_lib_m_cosf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cosf ();
+int
+main ()
+{
+return cosf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cosf=yes
+else
+  ac_cv_lib_m_cosf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cosf" >&5
+$as_echo "$ac_cv_lib_m_cosf" >&6; }
+if test "x$ac_cv_lib_m_cosf" = x""yes; then :
+
+$as_echo "#define HAVE_COSF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
+$as_echo_n "checking for cos in -lm... " >&6; }
+if test "${ac_cv_lib_m_cos+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
+int
+main ()
+{
+return cos ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cos=yes
+else
+  ac_cv_lib_m_cos=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
+$as_echo "$ac_cv_lib_m_cos" >&6; }
+if test "x$ac_cv_lib_m_cos" = x""yes; then :
+
+$as_echo "#define HAVE_COS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosl in -lm" >&5
+$as_echo_n "checking for cosl in -lm... " >&6; }
+if test "${ac_cv_lib_m_cosl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cosl ();
+int
+main ()
+{
+return cosl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cosl=yes
+else
+  ac_cv_lib_m_cosl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cosl" >&5
+$as_echo "$ac_cv_lib_m_cosl" >&6; }
+if test "x$ac_cv_lib_m_cosl" = x""yes; then :
+
+$as_echo "#define HAVE_COSL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccosf in -lm" >&5
+$as_echo_n "checking for ccosf in -lm... " >&6; }
+if test "${ac_cv_lib_m_ccosf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ccosf ();
+int
+main ()
+{
+return ccosf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ccosf=yes
+else
+  ac_cv_lib_m_ccosf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ccosf" >&5
+$as_echo "$ac_cv_lib_m_ccosf" >&6; }
+if test "x$ac_cv_lib_m_ccosf" = x""yes; then :
+
+$as_echo "#define HAVE_CCOSF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccos in -lm" >&5
+$as_echo_n "checking for ccos in -lm... " >&6; }
+if test "${ac_cv_lib_m_ccos+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ccos ();
+int
+main ()
+{
+return ccos ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ccos=yes
+else
+  ac_cv_lib_m_ccos=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ccos" >&5
+$as_echo "$ac_cv_lib_m_ccos" >&6; }
+if test "x$ac_cv_lib_m_ccos" = x""yes; then :
+
+$as_echo "#define HAVE_CCOS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccosl in -lm" >&5
+$as_echo_n "checking for ccosl in -lm... " >&6; }
+if test "${ac_cv_lib_m_ccosl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ccosl ();
+int
+main ()
+{
+return ccosl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ccosl=yes
+else
+  ac_cv_lib_m_ccosl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ccosl" >&5
+$as_echo "$ac_cv_lib_m_ccosl" >&6; }
+if test "x$ac_cv_lib_m_ccosl" = x""yes; then :
+
+$as_echo "#define HAVE_CCOSL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for coshf in -lm" >&5
+$as_echo_n "checking for coshf in -lm... " >&6; }
+if test "${ac_cv_lib_m_coshf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char coshf ();
+int
+main ()
+{
+return coshf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_coshf=yes
+else
+  ac_cv_lib_m_coshf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_coshf" >&5
+$as_echo "$ac_cv_lib_m_coshf" >&6; }
+if test "x$ac_cv_lib_m_coshf" = x""yes; then :
+
+$as_echo "#define HAVE_COSHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosh in -lm" >&5
+$as_echo_n "checking for cosh in -lm... " >&6; }
+if test "${ac_cv_lib_m_cosh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cosh ();
+int
+main ()
+{
+return cosh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cosh=yes
+else
+  ac_cv_lib_m_cosh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cosh" >&5
+$as_echo "$ac_cv_lib_m_cosh" >&6; }
+if test "x$ac_cv_lib_m_cosh" = x""yes; then :
+
+$as_echo "#define HAVE_COSH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for coshl in -lm" >&5
+$as_echo_n "checking for coshl in -lm... " >&6; }
+if test "${ac_cv_lib_m_coshl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char coshl ();
+int
+main ()
+{
+return coshl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_coshl=yes
+else
+  ac_cv_lib_m_coshl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_coshl" >&5
+$as_echo "$ac_cv_lib_m_coshl" >&6; }
+if test "x$ac_cv_lib_m_coshl" = x""yes; then :
+
+$as_echo "#define HAVE_COSHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccoshf in -lm" >&5
+$as_echo_n "checking for ccoshf in -lm... " >&6; }
+if test "${ac_cv_lib_m_ccoshf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ccoshf ();
+int
+main ()
+{
+return ccoshf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ccoshf=yes
+else
+  ac_cv_lib_m_ccoshf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ccoshf" >&5
+$as_echo "$ac_cv_lib_m_ccoshf" >&6; }
+if test "x$ac_cv_lib_m_ccoshf" = x""yes; then :
+
+$as_echo "#define HAVE_CCOSHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccosh in -lm" >&5
+$as_echo_n "checking for ccosh in -lm... " >&6; }
+if test "${ac_cv_lib_m_ccosh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ccosh ();
+int
+main ()
+{
+return ccosh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ccosh=yes
+else
+  ac_cv_lib_m_ccosh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ccosh" >&5
+$as_echo "$ac_cv_lib_m_ccosh" >&6; }
+if test "x$ac_cv_lib_m_ccosh" = x""yes; then :
+
+$as_echo "#define HAVE_CCOSH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccoshl in -lm" >&5
+$as_echo_n "checking for ccoshl in -lm... " >&6; }
+if test "${ac_cv_lib_m_ccoshl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ccoshl ();
+int
+main ()
+{
+return ccoshl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ccoshl=yes
+else
+  ac_cv_lib_m_ccoshl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ccoshl" >&5
+$as_echo "$ac_cv_lib_m_ccoshl" >&6; }
+if test "x$ac_cv_lib_m_ccoshl" = x""yes; then :
+
+$as_echo "#define HAVE_CCOSHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for expf in -lm" >&5
+$as_echo_n "checking for expf in -lm... " >&6; }
+if test "${ac_cv_lib_m_expf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char expf ();
+int
+main ()
+{
+return expf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_expf=yes
+else
+  ac_cv_lib_m_expf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_expf" >&5
+$as_echo "$ac_cv_lib_m_expf" >&6; }
+if test "x$ac_cv_lib_m_expf" = x""yes; then :
+
+$as_echo "#define HAVE_EXPF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for exp in -lm" >&5
+$as_echo_n "checking for exp in -lm... " >&6; }
+if test "${ac_cv_lib_m_exp+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char exp ();
+int
+main ()
+{
+return exp ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_exp=yes
+else
+  ac_cv_lib_m_exp=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_exp" >&5
+$as_echo "$ac_cv_lib_m_exp" >&6; }
+if test "x$ac_cv_lib_m_exp" = x""yes; then :
+
+$as_echo "#define HAVE_EXP 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for expl in -lm" >&5
+$as_echo_n "checking for expl in -lm... " >&6; }
+if test "${ac_cv_lib_m_expl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char expl ();
+int
+main ()
+{
+return expl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_expl=yes
+else
+  ac_cv_lib_m_expl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_expl" >&5
+$as_echo "$ac_cv_lib_m_expl" >&6; }
+if test "x$ac_cv_lib_m_expl" = x""yes; then :
+
+$as_echo "#define HAVE_EXPL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cexpf in -lm" >&5
+$as_echo_n "checking for cexpf in -lm... " >&6; }
+if test "${ac_cv_lib_m_cexpf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cexpf ();
+int
+main ()
+{
+return cexpf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cexpf=yes
+else
+  ac_cv_lib_m_cexpf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cexpf" >&5
+$as_echo "$ac_cv_lib_m_cexpf" >&6; }
+if test "x$ac_cv_lib_m_cexpf" = x""yes; then :
+
+$as_echo "#define HAVE_CEXPF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cexp in -lm" >&5
+$as_echo_n "checking for cexp in -lm... " >&6; }
+if test "${ac_cv_lib_m_cexp+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cexp ();
+int
+main ()
+{
+return cexp ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cexp=yes
+else
+  ac_cv_lib_m_cexp=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cexp" >&5
+$as_echo "$ac_cv_lib_m_cexp" >&6; }
+if test "x$ac_cv_lib_m_cexp" = x""yes; then :
+
+$as_echo "#define HAVE_CEXP 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cexpl in -lm" >&5
+$as_echo_n "checking for cexpl in -lm... " >&6; }
+if test "${ac_cv_lib_m_cexpl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cexpl ();
+int
+main ()
+{
+return cexpl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cexpl=yes
+else
+  ac_cv_lib_m_cexpl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cexpl" >&5
+$as_echo "$ac_cv_lib_m_cexpl" >&6; }
+if test "x$ac_cv_lib_m_cexpl" = x""yes; then :
+
+$as_echo "#define HAVE_CEXPL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabsf in -lm" >&5
+$as_echo_n "checking for fabsf in -lm... " >&6; }
+if test "${ac_cv_lib_m_fabsf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fabsf ();
+int
+main ()
+{
+return fabsf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_fabsf=yes
+else
+  ac_cv_lib_m_fabsf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabsf" >&5
+$as_echo "$ac_cv_lib_m_fabsf" >&6; }
+if test "x$ac_cv_lib_m_fabsf" = x""yes; then :
+
+$as_echo "#define HAVE_FABSF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabs in -lm" >&5
+$as_echo_n "checking for fabs in -lm... " >&6; }
+if test "${ac_cv_lib_m_fabs+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fabs ();
+int
+main ()
+{
+return fabs ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_fabs=yes
+else
+  ac_cv_lib_m_fabs=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabs" >&5
+$as_echo "$ac_cv_lib_m_fabs" >&6; }
+if test "x$ac_cv_lib_m_fabs" = x""yes; then :
+
+$as_echo "#define HAVE_FABS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabsl in -lm" >&5
+$as_echo_n "checking for fabsl in -lm... " >&6; }
+if test "${ac_cv_lib_m_fabsl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fabsl ();
+int
+main ()
+{
+return fabsl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_fabsl=yes
+else
+  ac_cv_lib_m_fabsl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabsl" >&5
+$as_echo "$ac_cv_lib_m_fabsl" >&6; }
+if test "x$ac_cv_lib_m_fabsl" = x""yes; then :
+
+$as_echo "#define HAVE_FABSL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cabsf in -lm" >&5
+$as_echo_n "checking for cabsf in -lm... " >&6; }
+if test "${ac_cv_lib_m_cabsf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cabsf ();
+int
+main ()
+{
+return cabsf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cabsf=yes
+else
+  ac_cv_lib_m_cabsf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cabsf" >&5
+$as_echo "$ac_cv_lib_m_cabsf" >&6; }
+if test "x$ac_cv_lib_m_cabsf" = x""yes; then :
+
+$as_echo "#define HAVE_CABSF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cabs in -lm" >&5
+$as_echo_n "checking for cabs in -lm... " >&6; }
+if test "${ac_cv_lib_m_cabs+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cabs ();
+int
+main ()
+{
+return cabs ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cabs=yes
+else
+  ac_cv_lib_m_cabs=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cabs" >&5
+$as_echo "$ac_cv_lib_m_cabs" >&6; }
+if test "x$ac_cv_lib_m_cabs" = x""yes; then :
+
+$as_echo "#define HAVE_CABS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cabsl in -lm" >&5
+$as_echo_n "checking for cabsl in -lm... " >&6; }
+if test "${ac_cv_lib_m_cabsl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cabsl ();
+int
+main ()
+{
+return cabsl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cabsl=yes
+else
+  ac_cv_lib_m_cabsl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cabsl" >&5
+$as_echo "$ac_cv_lib_m_cabsl" >&6; }
+if test "x$ac_cv_lib_m_cabsl" = x""yes; then :
+
+$as_echo "#define HAVE_CABSL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floorf in -lm" >&5
+$as_echo_n "checking for floorf in -lm... " >&6; }
+if test "${ac_cv_lib_m_floorf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char floorf ();
+int
+main ()
+{
+return floorf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_floorf=yes
+else
+  ac_cv_lib_m_floorf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floorf" >&5
+$as_echo "$ac_cv_lib_m_floorf" >&6; }
+if test "x$ac_cv_lib_m_floorf" = x""yes; then :
+
+$as_echo "#define HAVE_FLOORF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5
+$as_echo_n "checking for floor in -lm... " >&6; }
+if test "${ac_cv_lib_m_floor+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char floor ();
+int
+main ()
+{
+return floor ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_floor=yes
+else
+  ac_cv_lib_m_floor=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5
+$as_echo "$ac_cv_lib_m_floor" >&6; }
+if test "x$ac_cv_lib_m_floor" = x""yes; then :
+
+$as_echo "#define HAVE_FLOOR 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floorl in -lm" >&5
+$as_echo_n "checking for floorl in -lm... " >&6; }
+if test "${ac_cv_lib_m_floorl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char floorl ();
+int
+main ()
+{
+return floorl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_floorl=yes
+else
+  ac_cv_lib_m_floorl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floorl" >&5
+$as_echo "$ac_cv_lib_m_floorl" >&6; }
+if test "x$ac_cv_lib_m_floorl" = x""yes; then :
+
+$as_echo "#define HAVE_FLOORL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmodf in -lm" >&5
+$as_echo_n "checking for fmodf in -lm... " >&6; }
+if test "${ac_cv_lib_m_fmodf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fmodf ();
+int
+main ()
+{
+return fmodf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_fmodf=yes
+else
+  ac_cv_lib_m_fmodf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fmodf" >&5
+$as_echo "$ac_cv_lib_m_fmodf" >&6; }
+if test "x$ac_cv_lib_m_fmodf" = x""yes; then :
+
+$as_echo "#define HAVE_FMODF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmod in -lm" >&5
+$as_echo_n "checking for fmod in -lm... " >&6; }
+if test "${ac_cv_lib_m_fmod+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fmod ();
+int
+main ()
+{
+return fmod ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_fmod=yes
+else
+  ac_cv_lib_m_fmod=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fmod" >&5
+$as_echo "$ac_cv_lib_m_fmod" >&6; }
+if test "x$ac_cv_lib_m_fmod" = x""yes; then :
+
+$as_echo "#define HAVE_FMOD 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmodl in -lm" >&5
+$as_echo_n "checking for fmodl in -lm... " >&6; }
+if test "${ac_cv_lib_m_fmodl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fmodl ();
+int
+main ()
+{
+return fmodl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_fmodl=yes
+else
+  ac_cv_lib_m_fmodl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fmodl" >&5
+$as_echo "$ac_cv_lib_m_fmodl" >&6; }
+if test "x$ac_cv_lib_m_fmodl" = x""yes; then :
+
+$as_echo "#define HAVE_FMODL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for frexpf in -lm" >&5
+$as_echo_n "checking for frexpf in -lm... " >&6; }
+if test "${ac_cv_lib_m_frexpf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char frexpf ();
+int
+main ()
+{
+return frexpf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_frexpf=yes
+else
+  ac_cv_lib_m_frexpf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_frexpf" >&5
+$as_echo "$ac_cv_lib_m_frexpf" >&6; }
+if test "x$ac_cv_lib_m_frexpf" = x""yes; then :
+
+$as_echo "#define HAVE_FREXPF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for frexp in -lm" >&5
+$as_echo_n "checking for frexp in -lm... " >&6; }
+if test "${ac_cv_lib_m_frexp+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char frexp ();
+int
+main ()
+{
+return frexp ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_frexp=yes
+else
+  ac_cv_lib_m_frexp=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_frexp" >&5
+$as_echo "$ac_cv_lib_m_frexp" >&6; }
+if test "x$ac_cv_lib_m_frexp" = x""yes; then :
+
+$as_echo "#define HAVE_FREXP 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for frexpl in -lm" >&5
+$as_echo_n "checking for frexpl in -lm... " >&6; }
+if test "${ac_cv_lib_m_frexpl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char frexpl ();
+int
+main ()
+{
+return frexpl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_frexpl=yes
+else
+  ac_cv_lib_m_frexpl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_frexpl" >&5
+$as_echo "$ac_cv_lib_m_frexpl" >&6; }
+if test "x$ac_cv_lib_m_frexpl" = x""yes; then :
+
+$as_echo "#define HAVE_FREXPL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hypotf in -lm" >&5
+$as_echo_n "checking for hypotf in -lm... " >&6; }
+if test "${ac_cv_lib_m_hypotf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char hypotf ();
+int
+main ()
+{
+return hypotf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_hypotf=yes
+else
+  ac_cv_lib_m_hypotf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_hypotf" >&5
+$as_echo "$ac_cv_lib_m_hypotf" >&6; }
+if test "x$ac_cv_lib_m_hypotf" = x""yes; then :
+
+$as_echo "#define HAVE_HYPOTF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hypot in -lm" >&5
+$as_echo_n "checking for hypot in -lm... " >&6; }
+if test "${ac_cv_lib_m_hypot+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char hypot ();
+int
+main ()
+{
+return hypot ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_hypot=yes
+else
+  ac_cv_lib_m_hypot=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_hypot" >&5
+$as_echo "$ac_cv_lib_m_hypot" >&6; }
+if test "x$ac_cv_lib_m_hypot" = x""yes; then :
+
+$as_echo "#define HAVE_HYPOT 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hypotl in -lm" >&5
+$as_echo_n "checking for hypotl in -lm... " >&6; }
+if test "${ac_cv_lib_m_hypotl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char hypotl ();
+int
+main ()
+{
+return hypotl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_hypotl=yes
+else
+  ac_cv_lib_m_hypotl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_hypotl" >&5
+$as_echo "$ac_cv_lib_m_hypotl" >&6; }
+if test "x$ac_cv_lib_m_hypotl" = x""yes; then :
+
+$as_echo "#define HAVE_HYPOTL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldexpf in -lm" >&5
+$as_echo_n "checking for ldexpf in -lm... " >&6; }
+if test "${ac_cv_lib_m_ldexpf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ldexpf ();
+int
+main ()
+{
+return ldexpf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ldexpf=yes
+else
+  ac_cv_lib_m_ldexpf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ldexpf" >&5
+$as_echo "$ac_cv_lib_m_ldexpf" >&6; }
+if test "x$ac_cv_lib_m_ldexpf" = x""yes; then :
+
+$as_echo "#define HAVE_LDEXPF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldexp in -lm" >&5
+$as_echo_n "checking for ldexp in -lm... " >&6; }
+if test "${ac_cv_lib_m_ldexp+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ldexp ();
+int
+main ()
+{
+return ldexp ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ldexp=yes
+else
+  ac_cv_lib_m_ldexp=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ldexp" >&5
+$as_echo "$ac_cv_lib_m_ldexp" >&6; }
+if test "x$ac_cv_lib_m_ldexp" = x""yes; then :
+
+$as_echo "#define HAVE_LDEXP 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldexpl in -lm" >&5
+$as_echo_n "checking for ldexpl in -lm... " >&6; }
+if test "${ac_cv_lib_m_ldexpl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ldexpl ();
+int
+main ()
+{
+return ldexpl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ldexpl=yes
+else
+  ac_cv_lib_m_ldexpl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ldexpl" >&5
+$as_echo "$ac_cv_lib_m_ldexpl" >&6; }
+if test "x$ac_cv_lib_m_ldexpl" = x""yes; then :
+
+$as_echo "#define HAVE_LDEXPL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for logf in -lm" >&5
+$as_echo_n "checking for logf in -lm... " >&6; }
+if test "${ac_cv_lib_m_logf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char logf ();
+int
+main ()
+{
+return logf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_logf=yes
+else
+  ac_cv_lib_m_logf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_logf" >&5
+$as_echo "$ac_cv_lib_m_logf" >&6; }
+if test "x$ac_cv_lib_m_logf" = x""yes; then :
+
+$as_echo "#define HAVE_LOGF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for log in -lm" >&5
+$as_echo_n "checking for log in -lm... " >&6; }
+if test "${ac_cv_lib_m_log+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log ();
+int
+main ()
+{
+return log ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log=yes
+else
+  ac_cv_lib_m_log=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log" >&5
+$as_echo "$ac_cv_lib_m_log" >&6; }
+if test "x$ac_cv_lib_m_log" = x""yes; then :
+
+$as_echo "#define HAVE_LOG 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for logl in -lm" >&5
+$as_echo_n "checking for logl in -lm... " >&6; }
+if test "${ac_cv_lib_m_logl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char logl ();
+int
+main ()
+{
+return logl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_logl=yes
+else
+  ac_cv_lib_m_logl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_logl" >&5
+$as_echo "$ac_cv_lib_m_logl" >&6; }
+if test "x$ac_cv_lib_m_logl" = x""yes; then :
+
+$as_echo "#define HAVE_LOGL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clogf in -lm" >&5
+$as_echo_n "checking for clogf in -lm... " >&6; }
+if test "${ac_cv_lib_m_clogf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clogf ();
+int
+main ()
+{
+return clogf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_clogf=yes
+else
+  ac_cv_lib_m_clogf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_clogf" >&5
+$as_echo "$ac_cv_lib_m_clogf" >&6; }
+if test "x$ac_cv_lib_m_clogf" = x""yes; then :
+
+$as_echo "#define HAVE_CLOGF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clog in -lm" >&5
+$as_echo_n "checking for clog in -lm... " >&6; }
+if test "${ac_cv_lib_m_clog+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clog ();
+int
+main ()
+{
+return clog ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_clog=yes
+else
+  ac_cv_lib_m_clog=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_clog" >&5
+$as_echo "$ac_cv_lib_m_clog" >&6; }
+if test "x$ac_cv_lib_m_clog" = x""yes; then :
+
+$as_echo "#define HAVE_CLOG 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clogl in -lm" >&5
+$as_echo_n "checking for clogl in -lm... " >&6; }
+if test "${ac_cv_lib_m_clogl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clogl ();
+int
+main ()
+{
+return clogl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_clogl=yes
+else
+  ac_cv_lib_m_clogl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_clogl" >&5
+$as_echo "$ac_cv_lib_m_clogl" >&6; }
+if test "x$ac_cv_lib_m_clogl" = x""yes; then :
+
+$as_echo "#define HAVE_CLOGL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for log10f in -lm" >&5
+$as_echo_n "checking for log10f in -lm... " >&6; }
+if test "${ac_cv_lib_m_log10f+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log10f ();
+int
+main ()
+{
+return log10f ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log10f=yes
+else
+  ac_cv_lib_m_log10f=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log10f" >&5
+$as_echo "$ac_cv_lib_m_log10f" >&6; }
+if test "x$ac_cv_lib_m_log10f" = x""yes; then :
+
+$as_echo "#define HAVE_LOG10F 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for log10 in -lm" >&5
+$as_echo_n "checking for log10 in -lm... " >&6; }
+if test "${ac_cv_lib_m_log10+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log10 ();
+int
+main ()
+{
+return log10 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log10=yes
+else
+  ac_cv_lib_m_log10=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log10" >&5
+$as_echo "$ac_cv_lib_m_log10" >&6; }
+if test "x$ac_cv_lib_m_log10" = x""yes; then :
+
+$as_echo "#define HAVE_LOG10 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for log10l in -lm" >&5
+$as_echo_n "checking for log10l in -lm... " >&6; }
+if test "${ac_cv_lib_m_log10l+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log10l ();
+int
+main ()
+{
+return log10l ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log10l=yes
+else
+  ac_cv_lib_m_log10l=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log10l" >&5
+$as_echo "$ac_cv_lib_m_log10l" >&6; }
+if test "x$ac_cv_lib_m_log10l" = x""yes; then :
+
+$as_echo "#define HAVE_LOG10L 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clog10f in -lm" >&5
+$as_echo_n "checking for clog10f in -lm... " >&6; }
+if test "${ac_cv_lib_m_clog10f+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clog10f ();
+int
+main ()
+{
+return clog10f ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_clog10f=yes
+else
+  ac_cv_lib_m_clog10f=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_clog10f" >&5
+$as_echo "$ac_cv_lib_m_clog10f" >&6; }
+if test "x$ac_cv_lib_m_clog10f" = x""yes; then :
+
+$as_echo "#define HAVE_CLOG10F 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clog10 in -lm" >&5
+$as_echo_n "checking for clog10 in -lm... " >&6; }
+if test "${ac_cv_lib_m_clog10+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clog10 ();
+int
+main ()
+{
+return clog10 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_clog10=yes
+else
+  ac_cv_lib_m_clog10=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_clog10" >&5
+$as_echo "$ac_cv_lib_m_clog10" >&6; }
+if test "x$ac_cv_lib_m_clog10" = x""yes; then :
+
+$as_echo "#define HAVE_CLOG10 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clog10l in -lm" >&5
+$as_echo_n "checking for clog10l in -lm... " >&6; }
+if test "${ac_cv_lib_m_clog10l+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clog10l ();
+int
+main ()
+{
+return clog10l ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_clog10l=yes
+else
+  ac_cv_lib_m_clog10l=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_clog10l" >&5
+$as_echo "$ac_cv_lib_m_clog10l" >&6; }
+if test "x$ac_cv_lib_m_clog10l" = x""yes; then :
+
+$as_echo "#define HAVE_CLOG10L 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nextafterf in -lm" >&5
+$as_echo_n "checking for nextafterf in -lm... " >&6; }
+if test "${ac_cv_lib_m_nextafterf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nextafterf ();
+int
+main ()
+{
+return nextafterf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_nextafterf=yes
+else
+  ac_cv_lib_m_nextafterf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_nextafterf" >&5
+$as_echo "$ac_cv_lib_m_nextafterf" >&6; }
+if test "x$ac_cv_lib_m_nextafterf" = x""yes; then :
+
+$as_echo "#define HAVE_NEXTAFTERF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nextafter in -lm" >&5
+$as_echo_n "checking for nextafter in -lm... " >&6; }
+if test "${ac_cv_lib_m_nextafter+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nextafter ();
+int
+main ()
+{
+return nextafter ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_nextafter=yes
+else
+  ac_cv_lib_m_nextafter=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_nextafter" >&5
+$as_echo "$ac_cv_lib_m_nextafter" >&6; }
+if test "x$ac_cv_lib_m_nextafter" = x""yes; then :
+
+$as_echo "#define HAVE_NEXTAFTER 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nextafterl in -lm" >&5
+$as_echo_n "checking for nextafterl in -lm... " >&6; }
+if test "${ac_cv_lib_m_nextafterl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nextafterl ();
+int
+main ()
+{
+return nextafterl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_nextafterl=yes
+else
+  ac_cv_lib_m_nextafterl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_nextafterl" >&5
+$as_echo "$ac_cv_lib_m_nextafterl" >&6; }
+if test "x$ac_cv_lib_m_nextafterl" = x""yes; then :
+
+$as_echo "#define HAVE_NEXTAFTERL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for powf in -lm" >&5
+$as_echo_n "checking for powf in -lm... " >&6; }
+if test "${ac_cv_lib_m_powf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char powf ();
+int
+main ()
+{
+return powf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_powf=yes
+else
+  ac_cv_lib_m_powf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_powf" >&5
+$as_echo "$ac_cv_lib_m_powf" >&6; }
+if test "x$ac_cv_lib_m_powf" = x""yes; then :
+
+$as_echo "#define HAVE_POWF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
+$as_echo_n "checking for pow in -lm... " >&6; }
+if test "${ac_cv_lib_m_pow+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_pow=yes
+else
+  ac_cv_lib_m_pow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
+$as_echo "$ac_cv_lib_m_pow" >&6; }
+if test "x$ac_cv_lib_m_pow" = x""yes; then :
+
+$as_echo "#define HAVE_POW 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for powl in -lm" >&5
+$as_echo_n "checking for powl in -lm... " >&6; }
+if test "${ac_cv_lib_m_powl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char powl ();
+int
+main ()
+{
+return powl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_powl=yes
+else
+  ac_cv_lib_m_powl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_powl" >&5
+$as_echo "$ac_cv_lib_m_powl" >&6; }
+if test "x$ac_cv_lib_m_powl" = x""yes; then :
+
+$as_echo "#define HAVE_POWL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpowf in -lm" >&5
+$as_echo_n "checking for cpowf in -lm... " >&6; }
+if test "${ac_cv_lib_m_cpowf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cpowf ();
+int
+main ()
+{
+return cpowf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cpowf=yes
+else
+  ac_cv_lib_m_cpowf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cpowf" >&5
+$as_echo "$ac_cv_lib_m_cpowf" >&6; }
+if test "x$ac_cv_lib_m_cpowf" = x""yes; then :
+
+$as_echo "#define HAVE_CPOWF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpow in -lm" >&5
+$as_echo_n "checking for cpow in -lm... " >&6; }
+if test "${ac_cv_lib_m_cpow+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cpow ();
+int
+main ()
+{
+return cpow ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cpow=yes
+else
+  ac_cv_lib_m_cpow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cpow" >&5
+$as_echo "$ac_cv_lib_m_cpow" >&6; }
+if test "x$ac_cv_lib_m_cpow" = x""yes; then :
+
+$as_echo "#define HAVE_CPOW 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpowl in -lm" >&5
+$as_echo_n "checking for cpowl in -lm... " >&6; }
+if test "${ac_cv_lib_m_cpowl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cpowl ();
+int
+main ()
+{
+return cpowl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cpowl=yes
+else
+  ac_cv_lib_m_cpowl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cpowl" >&5
+$as_echo "$ac_cv_lib_m_cpowl" >&6; }
+if test "x$ac_cv_lib_m_cpowl" = x""yes; then :
+
+$as_echo "#define HAVE_CPOWL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for roundf in -lm" >&5
+$as_echo_n "checking for roundf in -lm... " >&6; }
+if test "${ac_cv_lib_m_roundf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char roundf ();
+int
+main ()
+{
+return roundf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_roundf=yes
+else
+  ac_cv_lib_m_roundf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_roundf" >&5
+$as_echo "$ac_cv_lib_m_roundf" >&6; }
+if test "x$ac_cv_lib_m_roundf" = x""yes; then :
+
+$as_echo "#define HAVE_ROUNDF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for round in -lm" >&5
+$as_echo_n "checking for round in -lm... " >&6; }
+if test "${ac_cv_lib_m_round+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char round ();
+int
+main ()
+{
+return round ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_round=yes
+else
+  ac_cv_lib_m_round=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_round" >&5
+$as_echo "$ac_cv_lib_m_round" >&6; }
+if test "x$ac_cv_lib_m_round" = x""yes; then :
+
+$as_echo "#define HAVE_ROUND 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for roundl in -lm" >&5
+$as_echo_n "checking for roundl in -lm... " >&6; }
+if test "${ac_cv_lib_m_roundl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char roundl ();
+int
+main ()
+{
+return roundl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_roundl=yes
+else
+  ac_cv_lib_m_roundl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_roundl" >&5
+$as_echo "$ac_cv_lib_m_roundl" >&6; }
+if test "x$ac_cv_lib_m_roundl" = x""yes; then :
+
+$as_echo "#define HAVE_ROUNDL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lroundf in -lm" >&5
+$as_echo_n "checking for lroundf in -lm... " >&6; }
+if test "${ac_cv_lib_m_lroundf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lroundf ();
+int
+main ()
+{
+return lroundf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_lroundf=yes
+else
+  ac_cv_lib_m_lroundf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_lroundf" >&5
+$as_echo "$ac_cv_lib_m_lroundf" >&6; }
+if test "x$ac_cv_lib_m_lroundf" = x""yes; then :
+
+$as_echo "#define HAVE_LROUNDF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lround in -lm" >&5
+$as_echo_n "checking for lround in -lm... " >&6; }
+if test "${ac_cv_lib_m_lround+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lround ();
+int
+main ()
+{
+return lround ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_lround=yes
+else
+  ac_cv_lib_m_lround=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_lround" >&5
+$as_echo "$ac_cv_lib_m_lround" >&6; }
+if test "x$ac_cv_lib_m_lround" = x""yes; then :
+
+$as_echo "#define HAVE_LROUND 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lroundl in -lm" >&5
+$as_echo_n "checking for lroundl in -lm... " >&6; }
+if test "${ac_cv_lib_m_lroundl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lroundl ();
+int
+main ()
+{
+return lroundl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_lroundl=yes
+else
+  ac_cv_lib_m_lroundl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_lroundl" >&5
+$as_echo "$ac_cv_lib_m_lroundl" >&6; }
+if test "x$ac_cv_lib_m_lroundl" = x""yes; then :
+
+$as_echo "#define HAVE_LROUNDL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for llroundf in -lm" >&5
+$as_echo_n "checking for llroundf in -lm... " >&6; }
+if test "${ac_cv_lib_m_llroundf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char llroundf ();
+int
+main ()
+{
+return llroundf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_llroundf=yes
+else
+  ac_cv_lib_m_llroundf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_llroundf" >&5
+$as_echo "$ac_cv_lib_m_llroundf" >&6; }
+if test "x$ac_cv_lib_m_llroundf" = x""yes; then :
+
+$as_echo "#define HAVE_LLROUNDF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for llround in -lm" >&5
+$as_echo_n "checking for llround in -lm... " >&6; }
+if test "${ac_cv_lib_m_llround+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char llround ();
+int
+main ()
+{
+return llround ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_llround=yes
+else
+  ac_cv_lib_m_llround=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_llround" >&5
+$as_echo "$ac_cv_lib_m_llround" >&6; }
+if test "x$ac_cv_lib_m_llround" = x""yes; then :
+
+$as_echo "#define HAVE_LLROUND 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for llroundl in -lm" >&5
+$as_echo_n "checking for llroundl in -lm... " >&6; }
+if test "${ac_cv_lib_m_llroundl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char llroundl ();
+int
+main ()
+{
+return llroundl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_llroundl=yes
+else
+  ac_cv_lib_m_llroundl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_llroundl" >&5
+$as_echo "$ac_cv_lib_m_llroundl" >&6; }
+if test "x$ac_cv_lib_m_llroundl" = x""yes; then :
+
+$as_echo "#define HAVE_LLROUNDL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for scalbnf in -lm" >&5
+$as_echo_n "checking for scalbnf in -lm... " >&6; }
+if test "${ac_cv_lib_m_scalbnf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char scalbnf ();
+int
+main ()
+{
+return scalbnf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_scalbnf=yes
+else
+  ac_cv_lib_m_scalbnf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_scalbnf" >&5
+$as_echo "$ac_cv_lib_m_scalbnf" >&6; }
+if test "x$ac_cv_lib_m_scalbnf" = x""yes; then :
+
+$as_echo "#define HAVE_SCALBNF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for scalbn in -lm" >&5
+$as_echo_n "checking for scalbn in -lm... " >&6; }
+if test "${ac_cv_lib_m_scalbn+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char scalbn ();
+int
+main ()
+{
+return scalbn ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_scalbn=yes
+else
+  ac_cv_lib_m_scalbn=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_scalbn" >&5
+$as_echo "$ac_cv_lib_m_scalbn" >&6; }
+if test "x$ac_cv_lib_m_scalbn" = x""yes; then :
+
+$as_echo "#define HAVE_SCALBN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for scalbnl in -lm" >&5
+$as_echo_n "checking for scalbnl in -lm... " >&6; }
+if test "${ac_cv_lib_m_scalbnl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char scalbnl ();
+int
+main ()
+{
+return scalbnl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_scalbnl=yes
+else
+  ac_cv_lib_m_scalbnl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_scalbnl" >&5
+$as_echo "$ac_cv_lib_m_scalbnl" >&6; }
+if test "x$ac_cv_lib_m_scalbnl" = x""yes; then :
+
+$as_echo "#define HAVE_SCALBNL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinf in -lm" >&5
+$as_echo_n "checking for sinf in -lm... " >&6; }
+if test "${ac_cv_lib_m_sinf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sinf ();
+int
+main ()
+{
+return sinf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sinf=yes
+else
+  ac_cv_lib_m_sinf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinf" >&5
+$as_echo "$ac_cv_lib_m_sinf" >&6; }
+if test "x$ac_cv_lib_m_sinf" = x""yes; then :
+
+$as_echo "#define HAVE_SINF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
+$as_echo_n "checking for sin in -lm... " >&6; }
+if test "${ac_cv_lib_m_sin+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sin ();
+int
+main ()
+{
+return sin ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sin=yes
+else
+  ac_cv_lib_m_sin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5
+$as_echo "$ac_cv_lib_m_sin" >&6; }
+if test "x$ac_cv_lib_m_sin" = x""yes; then :
+
+$as_echo "#define HAVE_SIN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinl in -lm" >&5
+$as_echo_n "checking for sinl in -lm... " >&6; }
+if test "${ac_cv_lib_m_sinl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sinl ();
+int
+main ()
+{
+return sinl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sinl=yes
+else
+  ac_cv_lib_m_sinl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinl" >&5
+$as_echo "$ac_cv_lib_m_sinl" >&6; }
+if test "x$ac_cv_lib_m_sinl" = x""yes; then :
+
+$as_echo "#define HAVE_SINL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for csinf in -lm" >&5
+$as_echo_n "checking for csinf in -lm... " >&6; }
+if test "${ac_cv_lib_m_csinf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csinf ();
+int
+main ()
+{
+return csinf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_csinf=yes
+else
+  ac_cv_lib_m_csinf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_csinf" >&5
+$as_echo "$ac_cv_lib_m_csinf" >&6; }
+if test "x$ac_cv_lib_m_csinf" = x""yes; then :
+
+$as_echo "#define HAVE_CSINF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for csin in -lm" >&5
+$as_echo_n "checking for csin in -lm... " >&6; }
+if test "${ac_cv_lib_m_csin+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csin ();
+int
+main ()
+{
+return csin ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_csin=yes
+else
+  ac_cv_lib_m_csin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_csin" >&5
+$as_echo "$ac_cv_lib_m_csin" >&6; }
+if test "x$ac_cv_lib_m_csin" = x""yes; then :
+
+$as_echo "#define HAVE_CSIN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for csinl in -lm" >&5
+$as_echo_n "checking for csinl in -lm... " >&6; }
+if test "${ac_cv_lib_m_csinl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csinl ();
+int
+main ()
+{
+return csinl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_csinl=yes
+else
+  ac_cv_lib_m_csinl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_csinl" >&5
+$as_echo "$ac_cv_lib_m_csinl" >&6; }
+if test "x$ac_cv_lib_m_csinl" = x""yes; then :
+
+$as_echo "#define HAVE_CSINL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinhf in -lm" >&5
+$as_echo_n "checking for sinhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_sinhf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sinhf ();
+int
+main ()
+{
+return sinhf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sinhf=yes
+else
+  ac_cv_lib_m_sinhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinhf" >&5
+$as_echo "$ac_cv_lib_m_sinhf" >&6; }
+if test "x$ac_cv_lib_m_sinhf" = x""yes; then :
+
+$as_echo "#define HAVE_SINHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinh in -lm" >&5
+$as_echo_n "checking for sinh in -lm... " >&6; }
+if test "${ac_cv_lib_m_sinh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sinh ();
+int
+main ()
+{
+return sinh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sinh=yes
+else
+  ac_cv_lib_m_sinh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinh" >&5
+$as_echo "$ac_cv_lib_m_sinh" >&6; }
+if test "x$ac_cv_lib_m_sinh" = x""yes; then :
+
+$as_echo "#define HAVE_SINH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinhl in -lm" >&5
+$as_echo_n "checking for sinhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_sinhl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sinhl ();
+int
+main ()
+{
+return sinhl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sinhl=yes
+else
+  ac_cv_lib_m_sinhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinhl" >&5
+$as_echo "$ac_cv_lib_m_sinhl" >&6; }
+if test "x$ac_cv_lib_m_sinhl" = x""yes; then :
+
+$as_echo "#define HAVE_SINHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for csinhf in -lm" >&5
+$as_echo_n "checking for csinhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_csinhf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csinhf ();
+int
+main ()
+{
+return csinhf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_csinhf=yes
+else
+  ac_cv_lib_m_csinhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_csinhf" >&5
+$as_echo "$ac_cv_lib_m_csinhf" >&6; }
+if test "x$ac_cv_lib_m_csinhf" = x""yes; then :
+
+$as_echo "#define HAVE_CSINHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for csinh in -lm" >&5
+$as_echo_n "checking for csinh in -lm... " >&6; }
+if test "${ac_cv_lib_m_csinh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csinh ();
+int
+main ()
+{
+return csinh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_csinh=yes
+else
+  ac_cv_lib_m_csinh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_csinh" >&5
+$as_echo "$ac_cv_lib_m_csinh" >&6; }
+if test "x$ac_cv_lib_m_csinh" = x""yes; then :
+
+$as_echo "#define HAVE_CSINH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for csinhl in -lm" >&5
+$as_echo_n "checking for csinhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_csinhl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csinhl ();
+int
+main ()
+{
+return csinhl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_csinhl=yes
+else
+  ac_cv_lib_m_csinhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_csinhl" >&5
+$as_echo "$ac_cv_lib_m_csinhl" >&6; }
+if test "x$ac_cv_lib_m_csinhl" = x""yes; then :
+
+$as_echo "#define HAVE_CSINHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtf in -lm" >&5
+$as_echo_n "checking for sqrtf in -lm... " >&6; }
+if test "${ac_cv_lib_m_sqrtf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sqrtf ();
+int
+main ()
+{
+return sqrtf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sqrtf=yes
+else
+  ac_cv_lib_m_sqrtf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrtf" >&5
+$as_echo "$ac_cv_lib_m_sqrtf" >&6; }
+if test "x$ac_cv_lib_m_sqrtf" = x""yes; then :
+
+$as_echo "#define HAVE_SQRTF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
+$as_echo_n "checking for sqrt in -lm... " >&6; }
+if test "${ac_cv_lib_m_sqrt+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sqrt ();
+int
+main ()
+{
+return sqrt ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sqrt=yes
+else
+  ac_cv_lib_m_sqrt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
+$as_echo "$ac_cv_lib_m_sqrt" >&6; }
+if test "x$ac_cv_lib_m_sqrt" = x""yes; then :
+
+$as_echo "#define HAVE_SQRT 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtl in -lm" >&5
+$as_echo_n "checking for sqrtl in -lm... " >&6; }
+if test "${ac_cv_lib_m_sqrtl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sqrtl ();
+int
+main ()
+{
+return sqrtl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sqrtl=yes
+else
+  ac_cv_lib_m_sqrtl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrtl" >&5
+$as_echo "$ac_cv_lib_m_sqrtl" >&6; }
+if test "x$ac_cv_lib_m_sqrtl" = x""yes; then :
+
+$as_echo "#define HAVE_SQRTL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for csqrtf in -lm" >&5
+$as_echo_n "checking for csqrtf in -lm... " >&6; }
+if test "${ac_cv_lib_m_csqrtf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csqrtf ();
+int
+main ()
+{
+return csqrtf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_csqrtf=yes
+else
+  ac_cv_lib_m_csqrtf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_csqrtf" >&5
+$as_echo "$ac_cv_lib_m_csqrtf" >&6; }
+if test "x$ac_cv_lib_m_csqrtf" = x""yes; then :
+
+$as_echo "#define HAVE_CSQRTF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for csqrt in -lm" >&5
+$as_echo_n "checking for csqrt in -lm... " >&6; }
+if test "${ac_cv_lib_m_csqrt+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csqrt ();
+int
+main ()
+{
+return csqrt ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_csqrt=yes
+else
+  ac_cv_lib_m_csqrt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_csqrt" >&5
+$as_echo "$ac_cv_lib_m_csqrt" >&6; }
+if test "x$ac_cv_lib_m_csqrt" = x""yes; then :
+
+$as_echo "#define HAVE_CSQRT 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for csqrtl in -lm" >&5
+$as_echo_n "checking for csqrtl in -lm... " >&6; }
+if test "${ac_cv_lib_m_csqrtl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csqrtl ();
+int
+main ()
+{
+return csqrtl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_csqrtl=yes
+else
+  ac_cv_lib_m_csqrtl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_csqrtl" >&5
+$as_echo "$ac_cv_lib_m_csqrtl" >&6; }
+if test "x$ac_cv_lib_m_csqrtl" = x""yes; then :
+
+$as_echo "#define HAVE_CSQRTL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanf in -lm" >&5
+$as_echo_n "checking for tanf in -lm... " >&6; }
+if test "${ac_cv_lib_m_tanf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tanf ();
+int
+main ()
+{
+return tanf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_tanf=yes
+else
+  ac_cv_lib_m_tanf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanf" >&5
+$as_echo "$ac_cv_lib_m_tanf" >&6; }
+if test "x$ac_cv_lib_m_tanf" = x""yes; then :
+
+$as_echo "#define HAVE_TANF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tan in -lm" >&5
+$as_echo_n "checking for tan in -lm... " >&6; }
+if test "${ac_cv_lib_m_tan+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tan ();
+int
+main ()
+{
+return tan ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_tan=yes
+else
+  ac_cv_lib_m_tan=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tan" >&5
+$as_echo "$ac_cv_lib_m_tan" >&6; }
+if test "x$ac_cv_lib_m_tan" = x""yes; then :
+
+$as_echo "#define HAVE_TAN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanl in -lm" >&5
+$as_echo_n "checking for tanl in -lm... " >&6; }
+if test "${ac_cv_lib_m_tanl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tanl ();
+int
+main ()
+{
+return tanl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_tanl=yes
+else
+  ac_cv_lib_m_tanl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanl" >&5
+$as_echo "$ac_cv_lib_m_tanl" >&6; }
+if test "x$ac_cv_lib_m_tanl" = x""yes; then :
+
+$as_echo "#define HAVE_TANL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctanf in -lm" >&5
+$as_echo_n "checking for ctanf in -lm... " >&6; }
+if test "${ac_cv_lib_m_ctanf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ctanf ();
+int
+main ()
+{
+return ctanf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ctanf=yes
+else
+  ac_cv_lib_m_ctanf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ctanf" >&5
+$as_echo "$ac_cv_lib_m_ctanf" >&6; }
+if test "x$ac_cv_lib_m_ctanf" = x""yes; then :
+
+$as_echo "#define HAVE_CTANF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctan in -lm" >&5
+$as_echo_n "checking for ctan in -lm... " >&6; }
+if test "${ac_cv_lib_m_ctan+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ctan ();
+int
+main ()
+{
+return ctan ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ctan=yes
+else
+  ac_cv_lib_m_ctan=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ctan" >&5
+$as_echo "$ac_cv_lib_m_ctan" >&6; }
+if test "x$ac_cv_lib_m_ctan" = x""yes; then :
+
+$as_echo "#define HAVE_CTAN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctanl in -lm" >&5
+$as_echo_n "checking for ctanl in -lm... " >&6; }
+if test "${ac_cv_lib_m_ctanl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ctanl ();
+int
+main ()
+{
+return ctanl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ctanl=yes
+else
+  ac_cv_lib_m_ctanl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ctanl" >&5
+$as_echo "$ac_cv_lib_m_ctanl" >&6; }
+if test "x$ac_cv_lib_m_ctanl" = x""yes; then :
+
+$as_echo "#define HAVE_CTANL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanhf in -lm" >&5
+$as_echo_n "checking for tanhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_tanhf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tanhf ();
+int
+main ()
+{
+return tanhf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_tanhf=yes
+else
+  ac_cv_lib_m_tanhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanhf" >&5
+$as_echo "$ac_cv_lib_m_tanhf" >&6; }
+if test "x$ac_cv_lib_m_tanhf" = x""yes; then :
+
+$as_echo "#define HAVE_TANHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanh in -lm" >&5
+$as_echo_n "checking for tanh in -lm... " >&6; }
+if test "${ac_cv_lib_m_tanh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tanh ();
+int
+main ()
+{
+return tanh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_tanh=yes
+else
+  ac_cv_lib_m_tanh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanh" >&5
+$as_echo "$ac_cv_lib_m_tanh" >&6; }
+if test "x$ac_cv_lib_m_tanh" = x""yes; then :
+
+$as_echo "#define HAVE_TANH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanhl in -lm" >&5
+$as_echo_n "checking for tanhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_tanhl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tanhl ();
+int
+main ()
+{
+return tanhl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_tanhl=yes
+else
+  ac_cv_lib_m_tanhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanhl" >&5
+$as_echo "$ac_cv_lib_m_tanhl" >&6; }
+if test "x$ac_cv_lib_m_tanhl" = x""yes; then :
+
+$as_echo "#define HAVE_TANHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctanhf in -lm" >&5
+$as_echo_n "checking for ctanhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_ctanhf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ctanhf ();
+int
+main ()
+{
+return ctanhf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ctanhf=yes
+else
+  ac_cv_lib_m_ctanhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ctanhf" >&5
+$as_echo "$ac_cv_lib_m_ctanhf" >&6; }
+if test "x$ac_cv_lib_m_ctanhf" = x""yes; then :
+
+$as_echo "#define HAVE_CTANHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctanh in -lm" >&5
+$as_echo_n "checking for ctanh in -lm... " >&6; }
+if test "${ac_cv_lib_m_ctanh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ctanh ();
+int
+main ()
+{
+return ctanh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ctanh=yes
+else
+  ac_cv_lib_m_ctanh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ctanh" >&5
+$as_echo "$ac_cv_lib_m_ctanh" >&6; }
+if test "x$ac_cv_lib_m_ctanh" = x""yes; then :
+
+$as_echo "#define HAVE_CTANH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctanhl in -lm" >&5
+$as_echo_n "checking for ctanhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_ctanhl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ctanhl ();
+int
+main ()
+{
+return ctanhl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ctanhl=yes
+else
+  ac_cv_lib_m_ctanhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ctanhl" >&5
+$as_echo "$ac_cv_lib_m_ctanhl" >&6; }
+if test "x$ac_cv_lib_m_ctanhl" = x""yes; then :
+
+$as_echo "#define HAVE_CTANHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for truncf in -lm" >&5
+$as_echo_n "checking for truncf in -lm... " >&6; }
+if test "${ac_cv_lib_m_truncf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char truncf ();
+int
+main ()
+{
+return truncf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_truncf=yes
+else
+  ac_cv_lib_m_truncf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_truncf" >&5
+$as_echo "$ac_cv_lib_m_truncf" >&6; }
+if test "x$ac_cv_lib_m_truncf" = x""yes; then :
+
+$as_echo "#define HAVE_TRUNCF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for trunc in -lm" >&5
+$as_echo_n "checking for trunc in -lm... " >&6; }
+if test "${ac_cv_lib_m_trunc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char trunc ();
+int
+main ()
+{
+return trunc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_trunc=yes
+else
+  ac_cv_lib_m_trunc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_trunc" >&5
+$as_echo "$ac_cv_lib_m_trunc" >&6; }
+if test "x$ac_cv_lib_m_trunc" = x""yes; then :
+
+$as_echo "#define HAVE_TRUNC 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for truncl in -lm" >&5
+$as_echo_n "checking for truncl in -lm... " >&6; }
+if test "${ac_cv_lib_m_truncl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char truncl ();
+int
+main ()
+{
+return truncl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_truncl=yes
+else
+  ac_cv_lib_m_truncl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_truncl" >&5
+$as_echo "$ac_cv_lib_m_truncl" >&6; }
+if test "x$ac_cv_lib_m_truncl" = x""yes; then :
+
+$as_echo "#define HAVE_TRUNCL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for erff in -lm" >&5
+$as_echo_n "checking for erff in -lm... " >&6; }
+if test "${ac_cv_lib_m_erff+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char erff ();
+int
+main ()
+{
+return erff ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_erff=yes
+else
+  ac_cv_lib_m_erff=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_erff" >&5
+$as_echo "$ac_cv_lib_m_erff" >&6; }
+if test "x$ac_cv_lib_m_erff" = x""yes; then :
+
+$as_echo "#define HAVE_ERFF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for erf in -lm" >&5
+$as_echo_n "checking for erf in -lm... " >&6; }
+if test "${ac_cv_lib_m_erf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char erf ();
+int
+main ()
+{
+return erf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_erf=yes
+else
+  ac_cv_lib_m_erf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_erf" >&5
+$as_echo "$ac_cv_lib_m_erf" >&6; }
+if test "x$ac_cv_lib_m_erf" = x""yes; then :
+
+$as_echo "#define HAVE_ERF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for erfl in -lm" >&5
+$as_echo_n "checking for erfl in -lm... " >&6; }
+if test "${ac_cv_lib_m_erfl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char erfl ();
+int
+main ()
+{
+return erfl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_erfl=yes
+else
+  ac_cv_lib_m_erfl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_erfl" >&5
+$as_echo "$ac_cv_lib_m_erfl" >&6; }
+if test "x$ac_cv_lib_m_erfl" = x""yes; then :
+
+$as_echo "#define HAVE_ERFL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for erfcf in -lm" >&5
+$as_echo_n "checking for erfcf in -lm... " >&6; }
+if test "${ac_cv_lib_m_erfcf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char erfcf ();
+int
+main ()
+{
+return erfcf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_erfcf=yes
+else
+  ac_cv_lib_m_erfcf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_erfcf" >&5
+$as_echo "$ac_cv_lib_m_erfcf" >&6; }
+if test "x$ac_cv_lib_m_erfcf" = x""yes; then :
+
+$as_echo "#define HAVE_ERFCF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for erfc in -lm" >&5
+$as_echo_n "checking for erfc in -lm... " >&6; }
+if test "${ac_cv_lib_m_erfc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char erfc ();
+int
+main ()
+{
+return erfc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_erfc=yes
+else
+  ac_cv_lib_m_erfc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_erfc" >&5
+$as_echo "$ac_cv_lib_m_erfc" >&6; }
+if test "x$ac_cv_lib_m_erfc" = x""yes; then :
+
+$as_echo "#define HAVE_ERFC 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for erfcl in -lm" >&5
+$as_echo_n "checking for erfcl in -lm... " >&6; }
+if test "${ac_cv_lib_m_erfcl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char erfcl ();
+int
+main ()
+{
+return erfcl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_erfcl=yes
+else
+  ac_cv_lib_m_erfcl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_erfcl" >&5
+$as_echo "$ac_cv_lib_m_erfcl" >&6; }
+if test "x$ac_cv_lib_m_erfcl" = x""yes; then :
+
+$as_echo "#define HAVE_ERFCL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for j0f in -lm" >&5
+$as_echo_n "checking for j0f in -lm... " >&6; }
+if test "${ac_cv_lib_m_j0f+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char j0f ();
+int
+main ()
+{
+return j0f ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_j0f=yes
+else
+  ac_cv_lib_m_j0f=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_j0f" >&5
+$as_echo "$ac_cv_lib_m_j0f" >&6; }
+if test "x$ac_cv_lib_m_j0f" = x""yes; then :
+
+$as_echo "#define HAVE_J0F 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for j0 in -lm" >&5
+$as_echo_n "checking for j0 in -lm... " >&6; }
+if test "${ac_cv_lib_m_j0+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char j0 ();
+int
+main ()
+{
+return j0 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_j0=yes
+else
+  ac_cv_lib_m_j0=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_j0" >&5
+$as_echo "$ac_cv_lib_m_j0" >&6; }
+if test "x$ac_cv_lib_m_j0" = x""yes; then :
+
+$as_echo "#define HAVE_J0 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for j0l in -lm" >&5
+$as_echo_n "checking for j0l in -lm... " >&6; }
+if test "${ac_cv_lib_m_j0l+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char j0l ();
+int
+main ()
+{
+return j0l ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_j0l=yes
+else
+  ac_cv_lib_m_j0l=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_j0l" >&5
+$as_echo "$ac_cv_lib_m_j0l" >&6; }
+if test "x$ac_cv_lib_m_j0l" = x""yes; then :
+
+$as_echo "#define HAVE_J0L 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for j1f in -lm" >&5
+$as_echo_n "checking for j1f in -lm... " >&6; }
+if test "${ac_cv_lib_m_j1f+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char j1f ();
+int
+main ()
+{
+return j1f ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_j1f=yes
+else
+  ac_cv_lib_m_j1f=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_j1f" >&5
+$as_echo "$ac_cv_lib_m_j1f" >&6; }
+if test "x$ac_cv_lib_m_j1f" = x""yes; then :
+
+$as_echo "#define HAVE_J1F 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for j1 in -lm" >&5
+$as_echo_n "checking for j1 in -lm... " >&6; }
+if test "${ac_cv_lib_m_j1+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char j1 ();
+int
+main ()
+{
+return j1 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_j1=yes
+else
+  ac_cv_lib_m_j1=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_j1" >&5
+$as_echo "$ac_cv_lib_m_j1" >&6; }
+if test "x$ac_cv_lib_m_j1" = x""yes; then :
+
+$as_echo "#define HAVE_J1 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for j1l in -lm" >&5
+$as_echo_n "checking for j1l in -lm... " >&6; }
+if test "${ac_cv_lib_m_j1l+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char j1l ();
+int
+main ()
+{
+return j1l ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_j1l=yes
+else
+  ac_cv_lib_m_j1l=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_j1l" >&5
+$as_echo "$ac_cv_lib_m_j1l" >&6; }
+if test "x$ac_cv_lib_m_j1l" = x""yes; then :
+
+$as_echo "#define HAVE_J1L 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jnf in -lm" >&5
+$as_echo_n "checking for jnf in -lm... " >&6; }
+if test "${ac_cv_lib_m_jnf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jnf ();
+int
+main ()
+{
+return jnf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_jnf=yes
+else
+  ac_cv_lib_m_jnf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_jnf" >&5
+$as_echo "$ac_cv_lib_m_jnf" >&6; }
+if test "x$ac_cv_lib_m_jnf" = x""yes; then :
+
+$as_echo "#define HAVE_JNF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jn in -lm" >&5
+$as_echo_n "checking for jn in -lm... " >&6; }
+if test "${ac_cv_lib_m_jn+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jn ();
+int
+main ()
+{
+return jn ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_jn=yes
+else
+  ac_cv_lib_m_jn=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_jn" >&5
+$as_echo "$ac_cv_lib_m_jn" >&6; }
+if test "x$ac_cv_lib_m_jn" = x""yes; then :
+
+$as_echo "#define HAVE_JN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jnl in -lm" >&5
+$as_echo_n "checking for jnl in -lm... " >&6; }
+if test "${ac_cv_lib_m_jnl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jnl ();
+int
+main ()
+{
+return jnl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_jnl=yes
+else
+  ac_cv_lib_m_jnl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_jnl" >&5
+$as_echo "$ac_cv_lib_m_jnl" >&6; }
+if test "x$ac_cv_lib_m_jnl" = x""yes; then :
+
+$as_echo "#define HAVE_JNL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for y0f in -lm" >&5
+$as_echo_n "checking for y0f in -lm... " >&6; }
+if test "${ac_cv_lib_m_y0f+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char y0f ();
+int
+main ()
+{
+return y0f ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_y0f=yes
+else
+  ac_cv_lib_m_y0f=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_y0f" >&5
+$as_echo "$ac_cv_lib_m_y0f" >&6; }
+if test "x$ac_cv_lib_m_y0f" = x""yes; then :
+
+$as_echo "#define HAVE_Y0F 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for y0 in -lm" >&5
+$as_echo_n "checking for y0 in -lm... " >&6; }
+if test "${ac_cv_lib_m_y0+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char y0 ();
+int
+main ()
+{
+return y0 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_y0=yes
+else
+  ac_cv_lib_m_y0=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_y0" >&5
+$as_echo "$ac_cv_lib_m_y0" >&6; }
+if test "x$ac_cv_lib_m_y0" = x""yes; then :
+
+$as_echo "#define HAVE_Y0 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for y0l in -lm" >&5
+$as_echo_n "checking for y0l in -lm... " >&6; }
+if test "${ac_cv_lib_m_y0l+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char y0l ();
+int
+main ()
+{
+return y0l ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_y0l=yes
+else
+  ac_cv_lib_m_y0l=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_y0l" >&5
+$as_echo "$ac_cv_lib_m_y0l" >&6; }
+if test "x$ac_cv_lib_m_y0l" = x""yes; then :
+
+$as_echo "#define HAVE_Y0L 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for y1f in -lm" >&5
+$as_echo_n "checking for y1f in -lm... " >&6; }
+if test "${ac_cv_lib_m_y1f+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char y1f ();
+int
+main ()
+{
+return y1f ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_y1f=yes
+else
+  ac_cv_lib_m_y1f=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_y1f" >&5
+$as_echo "$ac_cv_lib_m_y1f" >&6; }
+if test "x$ac_cv_lib_m_y1f" = x""yes; then :
+
+$as_echo "#define HAVE_Y1F 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for y1 in -lm" >&5
+$as_echo_n "checking for y1 in -lm... " >&6; }
+if test "${ac_cv_lib_m_y1+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char y1 ();
+int
+main ()
+{
+return y1 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_y1=yes
+else
+  ac_cv_lib_m_y1=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_y1" >&5
+$as_echo "$ac_cv_lib_m_y1" >&6; }
+if test "x$ac_cv_lib_m_y1" = x""yes; then :
+
+$as_echo "#define HAVE_Y1 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for y1l in -lm" >&5
+$as_echo_n "checking for y1l in -lm... " >&6; }
+if test "${ac_cv_lib_m_y1l+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char y1l ();
+int
+main ()
+{
+return y1l ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_y1l=yes
+else
+  ac_cv_lib_m_y1l=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_y1l" >&5
+$as_echo "$ac_cv_lib_m_y1l" >&6; }
+if test "x$ac_cv_lib_m_y1l" = x""yes; then :
+
+$as_echo "#define HAVE_Y1L 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ynf in -lm" >&5
+$as_echo_n "checking for ynf in -lm... " >&6; }
+if test "${ac_cv_lib_m_ynf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ynf ();
+int
+main ()
+{
+return ynf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ynf=yes
+else
+  ac_cv_lib_m_ynf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ynf" >&5
+$as_echo "$ac_cv_lib_m_ynf" >&6; }
+if test "x$ac_cv_lib_m_ynf" = x""yes; then :
+
+$as_echo "#define HAVE_YNF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for yn in -lm" >&5
+$as_echo_n "checking for yn in -lm... " >&6; }
+if test "${ac_cv_lib_m_yn+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char yn ();
+int
+main ()
+{
+return yn ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_yn=yes
+else
+  ac_cv_lib_m_yn=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_yn" >&5
+$as_echo "$ac_cv_lib_m_yn" >&6; }
+if test "x$ac_cv_lib_m_yn" = x""yes; then :
+
+$as_echo "#define HAVE_YN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ynl in -lm" >&5
+$as_echo_n "checking for ynl in -lm... " >&6; }
+if test "${ac_cv_lib_m_ynl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ynl ();
+int
+main ()
+{
+return ynl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_ynl=yes
+else
+  ac_cv_lib_m_ynl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ynl" >&5
+$as_echo "$ac_cv_lib_m_ynl" >&6; }
+if test "x$ac_cv_lib_m_ynl" = x""yes; then :
+
+$as_echo "#define HAVE_YNL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgamma in -lm" >&5
+$as_echo_n "checking for tgamma in -lm... " >&6; }
+if test "${ac_cv_lib_m_tgamma+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tgamma ();
+int
+main ()
+{
+return tgamma ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_tgamma=yes
+else
+  ac_cv_lib_m_tgamma=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tgamma" >&5
+$as_echo "$ac_cv_lib_m_tgamma" >&6; }
+if test "x$ac_cv_lib_m_tgamma" = x""yes; then :
+
+$as_echo "#define HAVE_TGAMMA 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgammaf in -lm" >&5
+$as_echo_n "checking for tgammaf in -lm... " >&6; }
+if test "${ac_cv_lib_m_tgammaf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tgammaf ();
+int
+main ()
+{
+return tgammaf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_tgammaf=yes
+else
+  ac_cv_lib_m_tgammaf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tgammaf" >&5
+$as_echo "$ac_cv_lib_m_tgammaf" >&6; }
+if test "x$ac_cv_lib_m_tgammaf" = x""yes; then :
+
+$as_echo "#define HAVE_TGAMMAF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgammal in -lm" >&5
+$as_echo_n "checking for tgammal in -lm... " >&6; }
+if test "${ac_cv_lib_m_tgammal+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tgammal ();
+int
+main ()
+{
+return tgammal ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_tgammal=yes
+else
+  ac_cv_lib_m_tgammal=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tgammal" >&5
+$as_echo "$ac_cv_lib_m_tgammal" >&6; }
+if test "x$ac_cv_lib_m_tgammal" = x""yes; then :
+
+$as_echo "#define HAVE_TGAMMAL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lgamma in -lm" >&5
+$as_echo_n "checking for lgamma in -lm... " >&6; }
+if test "${ac_cv_lib_m_lgamma+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lgamma ();
+int
+main ()
+{
+return lgamma ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_lgamma=yes
+else
+  ac_cv_lib_m_lgamma=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_lgamma" >&5
+$as_echo "$ac_cv_lib_m_lgamma" >&6; }
+if test "x$ac_cv_lib_m_lgamma" = x""yes; then :
+
+$as_echo "#define HAVE_LGAMMA 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lgammaf in -lm" >&5
+$as_echo_n "checking for lgammaf in -lm... " >&6; }
+if test "${ac_cv_lib_m_lgammaf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lgammaf ();
+int
+main ()
+{
+return lgammaf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_lgammaf=yes
+else
+  ac_cv_lib_m_lgammaf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_lgammaf" >&5
+$as_echo "$ac_cv_lib_m_lgammaf" >&6; }
+if test "x$ac_cv_lib_m_lgammaf" = x""yes; then :
+
+$as_echo "#define HAVE_LGAMMAF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lgammal in -lm" >&5
+$as_echo_n "checking for lgammal in -lm... " >&6; }
+if test "${ac_cv_lib_m_lgammal+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lgammal ();
+int
+main ()
+{
+return lgammal ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_lgammal=yes
+else
+  ac_cv_lib_m_lgammal=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_lgammal" >&5
+$as_echo "$ac_cv_lib_m_lgammal" >&6; }
+if test "x$ac_cv_lib_m_lgammal" = x""yes; then :
+
+$as_echo "#define HAVE_LGAMMAL 1" >>confdefs.h
+
+fi
+
+
+# Check for GFORTRAN_C99_1.1 funcs
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacos in -lm" >&5
+$as_echo_n "checking for cacos in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacos+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacos ();
+int
+main ()
+{
+return cacos ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cacos=yes
+else
+  ac_cv_lib_m_cacos=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacos" >&5
+$as_echo "$ac_cv_lib_m_cacos" >&6; }
+if test "x$ac_cv_lib_m_cacos" = x""yes; then :
+
+$as_echo "#define HAVE_CACOS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacosf in -lm" >&5
+$as_echo_n "checking for cacosf in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacosf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacosf ();
+int
+main ()
+{
+return cacosf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cacosf=yes
+else
+  ac_cv_lib_m_cacosf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacosf" >&5
+$as_echo "$ac_cv_lib_m_cacosf" >&6; }
+if test "x$ac_cv_lib_m_cacosf" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacosh in -lm" >&5
+$as_echo_n "checking for cacosh in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacosh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacosh ();
+int
+main ()
+{
+return cacosh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cacosh=yes
+else
+  ac_cv_lib_m_cacosh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacosh" >&5
+$as_echo "$ac_cv_lib_m_cacosh" >&6; }
+if test "x$ac_cv_lib_m_cacosh" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacoshf in -lm" >&5
+$as_echo_n "checking for cacoshf in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacoshf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacoshf ();
+int
+main ()
+{
+return cacoshf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cacoshf=yes
+else
+  ac_cv_lib_m_cacoshf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacoshf" >&5
+$as_echo "$ac_cv_lib_m_cacoshf" >&6; }
+if test "x$ac_cv_lib_m_cacoshf" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacoshl in -lm" >&5
+$as_echo_n "checking for cacoshl in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacoshl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacoshl ();
+int
+main ()
+{
+return cacoshl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cacoshl=yes
+else
+  ac_cv_lib_m_cacoshl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacoshl" >&5
+$as_echo "$ac_cv_lib_m_cacoshl" >&6; }
+if test "x$ac_cv_lib_m_cacoshl" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacosl in -lm" >&5
+$as_echo_n "checking for cacosl in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacosl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacosl ();
+int
+main ()
+{
+return cacosl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_cacosl=yes
+else
+  ac_cv_lib_m_cacosl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacosl" >&5
+$as_echo "$ac_cv_lib_m_cacosl" >&6; }
+if test "x$ac_cv_lib_m_cacosl" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casin in -lm" >&5
+$as_echo_n "checking for casin in -lm... " >&6; }
+if test "${ac_cv_lib_m_casin+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casin ();
+int
+main ()
+{
+return casin ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_casin=yes
+else
+  ac_cv_lib_m_casin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casin" >&5
+$as_echo "$ac_cv_lib_m_casin" >&6; }
+if test "x$ac_cv_lib_m_casin" = x""yes; then :
+
+$as_echo "#define HAVE_CASIN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinf in -lm" >&5
+$as_echo_n "checking for casinf in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinf ();
+int
+main ()
+{
+return casinf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_casinf=yes
+else
+  ac_cv_lib_m_casinf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinf" >&5
+$as_echo "$ac_cv_lib_m_casinf" >&6; }
+if test "x$ac_cv_lib_m_casinf" = x""yes; then :
+
+$as_echo "#define HAVE_CASINF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinh in -lm" >&5
+$as_echo_n "checking for casinh in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinh ();
+int
+main ()
+{
+return casinh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_casinh=yes
+else
+  ac_cv_lib_m_casinh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinh" >&5
+$as_echo "$ac_cv_lib_m_casinh" >&6; }
+if test "x$ac_cv_lib_m_casinh" = x""yes; then :
+
+$as_echo "#define HAVE_CASINH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinhf in -lm" >&5
+$as_echo_n "checking for casinhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinhf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinhf ();
+int
+main ()
+{
+return casinhf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_casinhf=yes
+else
+  ac_cv_lib_m_casinhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinhf" >&5
+$as_echo "$ac_cv_lib_m_casinhf" >&6; }
+if test "x$ac_cv_lib_m_casinhf" = x""yes; then :
+
+$as_echo "#define HAVE_CASINHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinhl in -lm" >&5
+$as_echo_n "checking for casinhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinhl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinhl ();
+int
+main ()
+{
+return casinhl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_casinhl=yes
+else
+  ac_cv_lib_m_casinhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinhl" >&5
+$as_echo "$ac_cv_lib_m_casinhl" >&6; }
+if test "x$ac_cv_lib_m_casinhl" = x""yes; then :
+
+$as_echo "#define HAVE_CASINHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinl in -lm" >&5
+$as_echo_n "checking for casinl in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinl ();
+int
+main ()
+{
+return casinl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_casinl=yes
+else
+  ac_cv_lib_m_casinl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinl" >&5
+$as_echo "$ac_cv_lib_m_casinl" >&6; }
+if test "x$ac_cv_lib_m_casinl" = x""yes; then :
+
+$as_echo "#define HAVE_CASINL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catan in -lm" >&5
+$as_echo_n "checking for catan in -lm... " >&6; }
+if test "${ac_cv_lib_m_catan+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catan ();
+int
+main ()
+{
+return catan ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_catan=yes
+else
+  ac_cv_lib_m_catan=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catan" >&5
+$as_echo "$ac_cv_lib_m_catan" >&6; }
+if test "x$ac_cv_lib_m_catan" = x""yes; then :
+
+$as_echo "#define HAVE_CATAN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanf in -lm" >&5
+$as_echo_n "checking for catanf in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanf ();
+int
+main ()
+{
+return catanf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_catanf=yes
+else
+  ac_cv_lib_m_catanf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanf" >&5
+$as_echo "$ac_cv_lib_m_catanf" >&6; }
+if test "x$ac_cv_lib_m_catanf" = x""yes; then :
+
+$as_echo "#define HAVE_CATANF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanh in -lm" >&5
+$as_echo_n "checking for catanh in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanh+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanh ();
+int
+main ()
+{
+return catanh ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_catanh=yes
+else
+  ac_cv_lib_m_catanh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanh" >&5
+$as_echo "$ac_cv_lib_m_catanh" >&6; }
+if test "x$ac_cv_lib_m_catanh" = x""yes; then :
+
+$as_echo "#define HAVE_CATANH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanhf in -lm" >&5
+$as_echo_n "checking for catanhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanhf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanhf ();
+int
+main ()
+{
+return catanhf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_catanhf=yes
+else
+  ac_cv_lib_m_catanhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanhf" >&5
+$as_echo "$ac_cv_lib_m_catanhf" >&6; }
+if test "x$ac_cv_lib_m_catanhf" = x""yes; then :
+
+$as_echo "#define HAVE_CATANHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanhl in -lm" >&5
+$as_echo_n "checking for catanhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanhl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanhl ();
+int
+main ()
+{
+return catanhl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_catanhl=yes
+else
+  ac_cv_lib_m_catanhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanhl" >&5
+$as_echo "$ac_cv_lib_m_catanhl" >&6; }
+if test "x$ac_cv_lib_m_catanhl" = x""yes; then :
+
+$as_echo "#define HAVE_CATANHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanl in -lm" >&5
+$as_echo_n "checking for catanl in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanl+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanl ();
+int
+main ()
+{
+return catanl ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_catanl=yes
+else
+  ac_cv_lib_m_catanl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanl" >&5
+$as_echo "$ac_cv_lib_m_catanl" >&6; }
+if test "x$ac_cv_lib_m_catanl" = x""yes; then :
+
+$as_echo "#define HAVE_CATANL 1" >>confdefs.h
+
+fi
+
+
+# On AIX, clog is present in libm as __clog
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __clog in -lm" >&5
+$as_echo_n "checking for __clog in -lm... " >&6; }
+if test "${ac_cv_lib_m___clog+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char __clog ();
+int
+main ()
+{
+return __clog ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m___clog=yes
+else
+  ac_cv_lib_m___clog=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m___clog" >&5
+$as_echo "$ac_cv_lib_m___clog" >&6; }
+if test "x$ac_cv_lib_m___clog" = x""yes; then :
+
+$as_echo "#define HAVE_CLOG 1" >>confdefs.h
+
+fi
+
+
+# Check whether the system has a working stat()
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target stat is reliable" >&5
+$as_echo_n "checking whether the target stat is reliable... " >&6; }
+if test "${libgfor_cv_have_working_stat+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  if test "$cross_compiling" = yes; then :
+
+case "${target}" in
+  *mingw*) libgfor_cv_have_working_stat=no ;;
+  *) libgfor_cv_have_working_stat=yes;;
+esac
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+int main ()
+{
+  FILE *f, *g;
+  struct stat st1, st2;
+
+  f = fopen ("foo", "w");
+  g = fopen ("bar", "w");
+  if (stat ("foo", &st1) != 0 || stat ("bar", &st2))
+    return 1;
+  if (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino)
+    return 1;
+  fclose(f);
+  fclose(g);
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  libgfor_cv_have_working_stat=yes
+else
+  libgfor_cv_have_working_stat=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_working_stat" >&5
+$as_echo "$libgfor_cv_have_working_stat" >&6; }
+if test x"$libgfor_cv_have_working_stat" = xyes; then
+
+$as_echo "#define HAVE_WORKING_STAT 1" >>confdefs.h
+
+fi
+
+# Check whether __mingw_snprintf() is present
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __mingw_snprintf is present" >&5
+$as_echo_n "checking whether __mingw_snprintf is present... " >&6; }
+if test "${libgfor_cv_have_mingw_snprintf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+extern int __mingw_snprintf (char *, size_t, const char *, ...);
+
+int
+main ()
+{
+
+__mingw_snprintf (NULL, 0, "%d\n", 1);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "libgfor_cv_have_mingw_snprintf=yes"
+else
+  eval "libgfor_cv_have_mingw_snprintf=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_mingw_snprintf" >&5
+$as_echo "$libgfor_cv_have_mingw_snprintf" >&6; }
+  if test x"$libgfor_cv_have_mingw_snprintf" = xyes; then
+
+$as_echo "#define HAVE_MINGW_SNPRINTF 1" >>confdefs.h
+
+  fi
+
+
+# Check for a broken powf implementation
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether powf is broken" >&5
+$as_echo_n "checking whether powf is broken... " >&6; }
+if test "${libgfor_cv_have_broken_powf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+case "${target}" in
+  hppa*64*-*-hpux*) libgfor_cv_have_broken_powf=yes ;;
+  *) libgfor_cv_have_broken_powf=no;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_broken_powf" >&5
+$as_echo "$libgfor_cv_have_broken_powf" >&6; }
+  if test x"$libgfor_cv_have_broken_powf" = xyes; then
+
+$as_echo "#define HAVE_BROKEN_POWF 1" >>confdefs.h
+
+  fi
+
+
+# Check whether libquadmath should be used
+# Check whether --enable-libquadmath-support was given.
+if test "${enable_libquadmath_support+set}" = set; then :
+  enableval=$enable_libquadmath_support; ENABLE_LIBQUADMATH_SUPPORT=$enableval
+else
+  ENABLE_LIBQUADMATH_SUPPORT=yes
+fi
+
+enable_libquadmath_support=
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
+  enable_libquadmath_support=no
+fi
+
+# Check whether we have a __float128 type, depends on enable_libquadmath_support
+
+  LIBQUADSPEC=
+
+  if test "x$enable_libquadmath_support" != xno; then
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have a usable __float128 type" >&5
+$as_echo_n "checking whether we have a usable __float128 type... " >&6; }
+if test "${libgfor_cv_have_float128+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+   if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+    typedef _Complex float __attribute__((mode(TC))) __complex128;
+
+    __float128 foo (__float128 x)
+    {
+
+     __complex128 z1, z2;
+
+     z1 = x;
+     z2 = x / 7.Q;
+     z2 /= z1;
+
+     return (__float128) z2;
+    }
+
+    __float128 bar (__float128 x)
+    {
+      return x * __builtin_huge_valq ();
+    }
+
+int
+main ()
+{
+
+    foo (1.2Q);
+    bar (1.2Q);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+    libgfor_cv_have_float128=yes
+
+else
+
+    libgfor_cv_have_float128=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+    typedef _Complex float __attribute__((mode(TC))) __complex128;
+
+    __float128 foo (__float128 x)
+    {
+
+     __complex128 z1, z2;
+
+     z1 = x;
+     z2 = x / 7.Q;
+     z2 /= z1;
+
+     return (__float128) z2;
+    }
+
+    __float128 bar (__float128 x)
+    {
+      return x * __builtin_huge_valq ();
+    }
+
+int
+main ()
+{
+
+    foo (1.2Q);
+    bar (1.2Q);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+    libgfor_cv_have_float128=yes
+
+else
+
+    libgfor_cv_have_float128=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_float128" >&5
+$as_echo "$libgfor_cv_have_float128" >&6; }
+
+  if test "x$libgfor_cv_have_float128" = xyes; then
+
+$as_echo "#define HAVE_FLOAT128 1" >>confdefs.h
+
+
+                                ac_xsave_c_werror_flag=$ac_c_werror_flag
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --as-needed works" >&5
+$as_echo_n "checking whether --as-needed works... " >&6; }
+if test "${libgfor_cv_have_as_needed+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      save_LDFLAGS="$LDFLAGS"
+      LDFLAGS="$LDFLAGS -Wl,--as-needed -lm -Wl,--no-as-needed"
+      libgfor_cv_have_as_needed=no
+
+ac_c_werror_flag=yes
+      if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libgfor_cv_have_as_needed=yes
+else
+  libgfor_cv_have_as_needed=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+      LDFLAGS="$save_LDFLAGS"
+      ac_c_werror_flag=$ac_xsave_c_werror_flag
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_as_needed" >&5
+$as_echo "$libgfor_cv_have_as_needed" >&6; }
+
+        if test "x$libgfor_cv_have_as_needed" = xyes; then
+      LIBQUADSPEC="%{static-libgfortran:--as-needed} -lquadmath %{static-libgfortran:--no-as-needed}"
+    else
+      LIBQUADSPEC="-lquadmath"
+    fi
+    if test -f ../libquadmath/libquadmath.la; then
+      LIBQUADLIB=../libquadmath/libquadmath.la
+      LIBQUADLIB_DEP=../libquadmath/libquadmath.la
+      LIBQUADINCLUDE='-I$(srcdir)/../libquadmath'
+    else
+      LIBQUADLIB="-lquadmath"
+      LIBQUADLIB_DEP=
+      LIBQUADINCLUDE=
+    fi
+  fi
+  else
+    # for --disable-quadmath
+    LIBQUADLIB=
+    LIBQUADLIB_DEP=
+    LIBQUADINCLUDE=
+  fi
+
+
+
+
+
+
+     if test "x$libgfor_cv_have_float128" = xyes; then
+  LIBGFOR_BUILD_QUAD_TRUE=
+  LIBGFOR_BUILD_QUAD_FALSE='#'
+else
+  LIBGFOR_BUILD_QUAD_TRUE='#'
+  LIBGFOR_BUILD_QUAD_FALSE=
+fi
+
+
+
+# Check for GNU libc feenableexcept
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for feenableexcept in -lm" >&5
+$as_echo_n "checking for feenableexcept in -lm... " >&6; }
+if test "${ac_cv_lib_m_feenableexcept+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char feenableexcept ();
+int
+main ()
+{
+return feenableexcept ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_feenableexcept=yes
+else
+  ac_cv_lib_m_feenableexcept=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_feenableexcept" >&5
+$as_echo "$ac_cv_lib_m_feenableexcept" >&6; }
+if test "x$ac_cv_lib_m_feenableexcept" = x""yes; then :
+  have_feenableexcept=yes
+$as_echo "#define HAVE_FEENABLEEXCEPT 1" >>confdefs.h
+
+fi
+
+
+# At least for glibc and Tru64, clock_gettime is in librt.  But don't
+# pull that in if it still doesn't give us the function we want.  This
+# test is copied from libgomp, and modified to not link in -lrt as
+# libgfortran calls clock_gettime via a weak reference if it's found
+# in librt.
+if test $ac_cv_func_clock_gettime = no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_rt_clock_gettime=yes
+else
+  ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
+
+$as_echo "#define HAVE_CLOCK_GETTIME_LIBRT 1" >>confdefs.h
+
+fi
+
+fi
+
+# Check for SysV fpsetmask
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fpsetmask is present" >&5
+$as_echo_n "checking whether fpsetmask is present... " >&6; }
+if test "${libgfor_cv_have_fpsetmask+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if HAVE_FLOATINGPOINT_H
+# include <floatingpoint.h>
+#endif /* HAVE_FLOATINGPOINT_H */
+#if HAVE_IEEEFP_H
+# include <ieeefp.h>
+#endif /* HAVE_IEEEFP_H */
+int
+main ()
+{
+fpsetmask(0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "libgfor_cv_have_fpsetmask=yes"
+else
+  eval "libgfor_cv_have_fpsetmask=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_fpsetmask" >&5
+$as_echo "$libgfor_cv_have_fpsetmask" >&6; }
+  if test x"$libgfor_cv_have_fpsetmask" = xyes; then
+    have_fpsetmask=yes
+
+$as_echo "#define HAVE_FPSETMASK 1" >>confdefs.h
+
+  fi
+
+
+# Check for AIX fp_trap and fp_enable
+ac_fn_c_check_func "$LINENO" "fp_trap" "ac_cv_func_fp_trap"
+if test "x$ac_cv_func_fp_trap" = x""yes; then :
+  have_fp_trap=yes
+$as_echo "#define HAVE_FP_TRAP 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_func "$LINENO" "fp_enable" "ac_cv_func_fp_enable"
+if test "x$ac_cv_func_fp_enable" = x""yes; then :
+  have_fp_enable=yes
+$as_echo "#define HAVE_FP_ENABLE 1" >>confdefs.h
+
+fi
+
+
+# Runs configure.host to set up necessary host-dependent shell variables.
+# We then display a message about it, and propagate them through the
+# build chain.
+. ${srcdir}/configure.host
+{ $as_echo "$as_me:${as_lineno-$LINENO}: FPU dependent file will be ${fpu_host}.h" >&5
+$as_echo "$as_me: FPU dependent file will be ${fpu_host}.h" >&6;}
+FPU_HOST_HEADER=config/${fpu_host}.h
+
+
+# Some targets require additional compiler options for IEEE compatibility.
+IEEE_FLAGS="${ieee_flags}"
+
+
+
+# Check for POSIX getpwuid_r
+#
+# There are two versions of getpwuid_r, the POSIX one with 5
+# arguments, and another one with 4 arguments used by at least HP-UX
+# 10.2.
+if test "$ac_cv_func_getpwuid_r" = "yes"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX version of getpwuid_r with 5 arguments" >&5
+$as_echo_n "checking POSIX version of getpwuid_r with 5 arguments... " >&6; }
+if test "${libgfor_cv_posix_getpwuid_r+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+   if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <pwd.h>
+int
+main ()
+{
+
+    getpwuid_r(0, NULL, NULL, 0, NULL);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libgfor_cv_posix_getpwuid_r="yes"
+else
+  libgfor_cv_posix_getpwuid_r="no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_posix_getpwuid_r" >&5
+$as_echo "$libgfor_cv_posix_getpwuid_r" >&6; }
+fi
+if test "$libgfor_cv_posix_getpwuid_r" = "yes"; then
+
+$as_echo "#define HAVE_POSIX_GETPWUID_R 1" >>confdefs.h
+
+fi
+
+
+# Check out attribute support.
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports hidden visibility" >&5
+$as_echo_n "checking whether the target supports hidden visibility... " >&6; }
+if test "${libgfor_cv_have_attribute_visibility+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Werror"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+void __attribute__((visibility("hidden"))) foo(void) { }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libgfor_cv_have_attribute_visibility=yes
+else
+  libgfor_cv_have_attribute_visibility=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$save_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_attribute_visibility" >&5
+$as_echo "$libgfor_cv_have_attribute_visibility" >&6; }
+  if test $libgfor_cv_have_attribute_visibility = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_VISIBILITY 1" >>confdefs.h
+
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports dllexport" >&5
+$as_echo_n "checking whether the target supports dllexport... " >&6; }
+if test "${libgfor_cv_have_attribute_dllexport+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Werror"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+void __attribute__((dllexport)) foo(void) { }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libgfor_cv_have_attribute_dllexport=yes
+else
+  libgfor_cv_have_attribute_dllexport=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$save_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_attribute_dllexport" >&5
+$as_echo "$libgfor_cv_have_attribute_dllexport" >&6; }
+  if test $libgfor_cv_have_attribute_dllexport = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_DLLEXPORT 1" >>confdefs.h
+
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports symbol aliases" >&5
+$as_echo_n "checking whether the target supports symbol aliases... " >&6; }
+if test "${libgfor_cv_have_attribute_alias+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+void foo(void) { }
+extern void bar(void) __attribute__((alias("foo")));
+int
+main ()
+{
+bar();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libgfor_cv_have_attribute_alias=yes
+else
+  libgfor_cv_have_attribute_alias=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_attribute_alias" >&5
+$as_echo "$libgfor_cv_have_attribute_alias" >&6; }
+  if test $libgfor_cv_have_attribute_alias = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_ALIAS 1" >>confdefs.h
+
+  fi
+
+# Check out sync builtins support.
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports __sync_fetch_and_add" >&5
+$as_echo_n "checking whether the target supports __sync_fetch_and_add... " >&6; }
+if test "${libgfor_cv_have_sync_fetch_and_add+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foovar = 0;
+int
+main ()
+{
+
+if (foovar <= 0) return __sync_fetch_and_add (&foovar, 1);
+if (foovar > 10) return __sync_add_and_fetch (&foovar, -1);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libgfor_cv_have_sync_fetch_and_add=yes
+else
+  libgfor_cv_have_sync_fetch_and_add=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_sync_fetch_and_add" >&5
+$as_echo "$libgfor_cv_have_sync_fetch_and_add" >&6; }
+  if test $libgfor_cv_have_sync_fetch_and_add = yes; then
+
+$as_echo "#define HAVE_SYNC_FETCH_AND_ADD 1" >>confdefs.h
+
+  fi
+
+# Check out #pragma weak.
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pragma weak works" >&5
+$as_echo_n "checking whether pragma weak works... " >&6; }
+if test "${libgfor_cv_have_pragma_weak+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gfor_save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Wunknown-pragmas"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+void foo (void);
+#pragma weak foo
+
+int
+main ()
+{
+if (foo) foo ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libgfor_cv_have_pragma_weak=yes
+else
+  libgfor_cv_have_pragma_weak=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_pragma_weak" >&5
+$as_echo "$libgfor_cv_have_pragma_weak" >&6; }
+  if test $libgfor_cv_have_pragma_weak = yes; then
+
+$as_echo "#define SUPPORTS_WEAK 1" >>confdefs.h
+
+  fi
+  case "$host" in
+    *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* )
+
+$as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
+
+      ;;
+  esac
+
+# Various other checks on target
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target can unlink an open file" >&5
+$as_echo_n "checking whether the target can unlink an open file... " >&6; }
+if test "${libgfor_cv_have_unlink_open_file+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  if test "$cross_compiling" = yes; then :
+
+case "${target}" in
+  *mingw*) libgfor_cv_have_unlink_open_file=no ;;
+  *) libgfor_cv_have_unlink_open_file=yes;;
+esac
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+int main ()
+{
+  int fd;
+
+  fd = open ("testfile", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR);
+  if (fd <= 0)
+    return 0;
+  if (unlink ("testfile") == -1)
+    return 1;
+  write (fd, "This is a test\n", 15);
+  close (fd);
+
+  if (open ("testfile", O_RDONLY) == -1 && errno == ENOENT)
+    return 0;
+  else
+    return 1;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  libgfor_cv_have_unlink_open_file=yes
+else
+  libgfor_cv_have_unlink_open_file=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_unlink_open_file" >&5
+$as_echo "$libgfor_cv_have_unlink_open_file" >&6; }
+if test x"$libgfor_cv_have_unlink_open_file" = xyes; then
+
+$as_echo "#define HAVE_UNLINK_OPEN_FILE 1" >>confdefs.h
+
+fi
+
+# Check whether line terminator is LF or CRLF
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target has CRLF as line terminator" >&5
+$as_echo_n "checking whether the target has CRLF as line terminator... " >&6; }
+if test "${libgfor_cv_have_crlf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  if test "$cross_compiling" = yes; then :
+
+case "${target}" in
+  *mingw*) libgfor_cv_have_crlf=yes ;;
+  *) libgfor_cv_have_crlf=no;;
+esac
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* This test program should exit with status 0 if system uses a CRLF as
+   line terminator, and status 1 otherwise.
+   Since it is used to check for mingw systems, and should return 0 in any
+   other case, in case of a failure we will not use CRLF.  */
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+int main ()
+{
+#ifndef O_BINARY
+  exit(1);
+#else
+  int fd, bytes;
+  char buff[5];
+
+  fd = open ("foo", O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU);
+  if (fd < 0)
+    exit(1);
+  if (write (fd, "\n", 1) < 0)
+    perror ("write");
+
+  close (fd);
+
+  if ((fd = open ("foo", O_RDONLY | O_BINARY, S_IRWXU)) < 0)
+    exit(1);
+  bytes = read (fd, buff, 5);
+  if (bytes == 2 && buff[0] == '\r' && buff[1] == '\n')
+    exit(0);
+  else
+    exit(1);
+#endif
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  libgfor_cv_have_crlf=yes
+else
+  libgfor_cv_have_crlf=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_crlf" >&5
+$as_echo "$libgfor_cv_have_crlf" >&6; }
+if test x"$libgfor_cv_have_crlf" = xyes; then
+
+$as_echo "#define HAVE_CRLF 1" >>confdefs.h
+
+fi
+
+# Check whether we have _Unwind_GetIPInfo for backtrace
+
+
+# Check whether --with-system-libunwind was given.
+if test "${with_system_libunwind+set}" = set; then :
+  withval=$with_system_libunwind;
+fi
+
+  # If system-libunwind was not specifically set, pick a default setting.
+  if test x$with_system_libunwind = x; then
+    case ${target} in
+      ia64-*-hpux*) with_system_libunwind=yes ;;
+      *) with_system_libunwind=no ;;
+    esac
+  fi
+  # Based on system-libunwind and target, do we have ipinfo?
+  if  test x$with_system_libunwind = xyes; then
+    case ${target} in
+      ia64-*-*) have_unwind_getipinfo=no ;;
+      *) have_unwind_getipinfo=yes ;;
+    esac
+  else
+    # Darwin before version 9 does not have _Unwind_GetIPInfo.
+
+    case ${target} in
+      *-*-darwin[3-8]|*-*-darwin[3-8].*) have_unwind_getipinfo=no ;;
+      *) have_unwind_getipinfo=yes ;;
+    esac
+
+  fi
+
+  if test x$have_unwind_getipinfo = xyes; then
+
+$as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
+
+  fi
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+if test ${multilib} = yes; then
+  multilib_arg="--enable-multilib"
+else
+  multilib_arg=
+fi
+
+# Write our Makefile and spec file.
+ac_config_files="$ac_config_files Makefile libgfortran.spec"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${onestep_TRUE}" && test -z "${onestep_FALSE}"; then
+  as_fn_error "conditional \"onestep\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGFOR_USE_SYMVER_TRUE}" && test -z "${LIBGFOR_USE_SYMVER_FALSE}"; then
+  as_fn_error "conditional \"LIBGFOR_USE_SYMVER\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGFOR_USE_SYMVER_GNU_TRUE}" && test -z "${LIBGFOR_USE_SYMVER_GNU_FALSE}"; then
+  as_fn_error "conditional \"LIBGFOR_USE_SYMVER_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGFOR_USE_SYMVER_SUN_TRUE}" && test -z "${LIBGFOR_USE_SYMVER_SUN_FALSE}"; then
+  as_fn_error "conditional \"LIBGFOR_USE_SYMVER_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGFOR_BUILD_QUAD_TRUE}" && test -z "${LIBGFOR_BUILD_QUAD_FALSE}"; then
+  as_fn_error "conditional \"LIBGFOR_BUILD_QUAD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by GNU Fortran Runtime Library $as_me 0.3, which was
+generated by GNU Autoconf 2.64.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider.
+GNU Fortran Runtime Library home page: <http://www.gnu.org/software/libgfortran/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+GNU Fortran Runtime Library config.status 0.3
+configured by $0, generated by GNU Autoconf 2.64,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"
+CXX="$CXX"
+GFORTRAN="$GFORTRAN"
+GCJ="$GCJ"
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_FC='`$ECHO "$LD_FC" | $SED "$delay_single_quote_subst"`'
+reload_flag_FC='`$ECHO "$reload_flag_FC" | $SED "$delay_single_quote_subst"`'
+reload_cmds_FC='`$ECHO "$reload_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_FC='`$ECHO "$old_archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+compiler_FC='`$ECHO "$compiler_FC" | $SED "$delay_single_quote_subst"`'
+GCC_FC='`$ECHO "$GCC_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_FC='`$ECHO "$lt_prog_compiler_no_builtin_flag_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_FC='`$ECHO "$lt_prog_compiler_wl_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_FC='`$ECHO "$lt_prog_compiler_pic_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_FC='`$ECHO "$lt_prog_compiler_static_FC" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_FC='`$ECHO "$lt_cv_prog_compiler_c_o_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_FC='`$ECHO "$archive_cmds_need_lc_FC" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_FC='`$ECHO "$enable_shared_with_static_runtimes_FC" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_FC='`$ECHO "$export_dynamic_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_FC='`$ECHO "$whole_archive_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_FC='`$ECHO "$compiler_needs_object_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_FC='`$ECHO "$old_archive_from_new_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_FC='`$ECHO "$old_archive_from_expsyms_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_FC='`$ECHO "$archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_FC='`$ECHO "$archive_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_cmds_FC='`$ECHO "$module_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_FC='`$ECHO "$module_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_FC='`$ECHO "$with_gnu_ld_FC" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_FC='`$ECHO "$allow_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_FC='`$ECHO "$no_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_FC='`$ECHO "$hardcode_libdir_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_FC='`$ECHO "$hardcode_libdir_flag_spec_ld_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_FC='`$ECHO "$hardcode_libdir_separator_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_FC='`$ECHO "$hardcode_direct_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_FC='`$ECHO "$hardcode_direct_absolute_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_FC='`$ECHO "$hardcode_minus_L_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_FC='`$ECHO "$hardcode_shlibpath_var_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_FC='`$ECHO "$hardcode_automatic_FC" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_FC='`$ECHO "$inherit_rpath_FC" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_FC='`$ECHO "$link_all_deplibs_FC" | $SED "$delay_single_quote_subst"`'
+fix_srcfile_path_FC='`$ECHO "$fix_srcfile_path_FC" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_FC='`$ECHO "$always_export_symbols_FC" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_FC='`$ECHO "$export_symbols_cmds_FC" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_FC='`$ECHO "$exclude_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+include_expsyms_FC='`$ECHO "$include_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_FC='`$ECHO "$prelink_cmds_FC" | $SED "$delay_single_quote_subst"`'
+file_list_spec_FC='`$ECHO "$file_list_spec_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_action_FC='`$ECHO "$hardcode_action_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_FC='`$ECHO "$compiler_lib_search_dirs_FC" | $SED "$delay_single_quote_subst"`'
+predep_objects_FC='`$ECHO "$predep_objects_FC" | $SED "$delay_single_quote_subst"`'
+postdep_objects_FC='`$ECHO "$postdep_objects_FC" | $SED "$delay_single_quote_subst"`'
+predeps_FC='`$ECHO "$predeps_FC" | $SED "$delay_single_quote_subst"`'
+postdeps_FC='`$ECHO "$postdeps_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_FC='`$ECHO "$compiler_lib_search_path_FC" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_FC \
+reload_flag_FC \
+compiler_FC \
+lt_prog_compiler_no_builtin_flag_FC \
+lt_prog_compiler_wl_FC \
+lt_prog_compiler_pic_FC \
+lt_prog_compiler_static_FC \
+lt_cv_prog_compiler_c_o_FC \
+export_dynamic_flag_spec_FC \
+whole_archive_flag_spec_FC \
+compiler_needs_object_FC \
+with_gnu_ld_FC \
+allow_undefined_flag_FC \
+no_undefined_flag_FC \
+hardcode_libdir_flag_spec_FC \
+hardcode_libdir_flag_spec_ld_FC \
+hardcode_libdir_separator_FC \
+fix_srcfile_path_FC \
+exclude_expsyms_FC \
+include_expsyms_FC \
+file_list_spec_FC \
+compiler_lib_search_dirs_FC \
+predep_objects_FC \
+postdep_objects_FC \
+predeps_FC \
+postdeps_FC \
+compiler_lib_search_path_FC; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_FC \
+old_archive_cmds_FC \
+old_archive_from_new_cmds_FC \
+old_archive_from_expsyms_cmds_FC \
+archive_cmds_FC \
+archive_expsym_cmds_FC \
+module_cmds_FC \
+module_expsym_cmds_FC \
+export_symbols_cmds_FC \
+prelink_cmds_FC; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+
+
+GCC="$GCC"
+CC="$CC"
+acx_cv_header_stdint="$acx_cv_header_stdint"
+acx_cv_type_int8_t="$acx_cv_type_int8_t"
+acx_cv_type_int16_t="$acx_cv_type_int16_t"
+acx_cv_type_int32_t="$acx_cv_type_int32_t"
+acx_cv_type_int64_t="$acx_cv_type_int64_t"
+acx_cv_type_intptr_t="$acx_cv_type_intptr_t"
+ac_cv_type_uintmax_t="$ac_cv_type_uintmax_t"
+ac_cv_type_uintptr_t="$ac_cv_type_uintptr_t"
+ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
+ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
+ac_cv_type_u_int32_t="$ac_cv_type_u_int32_t"
+ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
+ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
+ac_cv_sizeof_void_p="$ac_cv_sizeof_void_p"
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "gstdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "libgfortran.spec") CONFIG_FILES="$CONFIG_FILES libgfortran.spec" ;;
+
+  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[    ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || as_fn_error "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+   ac_file=Makefile . ${multi_basedir}/config-ml.in
+   ;;
+esac ;;
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="FC "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1+=\$2"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+    ;;
+  esac
+
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: FC
+
+# The linker used to build libraries.
+LD=$lt_LD_FC
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_FC
+reload_cmds=$lt_reload_cmds_FC
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_FC
+
+# A language specific compiler.
+CC=$lt_compiler_FC
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_FC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_FC
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_FC
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_FC
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_FC
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_FC
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_FC
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_FC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_FC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_FC
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_FC
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_FC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_FC
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_FC
+archive_expsym_cmds=$lt_archive_expsym_cmds_FC
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_FC
+module_expsym_cmds=$lt_module_expsym_cmds_FC
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_FC
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_FC
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_FC
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_FC
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_FC
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_FC
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_FC
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_FC
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_FC
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_FC
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_FC
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_FC
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_FC
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path_FC
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_FC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_FC
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_FC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_FC
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_FC
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_FC
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_FC
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_FC
+postdep_objects=$lt_postdep_objects_FC
+predeps=$lt_predeps_FC
+postdeps=$lt_postdeps_FC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_FC
+
+# ### END LIBTOOL TAG CONFIG: FC
+_LT_EOF
+
+ ;;
+    "gstdint.h":C)
+if test "$GCC" = yes; then
+  echo "/* generated for " `$CC --version | sed 1q` "*/" > tmp-stdint.h
+else
+  echo "/* generated for $CC */" > tmp-stdint.h
+fi
+
+sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+  #ifndef GCC_GENERATED_STDINT_H
+  #define GCC_GENERATED_STDINT_H 1
+
+  #include <sys/types.h>
+EOF
+
+if test "$acx_cv_header_stdint" != stdint.h; then
+  echo "#include <stddef.h>" >> tmp-stdint.h
+fi
+if test "$acx_cv_header_stdint" != stddef.h; then
+  echo "#include <$acx_cv_header_stdint>" >> tmp-stdint.h
+fi
+
+sed 's/^ *//' >> tmp-stdint.h <<EOF
+  /* glibc uses these symbols as guards to prevent redefinitions.  */
+  #ifdef __int8_t_defined
+  #define _INT8_T
+  #define _INT16_T
+  #define _INT32_T
+  #endif
+  #ifdef __uint32_t_defined
+  #define _UINT32_T
+  #endif
+
+EOF
+
+# ----------------- done header, emit basic int types -------------
+if test "$acx_cv_header_stdint" = stddef.h; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    #ifndef _UINT8_T
+    #define _UINT8_T
+    #ifndef __uint8_t_defined
+    #define __uint8_t_defined
+    #ifndef uint8_t
+    typedef unsigned $acx_cv_type_int8_t uint8_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _UINT16_T
+    #define _UINT16_T
+    #ifndef __uint16_t_defined
+    #define __uint16_t_defined
+    #ifndef uint16_t
+    typedef unsigned $acx_cv_type_int16_t uint16_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _UINT32_T
+    #define _UINT32_T
+    #ifndef __uint32_t_defined
+    #define __uint32_t_defined
+    #ifndef uint32_t
+    typedef unsigned $acx_cv_type_int32_t uint32_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _INT8_T
+    #define _INT8_T
+    #ifndef __int8_t_defined
+    #define __int8_t_defined
+    #ifndef int8_t
+    typedef $acx_cv_type_int8_t int8_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _INT16_T
+    #define _INT16_T
+    #ifndef __int16_t_defined
+    #define __int16_t_defined
+    #ifndef int16_t
+    typedef $acx_cv_type_int16_t int16_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _INT32_T
+    #define _INT32_T
+    #ifndef __int32_t_defined
+    #define __int32_t_defined
+    #ifndef int32_t
+    typedef $acx_cv_type_int32_t int32_t;
+    #endif
+    #endif
+    #endif
+EOF
+elif test "$ac_cv_type_u_int32_t" = yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* int8_t int16_t int32_t defined by inet code, we do the u_intXX types */
+    #ifndef _INT8_T
+    #define _INT8_T
+    #endif
+    #ifndef _INT16_T
+    #define _INT16_T
+    #endif
+    #ifndef _INT32_T
+    #define _INT32_T
+    #endif
+
+    #ifndef _UINT8_T
+    #define _UINT8_T
+    #ifndef __uint8_t_defined
+    #define __uint8_t_defined
+    #ifndef uint8_t
+    typedef u_int8_t uint8_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _UINT16_T
+    #define _UINT16_T
+    #ifndef __uint16_t_defined
+    #define __uint16_t_defined
+    #ifndef uint16_t
+    typedef u_int16_t uint16_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _UINT32_T
+    #define _UINT32_T
+    #ifndef __uint32_t_defined
+    #define __uint32_t_defined
+    #ifndef uint32_t
+    typedef u_int32_t uint32_t;
+    #endif
+    #endif
+    #endif
+EOF
+else
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Some systems have guard macros to prevent redefinitions, define them.  */
+    #ifndef _INT8_T
+    #define _INT8_T
+    #endif
+    #ifndef _INT16_T
+    #define _INT16_T
+    #endif
+    #ifndef _INT32_T
+    #define _INT32_T
+    #endif
+    #ifndef _UINT8_T
+    #define _UINT8_T
+    #endif
+    #ifndef _UINT16_T
+    #define _UINT16_T
+    #endif
+    #ifndef _UINT32_T
+    #define _UINT32_T
+    #endif
+EOF
+fi
+
+# ------------- done basic int types, emit int64_t types ------------
+if test "$ac_cv_type_uint64_t" = yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* system headers have good uint64_t and int64_t */
+    #ifndef _INT64_T
+    #define _INT64_T
+    #endif
+    #ifndef _UINT64_T
+    #define _UINT64_T
+    #endif
+EOF
+elif test "$ac_cv_type_u_int64_t" = yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* system headers have an u_int64_t (and int64_t) */
+    #ifndef _INT64_T
+    #define _INT64_T
+    #endif
+    #ifndef _UINT64_T
+    #define _UINT64_T
+    #ifndef __uint64_t_defined
+    #define __uint64_t_defined
+    #ifndef uint64_t
+    typedef u_int64_t uint64_t;
+    #endif
+    #endif
+    #endif
+EOF
+elif test -n "$acx_cv_type_int64_t"; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* architecture has a 64-bit type, $acx_cv_type_int64_t */
+    #ifndef _INT64_T
+    #define _INT64_T
+    #ifndef int64_t
+    typedef $acx_cv_type_int64_t int64_t;
+    #endif
+    #endif
+    #ifndef _UINT64_T
+    #define _UINT64_T
+    #ifndef __uint64_t_defined
+    #define __uint64_t_defined
+    #ifndef uint64_t
+    typedef unsigned $acx_cv_type_int64_t uint64_t;
+    #endif
+    #endif
+    #endif
+EOF
+else
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* some common heuristics for int64_t, using compiler-specific tests */
+    #if defined __STDC_VERSION__ && (__STDC_VERSION__-0) >= 199901L
+    #ifndef _INT64_T
+    #define _INT64_T
+    #ifndef __int64_t_defined
+    #ifndef int64_t
+    typedef long long int64_t;
+    #endif
+    #endif
+    #endif
+    #ifndef _UINT64_T
+    #define _UINT64_T
+    #ifndef uint64_t
+    typedef unsigned long long uint64_t;
+    #endif
+    #endif
+
+    #elif defined __GNUC__ && defined (__STDC__) && __STDC__-0
+    /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
+       does not implement __extension__.  But that compiler doesn't define
+       __GNUC_MINOR__.  */
+    # if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
+    # define __extension__
+    # endif
+
+    # ifndef _INT64_T
+    # define _INT64_T
+    # ifndef int64_t
+    __extension__ typedef long long int64_t;
+    # endif
+    # endif
+    # ifndef _UINT64_T
+    # define _UINT64_T
+    # ifndef uint64_t
+    __extension__ typedef unsigned long long uint64_t;
+    # endif
+    # endif
+
+    #elif !defined __STRICT_ANSI__
+    # if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
+
+    #  ifndef _INT64_T
+    #  define _INT64_T
+    #  ifndef int64_t
+    typedef __int64 int64_t;
+    #  endif
+    #  endif
+    #  ifndef _UINT64_T
+    #  define _UINT64_T
+    #  ifndef uint64_t
+    typedef unsigned __int64 uint64_t;
+    #  endif
+    #  endif
+    # endif /* compiler */
+
+    #endif /* ANSI version */
+EOF
+fi
+
+# ------------- done int64_t types, emit intptr types ------------
+if test "$ac_cv_type_uintptr_t" != yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Define intptr_t based on sizeof(void*) = $ac_cv_sizeof_void_p */
+    #ifndef __uintptr_t_defined
+    #ifndef uintptr_t
+    typedef u$acx_cv_type_intptr_t uintptr_t;
+    #endif
+    #endif
+    #ifndef __intptr_t_defined
+    #ifndef intptr_t
+    typedef $acx_cv_type_intptr_t  intptr_t;
+    #endif
+    #endif
+EOF
+fi
+
+# ------------- done intptr types, emit int_least types ------------
+if test "$ac_cv_type_int_least32_t" != yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Define int_least types */
+    typedef int8_t     int_least8_t;
+    typedef int16_t    int_least16_t;
+    typedef int32_t    int_least32_t;
+    #ifdef _INT64_T
+    typedef int64_t    int_least64_t;
+    #endif
+
+    typedef uint8_t    uint_least8_t;
+    typedef uint16_t   uint_least16_t;
+    typedef uint32_t   uint_least32_t;
+    #ifdef _UINT64_T
+    typedef uint64_t   uint_least64_t;
+    #endif
+EOF
+fi
+
+# ------------- done intptr types, emit int_fast types ------------
+if test "$ac_cv_type_int_fast32_t" != yes; then
+      sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Define int_fast types.  short is often slow */
+    typedef int8_t       int_fast8_t;
+    typedef int          int_fast16_t;
+    typedef int32_t      int_fast32_t;
+    #ifdef _INT64_T
+    typedef int64_t      int_fast64_t;
+    #endif
+
+    typedef uint8_t      uint_fast8_t;
+    typedef unsigned int uint_fast16_t;
+    typedef uint32_t     uint_fast32_t;
+    #ifdef _UINT64_T
+    typedef uint64_t     uint_fast64_t;
+    #endif
+EOF
+fi
+
+if test "$ac_cv_type_uintmax_t" != yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Define intmax based on what we found */
+    #ifndef intmax_t
+    #ifdef _INT64_T
+    typedef int64_t       intmax_t;
+    #else
+    typedef long          intmax_t;
+    #endif
+    #endif
+    #ifndef uintmax_t
+    #ifdef _UINT64_T
+    typedef uint64_t      uintmax_t;
+    #else
+    typedef unsigned long uintmax_t;
+    #endif
+    #endif
+EOF
+fi
+
+sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+  #endif /* GCC_GENERATED_STDINT_H */
+EOF
+
+if test -r gstdint.h && cmp -s tmp-stdint.h gstdint.h; then
+  rm -f tmp-stdint.h
+else
+  mv -f tmp-stdint.h gstdint.h
+fi
+
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/l4/pkg/libgfortran/lib/contrib/configure.ac b/l4/pkg/libgfortran/lib/contrib/configure.ac
new file mode 100644 (file)
index 0000000..387ece2
--- /dev/null
@@ -0,0 +1,570 @@
+# Process this file with autoconf to produce a configure script, like so:
+# aclocal && autoconf && autoheader && automake
+
+AC_PREREQ(2.64)
+AC_INIT([GNU Fortran Runtime Library], 0.3,,[libgfortran])
+AC_CONFIG_HEADER(config.h)
+GCC_TOPLEV_SUBDIRS
+
+# -------
+# Options
+# -------
+
+AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
+AC_ARG_ENABLE(version-specific-runtime-libs,
+AS_HELP_STRING([--enable-version-specific-runtime-libs],
+  [specify that runtime libraries should be installed in a compiler-specific directory]),
+[case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no)  version_specific_libs=no ;;
+ *)   AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+[version_specific_libs=no])
+AC_MSG_RESULT($version_specific_libs)
+
+# Build with intermodule optimisations
+AC_MSG_CHECKING([for --enable-intermodule])
+AC_ARG_ENABLE(intermodule,
+AS_HELP_STRING([--enable-intermodule],[build the library in one step]),
+[case "$enable_intermodule" in
+  yes) onestep="-onestep";;
+    *) onestep="";;
+esac],
+[onestep=""])
+AC_MSG_RESULT($enable_intermodule)
+AM_CONDITIONAL(onestep,[test x$onestep = x-onestep])
+AC_SUBST(onestep)
+
+# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
+#
+# You will slowly go insane if you do not grok the following fact:  when
+# building this library, the top-level /target/ becomes the library's /host/.
+#
+# configure then causes --target to default to --host, exactly like any
+# other package using autoconf.  Therefore, 'target' and 'host' will
+# always be the same.  This makes sense both for native and cross compilers
+# just think about it for a little while.  :-)
+#
+# Also, if this library is being configured as part of a cross compiler, the
+# top-level configure script will pass the "real" host as $with_cross_host.
+#
+# Do not delete or change the following two lines.  For why, see
+# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
+AC_CANONICAL_SYSTEM
+ACX_NONCANONICAL_TARGET
+
+target_alias=${target_alias-$host_alias}
+AC_SUBST(target_alias)
+
+# Sets up automake.  Must come after AC_CANONICAL_SYSTEM.  Each of the
+# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
+#  1.9.6:  minimum required version
+#  no-define:  PACKAGE and VERSION will not be #define'd in config.h (a bunch
+#              of other PACKAGE_* variables will, however, and there's nothing
+#              we can do about that; they come from AC_INIT).
+#  foreign:  we don't follow the normal rules for GNU packages (no COPYING
+#            file in the top srcdir, etc, etc), so stop complaining.
+#  no-dist:  we don't want 'dist' and related rules.
+#  -Wall:  turns on all automake warnings...
+#  -Wno-portability:  ...except this one, since GNU make is required.
+AM_INIT_AUTOMAKE([1.9.6 no-define foreign no-dist -Wall -Wno-portability])
+
+AM_MAINTAINER_MODE
+AM_ENABLE_MULTILIB(, ..)
+
+# Handy for debugging:
+#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
+
+# Are we being configured with some form of cross compiler?
+# NB: We don't actually need to know this just now, but when, say, a test
+#     suite is included, we'll have to know.
+if test "$build" != "$host"; then
+  LIBGFOR_IS_NATIVE=false
+  GCC_NO_EXECUTABLES
+else
+  LIBGFOR_IS_NATIVE=true
+fi
+
+AC_USE_SYSTEM_EXTENSIONS
+
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${version_specific_libs} in
+  yes)
+    # Need the gcc compiler version to know where to install libraries
+    # and header files if --enable-version-specific-runtime-libs option
+    # is selected.
+    toolexecdir='$(libdir)/gcc/$(target_alias)'
+    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+    ;;
+  no)
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      # Install a library built with a cross compiler in tooldir, not libdir.
+      toolexecdir='$(exec_prefix)/$(target_alias)'
+      toolexeclibdir='$(toolexecdir)/lib'
+    else
+      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+      toolexeclibdir='$(libdir)'
+    fi
+    multi_os_directory=`$CC -print-multi-os-directory`
+    case $multi_os_directory in
+      .) ;; # Avoid trailing /.
+      *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+    esac
+    ;;
+esac
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexeclibdir)
+
+# Create a spec file, so that compile/link tests don't fail
+test -f libgfortran.spec || touch libgfortran.spec
+
+AC_LANG_C
+# Check the compiler.
+# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+# We must force CC to /not/ be precious variables; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+m4_define([_AC_ARG_VAR_PRECIOUS],[])
+AC_PROG_CC
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+
+AC_SUBST(CFLAGS)
+
+AM_PROG_CC_C_O
+
+# Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
+if test "x$GCC" = "xyes"; then
+  AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
+  ## We like to use C99 routines when available.  This makes sure that
+  ## __STDC_VERSION__ is set such that libc includes make them available.
+  AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
+  ## Compile the following tests with the same system header contents
+  ## that we'll encounter when compiling our own source files.
+  CFLAGS="-std=gnu99 $CFLAGS"
+fi
+AC_SUBST(AM_FCFLAGS)
+AC_SUBST(AM_CFLAGS)
+AC_SUBST(CFLAGS)
+
+# Check for symbol versioning (copied from libssp).
+AC_MSG_CHECKING([whether symbol versioning is supported])
+AC_ARG_ENABLE(symvers,
+AS_HELP_STRING([--disable-symvers],
+  [disable symbol versioning for libgfortran]),
+gfortran_use_symver=$enableval,
+gfortran_use_symver=yes)
+if test "x$gfortran_use_symver" != xno; then
+  save_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
+  cat > conftest.map <<EOF
+FOO_1.0 {
+  global: *foo*; bar; local: *;
+};
+EOF
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]],[[]])],[gfortran_use_symver=gnu],[gfortran_use_symver=no])
+  if test x$gfortran_use_symver = xno; then
+    case "$target_os" in
+      solaris2*)
+        LDFLAGS="$save_LDFLAGS"
+        LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+        # Sun ld cannot handle wildcards and treats all entries as undefined.
+        cat > conftest.map <<EOF
+FOO_1.0 {
+  global: foo; local: *;
+};
+EOF
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]],[[]])],[gfortran_use_symver=sun],[gfortran_use_symver=no])
+        ;;
+    esac
+  fi
+  LDFLAGS="$save_LDFLAGS"
+fi
+AC_MSG_RESULT($gfortran_use_symver)
+AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" != xno])
+AM_CONDITIONAL(LIBGFOR_USE_SYMVER_GNU, [test "x$gfortran_use_symver" = xgnu])
+AM_CONDITIONAL(LIBGFOR_USE_SYMVER_SUN, [test "x$gfortran_use_symver" = xsun])
+
+# Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
+# similarly to how libstdc++ does it
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+
+# Check for -ffunction-sections -fdata-sections
+AC_MSG_CHECKING([for gcc that supports -ffunction-sections -fdata-sections])
+CFLAGS='-Werror -ffunction-sections -fdata-sections'
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int foo;]])], [ac_fdsections=yes], [ac_fdsections=no])
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+else
+  # this is the suspicious part
+  CFLAGS=""
+fi
+if test x"$ac_fdsections" = x"yes"; then
+  SECTION_FLAGS='-ffunction-sections -fdata-sections'
+fi
+AC_MSG_RESULT($ac_fdsections)
+AC_SUBST(SECTION_FLAGS)
+
+# Find other programs we need.
+AC_CHECK_TOOL(AS, as)
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
+AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+
+# Configure libtool
+#AC_MSG_NOTICE([====== Starting libtool configuration])
+AC_LIBTOOL_DLOPEN
+AM_PROG_LIBTOOL
+ACX_LT_HOST_FLAGS
+AC_SUBST(enable_shared)
+AC_SUBST(enable_static)
+#AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
+
+# We need gfortran to compile parts of the library
+#AC_PROG_FC(gfortran)
+FC="$GFORTRAN"
+AC_PROG_FC(gfortran)
+
+# extra LD Flags which are required for targets
+case "${host}" in
+  *-darwin*)
+    # Darwin needs -single_module when linking libgfortran
+    extra_ldflags_libgfortran=-Wl,-single_module
+    ;;
+esac
+AC_SUBST(extra_ldflags_libgfortran)
+
+# We need a working compiler at that point, otherwise give a clear
+# error message and bail out.
+LIBGFOR_WORKING_GFORTRAN
+
+AC_SYS_LARGEFILE
+
+# Types
+AC_TYPE_OFF_T
+AC_TYPE_INTPTR_T
+AC_TYPE_UINTPTR_T
+AC_CHECK_TYPES([ptrdiff_t])
+
+# check header files (we assume C89 is available, so don't check for that)
+AC_CHECK_HEADERS_ONCE(unistd.h sys/time.h sys/times.h sys/resource.h \
+sys/types.h sys/stat.h sys/wait.h floatingpoint.h ieeefp.h fenv.h fptrap.h \
+pwd.h complex.h) 
+
+GCC_HEADER_STDINT(gstdint.h)
+
+AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev])
+
+# Check for library functions.
+AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \
+ftruncate chsize chdir getlogin gethostname kill link symlink sleep ttyname \
+alarm access fork execl wait setmode execve pipe dup2 close \
+strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \
+getcwd localtime_r gmtime_r strerror_r getpwuid_r ttyname_r clock_gettime \
+readlink getgid getpid getppid getuid geteuid umask)
+
+# Check for C99 (and other IEEE) math functions
+AC_CHECK_LIB([m],[acosf],[AC_DEFINE([HAVE_ACOSF],[1],[libm includes acosf])])
+AC_CHECK_LIB([m],[acos],[AC_DEFINE([HAVE_ACOS],[1],[libm includes acos])])
+AC_CHECK_LIB([m],[acosl],[AC_DEFINE([HAVE_ACOSL],[1],[libm includes acosl])])
+AC_CHECK_LIB([m],[acoshf],[AC_DEFINE([HAVE_ACOSHF],[1],[libm includes acoshf])])
+AC_CHECK_LIB([m],[acosh],[AC_DEFINE([HAVE_ACOSH],[1],[libm includes acosh])])
+AC_CHECK_LIB([m],[acoshl],[AC_DEFINE([HAVE_ACOSHL],[1],[libm includes acoshl])])
+AC_CHECK_LIB([m],[asinf],[AC_DEFINE([HAVE_ASINF],[1],[libm includes asinf])])
+AC_CHECK_LIB([m],[asin],[AC_DEFINE([HAVE_ASIN],[1],[libm includes asin])])
+AC_CHECK_LIB([m],[asinl],[AC_DEFINE([HAVE_ASINL],[1],[libm includes asinl])])
+AC_CHECK_LIB([m],[asinhf],[AC_DEFINE([HAVE_ASINHF],[1],[libm includes asinhf])])
+AC_CHECK_LIB([m],[asinh],[AC_DEFINE([HAVE_ASINH],[1],[libm includes asinh])])
+AC_CHECK_LIB([m],[asinhl],[AC_DEFINE([HAVE_ASINHL],[1],[libm includes asinhl])])
+AC_CHECK_LIB([m],[atan2f],[AC_DEFINE([HAVE_ATAN2F],[1],[libm includes atan2f])])
+AC_CHECK_LIB([m],[atan2],[AC_DEFINE([HAVE_ATAN2],[1],[libm includes atan2])])
+AC_CHECK_LIB([m],[atan2l],[AC_DEFINE([HAVE_ATAN2L],[1],[libm includes atan2l])])
+AC_CHECK_LIB([m],[atanf],[AC_DEFINE([HAVE_ATANF],[1],[libm includes atanf])])
+AC_CHECK_LIB([m],[atan],[AC_DEFINE([HAVE_ATAN],[1],[libm includes atan])])
+AC_CHECK_LIB([m],[atanl],[AC_DEFINE([HAVE_ATANL],[1],[libm includes atanl])])
+AC_CHECK_LIB([m],[atanhf],[AC_DEFINE([HAVE_ATANHF],[1],[libm includes atanhf])])
+AC_CHECK_LIB([m],[atanh],[AC_DEFINE([HAVE_ATANH],[1],[libm includes atanh])])
+AC_CHECK_LIB([m],[atanhl],[AC_DEFINE([HAVE_ATANHL],[1],[libm includes atanhl])])
+AC_CHECK_LIB([m],[cargf],[AC_DEFINE([HAVE_CARGF],[1],[libm includes cargf])])
+AC_CHECK_LIB([m],[carg],[AC_DEFINE([HAVE_CARG],[1],[libm includes carg])])
+AC_CHECK_LIB([m],[cargl],[AC_DEFINE([HAVE_CARGL],[1],[libm includes cargl])])
+AC_CHECK_LIB([m],[ceilf],[AC_DEFINE([HAVE_CEILF],[1],[libm includes ceilf])])
+AC_CHECK_LIB([m],[ceil],[AC_DEFINE([HAVE_CEIL],[1],[libm includes ceil])])
+AC_CHECK_LIB([m],[ceill],[AC_DEFINE([HAVE_CEILL],[1],[libm includes ceill])])
+AC_CHECK_LIB([m],[copysignf],[AC_DEFINE([HAVE_COPYSIGNF],[1],[libm includes copysignf])])
+AC_CHECK_LIB([m],[copysign],[AC_DEFINE([HAVE_COPYSIGN],[1],[libm includes copysign])])
+AC_CHECK_LIB([m],[copysignl],[AC_DEFINE([HAVE_COPYSIGNL],[1],[libm includes copysignl])])
+AC_CHECK_LIB([m],[cosf],[AC_DEFINE([HAVE_COSF],[1],[libm includes cosf])])
+AC_CHECK_LIB([m],[cos],[AC_DEFINE([HAVE_COS],[1],[libm includes cos])])
+AC_CHECK_LIB([m],[cosl],[AC_DEFINE([HAVE_COSL],[1],[libm includes cosl])])
+AC_CHECK_LIB([m],[ccosf],[AC_DEFINE([HAVE_CCOSF],[1],[libm includes ccosf])])
+AC_CHECK_LIB([m],[ccos],[AC_DEFINE([HAVE_CCOS],[1],[libm includes ccos])])
+AC_CHECK_LIB([m],[ccosl],[AC_DEFINE([HAVE_CCOSL],[1],[libm includes ccosl])])
+AC_CHECK_LIB([m],[coshf],[AC_DEFINE([HAVE_COSHF],[1],[libm includes coshf])])
+AC_CHECK_LIB([m],[cosh],[AC_DEFINE([HAVE_COSH],[1],[libm includes cosh])])
+AC_CHECK_LIB([m],[coshl],[AC_DEFINE([HAVE_COSHL],[1],[libm includes coshl])])
+AC_CHECK_LIB([m],[ccoshf],[AC_DEFINE([HAVE_CCOSHF],[1],[libm includes ccoshf])])
+AC_CHECK_LIB([m],[ccosh],[AC_DEFINE([HAVE_CCOSH],[1],[libm includes ccosh])])
+AC_CHECK_LIB([m],[ccoshl],[AC_DEFINE([HAVE_CCOSHL],[1],[libm includes ccoshl])])
+AC_CHECK_LIB([m],[expf],[AC_DEFINE([HAVE_EXPF],[1],[libm includes expf])])
+AC_CHECK_LIB([m],[exp],[AC_DEFINE([HAVE_EXP],[1],[libm includes exp])])
+AC_CHECK_LIB([m],[expl],[AC_DEFINE([HAVE_EXPL],[1],[libm includes expl])])
+AC_CHECK_LIB([m],[cexpf],[AC_DEFINE([HAVE_CEXPF],[1],[libm includes cexpf])])
+AC_CHECK_LIB([m],[cexp],[AC_DEFINE([HAVE_CEXP],[1],[libm includes cexp])])
+AC_CHECK_LIB([m],[cexpl],[AC_DEFINE([HAVE_CEXPL],[1],[libm includes cexpl])])
+AC_CHECK_LIB([m],[fabsf],[AC_DEFINE([HAVE_FABSF],[1],[libm includes fabsf])])
+AC_CHECK_LIB([m],[fabs],[AC_DEFINE([HAVE_FABS],[1],[libm includes fabs])])
+AC_CHECK_LIB([m],[fabsl],[AC_DEFINE([HAVE_FABSL],[1],[libm includes fabsl])])
+AC_CHECK_LIB([m],[cabsf],[AC_DEFINE([HAVE_CABSF],[1],[libm includes cabsf])])
+AC_CHECK_LIB([m],[cabs],[AC_DEFINE([HAVE_CABS],[1],[libm includes cabs])])
+AC_CHECK_LIB([m],[cabsl],[AC_DEFINE([HAVE_CABSL],[1],[libm includes cabsl])])
+AC_CHECK_LIB([m],[floorf],[AC_DEFINE([HAVE_FLOORF],[1],[libm includes floorf])])
+AC_CHECK_LIB([m],[floor],[AC_DEFINE([HAVE_FLOOR],[1],[libm includes floor])])
+AC_CHECK_LIB([m],[floorl],[AC_DEFINE([HAVE_FLOORL],[1],[libm includes floorl])])
+AC_CHECK_LIB([m],[fmodf],[AC_DEFINE([HAVE_FMODF],[1],[libm includes fmodf])])
+AC_CHECK_LIB([m],[fmod],[AC_DEFINE([HAVE_FMOD],[1],[libm includes fmod])])
+AC_CHECK_LIB([m],[fmodl],[AC_DEFINE([HAVE_FMODL],[1],[libm includes fmodl])])
+AC_CHECK_LIB([m],[frexpf],[AC_DEFINE([HAVE_FREXPF],[1],[libm includes frexpf])])
+AC_CHECK_LIB([m],[frexp],[AC_DEFINE([HAVE_FREXP],[1],[libm includes frexp])])
+AC_CHECK_LIB([m],[frexpl],[AC_DEFINE([HAVE_FREXPL],[1],[libm includes frexpl])])
+AC_CHECK_LIB([m],[hypotf],[AC_DEFINE([HAVE_HYPOTF],[1],[libm includes hypotf])])
+AC_CHECK_LIB([m],[hypot],[AC_DEFINE([HAVE_HYPOT],[1],[libm includes hypot])])
+AC_CHECK_LIB([m],[hypotl],[AC_DEFINE([HAVE_HYPOTL],[1],[libm includes hypotl])])
+AC_CHECK_LIB([m],[ldexpf],[AC_DEFINE([HAVE_LDEXPF],[1],[libm includes ldexpf])])
+AC_CHECK_LIB([m],[ldexp],[AC_DEFINE([HAVE_LDEXP],[1],[libm includes ldexp])])
+AC_CHECK_LIB([m],[ldexpl],[AC_DEFINE([HAVE_LDEXPL],[1],[libm includes ldexpl])])
+AC_CHECK_LIB([m],[logf],[AC_DEFINE([HAVE_LOGF],[1],[libm includes logf])])
+AC_CHECK_LIB([m],[log],[AC_DEFINE([HAVE_LOG],[1],[libm includes log])])
+AC_CHECK_LIB([m],[logl],[AC_DEFINE([HAVE_LOGL],[1],[libm includes logl])])
+AC_CHECK_LIB([m],[clogf],[AC_DEFINE([HAVE_CLOGF],[1],[libm includes clogf])])
+AC_CHECK_LIB([m],[clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
+AC_CHECK_LIB([m],[clogl],[AC_DEFINE([HAVE_CLOGL],[1],[libm includes clogl])])
+AC_CHECK_LIB([m],[log10f],[AC_DEFINE([HAVE_LOG10F],[1],[libm includes log10f])])
+AC_CHECK_LIB([m],[log10],[AC_DEFINE([HAVE_LOG10],[1],[libm includes log10])])
+AC_CHECK_LIB([m],[log10l],[AC_DEFINE([HAVE_LOG10L],[1],[libm includes log10l])])
+AC_CHECK_LIB([m],[clog10f],[AC_DEFINE([HAVE_CLOG10F],[1],[libm includes clog10f])])
+AC_CHECK_LIB([m],[clog10],[AC_DEFINE([HAVE_CLOG10],[1],[libm includes clog10])])
+AC_CHECK_LIB([m],[clog10l],[AC_DEFINE([HAVE_CLOG10L],[1],[libm includes clog10l])])
+AC_CHECK_LIB([m],[nextafterf],[AC_DEFINE([HAVE_NEXTAFTERF],[1],[libm includes nextafterf])])
+AC_CHECK_LIB([m],[nextafter],[AC_DEFINE([HAVE_NEXTAFTER],[1],[libm includes nextafter])])
+AC_CHECK_LIB([m],[nextafterl],[AC_DEFINE([HAVE_NEXTAFTERL],[1],[libm includes nextafterl])])
+AC_CHECK_LIB([m],[powf],[AC_DEFINE([HAVE_POWF],[1],[libm includes powf])])
+AC_CHECK_LIB([m],[pow],[AC_DEFINE([HAVE_POW],[1],[libm includes pow])])
+AC_CHECK_LIB([m],[powl],[AC_DEFINE([HAVE_POWL],[1],[libm includes powl])])
+AC_CHECK_LIB([m],[cpowf],[AC_DEFINE([HAVE_CPOWF],[1],[libm includes cpowf])])
+AC_CHECK_LIB([m],[cpow],[AC_DEFINE([HAVE_CPOW],[1],[libm includes cpow])])
+AC_CHECK_LIB([m],[cpowl],[AC_DEFINE([HAVE_CPOWL],[1],[libm includes cpowl])])
+AC_CHECK_LIB([m],[roundf],[AC_DEFINE([HAVE_ROUNDF],[1],[libm includes roundf])])
+AC_CHECK_LIB([m],[round],[AC_DEFINE([HAVE_ROUND],[1],[libm includes round])])
+AC_CHECK_LIB([m],[roundl],[AC_DEFINE([HAVE_ROUNDL],[1],[libm includes roundl])])
+AC_CHECK_LIB([m],[lroundf],[AC_DEFINE([HAVE_LROUNDF],[1],[libm includes lroundf])])
+AC_CHECK_LIB([m],[lround],[AC_DEFINE([HAVE_LROUND],[1],[libm includes lround])])
+AC_CHECK_LIB([m],[lroundl],[AC_DEFINE([HAVE_LROUNDL],[1],[libm includes lroundl])])
+AC_CHECK_LIB([m],[llroundf],[AC_DEFINE([HAVE_LLROUNDF],[1],[libm includes llroundf])])
+AC_CHECK_LIB([m],[llround],[AC_DEFINE([HAVE_LLROUND],[1],[libm includes llround])])
+AC_CHECK_LIB([m],[llroundl],[AC_DEFINE([HAVE_LLROUNDL],[1],[libm includes llroundl])])
+AC_CHECK_LIB([m],[scalbnf],[AC_DEFINE([HAVE_SCALBNF],[1],[libm includes scalbnf])])
+AC_CHECK_LIB([m],[scalbn],[AC_DEFINE([HAVE_SCALBN],[1],[libm includes scalbn])])
+AC_CHECK_LIB([m],[scalbnl],[AC_DEFINE([HAVE_SCALBNL],[1],[libm includes scalbnl])])
+AC_CHECK_LIB([m],[sinf],[AC_DEFINE([HAVE_SINF],[1],[libm includes sinf])])
+AC_CHECK_LIB([m],[sin],[AC_DEFINE([HAVE_SIN],[1],[libm includes sin])])
+AC_CHECK_LIB([m],[sinl],[AC_DEFINE([HAVE_SINL],[1],[libm includes sinl])])
+AC_CHECK_LIB([m],[csinf],[AC_DEFINE([HAVE_CSINF],[1],[libm includes csinf])])
+AC_CHECK_LIB([m],[csin],[AC_DEFINE([HAVE_CSIN],[1],[libm includes csin])])
+AC_CHECK_LIB([m],[csinl],[AC_DEFINE([HAVE_CSINL],[1],[libm includes csinl])])
+AC_CHECK_LIB([m],[sinhf],[AC_DEFINE([HAVE_SINHF],[1],[libm includes sinhf])])
+AC_CHECK_LIB([m],[sinh],[AC_DEFINE([HAVE_SINH],[1],[libm includes sinh])])
+AC_CHECK_LIB([m],[sinhl],[AC_DEFINE([HAVE_SINHL],[1],[libm includes sinhl])])
+AC_CHECK_LIB([m],[csinhf],[AC_DEFINE([HAVE_CSINHF],[1],[libm includes csinhf])])
+AC_CHECK_LIB([m],[csinh],[AC_DEFINE([HAVE_CSINH],[1],[libm includes csinh])])
+AC_CHECK_LIB([m],[csinhl],[AC_DEFINE([HAVE_CSINHL],[1],[libm includes csinhl])])
+AC_CHECK_LIB([m],[sqrtf],[AC_DEFINE([HAVE_SQRTF],[1],[libm includes sqrtf])])
+AC_CHECK_LIB([m],[sqrt],[AC_DEFINE([HAVE_SQRT],[1],[libm includes sqrt])])
+AC_CHECK_LIB([m],[sqrtl],[AC_DEFINE([HAVE_SQRTL],[1],[libm includes sqrtl])])
+AC_CHECK_LIB([m],[csqrtf],[AC_DEFINE([HAVE_CSQRTF],[1],[libm includes csqrtf])])
+AC_CHECK_LIB([m],[csqrt],[AC_DEFINE([HAVE_CSQRT],[1],[libm includes csqrt])])
+AC_CHECK_LIB([m],[csqrtl],[AC_DEFINE([HAVE_CSQRTL],[1],[libm includes csqrtl])])
+AC_CHECK_LIB([m],[tanf],[AC_DEFINE([HAVE_TANF],[1],[libm includes tanf])])
+AC_CHECK_LIB([m],[tan],[AC_DEFINE([HAVE_TAN],[1],[libm includes tan])])
+AC_CHECK_LIB([m],[tanl],[AC_DEFINE([HAVE_TANL],[1],[libm includes tanl])])
+AC_CHECK_LIB([m],[ctanf],[AC_DEFINE([HAVE_CTANF],[1],[libm includes ctanf])])
+AC_CHECK_LIB([m],[ctan],[AC_DEFINE([HAVE_CTAN],[1],[libm includes ctan])])
+AC_CHECK_LIB([m],[ctanl],[AC_DEFINE([HAVE_CTANL],[1],[libm includes ctanl])])
+AC_CHECK_LIB([m],[tanhf],[AC_DEFINE([HAVE_TANHF],[1],[libm includes tanhf])])
+AC_CHECK_LIB([m],[tanh],[AC_DEFINE([HAVE_TANH],[1],[libm includes tanh])])
+AC_CHECK_LIB([m],[tanhl],[AC_DEFINE([HAVE_TANHL],[1],[libm includes tanhl])])
+AC_CHECK_LIB([m],[ctanhf],[AC_DEFINE([HAVE_CTANHF],[1],[libm includes ctanhf])])
+AC_CHECK_LIB([m],[ctanh],[AC_DEFINE([HAVE_CTANH],[1],[libm includes ctanh])])
+AC_CHECK_LIB([m],[ctanhl],[AC_DEFINE([HAVE_CTANHL],[1],[libm includes ctanhl])])
+AC_CHECK_LIB([m],[truncf],[AC_DEFINE([HAVE_TRUNCF],[1],[libm includes truncf])])
+AC_CHECK_LIB([m],[trunc],[AC_DEFINE([HAVE_TRUNC],[1],[libm includes trunc])])
+AC_CHECK_LIB([m],[truncl],[AC_DEFINE([HAVE_TRUNCL],[1],[libm includes truncl])])
+AC_CHECK_LIB([m],[erff],[AC_DEFINE([HAVE_ERFF],[1],[libm includes erff])])
+AC_CHECK_LIB([m],[erf],[AC_DEFINE([HAVE_ERF],[1],[libm includes erf])])
+AC_CHECK_LIB([m],[erfl],[AC_DEFINE([HAVE_ERFL],[1],[libm includes erfl])])
+AC_CHECK_LIB([m],[erfcf],[AC_DEFINE([HAVE_ERFCF],[1],[libm includes erfcf])])
+AC_CHECK_LIB([m],[erfc],[AC_DEFINE([HAVE_ERFC],[1],[libm includes erfc])])
+AC_CHECK_LIB([m],[erfcl],[AC_DEFINE([HAVE_ERFCL],[1],[libm includes erfcl])])
+AC_CHECK_LIB([m],[j0f],[AC_DEFINE([HAVE_J0F],[1],[libm includes j0f])])
+AC_CHECK_LIB([m],[j0],[AC_DEFINE([HAVE_J0],[1],[libm includes j0])])
+AC_CHECK_LIB([m],[j0l],[AC_DEFINE([HAVE_J0L],[1],[libm includes j0l])])
+AC_CHECK_LIB([m],[j1f],[AC_DEFINE([HAVE_J1F],[1],[libm includes j1f])])
+AC_CHECK_LIB([m],[j1],[AC_DEFINE([HAVE_J1],[1],[libm includes j1])])
+AC_CHECK_LIB([m],[j1l],[AC_DEFINE([HAVE_J1L],[1],[libm includes j1l])])
+AC_CHECK_LIB([m],[jnf],[AC_DEFINE([HAVE_JNF],[1],[libm includes jnf])])
+AC_CHECK_LIB([m],[jn],[AC_DEFINE([HAVE_JN],[1],[libm includes jn])])
+AC_CHECK_LIB([m],[jnl],[AC_DEFINE([HAVE_JNL],[1],[libm includes jnl])])
+AC_CHECK_LIB([m],[y0f],[AC_DEFINE([HAVE_Y0F],[1],[libm includes y0f])])
+AC_CHECK_LIB([m],[y0],[AC_DEFINE([HAVE_Y0],[1],[libm includes y0])])
+AC_CHECK_LIB([m],[y0l],[AC_DEFINE([HAVE_Y0L],[1],[libm includes y0l])])
+AC_CHECK_LIB([m],[y1f],[AC_DEFINE([HAVE_Y1F],[1],[libm includes y1f])])
+AC_CHECK_LIB([m],[y1],[AC_DEFINE([HAVE_Y1],[1],[libm includes y1])])
+AC_CHECK_LIB([m],[y1l],[AC_DEFINE([HAVE_Y1L],[1],[libm includes y1l])])
+AC_CHECK_LIB([m],[ynf],[AC_DEFINE([HAVE_YNF],[1],[libm includes ynf])])
+AC_CHECK_LIB([m],[yn],[AC_DEFINE([HAVE_YN],[1],[libm includes yn])])
+AC_CHECK_LIB([m],[ynl],[AC_DEFINE([HAVE_YNL],[1],[libm includes ynl])])
+AC_CHECK_LIB([m],[tgamma],[AC_DEFINE([HAVE_TGAMMA],[1],[libm includes tgamma])])
+AC_CHECK_LIB([m],[tgammaf],[AC_DEFINE([HAVE_TGAMMAF],[1],[libm includes tgammaf])])
+AC_CHECK_LIB([m],[tgammal],[AC_DEFINE([HAVE_TGAMMAL],[1],[libm includes tgammal])])
+AC_CHECK_LIB([m],[lgamma],[AC_DEFINE([HAVE_LGAMMA],[1],[libm includes lgamma])])
+AC_CHECK_LIB([m],[lgammaf],[AC_DEFINE([HAVE_LGAMMAF],[1],[libm includes lgammaf])])
+AC_CHECK_LIB([m],[lgammal],[AC_DEFINE([HAVE_LGAMMAL],[1],[libm includes lgammal])])
+
+# Check for GFORTRAN_C99_1.1 funcs
+AC_CHECK_LIB([m],[cacos],[AC_DEFINE([HAVE_CACOS],[1],[libm includes cacos])])
+AC_CHECK_LIB([m],[cacosf],[AC_DEFINE([HAVE_CACOSF],[1],[libm includes cacosf])])
+AC_CHECK_LIB([m],[cacosh],[AC_DEFINE([HAVE_CACOSH],[1],[libm includes cacosh])])
+AC_CHECK_LIB([m],[cacoshf],[AC_DEFINE([HAVE_CACOSHF],[1],[libm includes cacoshf])])
+AC_CHECK_LIB([m],[cacoshl],[AC_DEFINE([HAVE_CACOSHL],[1],[libm includes cacoshl])])
+AC_CHECK_LIB([m],[cacosl],[AC_DEFINE([HAVE_CACOSL],[1],[libm includes cacosl])])
+AC_CHECK_LIB([m],[casin],[AC_DEFINE([HAVE_CASIN],[1],[libm includes casin])])
+AC_CHECK_LIB([m],[casinf],[AC_DEFINE([HAVE_CASINF],[1],[libm includes casinf])])
+AC_CHECK_LIB([m],[casinh],[AC_DEFINE([HAVE_CASINH],[1],[libm includes casinh])])
+AC_CHECK_LIB([m],[casinhf],[AC_DEFINE([HAVE_CASINHF],[1],[libm includes casinhf])])
+AC_CHECK_LIB([m],[casinhl],[AC_DEFINE([HAVE_CASINHL],[1],[libm includes casinhl])])
+AC_CHECK_LIB([m],[casinl],[AC_DEFINE([HAVE_CASINL],[1],[libm includes casinl])])
+AC_CHECK_LIB([m],[catan],[AC_DEFINE([HAVE_CATAN],[1],[libm includes catan])])
+AC_CHECK_LIB([m],[catanf],[AC_DEFINE([HAVE_CATANF],[1],[libm includes catanf])])
+AC_CHECK_LIB([m],[catanh],[AC_DEFINE([HAVE_CATANH],[1],[libm includes catanh])])
+AC_CHECK_LIB([m],[catanhf],[AC_DEFINE([HAVE_CATANHF],[1],[libm includes catanhf])])
+AC_CHECK_LIB([m],[catanhl],[AC_DEFINE([HAVE_CATANHL],[1],[libm includes catanhl])])
+AC_CHECK_LIB([m],[catanl],[AC_DEFINE([HAVE_CATANL],[1],[libm includes catanl])])
+
+# On AIX, clog is present in libm as __clog
+AC_CHECK_LIB([m],[__clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
+
+# Check whether the system has a working stat()
+LIBGFOR_CHECK_WORKING_STAT
+
+# Check whether __mingw_snprintf() is present
+LIBGFOR_CHECK_MINGW_SNPRINTF
+
+# Check for a broken powf implementation
+LIBGFOR_CHECK_FOR_BROKEN_POWF
+
+# Check whether libquadmath should be used
+AC_ARG_ENABLE(libquadmath-support,
+AS_HELP_STRING([--disable-libquadmath-support],
+  [disable libquadmath support for Fortran]),
+ENABLE_LIBQUADMATH_SUPPORT=$enableval,
+ENABLE_LIBQUADMATH_SUPPORT=yes)
+enable_libquadmath_support=
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
+  enable_libquadmath_support=no
+fi
+
+# Check whether we have a __float128 type, depends on enable_libquadmath_support
+LIBGFOR_CHECK_FLOAT128
+
+# Check for GNU libc feenableexcept
+AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])])
+
+# At least for glibc and Tru64, clock_gettime is in librt.  But don't
+# pull that in if it still doesn't give us the function we want.  This
+# test is copied from libgomp, and modified to not link in -lrt as
+# libgfortran calls clock_gettime via a weak reference if it's found
+# in librt.
+if test $ac_cv_func_clock_gettime = no; then
+  AC_CHECK_LIB(rt, clock_gettime,
+    [AC_DEFINE(HAVE_CLOCK_GETTIME_LIBRT, 1,
+               [Define to 1 if you have the `clock_gettime' function in librt.])])
+fi
+
+# Check for SysV fpsetmask
+LIBGFOR_CHECK_FPSETMASK
+
+# Check for AIX fp_trap and fp_enable
+AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])
+AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])])
+
+# Runs configure.host to set up necessary host-dependent shell variables.
+# We then display a message about it, and propagate them through the
+# build chain.
+. ${srcdir}/configure.host
+AC_MSG_NOTICE([FPU dependent file will be ${fpu_host}.h])
+FPU_HOST_HEADER=config/${fpu_host}.h
+AC_SUBST(FPU_HOST_HEADER)
+
+# Some targets require additional compiler options for IEEE compatibility.
+IEEE_FLAGS="${ieee_flags}"
+AC_SUBST(IEEE_FLAGS)
+
+
+# Check for POSIX getpwuid_r 
+#
+# There are two versions of getpwuid_r, the POSIX one with 5
+# arguments, and another one with 4 arguments used by at least HP-UX
+# 10.2.
+if test "$ac_cv_func_getpwuid_r" = "yes"; then
+   AC_CACHE_CHECK([POSIX version of getpwuid_r with 5 arguments], libgfor_cv_posix_getpwuid_r, [
+   AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#include <stdio.h>
+#include <sys/types.h>
+#include <pwd.h>], [
+    getpwuid_r(0, NULL, NULL, 0, NULL);
+    ])],  [libgfor_cv_posix_getpwuid_r="yes"], [libgfor_cv_posix_getpwuid_r="no"])])
+fi
+if test "$libgfor_cv_posix_getpwuid_r" = "yes"; then
+    AC_DEFINE([HAVE_POSIX_GETPWUID_R], [1], [Define to 1 if we have POSIX getpwuid_r which takes 5 arguments.])
+fi
+
+
+# Check out attribute support.
+LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY
+LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT
+LIBGFOR_CHECK_ATTRIBUTE_ALIAS
+
+# Check out sync builtins support.
+LIBGFOR_CHECK_SYNC_FETCH_AND_ADD
+
+# Check out #pragma weak.
+LIBGFOR_GTHREAD_WEAK
+
+# Various other checks on target
+LIBGFOR_CHECK_UNLINK_OPEN_FILE
+
+# Check whether line terminator is LF or CRLF
+LIBGFOR_CHECK_CRLF
+
+# Check whether we have _Unwind_GetIPInfo for backtrace
+GCC_CHECK_UNWIND_GETIPINFO
+
+AC_CACHE_SAVE
+
+if test ${multilib} = yes; then
+  multilib_arg="--enable-multilib"
+else
+  multilib_arg=
+fi
+
+# Write our Makefile and spec file.
+AC_CONFIG_FILES([
+Makefile
+libgfortran.spec
+])
+AC_OUTPUT
diff --git a/l4/pkg/libgfortran/lib/contrib/configure.host b/l4/pkg/libgfortran/lib/contrib/configure.host
new file mode 100644 (file)
index 0000000..92b6433
--- /dev/null
@@ -0,0 +1,47 @@
+# configure.host
+#
+# This shell script handles all host based configuration for libgfortran.
+# It sets various shell variables based on the the host triplet.
+# You can modify this shell script without rerunning autoconf/aclocal/etc.
+# This file is "sourced", not executed.
+#
+#
+# It uses the following shell variables as set by config.guess:
+#   host                The configuration host (full CPU-vendor-OS triplet)
+#   host_cpu            The configuration host CPU
+#   host_os             The configuration host OS
+#
+#
+# It sets the following shell variables:
+#
+#   fpu_host            FPU-specific code file, defaults to fpu-generic.
+
+
+# DEFAULTS
+fpu_host='fpu-generic'
+
+if test "x${have_feenableexcept}" = "xyes"; then
+  fpu_host='fpu-glibc'
+fi
+
+# x86 asm should be used instead of glibc, since glibc doesn't support
+# the x86 denormal exception.
+case "${host_cpu}" in
+  i?86 | x86_64)
+    fpu_host='fpu-387' ;;
+esac
+
+if test "x${have_fpsetmask}" = "xyes"; then
+  fpu_host='fpu-sysv'
+fi
+
+if test "x${have_fp_enable}" = "xyes" && test "x${have_fp_trap}" = "xyes"; then
+  fpu_host='fpu-aix'
+fi
+
+# Some targets require additional compiler options for NaN/Inf.
+ieee_flags=
+case "${host_cpu}" in
+  sh*)
+    ieee_flags="-mieee" ;;
+esac
diff --git a/l4/pkg/libgfortran/lib/contrib/fmain.c b/l4/pkg/libgfortran/lib/contrib/fmain.c
new file mode 100644 (file)
index 0000000..a99263c
--- /dev/null
@@ -0,0 +1,24 @@
+/* Note that this file is not used as of GFortran 4.5, and exists here
+   only for backwards compatibility.  */
+
+#include "libgfortran.h"
+
+/* The main Fortran program actually is a function, called MAIN__.
+   We call it from the main() function in this file.  */
+void MAIN__ (void);
+
+/* Main procedure for fortran programs.  All we do is set up the environment
+   for the Fortran program.  */
+int
+main (int argc, char *argv[])
+{
+  /* Set up the runtime environment.  */
+  set_args (argc, argv);
+
+  /* Call the Fortran main program.  Internally this is a function
+     called MAIN__ */
+  MAIN__ ();
+
+  /* Bye-bye!  */
+  return 0;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_c10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_c10.F90
new file mode 100644 (file)
index 0000000..ecc5ae4
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_10)
+#ifdef HAVE_CABSL
+
+elemental function _gfortran_specific__abs_c10 (parm)
+   complex (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__abs_c10
+
+   _gfortran_specific__abs_c10 = abs (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_c16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_c16.F90
new file mode 100644 (file)
index 0000000..ae55693
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_16)
+#ifdef HAVE_CABSL
+
+elemental function _gfortran_specific__abs_c16 (parm)
+   complex (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__abs_c16
+
+   _gfortran_specific__abs_c16 = abs (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_c4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_c4.F90
new file mode 100644 (file)
index 0000000..ee56045
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_4)
+#ifdef HAVE_CABSF
+
+elemental function _gfortran_specific__abs_c4 (parm)
+   complex (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__abs_c4
+
+   _gfortran_specific__abs_c4 = abs (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_c8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_c8.F90
new file mode 100644 (file)
index 0000000..b9ec758
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_8)
+#ifdef HAVE_CABS
+
+elemental function _gfortran_specific__abs_c8 (parm)
+   complex (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__abs_c8
+
+   _gfortran_specific__abs_c8 = abs (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_i16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_i16.F90
new file mode 100644 (file)
index 0000000..bcc71ad
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+
+elemental function _gfortran_specific__abs_i16 (parm)
+   integer (kind=16), intent (in) :: parm
+   integer (kind=16) :: _gfortran_specific__abs_i16
+
+   _gfortran_specific__abs_i16 = abs (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_i4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_i4.F90
new file mode 100644 (file)
index 0000000..9e49a0b
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+
+elemental function _gfortran_specific__abs_i4 (parm)
+   integer (kind=4), intent (in) :: parm
+   integer (kind=4) :: _gfortran_specific__abs_i4
+
+   _gfortran_specific__abs_i4 = abs (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_i8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_i8.F90
new file mode 100644 (file)
index 0000000..c0172eb
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+
+elemental function _gfortran_specific__abs_i8 (parm)
+   integer (kind=8), intent (in) :: parm
+   integer (kind=8) :: _gfortran_specific__abs_i8
+
+   _gfortran_specific__abs_i8 = abs (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_r10.F90
new file mode 100644 (file)
index 0000000..237512f
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_FABSL
+
+elemental function _gfortran_specific__abs_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__abs_r10
+
+   _gfortran_specific__abs_r10 = abs (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_r16.F90
new file mode 100644 (file)
index 0000000..df6dd16
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_FABSL
+
+elemental function _gfortran_specific__abs_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__abs_r16
+
+   _gfortran_specific__abs_r16 = abs (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_r4.F90
new file mode 100644 (file)
index 0000000..e7669df
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_FABSF
+
+elemental function _gfortran_specific__abs_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__abs_r4
+
+   _gfortran_specific__abs_r4 = abs (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_abs_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_abs_r8.F90
new file mode 100644 (file)
index 0000000..82a734c
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_FABS
+
+elemental function _gfortran_specific__abs_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__abs_r8
+
+   _gfortran_specific__abs_r8 = abs (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_acos_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_acos_r10.F90
new file mode 100644 (file)
index 0000000..8c5a71d
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_ACOSL
+
+elemental function _gfortran_specific__acos_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__acos_r10
+
+   _gfortran_specific__acos_r10 = acos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_acos_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_acos_r16.F90
new file mode 100644 (file)
index 0000000..93e36b4
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_ACOSL
+
+elemental function _gfortran_specific__acos_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__acos_r16
+
+   _gfortran_specific__acos_r16 = acos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_acos_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_acos_r4.F90
new file mode 100644 (file)
index 0000000..0c2474e
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_ACOSF
+
+elemental function _gfortran_specific__acos_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__acos_r4
+
+   _gfortran_specific__acos_r4 = acos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_acos_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_acos_r8.F90
new file mode 100644 (file)
index 0000000..a40ffd7
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_ACOS
+
+elemental function _gfortran_specific__acos_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__acos_r8
+
+   _gfortran_specific__acos_r8 = acos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_acosh_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_acosh_r10.F90
new file mode 100644 (file)
index 0000000..24ccef1
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_ACOSHL
+
+elemental function _gfortran_specific__acosh_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__acosh_r10
+
+   _gfortran_specific__acosh_r10 = acosh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_acosh_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_acosh_r16.F90
new file mode 100644 (file)
index 0000000..ce13a3b
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_ACOSHL
+
+elemental function _gfortran_specific__acosh_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__acosh_r16
+
+   _gfortran_specific__acosh_r16 = acosh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_acosh_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_acosh_r4.F90
new file mode 100644 (file)
index 0000000..6aa56f3
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_ACOSHF
+
+elemental function _gfortran_specific__acosh_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__acosh_r4
+
+   _gfortran_specific__acosh_r4 = acosh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_acosh_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_acosh_r8.F90
new file mode 100644 (file)
index 0000000..2250378
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_ACOSH
+
+elemental function _gfortran_specific__acosh_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__acosh_r8
+
+   _gfortran_specific__acosh_r8 = acosh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_aimag_c10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_aimag_c10.F90
new file mode 100644 (file)
index 0000000..ccad661
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+
+elemental function _gfortran_specific__aimag_c10 (parm)
+   complex (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__aimag_c10
+
+   _gfortran_specific__aimag_c10 = aimag (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_aimag_c16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_aimag_c16.F90
new file mode 100644 (file)
index 0000000..0035bd2
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+
+elemental function _gfortran_specific__aimag_c16 (parm)
+   complex (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__aimag_c16
+
+   _gfortran_specific__aimag_c16 = aimag (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_aimag_c4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_aimag_c4.F90
new file mode 100644 (file)
index 0000000..2c06453
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+
+elemental function _gfortran_specific__aimag_c4 (parm)
+   complex (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__aimag_c4
+
+   _gfortran_specific__aimag_c4 = aimag (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_aimag_c8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_aimag_c8.F90
new file mode 100644 (file)
index 0000000..c7d9fc7
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+
+elemental function _gfortran_specific__aimag_c8 (parm)
+   complex (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__aimag_c8
+
+   _gfortran_specific__aimag_c8 = aimag (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_aint_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_aint_r10.F90
new file mode 100644 (file)
index 0000000..508a6ed
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_TRUNCL
+
+elemental function _gfortran_specific__aint_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__aint_r10
+
+   _gfortran_specific__aint_r10 = aint (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_aint_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_aint_r16.F90
new file mode 100644 (file)
index 0000000..afc668d
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_TRUNCL
+
+elemental function _gfortran_specific__aint_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__aint_r16
+
+   _gfortran_specific__aint_r16 = aint (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_aint_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_aint_r4.F90
new file mode 100644 (file)
index 0000000..684d9ac
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_TRUNCF
+
+elemental function _gfortran_specific__aint_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__aint_r4
+
+   _gfortran_specific__aint_r4 = aint (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_aint_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_aint_r8.F90
new file mode 100644 (file)
index 0000000..14a1d2d
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_TRUNC
+
+elemental function _gfortran_specific__aint_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__aint_r8
+
+   _gfortran_specific__aint_r8 = aint (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_anint_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_anint_r10.F90
new file mode 100644 (file)
index 0000000..f6d6686
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_ROUNDL
+
+elemental function _gfortran_specific__anint_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__anint_r10
+
+   _gfortran_specific__anint_r10 = anint (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_anint_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_anint_r16.F90
new file mode 100644 (file)
index 0000000..6954a4a
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_ROUNDL
+
+elemental function _gfortran_specific__anint_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__anint_r16
+
+   _gfortran_specific__anint_r16 = anint (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_anint_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_anint_r4.F90
new file mode 100644 (file)
index 0000000..70ba1c9
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_ROUNDF
+
+elemental function _gfortran_specific__anint_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__anint_r4
+
+   _gfortran_specific__anint_r4 = anint (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_anint_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_anint_r8.F90
new file mode 100644 (file)
index 0000000..8ba151c
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_ROUND
+
+elemental function _gfortran_specific__anint_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__anint_r8
+
+   _gfortran_specific__anint_r8 = anint (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_asin_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_asin_r10.F90
new file mode 100644 (file)
index 0000000..0c91678
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_ASINL
+
+elemental function _gfortran_specific__asin_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__asin_r10
+
+   _gfortran_specific__asin_r10 = asin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_asin_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_asin_r16.F90
new file mode 100644 (file)
index 0000000..5fbbdb2
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_ASINL
+
+elemental function _gfortran_specific__asin_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__asin_r16
+
+   _gfortran_specific__asin_r16 = asin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_asin_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_asin_r4.F90
new file mode 100644 (file)
index 0000000..6cda5ee
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_ASINF
+
+elemental function _gfortran_specific__asin_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__asin_r4
+
+   _gfortran_specific__asin_r4 = asin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_asin_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_asin_r8.F90
new file mode 100644 (file)
index 0000000..c7dd827
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_ASIN
+
+elemental function _gfortran_specific__asin_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__asin_r8
+
+   _gfortran_specific__asin_r8 = asin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_asinh_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_asinh_r10.F90
new file mode 100644 (file)
index 0000000..5f14465
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_ASINHL
+
+elemental function _gfortran_specific__asinh_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__asinh_r10
+
+   _gfortran_specific__asinh_r10 = asinh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_asinh_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_asinh_r16.F90
new file mode 100644 (file)
index 0000000..bd81efa
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_ASINHL
+
+elemental function _gfortran_specific__asinh_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__asinh_r16
+
+   _gfortran_specific__asinh_r16 = asinh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_asinh_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_asinh_r4.F90
new file mode 100644 (file)
index 0000000..5187991
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_ASINHF
+
+elemental function _gfortran_specific__asinh_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__asinh_r4
+
+   _gfortran_specific__asinh_r4 = asinh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_asinh_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_asinh_r8.F90
new file mode 100644 (file)
index 0000000..054fd05
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_ASINH
+
+elemental function _gfortran_specific__asinh_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__asinh_r8
+
+   _gfortran_specific__asinh_r8 = asinh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atan2_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atan2_r10.F90
new file mode 100644 (file)
index 0000000..727df74
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+
+#ifdef HAVE_ATAN2L
+
+elemental function _gfortran_specific__atan2_r10 (p1, p2)
+   real (kind=10), intent (in) :: p1, p2
+   real (kind=10) :: _gfortran_specific__atan2_r10
+
+   _gfortran_specific__atan2_r10 = atan2 (p1, p2)
+end function
+
+#endif
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atan2_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atan2_r16.F90
new file mode 100644 (file)
index 0000000..6ce962f
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+
+#ifdef HAVE_ATAN2L
+
+elemental function _gfortran_specific__atan2_r16 (p1, p2)
+   real (kind=16), intent (in) :: p1, p2
+   real (kind=16) :: _gfortran_specific__atan2_r16
+
+   _gfortran_specific__atan2_r16 = atan2 (p1, p2)
+end function
+
+#endif
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atan2_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atan2_r4.F90
new file mode 100644 (file)
index 0000000..c3e0f89
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+
+#ifdef HAVE_ATAN2F
+
+elemental function _gfortran_specific__atan2_r4 (p1, p2)
+   real (kind=4), intent (in) :: p1, p2
+   real (kind=4) :: _gfortran_specific__atan2_r4
+
+   _gfortran_specific__atan2_r4 = atan2 (p1, p2)
+end function
+
+#endif
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atan2_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atan2_r8.F90
new file mode 100644 (file)
index 0000000..243f0ca
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+
+#ifdef HAVE_ATAN2
+
+elemental function _gfortran_specific__atan2_r8 (p1, p2)
+   real (kind=8), intent (in) :: p1, p2
+   real (kind=8) :: _gfortran_specific__atan2_r8
+
+   _gfortran_specific__atan2_r8 = atan2 (p1, p2)
+end function
+
+#endif
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atan_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atan_r10.F90
new file mode 100644 (file)
index 0000000..3f022ff
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_ATANL
+
+elemental function _gfortran_specific__atan_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__atan_r10
+
+   _gfortran_specific__atan_r10 = atan (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atan_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atan_r16.F90
new file mode 100644 (file)
index 0000000..190b3dc
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_ATANL
+
+elemental function _gfortran_specific__atan_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__atan_r16
+
+   _gfortran_specific__atan_r16 = atan (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atan_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atan_r4.F90
new file mode 100644 (file)
index 0000000..f1df83c
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_ATANF
+
+elemental function _gfortran_specific__atan_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__atan_r4
+
+   _gfortran_specific__atan_r4 = atan (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atan_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atan_r8.F90
new file mode 100644 (file)
index 0000000..8b38c8f
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_ATAN
+
+elemental function _gfortran_specific__atan_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__atan_r8
+
+   _gfortran_specific__atan_r8 = atan (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atanh_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atanh_r10.F90
new file mode 100644 (file)
index 0000000..e913d5a
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_ATANHL
+
+elemental function _gfortran_specific__atanh_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__atanh_r10
+
+   _gfortran_specific__atanh_r10 = atanh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atanh_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atanh_r16.F90
new file mode 100644 (file)
index 0000000..167694b
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_ATANHL
+
+elemental function _gfortran_specific__atanh_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__atanh_r16
+
+   _gfortran_specific__atanh_r16 = atanh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atanh_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atanh_r4.F90
new file mode 100644 (file)
index 0000000..80227bf
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_ATANHF
+
+elemental function _gfortran_specific__atanh_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__atanh_r4
+
+   _gfortran_specific__atanh_r4 = atanh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_atanh_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_atanh_r8.F90
new file mode 100644 (file)
index 0000000..ed55b20
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_ATANH
+
+elemental function _gfortran_specific__atanh_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__atanh_r8
+
+   _gfortran_specific__atanh_r8 = atanh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_conjg_c10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_conjg_c10.F90
new file mode 100644 (file)
index 0000000..4ed59aa
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+
+elemental function _gfortran_specific__conjg_10 (parm)
+   complex (kind=10), intent (in) :: parm
+   complex (kind=10) :: _gfortran_specific__conjg_10
+
+   _gfortran_specific__conjg_10 = conjg (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_conjg_c16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_conjg_c16.F90
new file mode 100644 (file)
index 0000000..51fd32d
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+
+elemental function _gfortran_specific__conjg_16 (parm)
+   complex (kind=16), intent (in) :: parm
+   complex (kind=16) :: _gfortran_specific__conjg_16
+
+   _gfortran_specific__conjg_16 = conjg (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_conjg_c4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_conjg_c4.F90
new file mode 100644 (file)
index 0000000..23dc556
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+
+elemental function _gfortran_specific__conjg_4 (parm)
+   complex (kind=4), intent (in) :: parm
+   complex (kind=4) :: _gfortran_specific__conjg_4
+
+   _gfortran_specific__conjg_4 = conjg (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_conjg_c8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_conjg_c8.F90
new file mode 100644 (file)
index 0000000..7430c2a
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+
+elemental function _gfortran_specific__conjg_8 (parm)
+   complex (kind=8), intent (in) :: parm
+   complex (kind=8) :: _gfortran_specific__conjg_8
+
+   _gfortran_specific__conjg_8 = conjg (parm)
+end function
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cos_c10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cos_c10.F90
new file mode 100644 (file)
index 0000000..afe826b
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_10)
+#ifdef HAVE_CCOSL
+
+elemental function _gfortran_specific__cos_c10 (parm)
+   complex (kind=10), intent (in) :: parm
+   complex (kind=10) :: _gfortran_specific__cos_c10
+
+   _gfortran_specific__cos_c10 = cos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cos_c16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cos_c16.F90
new file mode 100644 (file)
index 0000000..32d6ee6
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_16)
+#ifdef HAVE_CCOSL
+
+elemental function _gfortran_specific__cos_c16 (parm)
+   complex (kind=16), intent (in) :: parm
+   complex (kind=16) :: _gfortran_specific__cos_c16
+
+   _gfortran_specific__cos_c16 = cos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cos_c4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cos_c4.F90
new file mode 100644 (file)
index 0000000..3f55047
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_4)
+#ifdef HAVE_CCOSF
+
+elemental function _gfortran_specific__cos_c4 (parm)
+   complex (kind=4), intent (in) :: parm
+   complex (kind=4) :: _gfortran_specific__cos_c4
+
+   _gfortran_specific__cos_c4 = cos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cos_c8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cos_c8.F90
new file mode 100644 (file)
index 0000000..14d21ed
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_8)
+#ifdef HAVE_CCOS
+
+elemental function _gfortran_specific__cos_c8 (parm)
+   complex (kind=8), intent (in) :: parm
+   complex (kind=8) :: _gfortran_specific__cos_c8
+
+   _gfortran_specific__cos_c8 = cos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cos_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cos_r10.F90
new file mode 100644 (file)
index 0000000..cac4a7f
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_COSL
+
+elemental function _gfortran_specific__cos_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__cos_r10
+
+   _gfortran_specific__cos_r10 = cos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cos_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cos_r16.F90
new file mode 100644 (file)
index 0000000..a5aadb6
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_COSL
+
+elemental function _gfortran_specific__cos_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__cos_r16
+
+   _gfortran_specific__cos_r16 = cos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cos_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cos_r4.F90
new file mode 100644 (file)
index 0000000..48df7df
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_COSF
+
+elemental function _gfortran_specific__cos_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__cos_r4
+
+   _gfortran_specific__cos_r4 = cos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cos_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cos_r8.F90
new file mode 100644 (file)
index 0000000..b3b8835
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_COS
+
+elemental function _gfortran_specific__cos_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__cos_r8
+
+   _gfortran_specific__cos_r8 = cos (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cosh_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cosh_r10.F90
new file mode 100644 (file)
index 0000000..93b3d75
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_COSHL
+
+elemental function _gfortran_specific__cosh_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__cosh_r10
+
+   _gfortran_specific__cosh_r10 = cosh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cosh_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cosh_r16.F90
new file mode 100644 (file)
index 0000000..c4abeab
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_COSHL
+
+elemental function _gfortran_specific__cosh_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__cosh_r16
+
+   _gfortran_specific__cosh_r16 = cosh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cosh_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cosh_r4.F90
new file mode 100644 (file)
index 0000000..0f08b61
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_COSHF
+
+elemental function _gfortran_specific__cosh_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__cosh_r4
+
+   _gfortran_specific__cosh_r4 = cosh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_cosh_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_cosh_r8.F90
new file mode 100644 (file)
index 0000000..5d81225
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_COSH
+
+elemental function _gfortran_specific__cosh_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__cosh_r8
+
+   _gfortran_specific__cosh_r8 = cosh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_dim_i16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_dim_i16.F90
new file mode 100644 (file)
index 0000000..0249f28
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+
+
+elemental function _gfortran_specific__dim_i16 (p1, p2)
+   integer (kind=16), intent (in) :: p1, p2
+   integer (kind=16) :: _gfortran_specific__dim_i16
+
+   _gfortran_specific__dim_i16 = dim (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_dim_i4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_dim_i4.F90
new file mode 100644 (file)
index 0000000..3fd6ad4
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+
+
+elemental function _gfortran_specific__dim_i4 (p1, p2)
+   integer (kind=4), intent (in) :: p1, p2
+   integer (kind=4) :: _gfortran_specific__dim_i4
+
+   _gfortran_specific__dim_i4 = dim (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_dim_i8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_dim_i8.F90
new file mode 100644 (file)
index 0000000..915cce0
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+
+
+elemental function _gfortran_specific__dim_i8 (p1, p2)
+   integer (kind=8), intent (in) :: p1, p2
+   integer (kind=8) :: _gfortran_specific__dim_i8
+
+   _gfortran_specific__dim_i8 = dim (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_dim_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_dim_r10.F90
new file mode 100644 (file)
index 0000000..d3366b3
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+
+
+
+elemental function _gfortran_specific__dim_r10 (p1, p2)
+   real (kind=10), intent (in) :: p1, p2
+   real (kind=10) :: _gfortran_specific__dim_r10
+
+   _gfortran_specific__dim_r10 = dim (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_dim_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_dim_r16.F90
new file mode 100644 (file)
index 0000000..21ab786
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+
+
+
+elemental function _gfortran_specific__dim_r16 (p1, p2)
+   real (kind=16), intent (in) :: p1, p2
+   real (kind=16) :: _gfortran_specific__dim_r16
+
+   _gfortran_specific__dim_r16 = dim (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_dim_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_dim_r4.F90
new file mode 100644 (file)
index 0000000..0a85671
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+
+
+
+elemental function _gfortran_specific__dim_r4 (p1, p2)
+   real (kind=4), intent (in) :: p1, p2
+   real (kind=4) :: _gfortran_specific__dim_r4
+
+   _gfortran_specific__dim_r4 = dim (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_dim_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_dim_r8.F90
new file mode 100644 (file)
index 0000000..96c97be
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+
+
+
+elemental function _gfortran_specific__dim_r8 (p1, p2)
+   real (kind=8), intent (in) :: p1, p2
+   real (kind=8) :: _gfortran_specific__dim_r8
+
+   _gfortran_specific__dim_r8 = dim (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_exp_c10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_exp_c10.F90
new file mode 100644 (file)
index 0000000..e50e7a5
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_10)
+#ifdef HAVE_CEXPL
+
+elemental function _gfortran_specific__exp_c10 (parm)
+   complex (kind=10), intent (in) :: parm
+   complex (kind=10) :: _gfortran_specific__exp_c10
+
+   _gfortran_specific__exp_c10 = exp (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_exp_c16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_exp_c16.F90
new file mode 100644 (file)
index 0000000..eedd95d
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_16)
+#ifdef HAVE_CEXPL
+
+elemental function _gfortran_specific__exp_c16 (parm)
+   complex (kind=16), intent (in) :: parm
+   complex (kind=16) :: _gfortran_specific__exp_c16
+
+   _gfortran_specific__exp_c16 = exp (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_exp_c4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_exp_c4.F90
new file mode 100644 (file)
index 0000000..12a4494
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_4)
+#ifdef HAVE_CEXPF
+
+elemental function _gfortran_specific__exp_c4 (parm)
+   complex (kind=4), intent (in) :: parm
+   complex (kind=4) :: _gfortran_specific__exp_c4
+
+   _gfortran_specific__exp_c4 = exp (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_exp_c8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_exp_c8.F90
new file mode 100644 (file)
index 0000000..bed2d0c
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_8)
+#ifdef HAVE_CEXP
+
+elemental function _gfortran_specific__exp_c8 (parm)
+   complex (kind=8), intent (in) :: parm
+   complex (kind=8) :: _gfortran_specific__exp_c8
+
+   _gfortran_specific__exp_c8 = exp (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_exp_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_exp_r10.F90
new file mode 100644 (file)
index 0000000..33807d9
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_EXPL
+
+elemental function _gfortran_specific__exp_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__exp_r10
+
+   _gfortran_specific__exp_r10 = exp (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_exp_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_exp_r16.F90
new file mode 100644 (file)
index 0000000..386629e
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_EXPL
+
+elemental function _gfortran_specific__exp_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__exp_r16
+
+   _gfortran_specific__exp_r16 = exp (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_exp_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_exp_r4.F90
new file mode 100644 (file)
index 0000000..ca924f2
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_EXPF
+
+elemental function _gfortran_specific__exp_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__exp_r4
+
+   _gfortran_specific__exp_r4 = exp (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_exp_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_exp_r8.F90
new file mode 100644 (file)
index 0000000..eaa448a
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_EXP
+
+elemental function _gfortran_specific__exp_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__exp_r8
+
+   _gfortran_specific__exp_r8 = exp (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log10_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log10_r10.F90
new file mode 100644 (file)
index 0000000..0717bdc
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_LOG10L
+
+elemental function _gfortran_specific__log10_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__log10_r10
+
+   _gfortran_specific__log10_r10 = log10 (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log10_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log10_r16.F90
new file mode 100644 (file)
index 0000000..22020e9
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_LOG10L
+
+elemental function _gfortran_specific__log10_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__log10_r16
+
+   _gfortran_specific__log10_r16 = log10 (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log10_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log10_r4.F90
new file mode 100644 (file)
index 0000000..11a6160
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_LOG10F
+
+elemental function _gfortran_specific__log10_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__log10_r4
+
+   _gfortran_specific__log10_r4 = log10 (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log10_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log10_r8.F90
new file mode 100644 (file)
index 0000000..9eeb274
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_LOG10
+
+elemental function _gfortran_specific__log10_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__log10_r8
+
+   _gfortran_specific__log10_r8 = log10 (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log_c10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log_c10.F90
new file mode 100644 (file)
index 0000000..1a03d5f
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_10)
+#ifdef HAVE_CLOGL
+
+elemental function _gfortran_specific__log_c10 (parm)
+   complex (kind=10), intent (in) :: parm
+   complex (kind=10) :: _gfortran_specific__log_c10
+
+   _gfortran_specific__log_c10 = log (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log_c16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log_c16.F90
new file mode 100644 (file)
index 0000000..d5c86b5
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_16)
+#ifdef HAVE_CLOGL
+
+elemental function _gfortran_specific__log_c16 (parm)
+   complex (kind=16), intent (in) :: parm
+   complex (kind=16) :: _gfortran_specific__log_c16
+
+   _gfortran_specific__log_c16 = log (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log_c4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log_c4.F90
new file mode 100644 (file)
index 0000000..ec4a311
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_4)
+#ifdef HAVE_CLOGF
+
+elemental function _gfortran_specific__log_c4 (parm)
+   complex (kind=4), intent (in) :: parm
+   complex (kind=4) :: _gfortran_specific__log_c4
+
+   _gfortran_specific__log_c4 = log (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log_c8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log_c8.F90
new file mode 100644 (file)
index 0000000..b7322ed
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_8)
+#ifdef HAVE_CLOG
+
+elemental function _gfortran_specific__log_c8 (parm)
+   complex (kind=8), intent (in) :: parm
+   complex (kind=8) :: _gfortran_specific__log_c8
+
+   _gfortran_specific__log_c8 = log (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log_r10.F90
new file mode 100644 (file)
index 0000000..c69cb83
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_LOGL
+
+elemental function _gfortran_specific__log_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__log_r10
+
+   _gfortran_specific__log_r10 = log (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log_r16.F90
new file mode 100644 (file)
index 0000000..6cd42ce
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_LOGL
+
+elemental function _gfortran_specific__log_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__log_r16
+
+   _gfortran_specific__log_r16 = log (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log_r4.F90
new file mode 100644 (file)
index 0000000..5111371
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_LOGF
+
+elemental function _gfortran_specific__log_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__log_r4
+
+   _gfortran_specific__log_r4 = log (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_log_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_log_r8.F90
new file mode 100644 (file)
index 0000000..37cf12e
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_LOG
+
+elemental function _gfortran_specific__log_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__log_r8
+
+   _gfortran_specific__log_r8 = log (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_mod_i16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_mod_i16.F90
new file mode 100644 (file)
index 0000000..78118d1
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+
+
+elemental function _gfortran_specific__mod_i16 (p1, p2)
+   integer (kind=16), intent (in) :: p1, p2
+   integer (kind=16) :: _gfortran_specific__mod_i16
+
+   _gfortran_specific__mod_i16 = mod (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_mod_i4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_mod_i4.F90
new file mode 100644 (file)
index 0000000..b25d04d
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+
+
+elemental function _gfortran_specific__mod_i4 (p1, p2)
+   integer (kind=4), intent (in) :: p1, p2
+   integer (kind=4) :: _gfortran_specific__mod_i4
+
+   _gfortran_specific__mod_i4 = mod (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_mod_i8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_mod_i8.F90
new file mode 100644 (file)
index 0000000..63169f4
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+
+
+elemental function _gfortran_specific__mod_i8 (p1, p2)
+   integer (kind=8), intent (in) :: p1, p2
+   integer (kind=8) :: _gfortran_specific__mod_i8
+
+   _gfortran_specific__mod_i8 = mod (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_mod_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_mod_r10.F90
new file mode 100644 (file)
index 0000000..f901485
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+
+
+
+elemental function _gfortran_specific__mod_r10 (p1, p2)
+   real (kind=10), intent (in) :: p1, p2
+   real (kind=10) :: _gfortran_specific__mod_r10
+
+   _gfortran_specific__mod_r10 = mod (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_mod_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_mod_r16.F90
new file mode 100644 (file)
index 0000000..98c00a9
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+
+
+
+elemental function _gfortran_specific__mod_r16 (p1, p2)
+   real (kind=16), intent (in) :: p1, p2
+   real (kind=16) :: _gfortran_specific__mod_r16
+
+   _gfortran_specific__mod_r16 = mod (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_mod_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_mod_r4.F90
new file mode 100644 (file)
index 0000000..9547352
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+
+
+
+elemental function _gfortran_specific__mod_r4 (p1, p2)
+   real (kind=4), intent (in) :: p1, p2
+   real (kind=4) :: _gfortran_specific__mod_r4
+
+   _gfortran_specific__mod_r4 = mod (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_mod_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_mod_r8.F90
new file mode 100644 (file)
index 0000000..94c47a6
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+
+
+
+elemental function _gfortran_specific__mod_r8 (p1, p2)
+   real (kind=8), intent (in) :: p1, p2
+   real (kind=8) :: _gfortran_specific__mod_r8
+
+   _gfortran_specific__mod_r8 = mod (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sign_i16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sign_i16.F90
new file mode 100644 (file)
index 0000000..fbca7cc
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+
+
+elemental function _gfortran_specific__sign_i16 (p1, p2)
+   integer (kind=16), intent (in) :: p1, p2
+   integer (kind=16) :: _gfortran_specific__sign_i16
+
+   _gfortran_specific__sign_i16 = sign (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sign_i4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sign_i4.F90
new file mode 100644 (file)
index 0000000..fe8efbe
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+
+
+elemental function _gfortran_specific__sign_i4 (p1, p2)
+   integer (kind=4), intent (in) :: p1, p2
+   integer (kind=4) :: _gfortran_specific__sign_i4
+
+   _gfortran_specific__sign_i4 = sign (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sign_i8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sign_i8.F90
new file mode 100644 (file)
index 0000000..3705ac4
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+
+
+elemental function _gfortran_specific__sign_i8 (p1, p2)
+   integer (kind=8), intent (in) :: p1, p2
+   integer (kind=8) :: _gfortran_specific__sign_i8
+
+   _gfortran_specific__sign_i8 = sign (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sign_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sign_r10.F90
new file mode 100644 (file)
index 0000000..8525017
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+
+
+
+elemental function _gfortran_specific__sign_r10 (p1, p2)
+   real (kind=10), intent (in) :: p1, p2
+   real (kind=10) :: _gfortran_specific__sign_r10
+
+   _gfortran_specific__sign_r10 = sign (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sign_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sign_r16.F90
new file mode 100644 (file)
index 0000000..1ab3aaa
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+
+
+
+elemental function _gfortran_specific__sign_r16 (p1, p2)
+   real (kind=16), intent (in) :: p1, p2
+   real (kind=16) :: _gfortran_specific__sign_r16
+
+   _gfortran_specific__sign_r16 = sign (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sign_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sign_r4.F90
new file mode 100644 (file)
index 0000000..f1dc1a1
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+
+
+
+elemental function _gfortran_specific__sign_r4 (p1, p2)
+   real (kind=4), intent (in) :: p1, p2
+   real (kind=4) :: _gfortran_specific__sign_r4
+
+   _gfortran_specific__sign_r4 = sign (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sign_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sign_r8.F90
new file mode 100644 (file)
index 0000000..b96ce83
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+
+
+
+elemental function _gfortran_specific__sign_r8 (p1, p2)
+   real (kind=8), intent (in) :: p1, p2
+   real (kind=8) :: _gfortran_specific__sign_r8
+
+   _gfortran_specific__sign_r8 = sign (p1, p2)
+end function
+
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sin_c10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sin_c10.F90
new file mode 100644 (file)
index 0000000..14f0f69
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_10)
+#ifdef HAVE_CSINL
+
+elemental function _gfortran_specific__sin_c10 (parm)
+   complex (kind=10), intent (in) :: parm
+   complex (kind=10) :: _gfortran_specific__sin_c10
+
+   _gfortran_specific__sin_c10 = sin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sin_c16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sin_c16.F90
new file mode 100644 (file)
index 0000000..140167f
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_16)
+#ifdef HAVE_CSINL
+
+elemental function _gfortran_specific__sin_c16 (parm)
+   complex (kind=16), intent (in) :: parm
+   complex (kind=16) :: _gfortran_specific__sin_c16
+
+   _gfortran_specific__sin_c16 = sin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sin_c4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sin_c4.F90
new file mode 100644 (file)
index 0000000..0f2a7ef
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_4)
+#ifdef HAVE_CSINF
+
+elemental function _gfortran_specific__sin_c4 (parm)
+   complex (kind=4), intent (in) :: parm
+   complex (kind=4) :: _gfortran_specific__sin_c4
+
+   _gfortran_specific__sin_c4 = sin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sin_c8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sin_c8.F90
new file mode 100644 (file)
index 0000000..45e8d78
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_8)
+#ifdef HAVE_CSIN
+
+elemental function _gfortran_specific__sin_c8 (parm)
+   complex (kind=8), intent (in) :: parm
+   complex (kind=8) :: _gfortran_specific__sin_c8
+
+   _gfortran_specific__sin_c8 = sin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sin_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sin_r10.F90
new file mode 100644 (file)
index 0000000..fbe312b
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_SINL
+
+elemental function _gfortran_specific__sin_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__sin_r10
+
+   _gfortran_specific__sin_r10 = sin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sin_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sin_r16.F90
new file mode 100644 (file)
index 0000000..08e5d41
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_SINL
+
+elemental function _gfortran_specific__sin_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__sin_r16
+
+   _gfortran_specific__sin_r16 = sin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sin_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sin_r4.F90
new file mode 100644 (file)
index 0000000..e0575a6
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_SINF
+
+elemental function _gfortran_specific__sin_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__sin_r4
+
+   _gfortran_specific__sin_r4 = sin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sin_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sin_r8.F90
new file mode 100644 (file)
index 0000000..9fd2acb
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_SIN
+
+elemental function _gfortran_specific__sin_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__sin_r8
+
+   _gfortran_specific__sin_r8 = sin (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sinh_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sinh_r10.F90
new file mode 100644 (file)
index 0000000..f290a12
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_SINHL
+
+elemental function _gfortran_specific__sinh_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__sinh_r10
+
+   _gfortran_specific__sinh_r10 = sinh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sinh_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sinh_r16.F90
new file mode 100644 (file)
index 0000000..c966f4f
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_SINHL
+
+elemental function _gfortran_specific__sinh_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__sinh_r16
+
+   _gfortran_specific__sinh_r16 = sinh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sinh_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sinh_r4.F90
new file mode 100644 (file)
index 0000000..3471036
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_SINHF
+
+elemental function _gfortran_specific__sinh_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__sinh_r4
+
+   _gfortran_specific__sinh_r4 = sinh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sinh_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sinh_r8.F90
new file mode 100644 (file)
index 0000000..c0aa46f
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_SINH
+
+elemental function _gfortran_specific__sinh_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__sinh_r8
+
+   _gfortran_specific__sinh_r8 = sinh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c10.F90
new file mode 100644 (file)
index 0000000..5013da0
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_10)
+#ifdef HAVE_CSQRTL
+
+elemental function _gfortran_specific__sqrt_c10 (parm)
+   complex (kind=10), intent (in) :: parm
+   complex (kind=10) :: _gfortran_specific__sqrt_c10
+
+   _gfortran_specific__sqrt_c10 = sqrt (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c16.F90
new file mode 100644 (file)
index 0000000..bf2253e
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_16)
+#ifdef HAVE_CSQRTL
+
+elemental function _gfortran_specific__sqrt_c16 (parm)
+   complex (kind=16), intent (in) :: parm
+   complex (kind=16) :: _gfortran_specific__sqrt_c16
+
+   _gfortran_specific__sqrt_c16 = sqrt (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c4.F90
new file mode 100644 (file)
index 0000000..45d7c49
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_4)
+#ifdef HAVE_CSQRTF
+
+elemental function _gfortran_specific__sqrt_c4 (parm)
+   complex (kind=4), intent (in) :: parm
+   complex (kind=4) :: _gfortran_specific__sqrt_c4
+
+   _gfortran_specific__sqrt_c4 = sqrt (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_c8.F90
new file mode 100644 (file)
index 0000000..1e72dda
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_COMPLEX_8)
+#ifdef HAVE_CSQRT
+
+elemental function _gfortran_specific__sqrt_c8 (parm)
+   complex (kind=8), intent (in) :: parm
+   complex (kind=8) :: _gfortran_specific__sqrt_c8
+
+   _gfortran_specific__sqrt_c8 = sqrt (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r10.F90
new file mode 100644 (file)
index 0000000..30e812b
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_SQRTL
+
+elemental function _gfortran_specific__sqrt_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__sqrt_r10
+
+   _gfortran_specific__sqrt_r10 = sqrt (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r16.F90
new file mode 100644 (file)
index 0000000..240d8ca
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_SQRTL
+
+elemental function _gfortran_specific__sqrt_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__sqrt_r16
+
+   _gfortran_specific__sqrt_r16 = sqrt (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r4.F90
new file mode 100644 (file)
index 0000000..4eb230e
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_SQRTF
+
+elemental function _gfortran_specific__sqrt_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__sqrt_r4
+
+   _gfortran_specific__sqrt_r4 = sqrt (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_sqrt_r8.F90
new file mode 100644 (file)
index 0000000..b61736a
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_SQRT
+
+elemental function _gfortran_specific__sqrt_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__sqrt_r8
+
+   _gfortran_specific__sqrt_r8 = sqrt (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_tan_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_tan_r10.F90
new file mode 100644 (file)
index 0000000..724e918
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_TANL
+
+elemental function _gfortran_specific__tan_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__tan_r10
+
+   _gfortran_specific__tan_r10 = tan (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_tan_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_tan_r16.F90
new file mode 100644 (file)
index 0000000..b3ac3b2
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_TANL
+
+elemental function _gfortran_specific__tan_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__tan_r16
+
+   _gfortran_specific__tan_r16 = tan (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_tan_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_tan_r4.F90
new file mode 100644 (file)
index 0000000..ad2ab13
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_TANF
+
+elemental function _gfortran_specific__tan_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__tan_r4
+
+   _gfortran_specific__tan_r4 = tan (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_tan_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_tan_r8.F90
new file mode 100644 (file)
index 0000000..c033b12
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_TAN
+
+elemental function _gfortran_specific__tan_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__tan_r8
+
+   _gfortran_specific__tan_r8 = tan (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_tanh_r10.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_tanh_r10.F90
new file mode 100644 (file)
index 0000000..b776a0d
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_10)
+#ifdef HAVE_TANHL
+
+elemental function _gfortran_specific__tanh_r10 (parm)
+   real (kind=10), intent (in) :: parm
+   real (kind=10) :: _gfortran_specific__tanh_r10
+
+   _gfortran_specific__tanh_r10 = tanh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_tanh_r16.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_tanh_r16.F90
new file mode 100644 (file)
index 0000000..80edb7e
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_16)
+#ifdef HAVE_TANHL
+
+elemental function _gfortran_specific__tanh_r16 (parm)
+   real (kind=16), intent (in) :: parm
+   real (kind=16) :: _gfortran_specific__tanh_r16
+
+   _gfortran_specific__tanh_r16 = tanh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_tanh_r4.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_tanh_r4.F90
new file mode 100644 (file)
index 0000000..4631dd8
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_4)
+#ifdef HAVE_TANHF
+
+elemental function _gfortran_specific__tanh_r4 (parm)
+   real (kind=4), intent (in) :: parm
+   real (kind=4) :: _gfortran_specific__tanh_r4
+
+   _gfortran_specific__tanh_r4 = tanh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/_tanh_r8.F90 b/l4/pkg/libgfortran/lib/contrib/generated/_tanh_r8.F90
new file mode 100644 (file)
index 0000000..cd3b66c
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+
+
+
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+#if defined (HAVE_GFC_REAL_8)
+#ifdef HAVE_TANH
+
+elemental function _gfortran_specific__tanh_r8 (parm)
+   real (kind=8), intent (in) :: parm
+   real (kind=8) :: _gfortran_specific__tanh_r8
+
+   _gfortran_specific__tanh_r8 = tanh (parm)
+end function
+
+#endif
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/all_l1.c b/l4/pkg/libgfortran/lib/contrib/generated/all_l1.c
new file mode 100644 (file)
index 0000000..edf9818
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ALL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_1)
+
+
+extern void all_l1 (gfc_array_l1 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(all_l1);
+
+void
+all_l1 (gfc_array_l1 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ALL intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ALL intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ALL intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_1 result;
+      src = base;
+      {
+
+  /* Return true only if all the elements are set.  */
+  result = 1;
+        if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (! *src)
+    {
+      result = 0;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/all_l16.c b/l4/pkg/libgfortran/lib/contrib/generated/all_l16.c
new file mode 100644 (file)
index 0000000..d5cde25
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ALL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_16)
+
+
+extern void all_l16 (gfc_array_l16 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(all_l16);
+
+void
+all_l16 (gfc_array_l16 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ALL intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ALL intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ALL intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_16 result;
+      src = base;
+      {
+
+  /* Return true only if all the elements are set.  */
+  result = 1;
+        if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (! *src)
+    {
+      result = 0;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/all_l2.c b/l4/pkg/libgfortran/lib/contrib/generated/all_l2.c
new file mode 100644 (file)
index 0000000..1128ada
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ALL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_2)
+
+
+extern void all_l2 (gfc_array_l2 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(all_l2);
+
+void
+all_l2 (gfc_array_l2 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ALL intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ALL intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ALL intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_2 result;
+      src = base;
+      {
+
+  /* Return true only if all the elements are set.  */
+  result = 1;
+        if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (! *src)
+    {
+      result = 0;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/all_l4.c b/l4/pkg/libgfortran/lib/contrib/generated/all_l4.c
new file mode 100644 (file)
index 0000000..97ad5a4
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ALL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_4)
+
+
+extern void all_l4 (gfc_array_l4 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(all_l4);
+
+void
+all_l4 (gfc_array_l4 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ALL intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ALL intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ALL intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_4 result;
+      src = base;
+      {
+
+  /* Return true only if all the elements are set.  */
+  result = 1;
+        if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (! *src)
+    {
+      result = 0;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/all_l8.c b/l4/pkg/libgfortran/lib/contrib/generated/all_l8.c
new file mode 100644 (file)
index 0000000..8846d34
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ALL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_8)
+
+
+extern void all_l8 (gfc_array_l8 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(all_l8);
+
+void
+all_l8 (gfc_array_l8 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ALL intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ALL intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ALL intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_8 result;
+      src = base;
+      {
+
+  /* Return true only if all the elements are set.  */
+  result = 1;
+        if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (! *src)
+    {
+      result = 0;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/any_l1.c b/l4/pkg/libgfortran/lib/contrib/generated/any_l1.c
new file mode 100644 (file)
index 0000000..8f52b51
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ANY intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_1)
+
+
+extern void any_l1 (gfc_array_l1 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(any_l1);
+
+void
+any_l1 (gfc_array_l1 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ANY intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ANY intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ANY intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_1 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  /* Return true if any of the elements are set.  */
+  if (*src)
+    {
+      result = 1;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/any_l16.c b/l4/pkg/libgfortran/lib/contrib/generated/any_l16.c
new file mode 100644 (file)
index 0000000..7f3f69e
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ANY intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_16)
+
+
+extern void any_l16 (gfc_array_l16 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(any_l16);
+
+void
+any_l16 (gfc_array_l16 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ANY intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ANY intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ANY intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_16 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  /* Return true if any of the elements are set.  */
+  if (*src)
+    {
+      result = 1;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/any_l2.c b/l4/pkg/libgfortran/lib/contrib/generated/any_l2.c
new file mode 100644 (file)
index 0000000..d2c4dbe
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ANY intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_2)
+
+
+extern void any_l2 (gfc_array_l2 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(any_l2);
+
+void
+any_l2 (gfc_array_l2 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ANY intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ANY intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ANY intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_2 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  /* Return true if any of the elements are set.  */
+  if (*src)
+    {
+      result = 1;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/any_l4.c b/l4/pkg/libgfortran/lib/contrib/generated/any_l4.c
new file mode 100644 (file)
index 0000000..f9d5637
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ANY intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_4)
+
+
+extern void any_l4 (gfc_array_l4 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(any_l4);
+
+void
+any_l4 (gfc_array_l4 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ANY intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ANY intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ANY intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_4 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  /* Return true if any of the elements are set.  */
+  if (*src)
+    {
+      result = 1;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/any_l8.c b/l4/pkg/libgfortran/lib/contrib/generated/any_l8.c
new file mode 100644 (file)
index 0000000..f595826
--- /dev/null
@@ -0,0 +1,221 @@
+/* Implementation of the ANY intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_8)
+
+
+extern void any_l8 (gfc_array_l8 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(any_l8);
+
+void
+any_l8 (gfc_array_l8 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " ANY intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " ANY intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in ANY intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_8 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  /* Return true if any of the elements are set.  */
+  if (*src)
+    {
+      result = 1;
+      break;
+    }
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/bessel_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/bessel_r10.c
new file mode 100644 (file)
index 0000000..93d08d6
--- /dev/null
@@ -0,0 +1,186 @@
+/* Implementation of the BESSEL_JN and BESSEL_YN transformational
+   function using a recurrence algorithm.
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+
+#define MATHFUNC(funcname) funcname ## l
+
+#if defined (HAVE_GFC_REAL_10)
+
+
+
+#if defined (HAVE_JNL)
+extern void bessel_jn_r10 (gfc_array_r10 * const restrict ret, int n1,
+                                    int n2, GFC_REAL_10 x);
+export_proto(bessel_jn_r10);
+
+void
+bessel_jn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2, GFC_REAL_10 x)
+{
+  int i;
+  index_type stride;
+
+  GFC_REAL_10 last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_10) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      ret->data[0] = 1;
+      for (i = 1; i <= n2-n1; i++)
+        ret->data[i*stride] = 0;
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(jn) (n2, x);
+  ret->data[(n2-n1)*stride] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(jn) (n2 - 1, x);
+  ret->data[(n2-n1-1)*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_10_LITERAL(2.)/x;
+
+  for (i = n2-n1-2; i >= 0; i--)
+    {
+      ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1;
+      last1 = last2;
+      last2 = ret->data[i*stride];
+    }
+}
+
+#endif
+
+#if defined (HAVE_YNL)
+extern void bessel_yn_r10 (gfc_array_r10 * const restrict ret,
+                                    int n1, int n2, GFC_REAL_10 x);
+export_proto(bessel_yn_r10);
+
+void
+bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2,
+                        GFC_REAL_10 x)
+{
+  int i;
+  index_type stride;
+
+  GFC_REAL_10 last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_10) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      for (i = 0; i <= n2-n1; i++)
+#if defined(GFC_REAL_10_INFINITY)
+        ret->data[i*stride] = -GFC_REAL_10_INFINITY;
+#else
+        ret->data[i*stride] = -GFC_REAL_10_HUGE;
+#endif
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(yn) (n1, x);
+  ret->data[0] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(yn) (n1 + 1, x);
+  ret->data[1*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_10_LITERAL(2.)/x;
+
+  for (i = 2; i <= n1+n2; i++)
+    {
+#if defined(GFC_REAL_10_INFINITY)
+      if (unlikely (last2 == -GFC_REAL_10_INFINITY))
+       {
+         ret->data[i*stride] = -GFC_REAL_10_INFINITY;
+       }
+      else
+#endif
+       {
+         ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1;
+         last1 = last2;
+         last2 = ret->data[i*stride];
+       }
+    }
+}
+#endif
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/bessel_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/bessel_r16.c
new file mode 100644 (file)
index 0000000..28c35c1
--- /dev/null
@@ -0,0 +1,190 @@
+/* Implementation of the BESSEL_JN and BESSEL_YN transformational
+   function using a recurrence algorithm.
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+#if defined (HAVE_GFC_REAL_16)
+
+
+
+#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_JNL))
+extern void bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1,
+                                    int n2, GFC_REAL_16 x);
+export_proto(bessel_jn_r16);
+
+void
+bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x)
+{
+  int i;
+  index_type stride;
+
+  GFC_REAL_16 last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_16) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      ret->data[0] = 1;
+      for (i = 1; i <= n2-n1; i++)
+        ret->data[i*stride] = 0;
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(jn) (n2, x);
+  ret->data[(n2-n1)*stride] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(jn) (n2 - 1, x);
+  ret->data[(n2-n1-1)*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_16_LITERAL(2.)/x;
+
+  for (i = n2-n1-2; i >= 0; i--)
+    {
+      ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1;
+      last1 = last2;
+      last2 = ret->data[i*stride];
+    }
+}
+
+#endif
+
+#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_YNL))
+extern void bessel_yn_r16 (gfc_array_r16 * const restrict ret,
+                                    int n1, int n2, GFC_REAL_16 x);
+export_proto(bessel_yn_r16);
+
+void
+bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2,
+                        GFC_REAL_16 x)
+{
+  int i;
+  index_type stride;
+
+  GFC_REAL_16 last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_16) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      for (i = 0; i <= n2-n1; i++)
+#if defined(GFC_REAL_16_INFINITY)
+        ret->data[i*stride] = -GFC_REAL_16_INFINITY;
+#else
+        ret->data[i*stride] = -GFC_REAL_16_HUGE;
+#endif
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(yn) (n1, x);
+  ret->data[0] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(yn) (n1 + 1, x);
+  ret->data[1*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_16_LITERAL(2.)/x;
+
+  for (i = 2; i <= n1+n2; i++)
+    {
+#if defined(GFC_REAL_16_INFINITY)
+      if (unlikely (last2 == -GFC_REAL_16_INFINITY))
+       {
+         ret->data[i*stride] = -GFC_REAL_16_INFINITY;
+       }
+      else
+#endif
+       {
+         ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1;
+         last1 = last2;
+         last2 = ret->data[i*stride];
+       }
+    }
+}
+#endif
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/bessel_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/bessel_r4.c
new file mode 100644 (file)
index 0000000..3d6e3ca
--- /dev/null
@@ -0,0 +1,186 @@
+/* Implementation of the BESSEL_JN and BESSEL_YN transformational
+   function using a recurrence algorithm.
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+
+#define MATHFUNC(funcname) funcname ## f
+
+#if defined (HAVE_GFC_REAL_4)
+
+
+
+#if defined (HAVE_JNF)
+extern void bessel_jn_r4 (gfc_array_r4 * const restrict ret, int n1,
+                                    int n2, GFC_REAL_4 x);
+export_proto(bessel_jn_r4);
+
+void
+bessel_jn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2, GFC_REAL_4 x)
+{
+  int i;
+  index_type stride;
+
+  GFC_REAL_4 last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_4) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      ret->data[0] = 1;
+      for (i = 1; i <= n2-n1; i++)
+        ret->data[i*stride] = 0;
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(jn) (n2, x);
+  ret->data[(n2-n1)*stride] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(jn) (n2 - 1, x);
+  ret->data[(n2-n1-1)*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_4_LITERAL(2.)/x;
+
+  for (i = n2-n1-2; i >= 0; i--)
+    {
+      ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1;
+      last1 = last2;
+      last2 = ret->data[i*stride];
+    }
+}
+
+#endif
+
+#if defined (HAVE_YNF)
+extern void bessel_yn_r4 (gfc_array_r4 * const restrict ret,
+                                    int n1, int n2, GFC_REAL_4 x);
+export_proto(bessel_yn_r4);
+
+void
+bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2,
+                        GFC_REAL_4 x)
+{
+  int i;
+  index_type stride;
+
+  GFC_REAL_4 last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_4) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      for (i = 0; i <= n2-n1; i++)
+#if defined(GFC_REAL_4_INFINITY)
+        ret->data[i*stride] = -GFC_REAL_4_INFINITY;
+#else
+        ret->data[i*stride] = -GFC_REAL_4_HUGE;
+#endif
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(yn) (n1, x);
+  ret->data[0] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(yn) (n1 + 1, x);
+  ret->data[1*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_4_LITERAL(2.)/x;
+
+  for (i = 2; i <= n1+n2; i++)
+    {
+#if defined(GFC_REAL_4_INFINITY)
+      if (unlikely (last2 == -GFC_REAL_4_INFINITY))
+       {
+         ret->data[i*stride] = -GFC_REAL_4_INFINITY;
+       }
+      else
+#endif
+       {
+         ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1;
+         last1 = last2;
+         last2 = ret->data[i*stride];
+       }
+    }
+}
+#endif
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/bessel_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/bessel_r8.c
new file mode 100644 (file)
index 0000000..7e3bcab
--- /dev/null
@@ -0,0 +1,186 @@
+/* Implementation of the BESSEL_JN and BESSEL_YN transformational
+   function using a recurrence algorithm.
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+
+#define MATHFUNC(funcname) funcname
+
+#if defined (HAVE_GFC_REAL_8)
+
+
+
+#if defined (HAVE_JN)
+extern void bessel_jn_r8 (gfc_array_r8 * const restrict ret, int n1,
+                                    int n2, GFC_REAL_8 x);
+export_proto(bessel_jn_r8);
+
+void
+bessel_jn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2, GFC_REAL_8 x)
+{
+  int i;
+  index_type stride;
+
+  GFC_REAL_8 last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_8) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      ret->data[0] = 1;
+      for (i = 1; i <= n2-n1; i++)
+        ret->data[i*stride] = 0;
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(jn) (n2, x);
+  ret->data[(n2-n1)*stride] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(jn) (n2 - 1, x);
+  ret->data[(n2-n1-1)*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_8_LITERAL(2.)/x;
+
+  for (i = n2-n1-2; i >= 0; i--)
+    {
+      ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1;
+      last1 = last2;
+      last2 = ret->data[i*stride];
+    }
+}
+
+#endif
+
+#if defined (HAVE_YN)
+extern void bessel_yn_r8 (gfc_array_r8 * const restrict ret,
+                                    int n1, int n2, GFC_REAL_8 x);
+export_proto(bessel_yn_r8);
+
+void
+bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2,
+                        GFC_REAL_8 x)
+{
+  int i;
+  index_type stride;
+
+  GFC_REAL_8 last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_8) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      for (i = 0; i <= n2-n1; i++)
+#if defined(GFC_REAL_8_INFINITY)
+        ret->data[i*stride] = -GFC_REAL_8_INFINITY;
+#else
+        ret->data[i*stride] = -GFC_REAL_8_HUGE;
+#endif
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(yn) (n1, x);
+  ret->data[0] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(yn) (n1 + 1, x);
+  ret->data[1*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_8_LITERAL(2.)/x;
+
+  for (i = 2; i <= n1+n2; i++)
+    {
+#if defined(GFC_REAL_8_INFINITY)
+      if (unlikely (last2 == -GFC_REAL_8_INFINITY))
+       {
+         ret->data[i*stride] = -GFC_REAL_8_INFINITY;
+       }
+      else
+#endif
+       {
+         ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1;
+         last1 = last2;
+         last2 = ret->data[i*stride];
+       }
+    }
+}
+#endif
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/count_16_l.c b/l4/pkg/libgfortran/lib/contrib/generated/count_16_l.c
new file mode 100644 (file)
index 0000000..e894e56
--- /dev/null
@@ -0,0 +1,217 @@
+/* Implementation of the COUNT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+
+extern void count_16_l (gfc_array_i16 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(count_16_l);
+
+void
+count_16_l (gfc_array_i16 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " COUNT intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " COUNT intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in COUNT intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (*src)
+    result++;
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/count_1_l.c b/l4/pkg/libgfortran/lib/contrib/generated/count_1_l.c
new file mode 100644 (file)
index 0000000..894ad0c
--- /dev/null
@@ -0,0 +1,217 @@
+/* Implementation of the COUNT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1)
+
+
+extern void count_1_l (gfc_array_i1 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(count_1_l);
+
+void
+count_1_l (gfc_array_i1 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " COUNT intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " COUNT intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in COUNT intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_INTEGER_1 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (*src)
+    result++;
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/count_2_l.c b/l4/pkg/libgfortran/lib/contrib/generated/count_2_l.c
new file mode 100644 (file)
index 0000000..d0e5ee4
--- /dev/null
@@ -0,0 +1,217 @@
+/* Implementation of the COUNT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2)
+
+
+extern void count_2_l (gfc_array_i2 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(count_2_l);
+
+void
+count_2_l (gfc_array_i2 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " COUNT intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " COUNT intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in COUNT intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_INTEGER_2 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (*src)
+    result++;
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/count_4_l.c b/l4/pkg/libgfortran/lib/contrib/generated/count_4_l.c
new file mode 100644 (file)
index 0000000..43af56b
--- /dev/null
@@ -0,0 +1,217 @@
+/* Implementation of the COUNT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+
+extern void count_4_l (gfc_array_i4 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(count_4_l);
+
+void
+count_4_l (gfc_array_i4 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " COUNT intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " COUNT intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in COUNT intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (*src)
+    result++;
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/count_8_l.c b/l4/pkg/libgfortran/lib/contrib/generated/count_8_l.c
new file mode 100644 (file)
index 0000000..6ddd701
--- /dev/null
@@ -0,0 +1,217 @@
+/* Implementation of the COUNT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+
+extern void count_8_l (gfc_array_i8 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(count_8_l);
+
+void
+count_8_l (gfc_array_i8 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " COUNT intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " COUNT intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in COUNT intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+  result = 0;
+        if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  if (*src)
+    result++;
+          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_c10.c
new file mode 100644 (file)
index 0000000..ec4bb8a
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+void
+cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_COMPLEX_10 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_COMPLEX_10 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_COMPLEX_10);
+         size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_10);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_COMPLEX_10 *dest = rptr;
+         const GFC_COMPLEX_10 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_c16.c
new file mode 100644 (file)
index 0000000..ac7e8b7
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+void
+cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_COMPLEX_16 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_COMPLEX_16 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_COMPLEX_16);
+         size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_16);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_COMPLEX_16 *dest = rptr;
+         const GFC_COMPLEX_16 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_c4.c
new file mode 100644 (file)
index 0000000..482af77
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+void
+cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_COMPLEX_4 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_COMPLEX_4 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_COMPLEX_4);
+         size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_4);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_COMPLEX_4 *dest = rptr;
+         const GFC_COMPLEX_4 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_c8.c
new file mode 100644 (file)
index 0000000..2b3a69e
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+void
+cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_COMPLEX_8 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_COMPLEX_8 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_COMPLEX_8);
+         size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_8);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_COMPLEX_8 *dest = rptr;
+         const GFC_COMPLEX_8 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i1.c
new file mode 100644 (file)
index 0000000..65173e3
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1)
+
+void
+cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_INTEGER_1 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_INTEGER_1 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_INTEGER_1);
+         size_t len2 = (len - shift) * sizeof (GFC_INTEGER_1);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_INTEGER_1 *dest = rptr;
+         const GFC_INTEGER_1 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i16.c
new file mode 100644 (file)
index 0000000..4374c45
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+void
+cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_INTEGER_16 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_INTEGER_16 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_INTEGER_16);
+         size_t len2 = (len - shift) * sizeof (GFC_INTEGER_16);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_INTEGER_16 *dest = rptr;
+         const GFC_INTEGER_16 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i2.c
new file mode 100644 (file)
index 0000000..1a39632
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2)
+
+void
+cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_INTEGER_2 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_INTEGER_2 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_INTEGER_2);
+         size_t len2 = (len - shift) * sizeof (GFC_INTEGER_2);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_INTEGER_2 *dest = rptr;
+         const GFC_INTEGER_2 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i4.c
new file mode 100644 (file)
index 0000000..9d22363
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+void
+cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_INTEGER_4 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_INTEGER_4 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_INTEGER_4);
+         size_t len2 = (len - shift) * sizeof (GFC_INTEGER_4);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_INTEGER_4 *dest = rptr;
+         const GFC_INTEGER_4 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_i8.c
new file mode 100644 (file)
index 0000000..43358aa
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+void
+cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_INTEGER_8 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_INTEGER_8 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_INTEGER_8);
+         size_t len2 = (len - shift) * sizeof (GFC_INTEGER_8);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_INTEGER_8 *dest = rptr;
+         const GFC_INTEGER_8 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_r10.c
new file mode 100644 (file)
index 0000000..bf469fd
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+void
+cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_REAL_10 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_REAL_10 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_REAL_10);
+         size_t len2 = (len - shift) * sizeof (GFC_REAL_10);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_REAL_10 *dest = rptr;
+         const GFC_REAL_10 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_r16.c
new file mode 100644 (file)
index 0000000..b9e19ff
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+void
+cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_REAL_16 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_REAL_16 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_REAL_16);
+         size_t len2 = (len - shift) * sizeof (GFC_REAL_16);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_REAL_16 *dest = rptr;
+         const GFC_REAL_16 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_r4.c
new file mode 100644 (file)
index 0000000..9bd0214
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+void
+cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_REAL_4 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_REAL_4 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_REAL_4);
+         size_t len2 = (len - shift) * sizeof (GFC_REAL_4);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_REAL_4 *dest = rptr;
+         const GFC_REAL_4 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift0_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift0_r8.c
new file mode 100644 (file)
index 0000000..1f99135
--- /dev/null
@@ -0,0 +1,171 @@
+/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+void
+cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  GFC_REAL_8 *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const GFC_REAL_8 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof (GFC_REAL_8);
+         size_t len2 = (len - shift) * sizeof (GFC_REAL_8);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         GFC_REAL_8 *dest = rptr;
+         const GFC_REAL_8 *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift1_16.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift1_16.c
new file mode 100644 (file)
index 0000000..b2cb7f1
--- /dev/null
@@ -0,0 +1,273 @@
+/* Implementation of the CSHIFT intrinsic
+   Copyright 2003, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Feng Wang <wf_cs@yahoo.com>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+static void
+cshift1 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const gfc_array_i16 * const restrict h, 
+       const GFC_INTEGER_16 * const restrict pwhich)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char *dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const GFC_INTEGER_16 *hptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  int which;
+  GFC_INTEGER_16 sh;
+  index_type arraysize;
+  index_type size;
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array))
+    runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
+
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  arraysize = size0 ((array_t *)array);
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->data = internal_malloc_size (size * arraysize);
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+          ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+           str = GFC_DESCRIPTOR_EXTENT(ret,i-1) *
+             GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+        }
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "CSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "CSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = size;
+  soffset = size;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      sh = (div (sh, len)).rem;
+      if (sh < 0)
+        sh += len;
+
+      src = &sptr[sh * soffset];
+      dest = rptr;
+
+      for (n = 0; n < len; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          if (n == len - sh - 1)
+            src = sptr;
+          else
+            src += soffset;
+        }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+            }
+        }
+    }
+}
+
+void cshift1_16 (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const gfc_array_i16 * const restrict, 
+       const GFC_INTEGER_16 * const restrict);
+export_proto(cshift1_16);
+
+void
+cshift1_16 (gfc_array_char * const restrict ret,
+       const gfc_array_char * const restrict array,
+       const gfc_array_i16 * const restrict h, 
+       const GFC_INTEGER_16 * const restrict pwhich)
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+
+void cshift1_16_char (gfc_array_char * const restrict ret, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict array,
+       const gfc_array_i16 * const restrict h, 
+       const GFC_INTEGER_16 * const restrict pwhich,
+       GFC_INTEGER_4);
+export_proto(cshift1_16_char);
+
+void
+cshift1_16_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array,
+       const gfc_array_i16 * const restrict h, 
+       const GFC_INTEGER_16 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)))
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+
+void cshift1_16_char4 (gfc_array_char * const restrict ret, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict array,
+       const gfc_array_i16 * const restrict h, 
+       const GFC_INTEGER_16 * const restrict pwhich,
+       GFC_INTEGER_4);
+export_proto(cshift1_16_char4);
+
+void
+cshift1_16_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array,
+       const gfc_array_i16 * const restrict h, 
+       const GFC_INTEGER_16 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)))
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift1_4.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift1_4.c
new file mode 100644 (file)
index 0000000..30f3d99
--- /dev/null
@@ -0,0 +1,273 @@
+/* Implementation of the CSHIFT intrinsic
+   Copyright 2003, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Feng Wang <wf_cs@yahoo.com>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+static void
+cshift1 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const gfc_array_i4 * const restrict h, 
+       const GFC_INTEGER_4 * const restrict pwhich)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char *dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const GFC_INTEGER_4 *hptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  int which;
+  GFC_INTEGER_4 sh;
+  index_type arraysize;
+  index_type size;
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array))
+    runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
+
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  arraysize = size0 ((array_t *)array);
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->data = internal_malloc_size (size * arraysize);
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+          ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+           str = GFC_DESCRIPTOR_EXTENT(ret,i-1) *
+             GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+        }
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "CSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "CSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = size;
+  soffset = size;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      sh = (div (sh, len)).rem;
+      if (sh < 0)
+        sh += len;
+
+      src = &sptr[sh * soffset];
+      dest = rptr;
+
+      for (n = 0; n < len; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          if (n == len - sh - 1)
+            src = sptr;
+          else
+            src += soffset;
+        }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+            }
+        }
+    }
+}
+
+void cshift1_4 (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const gfc_array_i4 * const restrict, 
+       const GFC_INTEGER_4 * const restrict);
+export_proto(cshift1_4);
+
+void
+cshift1_4 (gfc_array_char * const restrict ret,
+       const gfc_array_char * const restrict array,
+       const gfc_array_i4 * const restrict h, 
+       const GFC_INTEGER_4 * const restrict pwhich)
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+
+void cshift1_4_char (gfc_array_char * const restrict ret, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict array,
+       const gfc_array_i4 * const restrict h, 
+       const GFC_INTEGER_4 * const restrict pwhich,
+       GFC_INTEGER_4);
+export_proto(cshift1_4_char);
+
+void
+cshift1_4_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array,
+       const gfc_array_i4 * const restrict h, 
+       const GFC_INTEGER_4 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)))
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+
+void cshift1_4_char4 (gfc_array_char * const restrict ret, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict array,
+       const gfc_array_i4 * const restrict h, 
+       const GFC_INTEGER_4 * const restrict pwhich,
+       GFC_INTEGER_4);
+export_proto(cshift1_4_char4);
+
+void
+cshift1_4_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array,
+       const gfc_array_i4 * const restrict h, 
+       const GFC_INTEGER_4 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)))
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/cshift1_8.c b/l4/pkg/libgfortran/lib/contrib/generated/cshift1_8.c
new file mode 100644 (file)
index 0000000..c3bf473
--- /dev/null
@@ -0,0 +1,273 @@
+/* Implementation of the CSHIFT intrinsic
+   Copyright 2003, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Feng Wang <wf_cs@yahoo.com>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+static void
+cshift1 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const gfc_array_i8 * const restrict h, 
+       const GFC_INTEGER_8 * const restrict pwhich)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char *dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const GFC_INTEGER_8 *hptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  int which;
+  GFC_INTEGER_8 sh;
+  index_type arraysize;
+  index_type size;
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array))
+    runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
+
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  arraysize = size0 ((array_t *)array);
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->data = internal_malloc_size (size * arraysize);
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+          ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+           str = GFC_DESCRIPTOR_EXTENT(ret,i-1) *
+             GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+        }
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "CSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "CSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = size;
+  soffset = size;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      sh = (div (sh, len)).rem;
+      if (sh < 0)
+        sh += len;
+
+      src = &sptr[sh * soffset];
+      dest = rptr;
+
+      for (n = 0; n < len; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          if (n == len - sh - 1)
+            src = sptr;
+          else
+            src += soffset;
+        }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+            }
+        }
+    }
+}
+
+void cshift1_8 (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const gfc_array_i8 * const restrict, 
+       const GFC_INTEGER_8 * const restrict);
+export_proto(cshift1_8);
+
+void
+cshift1_8 (gfc_array_char * const restrict ret,
+       const gfc_array_char * const restrict array,
+       const gfc_array_i8 * const restrict h, 
+       const GFC_INTEGER_8 * const restrict pwhich)
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+
+void cshift1_8_char (gfc_array_char * const restrict ret, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict array,
+       const gfc_array_i8 * const restrict h, 
+       const GFC_INTEGER_8 * const restrict pwhich,
+       GFC_INTEGER_4);
+export_proto(cshift1_8_char);
+
+void
+cshift1_8_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array,
+       const gfc_array_i8 * const restrict h, 
+       const GFC_INTEGER_8 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)))
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+
+void cshift1_8_char4 (gfc_array_char * const restrict ret, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict array,
+       const gfc_array_i8 * const restrict h, 
+       const GFC_INTEGER_8 * const restrict pwhich,
+       GFC_INTEGER_4);
+export_proto(cshift1_8_char4);
+
+void
+cshift1_8_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array,
+       const gfc_array_i8 * const restrict h, 
+       const GFC_INTEGER_8 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)))
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/eoshift1_16.c b/l4/pkg/libgfortran/lib/contrib/generated/eoshift1_16.c
new file mode 100644 (file)
index 0000000..eb3a27a
--- /dev/null
@@ -0,0 +1,316 @@
+/* Implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+static void
+eoshift1 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i16 * const restrict h,
+       const char * const restrict pbound, 
+       const GFC_INTEGER_16 * const restrict pwhich, 
+       const char * filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const GFC_INTEGER_16 *hptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type size;
+  index_type arraysize;
+  int which;
+  GFC_INTEGER_16 sh;
+  GFC_INTEGER_16 delta;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+
+  arraysize = size0 ((array_t *) array);
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+         ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+
+        }
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      if (( sh >= 0 ? sh : -sh ) > len)
+       {
+         delta = len;
+         sh = len;
+       }
+      else
+       delta = (sh >= 0) ? sh: -sh;
+
+      if (sh > 0)
+        {
+          src = &sptr[delta * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[delta * roffset];
+        }
+      for (n = 0; n < len - delta; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (sh < 0)
+        dest = rptr;
+      n = delta;
+
+      if (pbound)
+       while (n--)
+         {
+           memcpy (dest, pbound, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+            }
+        }
+    }
+}
+
+void eoshift1_16 (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const gfc_array_i16 * const restrict, const char * const restrict, 
+       const GFC_INTEGER_16 * const restrict);
+export_proto(eoshift1_16);
+
+void
+eoshift1_16 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const gfc_array_i16 * const restrict h, 
+       const char * const restrict pbound,
+       const GFC_INTEGER_16 * const restrict pwhich)
+{
+  eoshift1 (ret, array, h, pbound, pwhich, "\0", 1);
+}
+
+
+void eoshift1_16_char (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict, 
+       const gfc_array_i16 * const restrict,
+       const char * const restrict, 
+       const GFC_INTEGER_16 * const restrict,
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift1_16_char);
+
+void
+eoshift1_16_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i16 * const restrict h,
+       const char *  const restrict pbound, 
+       const GFC_INTEGER_16 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  eoshift1 (ret, array, h, pbound, pwhich, " ", 1);
+}
+
+
+void eoshift1_16_char4 (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict, 
+       const gfc_array_i16 * const restrict,
+       const char * const restrict, 
+       const GFC_INTEGER_16 * const restrict,
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift1_16_char4);
+
+void
+eoshift1_16_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i16 * const restrict h,
+       const char *  const restrict pbound, 
+       const GFC_INTEGER_16 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  static const gfc_char4_t space = (unsigned char) ' ';
+  eoshift1 (ret, array, h, pbound, pwhich,
+           (const char *) &space, sizeof (gfc_char4_t));
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/eoshift1_4.c b/l4/pkg/libgfortran/lib/contrib/generated/eoshift1_4.c
new file mode 100644 (file)
index 0000000..d3776b9
--- /dev/null
@@ -0,0 +1,316 @@
+/* Implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+static void
+eoshift1 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i4 * const restrict h,
+       const char * const restrict pbound, 
+       const GFC_INTEGER_4 * const restrict pwhich, 
+       const char * filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const GFC_INTEGER_4 *hptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type size;
+  index_type arraysize;
+  int which;
+  GFC_INTEGER_4 sh;
+  GFC_INTEGER_4 delta;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+
+  arraysize = size0 ((array_t *) array);
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+         ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+
+        }
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      if (( sh >= 0 ? sh : -sh ) > len)
+       {
+         delta = len;
+         sh = len;
+       }
+      else
+       delta = (sh >= 0) ? sh: -sh;
+
+      if (sh > 0)
+        {
+          src = &sptr[delta * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[delta * roffset];
+        }
+      for (n = 0; n < len - delta; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (sh < 0)
+        dest = rptr;
+      n = delta;
+
+      if (pbound)
+       while (n--)
+         {
+           memcpy (dest, pbound, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+            }
+        }
+    }
+}
+
+void eoshift1_4 (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const gfc_array_i4 * const restrict, const char * const restrict, 
+       const GFC_INTEGER_4 * const restrict);
+export_proto(eoshift1_4);
+
+void
+eoshift1_4 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const gfc_array_i4 * const restrict h, 
+       const char * const restrict pbound,
+       const GFC_INTEGER_4 * const restrict pwhich)
+{
+  eoshift1 (ret, array, h, pbound, pwhich, "\0", 1);
+}
+
+
+void eoshift1_4_char (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict, 
+       const gfc_array_i4 * const restrict,
+       const char * const restrict, 
+       const GFC_INTEGER_4 * const restrict,
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift1_4_char);
+
+void
+eoshift1_4_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i4 * const restrict h,
+       const char *  const restrict pbound, 
+       const GFC_INTEGER_4 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  eoshift1 (ret, array, h, pbound, pwhich, " ", 1);
+}
+
+
+void eoshift1_4_char4 (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict, 
+       const gfc_array_i4 * const restrict,
+       const char * const restrict, 
+       const GFC_INTEGER_4 * const restrict,
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift1_4_char4);
+
+void
+eoshift1_4_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i4 * const restrict h,
+       const char *  const restrict pbound, 
+       const GFC_INTEGER_4 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  static const gfc_char4_t space = (unsigned char) ' ';
+  eoshift1 (ret, array, h, pbound, pwhich,
+           (const char *) &space, sizeof (gfc_char4_t));
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/eoshift1_8.c b/l4/pkg/libgfortran/lib/contrib/generated/eoshift1_8.c
new file mode 100644 (file)
index 0000000..5f026ac
--- /dev/null
@@ -0,0 +1,316 @@
+/* Implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+static void
+eoshift1 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i8 * const restrict h,
+       const char * const restrict pbound, 
+       const GFC_INTEGER_8 * const restrict pwhich, 
+       const char * filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const GFC_INTEGER_8 *hptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type size;
+  index_type arraysize;
+  int which;
+  GFC_INTEGER_8 sh;
+  GFC_INTEGER_8 delta;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+
+  arraysize = size0 ((array_t *) array);
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+         ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+
+        }
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      if (( sh >= 0 ? sh : -sh ) > len)
+       {
+         delta = len;
+         sh = len;
+       }
+      else
+       delta = (sh >= 0) ? sh: -sh;
+
+      if (sh > 0)
+        {
+          src = &sptr[delta * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[delta * roffset];
+        }
+      for (n = 0; n < len - delta; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (sh < 0)
+        dest = rptr;
+      n = delta;
+
+      if (pbound)
+       while (n--)
+         {
+           memcpy (dest, pbound, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+            }
+        }
+    }
+}
+
+void eoshift1_8 (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const gfc_array_i8 * const restrict, const char * const restrict, 
+       const GFC_INTEGER_8 * const restrict);
+export_proto(eoshift1_8);
+
+void
+eoshift1_8 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const gfc_array_i8 * const restrict h, 
+       const char * const restrict pbound,
+       const GFC_INTEGER_8 * const restrict pwhich)
+{
+  eoshift1 (ret, array, h, pbound, pwhich, "\0", 1);
+}
+
+
+void eoshift1_8_char (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict, 
+       const gfc_array_i8 * const restrict,
+       const char * const restrict, 
+       const GFC_INTEGER_8 * const restrict,
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift1_8_char);
+
+void
+eoshift1_8_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i8 * const restrict h,
+       const char *  const restrict pbound, 
+       const GFC_INTEGER_8 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  eoshift1 (ret, array, h, pbound, pwhich, " ", 1);
+}
+
+
+void eoshift1_8_char4 (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict, 
+       const gfc_array_i8 * const restrict,
+       const char * const restrict, 
+       const GFC_INTEGER_8 * const restrict,
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift1_8_char4);
+
+void
+eoshift1_8_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i8 * const restrict h,
+       const char *  const restrict pbound, 
+       const GFC_INTEGER_8 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  static const gfc_char4_t space = (unsigned char) ' ';
+  eoshift1 (ret, array, h, pbound, pwhich,
+           (const char *) &space, sizeof (gfc_char4_t));
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/eoshift3_16.c b/l4/pkg/libgfortran/lib/contrib/generated/eoshift3_16.c
new file mode 100644 (file)
index 0000000..1cf2167
--- /dev/null
@@ -0,0 +1,335 @@
+/* Implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+static void
+eoshift3 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i16 * const restrict h,
+       const gfc_array_char * const restrict bound, 
+       const GFC_INTEGER_16 * const restrict pwhich,
+       const char * filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const GFC_INTEGER_16 *hptr;
+  /* b.* indicates the bound array.  */
+  index_type bstride[GFC_MAX_DIMENSIONS];
+  index_type bstride0;
+  const char *bptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type size;
+  index_type arraysize;
+  int which;
+  GFC_INTEGER_16 sh;
+  GFC_INTEGER_16 delta;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  arraysize = size0 ((array_t *) array);
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->data = internal_malloc_size (size * arraysize);
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+         ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+
+        }
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          if (bound)
+            bstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(bound,n);
+          else
+            bstride[n] = 0;
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+  if (bound && bstride[0] == 0)
+    bstride[0] = size;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  bstride0 = bstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+  if (bound)
+    bptr = bound->data;
+  else
+    bptr = NULL;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      if (( sh >= 0 ? sh : -sh ) > len)
+       {
+         delta = len;
+         sh = len;
+       }
+      else
+       delta = (sh >= 0) ? sh: -sh;
+
+      if (sh > 0)
+        {
+          src = &sptr[delta * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[delta * roffset];
+        }
+      for (n = 0; n < len - delta; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (sh < 0)
+        dest = rptr;
+      n = delta;
+
+      if (bptr)
+       while (n--)
+         {
+           memcpy (dest, bptr, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      bptr += bstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          bptr -= bstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+              bptr += bstride[n];
+            }
+        }
+    }
+}
+
+extern void eoshift3_16 (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const gfc_array_i16 * const restrict, 
+       const gfc_array_char * const restrict,
+       const GFC_INTEGER_16 *);
+export_proto(eoshift3_16);
+
+void
+eoshift3_16 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const gfc_array_i16 * const restrict h, 
+       const gfc_array_char * const restrict bound,
+       const GFC_INTEGER_16 * const restrict pwhich)
+{
+  eoshift3 (ret, array, h, bound, pwhich, "\0", 1);
+}
+
+
+extern void eoshift3_16_char (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict,
+       const gfc_array_i16 * const restrict,
+       const gfc_array_char * const restrict,
+       const GFC_INTEGER_16 * const restrict, 
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift3_16_char);
+
+void
+eoshift3_16_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i16 *  const restrict h,
+       const gfc_array_char * const restrict bound,
+       const GFC_INTEGER_16 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  eoshift3 (ret, array, h, bound, pwhich, " ", 1);
+}
+
+
+extern void eoshift3_16_char4 (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict,
+       const gfc_array_i16 * const restrict,
+       const gfc_array_char * const restrict,
+       const GFC_INTEGER_16 * const restrict, 
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift3_16_char4);
+
+void
+eoshift3_16_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i16 *  const restrict h,
+       const gfc_array_char * const restrict bound,
+       const GFC_INTEGER_16 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  static const gfc_char4_t space = (unsigned char) ' ';
+  eoshift3 (ret, array, h, bound, pwhich,
+           (const char *) &space, sizeof (gfc_char4_t));
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/eoshift3_4.c b/l4/pkg/libgfortran/lib/contrib/generated/eoshift3_4.c
new file mode 100644 (file)
index 0000000..c6033d0
--- /dev/null
@@ -0,0 +1,335 @@
+/* Implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+static void
+eoshift3 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i4 * const restrict h,
+       const gfc_array_char * const restrict bound, 
+       const GFC_INTEGER_4 * const restrict pwhich,
+       const char * filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const GFC_INTEGER_4 *hptr;
+  /* b.* indicates the bound array.  */
+  index_type bstride[GFC_MAX_DIMENSIONS];
+  index_type bstride0;
+  const char *bptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type size;
+  index_type arraysize;
+  int which;
+  GFC_INTEGER_4 sh;
+  GFC_INTEGER_4 delta;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  arraysize = size0 ((array_t *) array);
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->data = internal_malloc_size (size * arraysize);
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+         ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+
+        }
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          if (bound)
+            bstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(bound,n);
+          else
+            bstride[n] = 0;
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+  if (bound && bstride[0] == 0)
+    bstride[0] = size;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  bstride0 = bstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+  if (bound)
+    bptr = bound->data;
+  else
+    bptr = NULL;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      if (( sh >= 0 ? sh : -sh ) > len)
+       {
+         delta = len;
+         sh = len;
+       }
+      else
+       delta = (sh >= 0) ? sh: -sh;
+
+      if (sh > 0)
+        {
+          src = &sptr[delta * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[delta * roffset];
+        }
+      for (n = 0; n < len - delta; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (sh < 0)
+        dest = rptr;
+      n = delta;
+
+      if (bptr)
+       while (n--)
+         {
+           memcpy (dest, bptr, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      bptr += bstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          bptr -= bstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+              bptr += bstride[n];
+            }
+        }
+    }
+}
+
+extern void eoshift3_4 (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const gfc_array_i4 * const restrict, 
+       const gfc_array_char * const restrict,
+       const GFC_INTEGER_4 *);
+export_proto(eoshift3_4);
+
+void
+eoshift3_4 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const gfc_array_i4 * const restrict h, 
+       const gfc_array_char * const restrict bound,
+       const GFC_INTEGER_4 * const restrict pwhich)
+{
+  eoshift3 (ret, array, h, bound, pwhich, "\0", 1);
+}
+
+
+extern void eoshift3_4_char (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict,
+       const gfc_array_i4 * const restrict,
+       const gfc_array_char * const restrict,
+       const GFC_INTEGER_4 * const restrict, 
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift3_4_char);
+
+void
+eoshift3_4_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i4 *  const restrict h,
+       const gfc_array_char * const restrict bound,
+       const GFC_INTEGER_4 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  eoshift3 (ret, array, h, bound, pwhich, " ", 1);
+}
+
+
+extern void eoshift3_4_char4 (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict,
+       const gfc_array_i4 * const restrict,
+       const gfc_array_char * const restrict,
+       const GFC_INTEGER_4 * const restrict, 
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift3_4_char4);
+
+void
+eoshift3_4_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i4 *  const restrict h,
+       const gfc_array_char * const restrict bound,
+       const GFC_INTEGER_4 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  static const gfc_char4_t space = (unsigned char) ' ';
+  eoshift3 (ret, array, h, bound, pwhich,
+           (const char *) &space, sizeof (gfc_char4_t));
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/eoshift3_8.c b/l4/pkg/libgfortran/lib/contrib/generated/eoshift3_8.c
new file mode 100644 (file)
index 0000000..7a7b196
--- /dev/null
@@ -0,0 +1,335 @@
+/* Implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+static void
+eoshift3 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i8 * const restrict h,
+       const gfc_array_char * const restrict bound, 
+       const GFC_INTEGER_8 * const restrict pwhich,
+       const char * filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const GFC_INTEGER_8 *hptr;
+  /* b.* indicates the bound array.  */
+  index_type bstride[GFC_MAX_DIMENSIONS];
+  index_type bstride0;
+  const char *bptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type size;
+  index_type arraysize;
+  int which;
+  GFC_INTEGER_8 sh;
+  GFC_INTEGER_8 delta;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  arraysize = size0 ((array_t *) array);
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->data = internal_malloc_size (size * arraysize);
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+         ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+
+        }
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          if (bound)
+            bstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(bound,n);
+          else
+            bstride[n] = 0;
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+  if (bound && bstride[0] == 0)
+    bstride[0] = size;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  bstride0 = bstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+  if (bound)
+    bptr = bound->data;
+  else
+    bptr = NULL;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      if (( sh >= 0 ? sh : -sh ) > len)
+       {
+         delta = len;
+         sh = len;
+       }
+      else
+       delta = (sh >= 0) ? sh: -sh;
+
+      if (sh > 0)
+        {
+          src = &sptr[delta * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[delta * roffset];
+        }
+      for (n = 0; n < len - delta; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (sh < 0)
+        dest = rptr;
+      n = delta;
+
+      if (bptr)
+       while (n--)
+         {
+           memcpy (dest, bptr, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      bptr += bstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          bptr -= bstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+              bptr += bstride[n];
+            }
+        }
+    }
+}
+
+extern void eoshift3_8 (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const gfc_array_i8 * const restrict, 
+       const gfc_array_char * const restrict,
+       const GFC_INTEGER_8 *);
+export_proto(eoshift3_8);
+
+void
+eoshift3_8 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const gfc_array_i8 * const restrict h, 
+       const gfc_array_char * const restrict bound,
+       const GFC_INTEGER_8 * const restrict pwhich)
+{
+  eoshift3 (ret, array, h, bound, pwhich, "\0", 1);
+}
+
+
+extern void eoshift3_8_char (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict,
+       const gfc_array_i8 * const restrict,
+       const gfc_array_char * const restrict,
+       const GFC_INTEGER_8 * const restrict, 
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift3_8_char);
+
+void
+eoshift3_8_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i8 *  const restrict h,
+       const gfc_array_char * const restrict bound,
+       const GFC_INTEGER_8 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  eoshift3 (ret, array, h, bound, pwhich, " ", 1);
+}
+
+
+extern void eoshift3_8_char4 (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict,
+       const gfc_array_i8 * const restrict,
+       const gfc_array_char * const restrict,
+       const GFC_INTEGER_8 * const restrict, 
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift3_8_char4);
+
+void
+eoshift3_8_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const gfc_array_i8 *  const restrict h,
+       const gfc_array_char * const restrict bound,
+       const GFC_INTEGER_8 * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  static const gfc_char4_t space = (unsigned char) ' ';
+  eoshift3 (ret, array, h, bound, pwhich,
+           (const char *) &space, sizeof (gfc_char4_t));
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/exponent_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/exponent_r10.c
new file mode 100644 (file)
index 0000000..a33451f
--- /dev/null
@@ -0,0 +1,45 @@
+/* Implementation of the EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## l
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL)
+
+extern GFC_INTEGER_4 exponent_r10 (GFC_REAL_10 s);
+export_proto(exponent_r10);
+
+GFC_INTEGER_4
+exponent_r10 (GFC_REAL_10 s)
+{
+  int ret;
+  MATHFUNC(frexp) (s, &ret);
+  return ret;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/exponent_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/exponent_r16.c
new file mode 100644 (file)
index 0000000..f05aad2
--- /dev/null
@@ -0,0 +1,49 @@
+/* Implementation of the EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
+
+extern GFC_INTEGER_4 exponent_r16 (GFC_REAL_16 s);
+export_proto(exponent_r16);
+
+GFC_INTEGER_4
+exponent_r16 (GFC_REAL_16 s)
+{
+  int ret;
+  MATHFUNC(frexp) (s, &ret);
+  return ret;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/exponent_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/exponent_r4.c
new file mode 100644 (file)
index 0000000..02e3602
--- /dev/null
@@ -0,0 +1,45 @@
+/* Implementation of the EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## f
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF)
+
+extern GFC_INTEGER_4 exponent_r4 (GFC_REAL_4 s);
+export_proto(exponent_r4);
+
+GFC_INTEGER_4
+exponent_r4 (GFC_REAL_4 s)
+{
+  int ret;
+  MATHFUNC(frexp) (s, &ret);
+  return ret;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/exponent_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/exponent_r8.c
new file mode 100644 (file)
index 0000000..b1633f1
--- /dev/null
@@ -0,0 +1,45 @@
+/* Implementation of the EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP)
+
+extern GFC_INTEGER_4 exponent_r8 (GFC_REAL_8 s);
+export_proto(exponent_r8);
+
+GFC_INTEGER_4
+exponent_r8 (GFC_REAL_8 s)
+{
+  int ret;
+  MATHFUNC(frexp) (s, &ret);
+  return ret;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/fraction_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/fraction_r10.c
new file mode 100644 (file)
index 0000000..c883ac9
--- /dev/null
@@ -0,0 +1,44 @@
+/* Implementation of the FRACTION intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## l
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL)
+
+extern GFC_REAL_10 fraction_r10 (GFC_REAL_10 s);
+export_proto(fraction_r10);
+
+GFC_REAL_10
+fraction_r10 (GFC_REAL_10 s)
+{
+  int dummy_exp;
+  return MATHFUNC(frexp) (s, &dummy_exp);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/fraction_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/fraction_r16.c
new file mode 100644 (file)
index 0000000..df692e1
--- /dev/null
@@ -0,0 +1,48 @@
+/* Implementation of the FRACTION intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
+
+extern GFC_REAL_16 fraction_r16 (GFC_REAL_16 s);
+export_proto(fraction_r16);
+
+GFC_REAL_16
+fraction_r16 (GFC_REAL_16 s)
+{
+  int dummy_exp;
+  return MATHFUNC(frexp) (s, &dummy_exp);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/fraction_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/fraction_r4.c
new file mode 100644 (file)
index 0000000..f8cac78
--- /dev/null
@@ -0,0 +1,44 @@
+/* Implementation of the FRACTION intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## f
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF)
+
+extern GFC_REAL_4 fraction_r4 (GFC_REAL_4 s);
+export_proto(fraction_r4);
+
+GFC_REAL_4
+fraction_r4 (GFC_REAL_4 s)
+{
+  int dummy_exp;
+  return MATHFUNC(frexp) (s, &dummy_exp);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/fraction_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/fraction_r8.c
new file mode 100644 (file)
index 0000000..02ac746
--- /dev/null
@@ -0,0 +1,44 @@
+/* Implementation of the FRACTION intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP)
+
+extern GFC_REAL_8 fraction_r8 (GFC_REAL_8 s);
+export_proto(fraction_r8);
+
+GFC_REAL_8
+fraction_r8 (GFC_REAL_8 s)
+{
+  int dummy_exp;
+  return MATHFUNC(frexp) (s, &dummy_exp);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iall_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/iall_i1.c
new file mode 100644 (file)
index 0000000..23a8f4f
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IALL intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_1)
+
+
+extern void iall_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(iall_i1);
+
+void
+iall_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IALL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_1 result;
+      src = base;
+      {
+
+  result = (GFC_INTEGER_1) -1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result &= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miall_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miall_i1);
+
+void
+miall_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IALL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IALL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IALL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_1 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result &= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siall_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siall_i1);
+
+void
+siall_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iall_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IALL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iall_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/iall_i16.c
new file mode 100644 (file)
index 0000000..d16c182
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IALL intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void iall_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(iall_i16);
+
+void
+iall_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IALL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+  result = (GFC_INTEGER_16) -1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result &= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miall_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miall_i16);
+
+void
+miall_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IALL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IALL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IALL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result &= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siall_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siall_i16);
+
+void
+siall_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iall_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IALL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iall_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/iall_i2.c
new file mode 100644 (file)
index 0000000..ef45da5
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IALL intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_2)
+
+
+extern void iall_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(iall_i2);
+
+void
+iall_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IALL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_2 result;
+      src = base;
+      {
+
+  result = (GFC_INTEGER_2) -1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result &= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miall_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miall_i2);
+
+void
+miall_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IALL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IALL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IALL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_2 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result &= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siall_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siall_i2);
+
+void
+siall_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iall_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IALL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iall_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/iall_i4.c
new file mode 100644 (file)
index 0000000..f2c10bf
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IALL intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void iall_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(iall_i4);
+
+void
+iall_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IALL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+  result = (GFC_INTEGER_4) -1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result &= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miall_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miall_i4);
+
+void
+miall_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IALL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IALL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IALL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result &= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siall_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siall_i4);
+
+void
+siall_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iall_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IALL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iall_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/iall_i8.c
new file mode 100644 (file)
index 0000000..2c5aa09
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IALL intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void iall_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(iall_i8);
+
+void
+iall_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IALL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+  result = (GFC_INTEGER_8) -1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result &= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miall_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miall_i8);
+
+void
+miall_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IALL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IALL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IALL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result &= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siall_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siall_i8);
+
+void
+siall_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iall_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IALL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IALL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iany_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/iany_i1.c
new file mode 100644 (file)
index 0000000..1f9f91c
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IANY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_1)
+
+
+extern void iany_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(iany_i1);
+
+void
+iany_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IANY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_1 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result |= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miany_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miany_i1);
+
+void
+miany_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IANY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IANY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IANY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_1 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result |= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siany_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siany_i1);
+
+void
+siany_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iany_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IANY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iany_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/iany_i16.c
new file mode 100644 (file)
index 0000000..55f3840
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IANY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void iany_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(iany_i16);
+
+void
+iany_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IANY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result |= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miany_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miany_i16);
+
+void
+miany_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IANY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IANY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IANY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result |= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siany_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siany_i16);
+
+void
+siany_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iany_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IANY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iany_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/iany_i2.c
new file mode 100644 (file)
index 0000000..aabb992
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IANY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_2)
+
+
+extern void iany_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(iany_i2);
+
+void
+iany_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IANY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_2 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result |= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miany_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miany_i2);
+
+void
+miany_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IANY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IANY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IANY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_2 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result |= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siany_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siany_i2);
+
+void
+siany_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iany_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IANY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iany_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/iany_i4.c
new file mode 100644 (file)
index 0000000..de7b66e
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IANY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void iany_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(iany_i4);
+
+void
+iany_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IANY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result |= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miany_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miany_i4);
+
+void
+miany_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IANY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IANY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IANY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result |= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siany_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siany_i4);
+
+void
+siany_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iany_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IANY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iany_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/iany_i8.c
new file mode 100644 (file)
index 0000000..71569e0
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IANY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void iany_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(iany_i8);
+
+void
+iany_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IANY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result |= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miany_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miany_i8);
+
+void
+miany_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IANY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IANY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IANY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result |= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siany_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siany_i8);
+
+void
+siany_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iany_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IANY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IANY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_c10.c
new file mode 100644 (file)
index 0000000..97ce9d1
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_COMPLEX_10 *
+internal_pack_c10 (gfc_array_c10 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_COMPLEX_10 *src;
+  GFC_COMPLEX_10 * restrict dest;
+  GFC_COMPLEX_10 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_COMPLEX_10 *)internal_malloc_size (ssize * sizeof (GFC_COMPLEX_10));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_c16.c
new file mode 100644 (file)
index 0000000..74e3cb6
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_COMPLEX_16 *
+internal_pack_c16 (gfc_array_c16 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_COMPLEX_16 *src;
+  GFC_COMPLEX_16 * restrict dest;
+  GFC_COMPLEX_16 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_COMPLEX_16 *)internal_malloc_size (ssize * sizeof (GFC_COMPLEX_16));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_c4.c
new file mode 100644 (file)
index 0000000..ae52bc6
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_COMPLEX_4 *
+internal_pack_c4 (gfc_array_c4 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_COMPLEX_4 *src;
+  GFC_COMPLEX_4 * restrict dest;
+  GFC_COMPLEX_4 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_COMPLEX_4 *)internal_malloc_size (ssize * sizeof (GFC_COMPLEX_4));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_c8.c
new file mode 100644 (file)
index 0000000..142ad99
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_COMPLEX_8 *
+internal_pack_c8 (gfc_array_c8 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_COMPLEX_8 *src;
+  GFC_COMPLEX_8 * restrict dest;
+  GFC_COMPLEX_8 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_COMPLEX_8 *)internal_malloc_size (ssize * sizeof (GFC_COMPLEX_8));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i1.c
new file mode 100644 (file)
index 0000000..dc26c1a
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_INTEGER_1 *
+internal_pack_1 (gfc_array_i1 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_INTEGER_1 *src;
+  GFC_INTEGER_1 * restrict dest;
+  GFC_INTEGER_1 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_INTEGER_1 *)internal_malloc_size (ssize * sizeof (GFC_INTEGER_1));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i16.c
new file mode 100644 (file)
index 0000000..32ce3a4
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_INTEGER_16 *
+internal_pack_16 (gfc_array_i16 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_INTEGER_16 *src;
+  GFC_INTEGER_16 * restrict dest;
+  GFC_INTEGER_16 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_INTEGER_16 *)internal_malloc_size (ssize * sizeof (GFC_INTEGER_16));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i2.c
new file mode 100644 (file)
index 0000000..3c39f8e
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_INTEGER_2 *
+internal_pack_2 (gfc_array_i2 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_INTEGER_2 *src;
+  GFC_INTEGER_2 * restrict dest;
+  GFC_INTEGER_2 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_INTEGER_2 *)internal_malloc_size (ssize * sizeof (GFC_INTEGER_2));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i4.c
new file mode 100644 (file)
index 0000000..4cd7dba
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_INTEGER_4 *
+internal_pack_4 (gfc_array_i4 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_INTEGER_4 *src;
+  GFC_INTEGER_4 * restrict dest;
+  GFC_INTEGER_4 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_INTEGER_4 *)internal_malloc_size (ssize * sizeof (GFC_INTEGER_4));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_i8.c
new file mode 100644 (file)
index 0000000..17acc68
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_INTEGER_8 *
+internal_pack_8 (gfc_array_i8 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_INTEGER_8 *src;
+  GFC_INTEGER_8 * restrict dest;
+  GFC_INTEGER_8 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_INTEGER_8 *)internal_malloc_size (ssize * sizeof (GFC_INTEGER_8));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_r10.c
new file mode 100644 (file)
index 0000000..557ccc2
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_REAL_10 *
+internal_pack_r10 (gfc_array_r10 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_REAL_10 *src;
+  GFC_REAL_10 * restrict dest;
+  GFC_REAL_10 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_REAL_10 *)internal_malloc_size (ssize * sizeof (GFC_REAL_10));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_r16.c
new file mode 100644 (file)
index 0000000..b737cc7
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_REAL_16 *
+internal_pack_r16 (gfc_array_r16 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_REAL_16 *src;
+  GFC_REAL_16 * restrict dest;
+  GFC_REAL_16 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_REAL_16 *)internal_malloc_size (ssize * sizeof (GFC_REAL_16));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_r4.c
new file mode 100644 (file)
index 0000000..68a7e5a
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_REAL_4 *
+internal_pack_r4 (gfc_array_r4 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_REAL_4 *src;
+  GFC_REAL_4 * restrict dest;
+  GFC_REAL_4 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_REAL_4 *)internal_malloc_size (ssize * sizeof (GFC_REAL_4));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_pack_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/in_pack_r8.c
new file mode 100644 (file)
index 0000000..1453f86
--- /dev/null
@@ -0,0 +1,119 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+
+GFC_REAL_8 *
+internal_pack_r8 (gfc_array_r8 * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const GFC_REAL_8 *src;
+  GFC_REAL_8 * restrict dest;
+  GFC_REAL_8 *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = (GFC_REAL_8 *)internal_malloc_size (ssize * sizeof (GFC_REAL_8));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c10.c
new file mode 100644 (file)
index 0000000..bcac6e7
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+void
+internal_unpack_c10 (gfc_array_c10 * d, const GFC_COMPLEX_10 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_COMPLEX_10 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_COMPLEX_10));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c16.c
new file mode 100644 (file)
index 0000000..1d09a80
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+void
+internal_unpack_c16 (gfc_array_c16 * d, const GFC_COMPLEX_16 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_COMPLEX_16 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_COMPLEX_16));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c4.c
new file mode 100644 (file)
index 0000000..9ad8a33
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+void
+internal_unpack_c4 (gfc_array_c4 * d, const GFC_COMPLEX_4 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_COMPLEX_4 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_COMPLEX_4));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_c8.c
new file mode 100644 (file)
index 0000000..6adae64
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+void
+internal_unpack_c8 (gfc_array_c8 * d, const GFC_COMPLEX_8 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_COMPLEX_8 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_COMPLEX_8));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i1.c
new file mode 100644 (file)
index 0000000..e632816
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1)
+
+void
+internal_unpack_1 (gfc_array_i1 * d, const GFC_INTEGER_1 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_INTEGER_1 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_INTEGER_1));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i16.c
new file mode 100644 (file)
index 0000000..c719920
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+void
+internal_unpack_16 (gfc_array_i16 * d, const GFC_INTEGER_16 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_INTEGER_16 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_INTEGER_16));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i2.c
new file mode 100644 (file)
index 0000000..ec0c1c3
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2)
+
+void
+internal_unpack_2 (gfc_array_i2 * d, const GFC_INTEGER_2 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_INTEGER_2 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_INTEGER_2));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i4.c
new file mode 100644 (file)
index 0000000..ce5d29d
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+void
+internal_unpack_4 (gfc_array_i4 * d, const GFC_INTEGER_4 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_INTEGER_4 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_INTEGER_4));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_i8.c
new file mode 100644 (file)
index 0000000..347f011
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+void
+internal_unpack_8 (gfc_array_i8 * d, const GFC_INTEGER_8 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_INTEGER_8 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_INTEGER_8));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r10.c
new file mode 100644 (file)
index 0000000..aa5f08e
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+void
+internal_unpack_r10 (gfc_array_r10 * d, const GFC_REAL_10 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_REAL_10 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_REAL_10));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r16.c
new file mode 100644 (file)
index 0000000..0b08228
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+void
+internal_unpack_r16 (gfc_array_r16 * d, const GFC_REAL_16 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_REAL_16 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_REAL_16));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r4.c
new file mode 100644 (file)
index 0000000..f436c8a
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+void
+internal_unpack_r4 (gfc_array_r4 * d, const GFC_REAL_4 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_REAL_4 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_REAL_4));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/in_unpack_r8.c
new file mode 100644 (file)
index 0000000..76aff2e
--- /dev/null
@@ -0,0 +1,107 @@
+/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+void
+internal_unpack_r8 (gfc_array_r8 * d, const GFC_REAL_8 * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  GFC_REAL_8 * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof (GFC_REAL_8));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iparity_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/iparity_i1.c
new file mode 100644 (file)
index 0000000..e2b40c2
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IPARITY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_1)
+
+
+extern void iparity_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(iparity_i1);
+
+void
+iparity_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IPARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_1 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result ^= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miparity_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miparity_i1);
+
+void
+miparity_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IPARITY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IPARITY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IPARITY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_1 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result ^= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siparity_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siparity_i1);
+
+void
+siparity_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iparity_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IPARITY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iparity_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/iparity_i16.c
new file mode 100644 (file)
index 0000000..5ebdabb
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IPARITY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void iparity_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(iparity_i16);
+
+void
+iparity_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IPARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result ^= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miparity_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miparity_i16);
+
+void
+miparity_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IPARITY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IPARITY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IPARITY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result ^= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siparity_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siparity_i16);
+
+void
+siparity_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iparity_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IPARITY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iparity_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/iparity_i2.c
new file mode 100644 (file)
index 0000000..f908a7a
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IPARITY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_2)
+
+
+extern void iparity_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(iparity_i2);
+
+void
+iparity_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IPARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_2 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result ^= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miparity_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miparity_i2);
+
+void
+miparity_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IPARITY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IPARITY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IPARITY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_2 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result ^= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siparity_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siparity_i2);
+
+void
+siparity_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iparity_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IPARITY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iparity_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/iparity_i4.c
new file mode 100644 (file)
index 0000000..2e5811b
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IPARITY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void iparity_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(iparity_i4);
+
+void
+iparity_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IPARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result ^= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miparity_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miparity_i4);
+
+void
+miparity_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IPARITY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IPARITY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IPARITY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result ^= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siparity_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siparity_i4);
+
+void
+siparity_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iparity_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IPARITY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/iparity_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/iparity_i8.c
new file mode 100644 (file)
index 0000000..c443275
--- /dev/null
@@ -0,0 +1,509 @@
+/* Implementation of the IPARITY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void iparity_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(iparity_i8);
+
+void
+iparity_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "IPARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result ^= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void miparity_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(miparity_i8);
+
+void
+miparity_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in IPARITY intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "IPARITY");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "IPARITY");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result ^= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void siparity_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(siparity_i8);
+
+void
+siparity_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      iparity_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " IPARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " IPARITY intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_c10.c
new file mode 100644 (file)
index 0000000..c54c78e
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_COMPLEX_10 *, const GFC_COMPLEX_10 *,
+                          const int *, const GFC_COMPLEX_10 *, const int *,
+                          const GFC_COMPLEX_10 *, GFC_COMPLEX_10 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_c10 (gfc_array_c10 * const restrict retarray, 
+       gfc_array_c10 * const restrict a, gfc_array_c10 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_c10);
+
+void
+matmul_c10 (gfc_array_c10 * const restrict retarray, 
+       gfc_array_c10 * const restrict a, gfc_array_c10 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_COMPLEX_10 * restrict abase;
+  const GFC_COMPLEX_10 * restrict bbase;
+  GFC_COMPLEX_10 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_COMPLEX_10 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_COMPLEX_10 * restrict bbase_y;
+      GFC_COMPLEX_10 * restrict dest_y;
+      const GFC_COMPLEX_10 * restrict abase_n;
+      GFC_COMPLEX_10 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_COMPLEX_10) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_COMPLEX_10)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_COMPLEX_10 *restrict abase_x;
+         const GFC_COMPLEX_10 *restrict bbase_y;
+         GFC_COMPLEX_10 *restrict dest_y;
+         GFC_COMPLEX_10 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_COMPLEX_10) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_COMPLEX_10 *restrict bbase_y;
+         GFC_COMPLEX_10 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_COMPLEX_10) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_COMPLEX_10)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_COMPLEX_10 *restrict bbase_y;
+      GFC_COMPLEX_10 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_COMPLEX_10) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_COMPLEX_10 *restrict abase_x;
+      const GFC_COMPLEX_10 *restrict bbase_y;
+      GFC_COMPLEX_10 *restrict dest_y;
+      GFC_COMPLEX_10 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_COMPLEX_10) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_c16.c
new file mode 100644 (file)
index 0000000..880c0e1
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_COMPLEX_16 *, const GFC_COMPLEX_16 *,
+                          const int *, const GFC_COMPLEX_16 *, const int *,
+                          const GFC_COMPLEX_16 *, GFC_COMPLEX_16 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_c16 (gfc_array_c16 * const restrict retarray, 
+       gfc_array_c16 * const restrict a, gfc_array_c16 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_c16);
+
+void
+matmul_c16 (gfc_array_c16 * const restrict retarray, 
+       gfc_array_c16 * const restrict a, gfc_array_c16 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_COMPLEX_16 * restrict abase;
+  const GFC_COMPLEX_16 * restrict bbase;
+  GFC_COMPLEX_16 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_COMPLEX_16 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_COMPLEX_16 * restrict bbase_y;
+      GFC_COMPLEX_16 * restrict dest_y;
+      const GFC_COMPLEX_16 * restrict abase_n;
+      GFC_COMPLEX_16 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_COMPLEX_16) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_COMPLEX_16)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_COMPLEX_16 *restrict abase_x;
+         const GFC_COMPLEX_16 *restrict bbase_y;
+         GFC_COMPLEX_16 *restrict dest_y;
+         GFC_COMPLEX_16 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_COMPLEX_16) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_COMPLEX_16 *restrict bbase_y;
+         GFC_COMPLEX_16 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_COMPLEX_16) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_COMPLEX_16)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_COMPLEX_16 *restrict bbase_y;
+      GFC_COMPLEX_16 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_COMPLEX_16) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_COMPLEX_16 *restrict abase_x;
+      const GFC_COMPLEX_16 *restrict bbase_y;
+      GFC_COMPLEX_16 *restrict dest_y;
+      GFC_COMPLEX_16 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_COMPLEX_16) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_c4.c
new file mode 100644 (file)
index 0000000..020033a
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_COMPLEX_4 *, const GFC_COMPLEX_4 *,
+                          const int *, const GFC_COMPLEX_4 *, const int *,
+                          const GFC_COMPLEX_4 *, GFC_COMPLEX_4 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_c4 (gfc_array_c4 * const restrict retarray, 
+       gfc_array_c4 * const restrict a, gfc_array_c4 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_c4);
+
+void
+matmul_c4 (gfc_array_c4 * const restrict retarray, 
+       gfc_array_c4 * const restrict a, gfc_array_c4 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_COMPLEX_4 * restrict abase;
+  const GFC_COMPLEX_4 * restrict bbase;
+  GFC_COMPLEX_4 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_COMPLEX_4 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_COMPLEX_4 * restrict bbase_y;
+      GFC_COMPLEX_4 * restrict dest_y;
+      const GFC_COMPLEX_4 * restrict abase_n;
+      GFC_COMPLEX_4 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_COMPLEX_4) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_COMPLEX_4)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_COMPLEX_4 *restrict abase_x;
+         const GFC_COMPLEX_4 *restrict bbase_y;
+         GFC_COMPLEX_4 *restrict dest_y;
+         GFC_COMPLEX_4 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_COMPLEX_4) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_COMPLEX_4 *restrict bbase_y;
+         GFC_COMPLEX_4 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_COMPLEX_4) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_COMPLEX_4)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_COMPLEX_4 *restrict bbase_y;
+      GFC_COMPLEX_4 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_COMPLEX_4) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_COMPLEX_4 *restrict abase_x;
+      const GFC_COMPLEX_4 *restrict bbase_y;
+      GFC_COMPLEX_4 *restrict dest_y;
+      GFC_COMPLEX_4 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_COMPLEX_4) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_c8.c
new file mode 100644 (file)
index 0000000..1522dcd
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_COMPLEX_8 *, const GFC_COMPLEX_8 *,
+                          const int *, const GFC_COMPLEX_8 *, const int *,
+                          const GFC_COMPLEX_8 *, GFC_COMPLEX_8 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_c8 (gfc_array_c8 * const restrict retarray, 
+       gfc_array_c8 * const restrict a, gfc_array_c8 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_c8);
+
+void
+matmul_c8 (gfc_array_c8 * const restrict retarray, 
+       gfc_array_c8 * const restrict a, gfc_array_c8 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_COMPLEX_8 * restrict abase;
+  const GFC_COMPLEX_8 * restrict bbase;
+  GFC_COMPLEX_8 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_COMPLEX_8 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_COMPLEX_8 * restrict bbase_y;
+      GFC_COMPLEX_8 * restrict dest_y;
+      const GFC_COMPLEX_8 * restrict abase_n;
+      GFC_COMPLEX_8 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_COMPLEX_8) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_COMPLEX_8)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_COMPLEX_8 *restrict abase_x;
+         const GFC_COMPLEX_8 *restrict bbase_y;
+         GFC_COMPLEX_8 *restrict dest_y;
+         GFC_COMPLEX_8 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_COMPLEX_8) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_COMPLEX_8 *restrict bbase_y;
+         GFC_COMPLEX_8 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_COMPLEX_8) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_COMPLEX_8)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_COMPLEX_8 *restrict bbase_y;
+      GFC_COMPLEX_8 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_COMPLEX_8) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_COMPLEX_8 *restrict abase_x;
+      const GFC_COMPLEX_8 *restrict bbase_y;
+      GFC_COMPLEX_8 *restrict dest_y;
+      GFC_COMPLEX_8 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_COMPLEX_8) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_i1.c
new file mode 100644 (file)
index 0000000..db56678
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_INTEGER_1 *, const GFC_INTEGER_1 *,
+                          const int *, const GFC_INTEGER_1 *, const int *,
+                          const GFC_INTEGER_1 *, GFC_INTEGER_1 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict a, gfc_array_i1 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_i1);
+
+void
+matmul_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict a, gfc_array_i1 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_INTEGER_1 * restrict abase;
+  const GFC_INTEGER_1 * restrict bbase;
+  GFC_INTEGER_1 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_INTEGER_1) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_INTEGER_1 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_INTEGER_1 * restrict bbase_y;
+      GFC_INTEGER_1 * restrict dest_y;
+      const GFC_INTEGER_1 * restrict abase_n;
+      GFC_INTEGER_1 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_INTEGER_1) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_INTEGER_1)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_INTEGER_1 *restrict abase_x;
+         const GFC_INTEGER_1 *restrict bbase_y;
+         GFC_INTEGER_1 *restrict dest_y;
+         GFC_INTEGER_1 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_INTEGER_1) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_INTEGER_1 *restrict bbase_y;
+         GFC_INTEGER_1 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_INTEGER_1) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_INTEGER_1)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_INTEGER_1 *restrict bbase_y;
+      GFC_INTEGER_1 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_INTEGER_1) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_INTEGER_1 *restrict abase_x;
+      const GFC_INTEGER_1 *restrict bbase_y;
+      GFC_INTEGER_1 *restrict dest_y;
+      GFC_INTEGER_1 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_INTEGER_1) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_i16.c
new file mode 100644 (file)
index 0000000..f607e27
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_INTEGER_16 *, const GFC_INTEGER_16 *,
+                          const int *, const GFC_INTEGER_16 *, const int *,
+                          const GFC_INTEGER_16 *, GFC_INTEGER_16 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict a, gfc_array_i16 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_i16);
+
+void
+matmul_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict a, gfc_array_i16 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_INTEGER_16 * restrict abase;
+  const GFC_INTEGER_16 * restrict bbase;
+  GFC_INTEGER_16 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_INTEGER_16) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_INTEGER_16 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_INTEGER_16 * restrict bbase_y;
+      GFC_INTEGER_16 * restrict dest_y;
+      const GFC_INTEGER_16 * restrict abase_n;
+      GFC_INTEGER_16 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_INTEGER_16) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_INTEGER_16)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_INTEGER_16 *restrict abase_x;
+         const GFC_INTEGER_16 *restrict bbase_y;
+         GFC_INTEGER_16 *restrict dest_y;
+         GFC_INTEGER_16 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_INTEGER_16) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_INTEGER_16 *restrict bbase_y;
+         GFC_INTEGER_16 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_INTEGER_16) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_INTEGER_16)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_INTEGER_16 *restrict bbase_y;
+      GFC_INTEGER_16 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_INTEGER_16) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_INTEGER_16 *restrict abase_x;
+      const GFC_INTEGER_16 *restrict bbase_y;
+      GFC_INTEGER_16 *restrict dest_y;
+      GFC_INTEGER_16 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_INTEGER_16) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_i2.c
new file mode 100644 (file)
index 0000000..58e340b
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_INTEGER_2 *, const GFC_INTEGER_2 *,
+                          const int *, const GFC_INTEGER_2 *, const int *,
+                          const GFC_INTEGER_2 *, GFC_INTEGER_2 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict a, gfc_array_i2 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_i2);
+
+void
+matmul_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict a, gfc_array_i2 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_INTEGER_2 * restrict abase;
+  const GFC_INTEGER_2 * restrict bbase;
+  GFC_INTEGER_2 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_INTEGER_2) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_INTEGER_2 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_INTEGER_2 * restrict bbase_y;
+      GFC_INTEGER_2 * restrict dest_y;
+      const GFC_INTEGER_2 * restrict abase_n;
+      GFC_INTEGER_2 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_INTEGER_2) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_INTEGER_2)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_INTEGER_2 *restrict abase_x;
+         const GFC_INTEGER_2 *restrict bbase_y;
+         GFC_INTEGER_2 *restrict dest_y;
+         GFC_INTEGER_2 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_INTEGER_2) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_INTEGER_2 *restrict bbase_y;
+         GFC_INTEGER_2 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_INTEGER_2) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_INTEGER_2)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_INTEGER_2 *restrict bbase_y;
+      GFC_INTEGER_2 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_INTEGER_2) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_INTEGER_2 *restrict abase_x;
+      const GFC_INTEGER_2 *restrict bbase_y;
+      GFC_INTEGER_2 *restrict dest_y;
+      GFC_INTEGER_2 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_INTEGER_2) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_i4.c
new file mode 100644 (file)
index 0000000..46ed493
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_INTEGER_4 *, const GFC_INTEGER_4 *,
+                          const int *, const GFC_INTEGER_4 *, const int *,
+                          const GFC_INTEGER_4 *, GFC_INTEGER_4 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict a, gfc_array_i4 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_i4);
+
+void
+matmul_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict a, gfc_array_i4 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_INTEGER_4 * restrict abase;
+  const GFC_INTEGER_4 * restrict bbase;
+  GFC_INTEGER_4 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_INTEGER_4 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_INTEGER_4 * restrict bbase_y;
+      GFC_INTEGER_4 * restrict dest_y;
+      const GFC_INTEGER_4 * restrict abase_n;
+      GFC_INTEGER_4 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_INTEGER_4) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_INTEGER_4)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_INTEGER_4 *restrict abase_x;
+         const GFC_INTEGER_4 *restrict bbase_y;
+         GFC_INTEGER_4 *restrict dest_y;
+         GFC_INTEGER_4 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_INTEGER_4) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_INTEGER_4 *restrict bbase_y;
+         GFC_INTEGER_4 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_INTEGER_4) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_INTEGER_4)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_INTEGER_4 *restrict bbase_y;
+      GFC_INTEGER_4 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_INTEGER_4) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_INTEGER_4 *restrict abase_x;
+      const GFC_INTEGER_4 *restrict bbase_y;
+      GFC_INTEGER_4 *restrict dest_y;
+      GFC_INTEGER_4 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_INTEGER_4) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_i8.c
new file mode 100644 (file)
index 0000000..54ffe62
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_INTEGER_8 *, const GFC_INTEGER_8 *,
+                          const int *, const GFC_INTEGER_8 *, const int *,
+                          const GFC_INTEGER_8 *, GFC_INTEGER_8 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict a, gfc_array_i8 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_i8);
+
+void
+matmul_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict a, gfc_array_i8 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_INTEGER_8 * restrict abase;
+  const GFC_INTEGER_8 * restrict bbase;
+  GFC_INTEGER_8 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_INTEGER_8 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_INTEGER_8 * restrict bbase_y;
+      GFC_INTEGER_8 * restrict dest_y;
+      const GFC_INTEGER_8 * restrict abase_n;
+      GFC_INTEGER_8 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_INTEGER_8) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_INTEGER_8)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_INTEGER_8 *restrict abase_x;
+         const GFC_INTEGER_8 *restrict bbase_y;
+         GFC_INTEGER_8 *restrict dest_y;
+         GFC_INTEGER_8 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_INTEGER_8) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_INTEGER_8 *restrict bbase_y;
+         GFC_INTEGER_8 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_INTEGER_8) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_INTEGER_8)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_INTEGER_8 *restrict bbase_y;
+      GFC_INTEGER_8 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_INTEGER_8) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_INTEGER_8 *restrict abase_x;
+      const GFC_INTEGER_8 *restrict bbase_y;
+      GFC_INTEGER_8 *restrict dest_y;
+      GFC_INTEGER_8 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_INTEGER_8) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_l16.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_l16.c
new file mode 100644 (file)
index 0000000..5fbeeb7
--- /dev/null
@@ -0,0 +1,239 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_16)
+
+/* Dimensions: retarray(x,y) a(x, count) b(count,y).
+   Either a or b can be rank 1.  In this case x or y is 1.  */
+
+extern void matmul_l16 (gfc_array_l16 * const restrict, 
+       gfc_array_l1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(matmul_l16);
+
+void
+matmul_l16 (gfc_array_l16 * const restrict retarray, 
+       gfc_array_l1 * const restrict a, gfc_array_l1 * const restrict b)
+{
+  const GFC_LOGICAL_1 * restrict abase;
+  const GFC_LOGICAL_1 * restrict bbase;
+  GFC_LOGICAL_16 * restrict dest;
+  index_type rxstride;
+  index_type rystride;
+  index_type xcount;
+  index_type ycount;
+  index_type xstride;
+  index_type ystride;
+  index_type x;
+  index_type y;
+  int a_kind;
+  int b_kind;
+
+  const GFC_LOGICAL_1 * restrict pa;
+  const GFC_LOGICAL_1 * restrict pb;
+  index_type astride;
+  index_type bstride;
+  index_type count;
+  index_type n;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+          
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_LOGICAL_16) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+  abase = a->data;
+  a_kind = GFC_DESCRIPTOR_SIZE (a);
+
+  if (a_kind == 1 || a_kind == 2 || a_kind == 4 || a_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+     || a_kind == 16
+#endif
+     )
+    abase = GFOR_POINTER_TO_L1 (abase, a_kind);
+  else
+    internal_error (NULL, "Funny sized logical array");
+
+  bbase = b->data;
+  b_kind = GFC_DESCRIPTOR_SIZE (b);
+
+  if (b_kind == 1 || b_kind == 2 || b_kind == 4 || b_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+     || b_kind == 16
+#endif
+     )
+    bbase = GFOR_POINTER_TO_L1 (bbase, b_kind);
+  else
+    internal_error (NULL, "Funny sized logical array");
+
+  dest = retarray->data;
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = rxstride;
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+  /* If we have rank 1 parameters, zero the absent stride, and set the size to
+     one.  */
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      astride = GFC_DESCRIPTOR_STRIDE_BYTES(a,0);
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+      xstride = 0;
+      rxstride = 0;
+      xcount = 1;
+    }
+  else
+    {
+      astride = GFC_DESCRIPTOR_STRIDE_BYTES(a,1);
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xstride = GFC_DESCRIPTOR_STRIDE_BYTES(a,0);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      bstride = GFC_DESCRIPTOR_STRIDE_BYTES(b,0);
+      assert(count == GFC_DESCRIPTOR_EXTENT(b,0));
+      ystride = 0;
+      rystride = 0;
+      ycount = 1;
+    }
+  else
+    {
+      bstride = GFC_DESCRIPTOR_STRIDE_BYTES(b,0);
+      assert(count == GFC_DESCRIPTOR_EXTENT(b,0));
+      ystride = GFC_DESCRIPTOR_STRIDE_BYTES(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  for (y = 0; y < ycount; y++)
+    {
+      for (x = 0; x < xcount; x++)
+        {
+          /* Do the summation for this element.  For real and integer types
+             this is the same as DOT_PRODUCT.  For complex types we use do
+             a*b, not conjg(a)*b.  */
+          pa = abase;
+          pb = bbase;
+          *dest = 0;
+
+          for (n = 0; n < count; n++)
+            {
+              if (*pa && *pb)
+                {
+                  *dest = 1;
+                  break;
+                }
+              pa += astride;
+              pb += bstride;
+            }
+
+          dest += rxstride;
+          abase += xstride;
+        }
+      abase -= xstride * xcount;
+      bbase += ystride;
+      dest += rystride - (rxstride * xcount);
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_l4.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_l4.c
new file mode 100644 (file)
index 0000000..19ca9f1
--- /dev/null
@@ -0,0 +1,239 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_4)
+
+/* Dimensions: retarray(x,y) a(x, count) b(count,y).
+   Either a or b can be rank 1.  In this case x or y is 1.  */
+
+extern void matmul_l4 (gfc_array_l4 * const restrict, 
+       gfc_array_l1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(matmul_l4);
+
+void
+matmul_l4 (gfc_array_l4 * const restrict retarray, 
+       gfc_array_l1 * const restrict a, gfc_array_l1 * const restrict b)
+{
+  const GFC_LOGICAL_1 * restrict abase;
+  const GFC_LOGICAL_1 * restrict bbase;
+  GFC_LOGICAL_4 * restrict dest;
+  index_type rxstride;
+  index_type rystride;
+  index_type xcount;
+  index_type ycount;
+  index_type xstride;
+  index_type ystride;
+  index_type x;
+  index_type y;
+  int a_kind;
+  int b_kind;
+
+  const GFC_LOGICAL_1 * restrict pa;
+  const GFC_LOGICAL_1 * restrict pb;
+  index_type astride;
+  index_type bstride;
+  index_type count;
+  index_type n;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+          
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+  abase = a->data;
+  a_kind = GFC_DESCRIPTOR_SIZE (a);
+
+  if (a_kind == 1 || a_kind == 2 || a_kind == 4 || a_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+     || a_kind == 16
+#endif
+     )
+    abase = GFOR_POINTER_TO_L1 (abase, a_kind);
+  else
+    internal_error (NULL, "Funny sized logical array");
+
+  bbase = b->data;
+  b_kind = GFC_DESCRIPTOR_SIZE (b);
+
+  if (b_kind == 1 || b_kind == 2 || b_kind == 4 || b_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+     || b_kind == 16
+#endif
+     )
+    bbase = GFOR_POINTER_TO_L1 (bbase, b_kind);
+  else
+    internal_error (NULL, "Funny sized logical array");
+
+  dest = retarray->data;
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = rxstride;
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+  /* If we have rank 1 parameters, zero the absent stride, and set the size to
+     one.  */
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      astride = GFC_DESCRIPTOR_STRIDE_BYTES(a,0);
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+      xstride = 0;
+      rxstride = 0;
+      xcount = 1;
+    }
+  else
+    {
+      astride = GFC_DESCRIPTOR_STRIDE_BYTES(a,1);
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xstride = GFC_DESCRIPTOR_STRIDE_BYTES(a,0);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      bstride = GFC_DESCRIPTOR_STRIDE_BYTES(b,0);
+      assert(count == GFC_DESCRIPTOR_EXTENT(b,0));
+      ystride = 0;
+      rystride = 0;
+      ycount = 1;
+    }
+  else
+    {
+      bstride = GFC_DESCRIPTOR_STRIDE_BYTES(b,0);
+      assert(count == GFC_DESCRIPTOR_EXTENT(b,0));
+      ystride = GFC_DESCRIPTOR_STRIDE_BYTES(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  for (y = 0; y < ycount; y++)
+    {
+      for (x = 0; x < xcount; x++)
+        {
+          /* Do the summation for this element.  For real and integer types
+             this is the same as DOT_PRODUCT.  For complex types we use do
+             a*b, not conjg(a)*b.  */
+          pa = abase;
+          pb = bbase;
+          *dest = 0;
+
+          for (n = 0; n < count; n++)
+            {
+              if (*pa && *pb)
+                {
+                  *dest = 1;
+                  break;
+                }
+              pa += astride;
+              pb += bstride;
+            }
+
+          dest += rxstride;
+          abase += xstride;
+        }
+      abase -= xstride * xcount;
+      bbase += ystride;
+      dest += rystride - (rxstride * xcount);
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_l8.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_l8.c
new file mode 100644 (file)
index 0000000..558ed25
--- /dev/null
@@ -0,0 +1,239 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_8)
+
+/* Dimensions: retarray(x,y) a(x, count) b(count,y).
+   Either a or b can be rank 1.  In this case x or y is 1.  */
+
+extern void matmul_l8 (gfc_array_l8 * const restrict, 
+       gfc_array_l1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(matmul_l8);
+
+void
+matmul_l8 (gfc_array_l8 * const restrict retarray, 
+       gfc_array_l1 * const restrict a, gfc_array_l1 * const restrict b)
+{
+  const GFC_LOGICAL_1 * restrict abase;
+  const GFC_LOGICAL_1 * restrict bbase;
+  GFC_LOGICAL_8 * restrict dest;
+  index_type rxstride;
+  index_type rystride;
+  index_type xcount;
+  index_type ycount;
+  index_type xstride;
+  index_type ystride;
+  index_type x;
+  index_type y;
+  int a_kind;
+  int b_kind;
+
+  const GFC_LOGICAL_1 * restrict pa;
+  const GFC_LOGICAL_1 * restrict pb;
+  index_type astride;
+  index_type bstride;
+  index_type count;
+  index_type n;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+          
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+  abase = a->data;
+  a_kind = GFC_DESCRIPTOR_SIZE (a);
+
+  if (a_kind == 1 || a_kind == 2 || a_kind == 4 || a_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+     || a_kind == 16
+#endif
+     )
+    abase = GFOR_POINTER_TO_L1 (abase, a_kind);
+  else
+    internal_error (NULL, "Funny sized logical array");
+
+  bbase = b->data;
+  b_kind = GFC_DESCRIPTOR_SIZE (b);
+
+  if (b_kind == 1 || b_kind == 2 || b_kind == 4 || b_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+     || b_kind == 16
+#endif
+     )
+    bbase = GFOR_POINTER_TO_L1 (bbase, b_kind);
+  else
+    internal_error (NULL, "Funny sized logical array");
+
+  dest = retarray->data;
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = rxstride;
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+  /* If we have rank 1 parameters, zero the absent stride, and set the size to
+     one.  */
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      astride = GFC_DESCRIPTOR_STRIDE_BYTES(a,0);
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+      xstride = 0;
+      rxstride = 0;
+      xcount = 1;
+    }
+  else
+    {
+      astride = GFC_DESCRIPTOR_STRIDE_BYTES(a,1);
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xstride = GFC_DESCRIPTOR_STRIDE_BYTES(a,0);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      bstride = GFC_DESCRIPTOR_STRIDE_BYTES(b,0);
+      assert(count == GFC_DESCRIPTOR_EXTENT(b,0));
+      ystride = 0;
+      rystride = 0;
+      ycount = 1;
+    }
+  else
+    {
+      bstride = GFC_DESCRIPTOR_STRIDE_BYTES(b,0);
+      assert(count == GFC_DESCRIPTOR_EXTENT(b,0));
+      ystride = GFC_DESCRIPTOR_STRIDE_BYTES(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  for (y = 0; y < ycount; y++)
+    {
+      for (x = 0; x < xcount; x++)
+        {
+          /* Do the summation for this element.  For real and integer types
+             this is the same as DOT_PRODUCT.  For complex types we use do
+             a*b, not conjg(a)*b.  */
+          pa = abase;
+          pb = bbase;
+          *dest = 0;
+
+          for (n = 0; n < count; n++)
+            {
+              if (*pa && *pb)
+                {
+                  *dest = 1;
+                  break;
+                }
+              pa += astride;
+              pb += bstride;
+            }
+
+          dest += rxstride;
+          abase += xstride;
+        }
+      abase -= xstride * xcount;
+      bbase += ystride;
+      dest += rystride - (rxstride * xcount);
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_r10.c
new file mode 100644 (file)
index 0000000..8e32554
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_REAL_10 *, const GFC_REAL_10 *,
+                          const int *, const GFC_REAL_10 *, const int *,
+                          const GFC_REAL_10 *, GFC_REAL_10 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict a, gfc_array_r10 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_r10);
+
+void
+matmul_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict a, gfc_array_r10 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_REAL_10 * restrict abase;
+  const GFC_REAL_10 * restrict bbase;
+  GFC_REAL_10 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_REAL_10) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_REAL_10 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_REAL_10 * restrict bbase_y;
+      GFC_REAL_10 * restrict dest_y;
+      const GFC_REAL_10 * restrict abase_n;
+      GFC_REAL_10 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_REAL_10) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_REAL_10)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_REAL_10 *restrict abase_x;
+         const GFC_REAL_10 *restrict bbase_y;
+         GFC_REAL_10 *restrict dest_y;
+         GFC_REAL_10 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_REAL_10) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_REAL_10 *restrict bbase_y;
+         GFC_REAL_10 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_REAL_10) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_REAL_10)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_REAL_10 *restrict bbase_y;
+      GFC_REAL_10 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_REAL_10) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_REAL_10 *restrict abase_x;
+      const GFC_REAL_10 *restrict bbase_y;
+      GFC_REAL_10 *restrict dest_y;
+      GFC_REAL_10 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_REAL_10) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_r16.c
new file mode 100644 (file)
index 0000000..c115531
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_REAL_16 *, const GFC_REAL_16 *,
+                          const int *, const GFC_REAL_16 *, const int *,
+                          const GFC_REAL_16 *, GFC_REAL_16 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict a, gfc_array_r16 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_r16);
+
+void
+matmul_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict a, gfc_array_r16 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_REAL_16 * restrict abase;
+  const GFC_REAL_16 * restrict bbase;
+  GFC_REAL_16 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_REAL_16) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_REAL_16 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_REAL_16 * restrict bbase_y;
+      GFC_REAL_16 * restrict dest_y;
+      const GFC_REAL_16 * restrict abase_n;
+      GFC_REAL_16 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_REAL_16) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_REAL_16)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_REAL_16 *restrict abase_x;
+         const GFC_REAL_16 *restrict bbase_y;
+         GFC_REAL_16 *restrict dest_y;
+         GFC_REAL_16 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_REAL_16) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_REAL_16 *restrict bbase_y;
+         GFC_REAL_16 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_REAL_16) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_REAL_16)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_REAL_16 *restrict bbase_y;
+      GFC_REAL_16 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_REAL_16) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_REAL_16 *restrict abase_x;
+      const GFC_REAL_16 *restrict bbase_y;
+      GFC_REAL_16 *restrict dest_y;
+      GFC_REAL_16 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_REAL_16) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_r4.c
new file mode 100644 (file)
index 0000000..5420872
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_REAL_4 *, const GFC_REAL_4 *,
+                          const int *, const GFC_REAL_4 *, const int *,
+                          const GFC_REAL_4 *, GFC_REAL_4 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict a, gfc_array_r4 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_r4);
+
+void
+matmul_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict a, gfc_array_r4 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_REAL_4 * restrict abase;
+  const GFC_REAL_4 * restrict bbase;
+  GFC_REAL_4 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_REAL_4 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_REAL_4 * restrict bbase_y;
+      GFC_REAL_4 * restrict dest_y;
+      const GFC_REAL_4 * restrict abase_n;
+      GFC_REAL_4 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_REAL_4) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_REAL_4)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_REAL_4 *restrict abase_x;
+         const GFC_REAL_4 *restrict bbase_y;
+         GFC_REAL_4 *restrict dest_y;
+         GFC_REAL_4 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_REAL_4) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_REAL_4 *restrict bbase_y;
+         GFC_REAL_4 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_REAL_4) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_REAL_4)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_REAL_4 *restrict bbase_y;
+      GFC_REAL_4 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_REAL_4) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_REAL_4 *restrict abase_x;
+      const GFC_REAL_4 *restrict bbase_y;
+      GFC_REAL_4 *restrict dest_y;
+      GFC_REAL_4 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_REAL_4) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/matmul_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/matmul_r8.c
new file mode 100644 (file)
index 0000000..72ad1fd
--- /dev/null
@@ -0,0 +1,376 @@
+/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we'll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const GFC_REAL_8 *, const GFC_REAL_8 *,
+                          const int *, const GFC_REAL_8 *, const int *,
+                          const GFC_REAL_8 *, GFC_REAL_8 *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict a, gfc_array_r8 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_r8);
+
+void
+matmul_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict a, gfc_array_r8 * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const GFC_REAL_8 * restrict abase;
+  const GFC_REAL_8 * restrict bbase;
+  GFC_REAL_8 * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we're performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const GFC_REAL_8 one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const GFC_REAL_8 * restrict bbase_y;
+      GFC_REAL_8 * restrict dest_y;
+      const GFC_REAL_8 * restrict abase_n;
+      GFC_REAL_8 bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof (GFC_REAL_8) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = (GFC_REAL_8)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const GFC_REAL_8 *restrict abase_x;
+         const GFC_REAL_8 *restrict bbase_y;
+         GFC_REAL_8 *restrict dest_y;
+         GFC_REAL_8 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = (GFC_REAL_8) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const GFC_REAL_8 *restrict bbase_y;
+         GFC_REAL_8 s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = (GFC_REAL_8) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = (GFC_REAL_8)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const GFC_REAL_8 *restrict bbase_y;
+      GFC_REAL_8 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = (GFC_REAL_8) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const GFC_REAL_8 *restrict abase_x;
+      const GFC_REAL_8 *restrict bbase_y;
+      GFC_REAL_8 *restrict dest_y;
+      GFC_REAL_8 s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = (GFC_REAL_8) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i1.c
new file mode 100644 (file)
index 0000000..5649018
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc0_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array);
+export_proto(maxloc0_16_i1);
+
+void
+maxloc0_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_1 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_1 maxval;
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    maxval = -GFC_INTEGER_1_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_16_i1);
+
+void
+mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_1 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_1 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    maxval = -GFC_INTEGER_1_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_16_i1);
+
+void
+smaxloc0_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      maxloc0_16_i1 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i16.c
new file mode 100644 (file)
index 0000000..1ff74f6
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc0_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array);
+export_proto(maxloc0_16_i16);
+
+void
+maxloc0_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_16 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_16 maxval;
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    maxval = -GFC_INTEGER_16_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_16_i16);
+
+void
+mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_16 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    maxval = -GFC_INTEGER_16_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_16_i16);
+
+void
+smaxloc0_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      maxloc0_16_i16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i2.c
new file mode 100644 (file)
index 0000000..8ca75b9
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc0_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array);
+export_proto(maxloc0_16_i2);
+
+void
+maxloc0_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_2 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_2 maxval;
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    maxval = -GFC_INTEGER_2_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_16_i2);
+
+void
+mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_2 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_2 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    maxval = -GFC_INTEGER_2_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_16_i2);
+
+void
+smaxloc0_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      maxloc0_16_i2 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i4.c
new file mode 100644 (file)
index 0000000..18feabb
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc0_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array);
+export_proto(maxloc0_16_i4);
+
+void
+maxloc0_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_4 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_4 maxval;
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    maxval = -GFC_INTEGER_4_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_16_i4);
+
+void
+mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_4 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    maxval = -GFC_INTEGER_4_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_16_i4);
+
+void
+smaxloc0_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      maxloc0_16_i4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_i8.c
new file mode 100644 (file)
index 0000000..bc5a3b3
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc0_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array);
+export_proto(maxloc0_16_i8);
+
+void
+maxloc0_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_8 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_8 maxval;
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    maxval = -GFC_INTEGER_8_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_16_i8);
+
+void
+mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_8 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    maxval = -GFC_INTEGER_8_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_16_i8);
+
+void
+smaxloc0_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      maxloc0_16_i8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r10.c
new file mode 100644 (file)
index 0000000..ee0052f
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc0_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array);
+export_proto(maxloc0_16_r10);
+
+void
+maxloc0_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_10 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_10 maxval;
+#if defined(GFC_REAL_10_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_10_INFINITY)
+    maxval = -GFC_REAL_10_INFINITY;
+#else
+    maxval = -GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_10_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_16_r10);
+
+void
+mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_REAL_10 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_10 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_10_INFINITY)
+    maxval = -GFC_REAL_10_INFINITY;
+#else
+    maxval = -GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_10_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_16_r10);
+
+void
+smaxloc0_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      maxloc0_16_r10 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r16.c
new file mode 100644 (file)
index 0000000..3c28d19
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc0_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array);
+export_proto(maxloc0_16_r16);
+
+void
+maxloc0_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_16 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_16 maxval;
+#if defined(GFC_REAL_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_16_INFINITY)
+    maxval = -GFC_REAL_16_INFINITY;
+#else
+    maxval = -GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_16_r16);
+
+void
+mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_REAL_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_16 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_16_INFINITY)
+    maxval = -GFC_REAL_16_INFINITY;
+#else
+    maxval = -GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_16_r16);
+
+void
+smaxloc0_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      maxloc0_16_r16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r4.c
new file mode 100644 (file)
index 0000000..616ec7a
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc0_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array);
+export_proto(maxloc0_16_r4);
+
+void
+maxloc0_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_4 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_4 maxval;
+#if defined(GFC_REAL_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_4_INFINITY)
+    maxval = -GFC_REAL_4_INFINITY;
+#else
+    maxval = -GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_16_r4);
+
+void
+mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_REAL_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_4 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_4_INFINITY)
+    maxval = -GFC_REAL_4_INFINITY;
+#else
+    maxval = -GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_16_r4);
+
+void
+smaxloc0_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      maxloc0_16_r4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_16_r8.c
new file mode 100644 (file)
index 0000000..8bb5f0d
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc0_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array);
+export_proto(maxloc0_16_r8);
+
+void
+maxloc0_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_8 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_8 maxval;
+#if defined(GFC_REAL_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_8_INFINITY)
+    maxval = -GFC_REAL_8_INFINITY;
+#else
+    maxval = -GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_16_r8);
+
+void
+mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_REAL_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_8 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_8_INFINITY)
+    maxval = -GFC_REAL_8_INFINITY;
+#else
+    maxval = -GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_16_r8);
+
+void
+smaxloc0_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      maxloc0_16_r8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i1.c
new file mode 100644 (file)
index 0000000..5fb626b
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc0_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array);
+export_proto(maxloc0_4_i1);
+
+void
+maxloc0_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_1 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_1 maxval;
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    maxval = -GFC_INTEGER_1_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_4_i1);
+
+void
+mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_1 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_1 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    maxval = -GFC_INTEGER_1_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_4_i1);
+
+void
+smaxloc0_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      maxloc0_4_i1 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i16.c
new file mode 100644 (file)
index 0000000..e4d252d
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc0_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array);
+export_proto(maxloc0_4_i16);
+
+void
+maxloc0_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_16 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_16 maxval;
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    maxval = -GFC_INTEGER_16_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_4_i16);
+
+void
+mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_16 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    maxval = -GFC_INTEGER_16_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_4_i16);
+
+void
+smaxloc0_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      maxloc0_4_i16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i2.c
new file mode 100644 (file)
index 0000000..a3866e4
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc0_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array);
+export_proto(maxloc0_4_i2);
+
+void
+maxloc0_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_2 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_2 maxval;
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    maxval = -GFC_INTEGER_2_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_4_i2);
+
+void
+mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_2 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_2 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    maxval = -GFC_INTEGER_2_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_4_i2);
+
+void
+smaxloc0_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      maxloc0_4_i2 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i4.c
new file mode 100644 (file)
index 0000000..0a4a5bd
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc0_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array);
+export_proto(maxloc0_4_i4);
+
+void
+maxloc0_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_4 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_4 maxval;
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    maxval = -GFC_INTEGER_4_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_4_i4);
+
+void
+mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_4 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    maxval = -GFC_INTEGER_4_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_4_i4);
+
+void
+smaxloc0_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      maxloc0_4_i4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_i8.c
new file mode 100644 (file)
index 0000000..435123b
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc0_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array);
+export_proto(maxloc0_4_i8);
+
+void
+maxloc0_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_8 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_8 maxval;
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    maxval = -GFC_INTEGER_8_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_4_i8);
+
+void
+mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_8 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    maxval = -GFC_INTEGER_8_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_4_i8);
+
+void
+smaxloc0_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      maxloc0_4_i8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r10.c
new file mode 100644 (file)
index 0000000..4b99bbe
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc0_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array);
+export_proto(maxloc0_4_r10);
+
+void
+maxloc0_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_10 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_10 maxval;
+#if defined(GFC_REAL_10_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_10_INFINITY)
+    maxval = -GFC_REAL_10_INFINITY;
+#else
+    maxval = -GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_10_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_4_r10);
+
+void
+mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_REAL_10 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_10 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_10_INFINITY)
+    maxval = -GFC_REAL_10_INFINITY;
+#else
+    maxval = -GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_10_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_4_r10);
+
+void
+smaxloc0_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      maxloc0_4_r10 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r16.c
new file mode 100644 (file)
index 0000000..1290355
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc0_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array);
+export_proto(maxloc0_4_r16);
+
+void
+maxloc0_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_16 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_16 maxval;
+#if defined(GFC_REAL_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_16_INFINITY)
+    maxval = -GFC_REAL_16_INFINITY;
+#else
+    maxval = -GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_4_r16);
+
+void
+mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_REAL_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_16 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_16_INFINITY)
+    maxval = -GFC_REAL_16_INFINITY;
+#else
+    maxval = -GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_4_r16);
+
+void
+smaxloc0_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      maxloc0_4_r16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r4.c
new file mode 100644 (file)
index 0000000..5483fda
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc0_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array);
+export_proto(maxloc0_4_r4);
+
+void
+maxloc0_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_4 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_4 maxval;
+#if defined(GFC_REAL_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_4_INFINITY)
+    maxval = -GFC_REAL_4_INFINITY;
+#else
+    maxval = -GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_4_r4);
+
+void
+mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_REAL_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_4 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_4_INFINITY)
+    maxval = -GFC_REAL_4_INFINITY;
+#else
+    maxval = -GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_4_r4);
+
+void
+smaxloc0_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      maxloc0_4_r4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_4_r8.c
new file mode 100644 (file)
index 0000000..e4631db
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc0_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array);
+export_proto(maxloc0_4_r8);
+
+void
+maxloc0_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_8 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_8 maxval;
+#if defined(GFC_REAL_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_8_INFINITY)
+    maxval = -GFC_REAL_8_INFINITY;
+#else
+    maxval = -GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_4_r8);
+
+void
+mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_REAL_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_8 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_8_INFINITY)
+    maxval = -GFC_REAL_8_INFINITY;
+#else
+    maxval = -GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_4_r8);
+
+void
+smaxloc0_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      maxloc0_4_r8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i1.c
new file mode 100644 (file)
index 0000000..ddfc4df
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc0_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array);
+export_proto(maxloc0_8_i1);
+
+void
+maxloc0_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_1 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_1 maxval;
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    maxval = -GFC_INTEGER_1_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_8_i1);
+
+void
+mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_1 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_1 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    maxval = -GFC_INTEGER_1_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_8_i1);
+
+void
+smaxloc0_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      maxloc0_8_i1 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i16.c
new file mode 100644 (file)
index 0000000..ce324b5
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc0_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array);
+export_proto(maxloc0_8_i16);
+
+void
+maxloc0_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_16 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_16 maxval;
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    maxval = -GFC_INTEGER_16_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_8_i16);
+
+void
+mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_16 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    maxval = -GFC_INTEGER_16_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_8_i16);
+
+void
+smaxloc0_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      maxloc0_8_i16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i2.c
new file mode 100644 (file)
index 0000000..1b59bb6
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc0_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array);
+export_proto(maxloc0_8_i2);
+
+void
+maxloc0_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_2 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_2 maxval;
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    maxval = -GFC_INTEGER_2_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_8_i2);
+
+void
+mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_2 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_2 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    maxval = -GFC_INTEGER_2_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_8_i2);
+
+void
+smaxloc0_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      maxloc0_8_i2 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i4.c
new file mode 100644 (file)
index 0000000..f1071d1
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc0_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array);
+export_proto(maxloc0_8_i4);
+
+void
+maxloc0_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_4 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_4 maxval;
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    maxval = -GFC_INTEGER_4_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_8_i4);
+
+void
+mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_4 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    maxval = -GFC_INTEGER_4_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_8_i4);
+
+void
+smaxloc0_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      maxloc0_8_i4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_i8.c
new file mode 100644 (file)
index 0000000..2774558
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc0_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array);
+export_proto(maxloc0_8_i8);
+
+void
+maxloc0_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_8 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_8 maxval;
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    maxval = -GFC_INTEGER_8_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_8_i8);
+
+void
+mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_8 maxval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    maxval = -GFC_INTEGER_8_INFINITY;
+#else
+    maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_8_i8);
+
+void
+smaxloc0_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      maxloc0_8_i8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r10.c
new file mode 100644 (file)
index 0000000..0d5183c
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc0_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array);
+export_proto(maxloc0_8_r10);
+
+void
+maxloc0_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_10 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_10 maxval;
+#if defined(GFC_REAL_10_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_10_INFINITY)
+    maxval = -GFC_REAL_10_INFINITY;
+#else
+    maxval = -GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_10_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_8_r10);
+
+void
+mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_REAL_10 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_10 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_10_INFINITY)
+    maxval = -GFC_REAL_10_INFINITY;
+#else
+    maxval = -GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_10_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_8_r10);
+
+void
+smaxloc0_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      maxloc0_8_r10 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r16.c
new file mode 100644 (file)
index 0000000..51bc7b3
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc0_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array);
+export_proto(maxloc0_8_r16);
+
+void
+maxloc0_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_16 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_16 maxval;
+#if defined(GFC_REAL_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_16_INFINITY)
+    maxval = -GFC_REAL_16_INFINITY;
+#else
+    maxval = -GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_8_r16);
+
+void
+mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_REAL_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_16 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_16_INFINITY)
+    maxval = -GFC_REAL_16_INFINITY;
+#else
+    maxval = -GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_8_r16);
+
+void
+smaxloc0_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      maxloc0_8_r16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r4.c
new file mode 100644 (file)
index 0000000..cebe571
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc0_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array);
+export_proto(maxloc0_8_r4);
+
+void
+maxloc0_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_4 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_4 maxval;
+#if defined(GFC_REAL_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_4_INFINITY)
+    maxval = -GFC_REAL_4_INFINITY;
+#else
+    maxval = -GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_8_r4);
+
+void
+mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_REAL_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_4 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_4_INFINITY)
+    maxval = -GFC_REAL_4_INFINITY;
+#else
+    maxval = -GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_8_r4);
+
+void
+smaxloc0_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      maxloc0_8_r4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc0_8_r8.c
new file mode 100644 (file)
index 0000000..d332995
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc0_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array);
+export_proto(maxloc0_8_r8);
+
+void
+maxloc0_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_8 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_8 maxval;
+#if defined(GFC_REAL_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_8_INFINITY)
+    maxval = -GFC_REAL_8_INFINITY;
+#else
+    maxval = -GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mmaxloc0_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mmaxloc0_8_r8);
+
+void
+mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_REAL_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MAXLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_8 maxval;
+   int fast = 0;
+
+#if defined(GFC_REAL_8_INFINITY)
+    maxval = -GFC_REAL_8_INFINITY;
+#else
+    maxval = -GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void smaxloc0_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(smaxloc0_8_r8);
+
+void
+smaxloc0_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      maxloc0_8_r8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MAXLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i1.c
new file mode 100644 (file)
index 0000000..3e42463
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc1_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_16_i1);
+
+void
+maxloc1_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_1 maxval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       maxval = -GFC_INTEGER_1_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_16_i1);
+
+void
+mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_1 maxval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       maxval = -GFC_INTEGER_1_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_16_i1);
+
+void
+smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_16_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i16.c
new file mode 100644 (file)
index 0000000..d6819aa
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc1_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_16_i16);
+
+void
+maxloc1_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_16 maxval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       maxval = -GFC_INTEGER_16_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_16_i16);
+
+void
+mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_16 maxval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       maxval = -GFC_INTEGER_16_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_16_i16);
+
+void
+smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_16_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i2.c
new file mode 100644 (file)
index 0000000..691d034
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc1_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_16_i2);
+
+void
+maxloc1_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_2 maxval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       maxval = -GFC_INTEGER_2_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_16_i2);
+
+void
+mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_2 maxval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       maxval = -GFC_INTEGER_2_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_16_i2);
+
+void
+smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_16_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i4.c
new file mode 100644 (file)
index 0000000..1e5b87c
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc1_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_16_i4);
+
+void
+maxloc1_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_4 maxval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       maxval = -GFC_INTEGER_4_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_16_i4);
+
+void
+mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_4 maxval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       maxval = -GFC_INTEGER_4_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_16_i4);
+
+void
+smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_16_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_i8.c
new file mode 100644 (file)
index 0000000..c6a73d8
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc1_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_16_i8);
+
+void
+maxloc1_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_8 maxval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       maxval = -GFC_INTEGER_8_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_16_i8);
+
+void
+mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_8 maxval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       maxval = -GFC_INTEGER_8_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_16_i8);
+
+void
+smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_16_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r10.c
new file mode 100644 (file)
index 0000000..d954000
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc1_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_16_r10);
+
+void
+maxloc1_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_REAL_10 maxval;
+#if defined (GFC_REAL_10_INFINITY)
+       maxval = -GFC_REAL_10_INFINITY;
+#else
+       maxval = -GFC_REAL_10_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_10_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_16_r10);
+
+void
+mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_10 maxval;
+#if defined (GFC_REAL_10_INFINITY)
+       maxval = -GFC_REAL_10_INFINITY;
+#else
+       maxval = -GFC_REAL_10_HUGE;
+#endif
+#if defined (GFC_REAL_10_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_10_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_10_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_16_r10);
+
+void
+smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_16_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r16.c
new file mode 100644 (file)
index 0000000..4ecb784
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc1_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_16_r16);
+
+void
+maxloc1_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_REAL_16 maxval;
+#if defined (GFC_REAL_16_INFINITY)
+       maxval = -GFC_REAL_16_INFINITY;
+#else
+       maxval = -GFC_REAL_16_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_16_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_16_r16);
+
+void
+mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_16 maxval;
+#if defined (GFC_REAL_16_INFINITY)
+       maxval = -GFC_REAL_16_INFINITY;
+#else
+       maxval = -GFC_REAL_16_HUGE;
+#endif
+#if defined (GFC_REAL_16_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_16_r16);
+
+void
+smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_16_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r4.c
new file mode 100644 (file)
index 0000000..e5cd291
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc1_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_16_r4);
+
+void
+maxloc1_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_REAL_4 maxval;
+#if defined (GFC_REAL_4_INFINITY)
+       maxval = -GFC_REAL_4_INFINITY;
+#else
+       maxval = -GFC_REAL_4_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_4_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_16_r4);
+
+void
+mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_4 maxval;
+#if defined (GFC_REAL_4_INFINITY)
+       maxval = -GFC_REAL_4_INFINITY;
+#else
+       maxval = -GFC_REAL_4_HUGE;
+#endif
+#if defined (GFC_REAL_4_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_16_r4);
+
+void
+smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_16_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_16_r8.c
new file mode 100644 (file)
index 0000000..2d209d7
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxloc1_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_16_r8);
+
+void
+maxloc1_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_REAL_8 maxval;
+#if defined (GFC_REAL_8_INFINITY)
+       maxval = -GFC_REAL_8_INFINITY;
+#else
+       maxval = -GFC_REAL_8_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_8_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_16_r8);
+
+void
+mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_8 maxval;
+#if defined (GFC_REAL_8_INFINITY)
+       maxval = -GFC_REAL_8_INFINITY;
+#else
+       maxval = -GFC_REAL_8_HUGE;
+#endif
+#if defined (GFC_REAL_8_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_16_r8);
+
+void
+smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_16_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i1.c
new file mode 100644 (file)
index 0000000..efd6958
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc1_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_4_i1);
+
+void
+maxloc1_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_1 maxval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       maxval = -GFC_INTEGER_1_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_4_i1);
+
+void
+mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_1 maxval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       maxval = -GFC_INTEGER_1_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_4_i1);
+
+void
+smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_4_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i16.c
new file mode 100644 (file)
index 0000000..71850fc
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc1_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_4_i16);
+
+void
+maxloc1_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_16 maxval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       maxval = -GFC_INTEGER_16_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_4_i16);
+
+void
+mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_16 maxval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       maxval = -GFC_INTEGER_16_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_4_i16);
+
+void
+smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_4_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i2.c
new file mode 100644 (file)
index 0000000..d825039
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc1_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_4_i2);
+
+void
+maxloc1_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_2 maxval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       maxval = -GFC_INTEGER_2_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_4_i2);
+
+void
+mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_2 maxval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       maxval = -GFC_INTEGER_2_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_4_i2);
+
+void
+smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_4_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i4.c
new file mode 100644 (file)
index 0000000..f70b5aa
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc1_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_4_i4);
+
+void
+maxloc1_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_4 maxval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       maxval = -GFC_INTEGER_4_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_4_i4);
+
+void
+mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_4 maxval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       maxval = -GFC_INTEGER_4_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_4_i4);
+
+void
+smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_4_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_i8.c
new file mode 100644 (file)
index 0000000..cda4a99
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc1_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_4_i8);
+
+void
+maxloc1_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_8 maxval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       maxval = -GFC_INTEGER_8_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_4_i8);
+
+void
+mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_8 maxval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       maxval = -GFC_INTEGER_8_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_4_i8);
+
+void
+smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_4_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r10.c
new file mode 100644 (file)
index 0000000..7901a4b
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc1_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_4_r10);
+
+void
+maxloc1_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_REAL_10 maxval;
+#if defined (GFC_REAL_10_INFINITY)
+       maxval = -GFC_REAL_10_INFINITY;
+#else
+       maxval = -GFC_REAL_10_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_10_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_4_r10);
+
+void
+mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_10 maxval;
+#if defined (GFC_REAL_10_INFINITY)
+       maxval = -GFC_REAL_10_INFINITY;
+#else
+       maxval = -GFC_REAL_10_HUGE;
+#endif
+#if defined (GFC_REAL_10_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_10_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_10_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_4_r10);
+
+void
+smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_4_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r16.c
new file mode 100644 (file)
index 0000000..f06d7b2
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc1_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_4_r16);
+
+void
+maxloc1_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_REAL_16 maxval;
+#if defined (GFC_REAL_16_INFINITY)
+       maxval = -GFC_REAL_16_INFINITY;
+#else
+       maxval = -GFC_REAL_16_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_16_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_4_r16);
+
+void
+mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_16 maxval;
+#if defined (GFC_REAL_16_INFINITY)
+       maxval = -GFC_REAL_16_INFINITY;
+#else
+       maxval = -GFC_REAL_16_HUGE;
+#endif
+#if defined (GFC_REAL_16_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_4_r16);
+
+void
+smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_4_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r4.c
new file mode 100644 (file)
index 0000000..e6837aa
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc1_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_4_r4);
+
+void
+maxloc1_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_REAL_4 maxval;
+#if defined (GFC_REAL_4_INFINITY)
+       maxval = -GFC_REAL_4_INFINITY;
+#else
+       maxval = -GFC_REAL_4_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_4_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_4_r4);
+
+void
+mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_4 maxval;
+#if defined (GFC_REAL_4_INFINITY)
+       maxval = -GFC_REAL_4_INFINITY;
+#else
+       maxval = -GFC_REAL_4_HUGE;
+#endif
+#if defined (GFC_REAL_4_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_4_r4);
+
+void
+smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_4_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_4_r8.c
new file mode 100644 (file)
index 0000000..26c10c7
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxloc1_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_4_r8);
+
+void
+maxloc1_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_REAL_8 maxval;
+#if defined (GFC_REAL_8_INFINITY)
+       maxval = -GFC_REAL_8_INFINITY;
+#else
+       maxval = -GFC_REAL_8_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_8_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_4_r8);
+
+void
+mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_8 maxval;
+#if defined (GFC_REAL_8_INFINITY)
+       maxval = -GFC_REAL_8_INFINITY;
+#else
+       maxval = -GFC_REAL_8_HUGE;
+#endif
+#if defined (GFC_REAL_8_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_4_r8);
+
+void
+smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_4_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i1.c
new file mode 100644 (file)
index 0000000..c9dc610
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc1_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_8_i1);
+
+void
+maxloc1_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_1 maxval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       maxval = -GFC_INTEGER_1_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_8_i1);
+
+void
+mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_1 maxval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       maxval = -GFC_INTEGER_1_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_1_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_8_i1);
+
+void
+smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_8_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i16.c
new file mode 100644 (file)
index 0000000..7cd62ac
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc1_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_8_i16);
+
+void
+maxloc1_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_16 maxval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       maxval = -GFC_INTEGER_16_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_8_i16);
+
+void
+mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_16 maxval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       maxval = -GFC_INTEGER_16_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_16_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_8_i16);
+
+void
+smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_8_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i2.c
new file mode 100644 (file)
index 0000000..fd0cc21
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc1_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_8_i2);
+
+void
+maxloc1_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_2 maxval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       maxval = -GFC_INTEGER_2_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_8_i2);
+
+void
+mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_2 maxval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       maxval = -GFC_INTEGER_2_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_2_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_8_i2);
+
+void
+smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_8_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i4.c
new file mode 100644 (file)
index 0000000..97cd54b
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc1_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_8_i4);
+
+void
+maxloc1_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_4 maxval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       maxval = -GFC_INTEGER_4_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_8_i4);
+
+void
+mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_4 maxval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       maxval = -GFC_INTEGER_4_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_4_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_8_i4);
+
+void
+smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_8_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_i8.c
new file mode 100644 (file)
index 0000000..f9c455c
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc1_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_8_i8);
+
+void
+maxloc1_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_8 maxval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       maxval = -GFC_INTEGER_8_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_8_i8);
+
+void
+mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_8 maxval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       maxval = -GFC_INTEGER_8_INFINITY;
+#else
+       maxval = (-GFC_INTEGER_8_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_8_i8);
+
+void
+smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_8_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r10.c
new file mode 100644 (file)
index 0000000..ab1173c
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc1_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_8_r10);
+
+void
+maxloc1_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_REAL_10 maxval;
+#if defined (GFC_REAL_10_INFINITY)
+       maxval = -GFC_REAL_10_INFINITY;
+#else
+       maxval = -GFC_REAL_10_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_10_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_8_r10);
+
+void
+mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_10 maxval;
+#if defined (GFC_REAL_10_INFINITY)
+       maxval = -GFC_REAL_10_INFINITY;
+#else
+       maxval = -GFC_REAL_10_HUGE;
+#endif
+#if defined (GFC_REAL_10_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_10_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_10_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_8_r10);
+
+void
+smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_8_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r16.c
new file mode 100644 (file)
index 0000000..9a02e12
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc1_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_8_r16);
+
+void
+maxloc1_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_REAL_16 maxval;
+#if defined (GFC_REAL_16_INFINITY)
+       maxval = -GFC_REAL_16_INFINITY;
+#else
+       maxval = -GFC_REAL_16_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_16_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_8_r16);
+
+void
+mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_16 maxval;
+#if defined (GFC_REAL_16_INFINITY)
+       maxval = -GFC_REAL_16_INFINITY;
+#else
+       maxval = -GFC_REAL_16_HUGE;
+#endif
+#if defined (GFC_REAL_16_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_8_r16);
+
+void
+smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_8_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r4.c
new file mode 100644 (file)
index 0000000..584bdb8
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc1_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_8_r4);
+
+void
+maxloc1_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_REAL_4 maxval;
+#if defined (GFC_REAL_4_INFINITY)
+       maxval = -GFC_REAL_4_INFINITY;
+#else
+       maxval = -GFC_REAL_4_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_4_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_8_r4);
+
+void
+mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_4 maxval;
+#if defined (GFC_REAL_4_INFINITY)
+       maxval = -GFC_REAL_4_INFINITY;
+#else
+       maxval = -GFC_REAL_4_HUGE;
+#endif
+#if defined (GFC_REAL_4_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_8_r4);
+
+void
+smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_8_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxloc1_8_r8.c
new file mode 100644 (file)
index 0000000..c6f3efd
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxloc1_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(maxloc1_8_r8);
+
+void
+maxloc1_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_REAL_8 maxval;
+#if defined (GFC_REAL_8_INFINITY)
+       maxval = -GFC_REAL_8_INFINITY;
+#else
+       maxval = -GFC_REAL_8_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_8_QUIET_NAN)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxloc1_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxloc1_8_r8);
+
+void
+mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_8 maxval;
+#if defined (GFC_REAL_8_INFINITY)
+       maxval = -GFC_REAL_8_INFINITY;
+#else
+       maxval = -GFC_REAL_8_HUGE;
+#endif
+#if defined (GFC_REAL_8_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxloc1_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxloc1_8_r8);
+
+void
+smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxloc1_8_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxval_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/maxval_i1.c
new file mode 100644 (file)
index 0000000..5b67682
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_1)
+
+
+extern void maxval_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(maxval_i1);
+
+void
+maxval_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_1 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_1_INFINITY)
+       result = -GFC_INTEGER_1_INFINITY;
+#else
+       result = (-GFC_INTEGER_1_HUGE-1);
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_1_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_1_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxval_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxval_i1);
+
+void
+mmaxval_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_1 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_1_INFINITY)
+       result = -GFC_INTEGER_1_INFINITY;
+#else
+       result = (-GFC_INTEGER_1_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_1_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_1_INFINITY) || defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_1_QUIET_NAN : (-GFC_INTEGER_1_HUGE-1);
+#else
+               result = (-GFC_INTEGER_1_HUGE-1);
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxval_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxval_i1);
+
+void
+smaxval_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxval_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = (-GFC_INTEGER_1_HUGE-1);
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxval_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxval_i16.c
new file mode 100644 (file)
index 0000000..148319d
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void maxval_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(maxval_i16);
+
+void
+maxval_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_16_INFINITY)
+       result = -GFC_INTEGER_16_INFINITY;
+#else
+       result = (-GFC_INTEGER_16_HUGE-1);
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_16_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_16_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxval_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxval_i16);
+
+void
+mmaxval_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_16_INFINITY)
+       result = -GFC_INTEGER_16_INFINITY;
+#else
+       result = (-GFC_INTEGER_16_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_16_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_16_INFINITY) || defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_16_QUIET_NAN : (-GFC_INTEGER_16_HUGE-1);
+#else
+               result = (-GFC_INTEGER_16_HUGE-1);
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxval_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxval_i16);
+
+void
+smaxval_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxval_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = (-GFC_INTEGER_16_HUGE-1);
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxval_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/maxval_i2.c
new file mode 100644 (file)
index 0000000..f87f3ed
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_2)
+
+
+extern void maxval_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(maxval_i2);
+
+void
+maxval_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_2 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_2_INFINITY)
+       result = -GFC_INTEGER_2_INFINITY;
+#else
+       result = (-GFC_INTEGER_2_HUGE-1);
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_2_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_2_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxval_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxval_i2);
+
+void
+mmaxval_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_2 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_2_INFINITY)
+       result = -GFC_INTEGER_2_INFINITY;
+#else
+       result = (-GFC_INTEGER_2_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_2_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_2_INFINITY) || defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_2_QUIET_NAN : (-GFC_INTEGER_2_HUGE-1);
+#else
+               result = (-GFC_INTEGER_2_HUGE-1);
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxval_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxval_i2);
+
+void
+smaxval_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxval_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = (-GFC_INTEGER_2_HUGE-1);
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxval_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxval_i4.c
new file mode 100644 (file)
index 0000000..51f2511
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void maxval_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(maxval_i4);
+
+void
+maxval_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_4_INFINITY)
+       result = -GFC_INTEGER_4_INFINITY;
+#else
+       result = (-GFC_INTEGER_4_HUGE-1);
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_4_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_4_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxval_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxval_i4);
+
+void
+mmaxval_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_4_INFINITY)
+       result = -GFC_INTEGER_4_INFINITY;
+#else
+       result = (-GFC_INTEGER_4_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_4_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_4_INFINITY) || defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_4_QUIET_NAN : (-GFC_INTEGER_4_HUGE-1);
+#else
+               result = (-GFC_INTEGER_4_HUGE-1);
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxval_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxval_i4);
+
+void
+smaxval_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxval_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = (-GFC_INTEGER_4_HUGE-1);
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxval_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxval_i8.c
new file mode 100644 (file)
index 0000000..74aca03
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void maxval_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(maxval_i8);
+
+void
+maxval_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_8_INFINITY)
+       result = -GFC_INTEGER_8_INFINITY;
+#else
+       result = (-GFC_INTEGER_8_HUGE-1);
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_8_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_8_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxval_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxval_i8);
+
+void
+mmaxval_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_8_INFINITY)
+       result = -GFC_INTEGER_8_INFINITY;
+#else
+       result = (-GFC_INTEGER_8_HUGE-1);
+#endif
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = (-GFC_INTEGER_8_HUGE-1);
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_8_INFINITY) || defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_8_QUIET_NAN : (-GFC_INTEGER_8_HUGE-1);
+#else
+               result = (-GFC_INTEGER_8_HUGE-1);
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxval_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxval_i8);
+
+void
+smaxval_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxval_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = (-GFC_INTEGER_8_HUGE-1);
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxval_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/maxval_r10.c
new file mode 100644 (file)
index 0000000..3eaaa4c
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_REAL_10)
+
+
+extern void maxval_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(maxval_r10);
+
+void
+maxval_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_REAL_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_REAL_10 result;
+      src = base;
+      {
+
+#if defined (GFC_REAL_10_INFINITY)
+       result = -GFC_REAL_10_INFINITY;
+#else
+       result = -GFC_REAL_10_HUGE;
+#endif
+       if (len <= 0)
+         *dest = -GFC_REAL_10_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_10_QUIET_NAN)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_REAL_10_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxval_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxval_r10);
+
+void
+mmaxval_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_10 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_10 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_REAL_10_INFINITY)
+       result = -GFC_REAL_10_INFINITY;
+#else
+       result = -GFC_REAL_10_HUGE;
+#endif
+#if defined (GFC_REAL_10_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = -GFC_REAL_10_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_REAL_10_INFINITY) || defined (GFC_REAL_10_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_10_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_REAL_10_QUIET_NAN)
+               result = non_empty_p ? GFC_REAL_10_QUIET_NAN : -GFC_REAL_10_HUGE;
+#else
+               result = -GFC_REAL_10_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxval_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxval_r10);
+
+void
+smaxval_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxval_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = -GFC_REAL_10_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxval_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/maxval_r16.c
new file mode 100644 (file)
index 0000000..bc4cf27
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16)
+
+
+extern void maxval_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(maxval_r16);
+
+void
+maxval_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_REAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_REAL_16 result;
+      src = base;
+      {
+
+#if defined (GFC_REAL_16_INFINITY)
+       result = -GFC_REAL_16_INFINITY;
+#else
+       result = -GFC_REAL_16_HUGE;
+#endif
+       if (len <= 0)
+         *dest = -GFC_REAL_16_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_16_QUIET_NAN)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_REAL_16_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxval_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxval_r16);
+
+void
+mmaxval_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_16 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_REAL_16_INFINITY)
+       result = -GFC_REAL_16_INFINITY;
+#else
+       result = -GFC_REAL_16_HUGE;
+#endif
+#if defined (GFC_REAL_16_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = -GFC_REAL_16_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_REAL_16_INFINITY) || defined (GFC_REAL_16_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_16_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_REAL_16_QUIET_NAN)
+               result = non_empty_p ? GFC_REAL_16_QUIET_NAN : -GFC_REAL_16_HUGE;
+#else
+               result = -GFC_REAL_16_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxval_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxval_r16);
+
+void
+smaxval_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxval_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = -GFC_REAL_16_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxval_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/maxval_r4.c
new file mode 100644 (file)
index 0000000..d7e25ee
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_REAL_4)
+
+
+extern void maxval_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(maxval_r4);
+
+void
+maxval_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_REAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_REAL_4 result;
+      src = base;
+      {
+
+#if defined (GFC_REAL_4_INFINITY)
+       result = -GFC_REAL_4_INFINITY;
+#else
+       result = -GFC_REAL_4_HUGE;
+#endif
+       if (len <= 0)
+         *dest = -GFC_REAL_4_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_4_QUIET_NAN)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_REAL_4_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxval_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxval_r4);
+
+void
+mmaxval_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_4 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_REAL_4_INFINITY)
+       result = -GFC_REAL_4_INFINITY;
+#else
+       result = -GFC_REAL_4_HUGE;
+#endif
+#if defined (GFC_REAL_4_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = -GFC_REAL_4_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_REAL_4_INFINITY) || defined (GFC_REAL_4_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_4_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_REAL_4_QUIET_NAN)
+               result = non_empty_p ? GFC_REAL_4_QUIET_NAN : -GFC_REAL_4_HUGE;
+#else
+               result = -GFC_REAL_4_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxval_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxval_r4);
+
+void
+smaxval_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxval_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = -GFC_REAL_4_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/maxval_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/maxval_r8.c
new file mode 100644 (file)
index 0000000..21c08e9
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_REAL_8)
+
+
+extern void maxval_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(maxval_r8);
+
+void
+maxval_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_REAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MAXVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_REAL_8 result;
+      src = base;
+      {
+
+#if defined (GFC_REAL_8_INFINITY)
+       result = -GFC_REAL_8_INFINITY;
+#else
+       result = -GFC_REAL_8_HUGE;
+#endif
+       if (len <= 0)
+         *dest = -GFC_REAL_8_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_8_QUIET_NAN)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_REAL_8_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mmaxval_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mmaxval_r8);
+
+void
+mmaxval_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_8 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MAXVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MAXVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MAXVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_REAL_8_INFINITY)
+       result = -GFC_REAL_8_INFINITY;
+#else
+       result = -GFC_REAL_8_HUGE;
+#endif
+#if defined (GFC_REAL_8_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = -GFC_REAL_8_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_REAL_8_INFINITY) || defined (GFC_REAL_8_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_8_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_REAL_8_QUIET_NAN)
+               result = non_empty_p ? GFC_REAL_8_QUIET_NAN : -GFC_REAL_8_HUGE;
+#else
+               result = -GFC_REAL_8_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void smaxval_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(smaxval_r8);
+
+void
+smaxval_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      maxval_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MAXVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MAXVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = -GFC_REAL_8_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i1.c
new file mode 100644 (file)
index 0000000..2fbd760
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc0_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array);
+export_proto(minloc0_16_i1);
+
+void
+minloc0_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_1 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_1 minval;
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    minval = GFC_INTEGER_1_INFINITY;
+#else
+    minval = GFC_INTEGER_1_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_16_i1);
+
+void
+mminloc0_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_1 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_1 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    minval = GFC_INTEGER_1_INFINITY;
+#else
+    minval = GFC_INTEGER_1_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_16_i1);
+
+void
+sminloc0_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      minloc0_16_i1 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i16.c
new file mode 100644 (file)
index 0000000..613ad48
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc0_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array);
+export_proto(minloc0_16_i16);
+
+void
+minloc0_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_16 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_16 minval;
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    minval = GFC_INTEGER_16_INFINITY;
+#else
+    minval = GFC_INTEGER_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_16_i16);
+
+void
+mminloc0_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_16 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    minval = GFC_INTEGER_16_INFINITY;
+#else
+    minval = GFC_INTEGER_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_16_i16);
+
+void
+sminloc0_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      minloc0_16_i16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i2.c
new file mode 100644 (file)
index 0000000..7591cd5
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc0_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array);
+export_proto(minloc0_16_i2);
+
+void
+minloc0_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_2 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_2 minval;
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    minval = GFC_INTEGER_2_INFINITY;
+#else
+    minval = GFC_INTEGER_2_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_16_i2);
+
+void
+mminloc0_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_2 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_2 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    minval = GFC_INTEGER_2_INFINITY;
+#else
+    minval = GFC_INTEGER_2_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_16_i2);
+
+void
+sminloc0_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      minloc0_16_i2 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i4.c
new file mode 100644 (file)
index 0000000..85601fb
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc0_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array);
+export_proto(minloc0_16_i4);
+
+void
+minloc0_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_4 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_4 minval;
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    minval = GFC_INTEGER_4_INFINITY;
+#else
+    minval = GFC_INTEGER_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_16_i4);
+
+void
+mminloc0_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_4 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    minval = GFC_INTEGER_4_INFINITY;
+#else
+    minval = GFC_INTEGER_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_16_i4);
+
+void
+sminloc0_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      minloc0_16_i4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_i8.c
new file mode 100644 (file)
index 0000000..88e1ee8
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc0_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array);
+export_proto(minloc0_16_i8);
+
+void
+minloc0_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_8 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_8 minval;
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    minval = GFC_INTEGER_8_INFINITY;
+#else
+    minval = GFC_INTEGER_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_16_i8);
+
+void
+mminloc0_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_INTEGER_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_8 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    minval = GFC_INTEGER_8_INFINITY;
+#else
+    minval = GFC_INTEGER_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_16_i8);
+
+void
+sminloc0_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      minloc0_16_i8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r10.c
new file mode 100644 (file)
index 0000000..7bfc7a7
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc0_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array);
+export_proto(minloc0_16_r10);
+
+void
+minloc0_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_10 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_10 minval;
+#if defined(GFC_REAL_10_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_10_INFINITY)
+    minval = GFC_REAL_10_INFINITY;
+#else
+    minval = GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_10_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_16_r10);
+
+void
+mminloc0_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_REAL_10 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_10 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_10_INFINITY)
+    minval = GFC_REAL_10_INFINITY;
+#else
+    minval = GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_10_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_16_r10);
+
+void
+sminloc0_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      minloc0_16_r10 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r16.c
new file mode 100644 (file)
index 0000000..d408854
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc0_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array);
+export_proto(minloc0_16_r16);
+
+void
+minloc0_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_16 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_16 minval;
+#if defined(GFC_REAL_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_16_INFINITY)
+    minval = GFC_REAL_16_INFINITY;
+#else
+    minval = GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_16_r16);
+
+void
+mminloc0_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_REAL_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_16 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_16_INFINITY)
+    minval = GFC_REAL_16_INFINITY;
+#else
+    minval = GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_16_r16);
+
+void
+sminloc0_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      minloc0_16_r16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r4.c
new file mode 100644 (file)
index 0000000..6b35a7a
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc0_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array);
+export_proto(minloc0_16_r4);
+
+void
+minloc0_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_4 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_4 minval;
+#if defined(GFC_REAL_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_4_INFINITY)
+    minval = GFC_REAL_4_INFINITY;
+#else
+    minval = GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_16_r4);
+
+void
+mminloc0_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_REAL_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_4 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_4_INFINITY)
+    minval = GFC_REAL_4_INFINITY;
+#else
+    minval = GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_16_r4);
+
+void
+sminloc0_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      minloc0_16_r4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_16_r8.c
new file mode 100644 (file)
index 0000000..c9ee9bf
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc0_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array);
+export_proto(minloc0_16_r8);
+
+void
+minloc0_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_8 *base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_8 minval;
+#if defined(GFC_REAL_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_8_INFINITY)
+    minval = GFC_REAL_8_INFINITY;
+#else
+    minval = GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_16_r8);
+
+void
+mminloc0_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_16 *dest;
+  const GFC_REAL_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_8 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_8_INFINITY)
+    minval = GFC_REAL_8_INFINITY;
+#else
+    minval = GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_16_r8);
+
+void
+sminloc0_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_16 *dest;
+
+  if (*mask)
+    {
+      minloc0_16_r8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i1.c
new file mode 100644 (file)
index 0000000..0187a3d
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc0_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array);
+export_proto(minloc0_4_i1);
+
+void
+minloc0_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_1 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_1 minval;
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    minval = GFC_INTEGER_1_INFINITY;
+#else
+    minval = GFC_INTEGER_1_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_4_i1);
+
+void
+mminloc0_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_1 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_1 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    minval = GFC_INTEGER_1_INFINITY;
+#else
+    minval = GFC_INTEGER_1_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_4_i1);
+
+void
+sminloc0_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      minloc0_4_i1 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i16.c
new file mode 100644 (file)
index 0000000..ce3cd27
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc0_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array);
+export_proto(minloc0_4_i16);
+
+void
+minloc0_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_16 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_16 minval;
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    minval = GFC_INTEGER_16_INFINITY;
+#else
+    minval = GFC_INTEGER_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_4_i16);
+
+void
+mminloc0_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_16 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    minval = GFC_INTEGER_16_INFINITY;
+#else
+    minval = GFC_INTEGER_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_4_i16);
+
+void
+sminloc0_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      minloc0_4_i16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i2.c
new file mode 100644 (file)
index 0000000..cedfbf3
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc0_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array);
+export_proto(minloc0_4_i2);
+
+void
+minloc0_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_2 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_2 minval;
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    minval = GFC_INTEGER_2_INFINITY;
+#else
+    minval = GFC_INTEGER_2_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_4_i2);
+
+void
+mminloc0_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_2 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_2 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    minval = GFC_INTEGER_2_INFINITY;
+#else
+    minval = GFC_INTEGER_2_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_4_i2);
+
+void
+sminloc0_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      minloc0_4_i2 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i4.c
new file mode 100644 (file)
index 0000000..42211a9
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc0_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array);
+export_proto(minloc0_4_i4);
+
+void
+minloc0_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_4 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_4 minval;
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    minval = GFC_INTEGER_4_INFINITY;
+#else
+    minval = GFC_INTEGER_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_4_i4);
+
+void
+mminloc0_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_4 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    minval = GFC_INTEGER_4_INFINITY;
+#else
+    minval = GFC_INTEGER_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_4_i4);
+
+void
+sminloc0_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      minloc0_4_i4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_i8.c
new file mode 100644 (file)
index 0000000..39cc14d
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc0_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array);
+export_proto(minloc0_4_i8);
+
+void
+minloc0_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_8 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_8 minval;
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    minval = GFC_INTEGER_8_INFINITY;
+#else
+    minval = GFC_INTEGER_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_4_i8);
+
+void
+mminloc0_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_INTEGER_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_8 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    minval = GFC_INTEGER_8_INFINITY;
+#else
+    minval = GFC_INTEGER_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_4_i8);
+
+void
+sminloc0_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      minloc0_4_i8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r10.c
new file mode 100644 (file)
index 0000000..9edd105
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc0_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array);
+export_proto(minloc0_4_r10);
+
+void
+minloc0_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_10 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_10 minval;
+#if defined(GFC_REAL_10_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_10_INFINITY)
+    minval = GFC_REAL_10_INFINITY;
+#else
+    minval = GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_10_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_4_r10);
+
+void
+mminloc0_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_REAL_10 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_10 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_10_INFINITY)
+    minval = GFC_REAL_10_INFINITY;
+#else
+    minval = GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_10_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_4_r10);
+
+void
+sminloc0_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      minloc0_4_r10 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r16.c
new file mode 100644 (file)
index 0000000..0cb3ee0
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc0_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array);
+export_proto(minloc0_4_r16);
+
+void
+minloc0_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_16 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_16 minval;
+#if defined(GFC_REAL_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_16_INFINITY)
+    minval = GFC_REAL_16_INFINITY;
+#else
+    minval = GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_4_r16);
+
+void
+mminloc0_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_REAL_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_16 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_16_INFINITY)
+    minval = GFC_REAL_16_INFINITY;
+#else
+    minval = GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_4_r16);
+
+void
+sminloc0_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      minloc0_4_r16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r4.c
new file mode 100644 (file)
index 0000000..817e61e
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc0_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array);
+export_proto(minloc0_4_r4);
+
+void
+minloc0_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_4 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_4 minval;
+#if defined(GFC_REAL_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_4_INFINITY)
+    minval = GFC_REAL_4_INFINITY;
+#else
+    minval = GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_4_r4);
+
+void
+mminloc0_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_REAL_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_4 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_4_INFINITY)
+    minval = GFC_REAL_4_INFINITY;
+#else
+    minval = GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_4_r4);
+
+void
+sminloc0_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      minloc0_4_r4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_4_r8.c
new file mode 100644 (file)
index 0000000..84c219b
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc0_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array);
+export_proto(minloc0_4_r8);
+
+void
+minloc0_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_8 *base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_8 minval;
+#if defined(GFC_REAL_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_8_INFINITY)
+    minval = GFC_REAL_8_INFINITY;
+#else
+    minval = GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_4_r8);
+
+void
+mminloc0_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_4 *dest;
+  const GFC_REAL_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_8 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_8_INFINITY)
+    minval = GFC_REAL_8_INFINITY;
+#else
+    minval = GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_4_r8);
+
+void
+sminloc0_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_4 *dest;
+
+  if (*mask)
+    {
+      minloc0_4_r8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i1.c
new file mode 100644 (file)
index 0000000..52f4f50
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc0_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array);
+export_proto(minloc0_8_i1);
+
+void
+minloc0_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_1 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_1 minval;
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    minval = GFC_INTEGER_1_INFINITY;
+#else
+    minval = GFC_INTEGER_1_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_8_i1);
+
+void
+mminloc0_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_1 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_1 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_1_INFINITY)
+    minval = GFC_INTEGER_1_INFINITY;
+#else
+    minval = GFC_INTEGER_1_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_1_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_8_i1);
+
+void
+sminloc0_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      minloc0_8_i1 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i16.c
new file mode 100644 (file)
index 0000000..980cd7e
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc0_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array);
+export_proto(minloc0_8_i16);
+
+void
+minloc0_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_16 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_16 minval;
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    minval = GFC_INTEGER_16_INFINITY;
+#else
+    minval = GFC_INTEGER_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_8_i16);
+
+void
+mminloc0_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_16 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_16_INFINITY)
+    minval = GFC_INTEGER_16_INFINITY;
+#else
+    minval = GFC_INTEGER_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_8_i16);
+
+void
+sminloc0_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      minloc0_8_i16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i2.c
new file mode 100644 (file)
index 0000000..26f79d4
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc0_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array);
+export_proto(minloc0_8_i2);
+
+void
+minloc0_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_2 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_2 minval;
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    minval = GFC_INTEGER_2_INFINITY;
+#else
+    minval = GFC_INTEGER_2_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_8_i2);
+
+void
+mminloc0_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_2 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_2 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_2_INFINITY)
+    minval = GFC_INTEGER_2_INFINITY;
+#else
+    minval = GFC_INTEGER_2_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_2_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_8_i2);
+
+void
+sminloc0_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      minloc0_8_i2 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i4.c
new file mode 100644 (file)
index 0000000..87f1927
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc0_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array);
+export_proto(minloc0_8_i4);
+
+void
+minloc0_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_4 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_4 minval;
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    minval = GFC_INTEGER_4_INFINITY;
+#else
+    minval = GFC_INTEGER_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_8_i4);
+
+void
+mminloc0_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_4 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_4_INFINITY)
+    minval = GFC_INTEGER_4_INFINITY;
+#else
+    minval = GFC_INTEGER_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_8_i4);
+
+void
+sminloc0_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      minloc0_8_i4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_i8.c
new file mode 100644 (file)
index 0000000..7305962
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc0_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array);
+export_proto(minloc0_8_i8);
+
+void
+minloc0_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_INTEGER_8 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_INTEGER_8 minval;
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    minval = GFC_INTEGER_8_INFINITY;
+#else
+    minval = GFC_INTEGER_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_8_i8);
+
+void
+mminloc0_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_INTEGER_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_INTEGER_8 minval;
+   int fast = 0;
+
+#if defined(GFC_INTEGER_8_INFINITY)
+    minval = GFC_INTEGER_8_INFINITY;
+#else
+    minval = GFC_INTEGER_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_INTEGER_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_8_i8);
+
+void
+sminloc0_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      minloc0_8_i8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r10.c
new file mode 100644 (file)
index 0000000..38ba7f0
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc0_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array);
+export_proto(minloc0_8_r10);
+
+void
+minloc0_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_10 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_10 minval;
+#if defined(GFC_REAL_10_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_10_INFINITY)
+    minval = GFC_REAL_10_INFINITY;
+#else
+    minval = GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_10_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_8_r10);
+
+void
+mminloc0_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_REAL_10 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_10 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_10_INFINITY)
+    minval = GFC_REAL_10_INFINITY;
+#else
+    minval = GFC_REAL_10_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_10_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_8_r10);
+
+void
+sminloc0_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      minloc0_8_r10 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r16.c
new file mode 100644 (file)
index 0000000..29b37f4
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc0_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array);
+export_proto(minloc0_8_r16);
+
+void
+minloc0_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_16 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_16 minval;
+#if defined(GFC_REAL_16_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_16_INFINITY)
+    minval = GFC_REAL_16_INFINITY;
+#else
+    minval = GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_16_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_8_r16);
+
+void
+mminloc0_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_REAL_16 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_16 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_16_INFINITY)
+    minval = GFC_REAL_16_INFINITY;
+#else
+    minval = GFC_REAL_16_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_16_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_8_r16);
+
+void
+sminloc0_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      minloc0_8_r16 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r4.c
new file mode 100644 (file)
index 0000000..cf4c3b6
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc0_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array);
+export_proto(minloc0_8_r4);
+
+void
+minloc0_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_4 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_4 minval;
+#if defined(GFC_REAL_4_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_4_INFINITY)
+    minval = GFC_REAL_4_INFINITY;
+#else
+    minval = GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_4_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_8_r4);
+
+void
+mminloc0_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_REAL_4 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_4 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_4_INFINITY)
+    minval = GFC_REAL_4_INFINITY;
+#else
+    minval = GFC_REAL_4_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_4_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_8_r4);
+
+void
+sminloc0_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      minloc0_8_r4 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc0_8_r8.c
new file mode 100644 (file)
index 0000000..3c5d338
--- /dev/null
@@ -0,0 +1,383 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc0_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array);
+export_proto(minloc0_8_r8);
+
+void
+minloc0_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const GFC_REAL_8 *base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+
+    GFC_REAL_8 minval;
+#if defined(GFC_REAL_8_QUIET_NAN)
+    int fast = 0;
+#endif
+
+#if defined(GFC_REAL_8_INFINITY)
+    minval = GFC_REAL_8_INFINITY;
+#else
+    minval = GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+#if defined(GFC_REAL_8_QUIET_NAN)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void mminloc0_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, gfc_array_l1 * const restrict);
+export_proto(mminloc0_8_r8);
+
+void
+mminloc0_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  GFC_INTEGER_8 *dest;
+  const GFC_REAL_8 *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "MINLOC");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+
+  GFC_REAL_8 minval;
+   int fast = 0;
+
+#if defined(GFC_REAL_8_INFINITY)
+    minval = GFC_REAL_8_INFINITY;
+#else
+    minval = GFC_REAL_8_HUGE;
+#endif
+  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined(GFC_REAL_8_QUIET_NAN)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }
+         /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}
+
+
+extern void sminloc0_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, GFC_LOGICAL_4 *);
+export_proto(sminloc0_8_r8);
+
+void
+sminloc0_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  GFC_INTEGER_8 *dest;
+
+  if (*mask)
+    {
+      minloc0_8_r8 (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "MINLOC");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = 0 ;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i1.c
new file mode 100644 (file)
index 0000000..8b4b53f
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc1_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(minloc1_16_i1);
+
+void
+minloc1_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_1 minval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       minval = GFC_INTEGER_1_INFINITY;
+#else
+       minval = GFC_INTEGER_1_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_16_i1);
+
+void
+mminloc1_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_1 minval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       minval = GFC_INTEGER_1_INFINITY;
+#else
+       minval = GFC_INTEGER_1_HUGE;
+#endif
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_16_i1 (gfc_array_i16 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_16_i1);
+
+void
+sminloc1_16_i1 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_16_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i16.c
new file mode 100644 (file)
index 0000000..3a18e8c
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc1_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(minloc1_16_i16);
+
+void
+minloc1_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_16 minval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       minval = GFC_INTEGER_16_INFINITY;
+#else
+       minval = GFC_INTEGER_16_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_16_i16);
+
+void
+mminloc1_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_16 minval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       minval = GFC_INTEGER_16_INFINITY;
+#else
+       minval = GFC_INTEGER_16_HUGE;
+#endif
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_16_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_16_i16);
+
+void
+sminloc1_16_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_16_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i2.c
new file mode 100644 (file)
index 0000000..bc13bee
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc1_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(minloc1_16_i2);
+
+void
+minloc1_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_2 minval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       minval = GFC_INTEGER_2_INFINITY;
+#else
+       minval = GFC_INTEGER_2_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_16_i2);
+
+void
+mminloc1_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_2 minval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       minval = GFC_INTEGER_2_INFINITY;
+#else
+       minval = GFC_INTEGER_2_HUGE;
+#endif
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_16_i2 (gfc_array_i16 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_16_i2);
+
+void
+sminloc1_16_i2 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_16_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i4.c
new file mode 100644 (file)
index 0000000..84d131a
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc1_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(minloc1_16_i4);
+
+void
+minloc1_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_4 minval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       minval = GFC_INTEGER_4_INFINITY;
+#else
+       minval = GFC_INTEGER_4_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_16_i4);
+
+void
+mminloc1_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_4 minval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       minval = GFC_INTEGER_4_INFINITY;
+#else
+       minval = GFC_INTEGER_4_HUGE;
+#endif
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_16_i4 (gfc_array_i16 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_16_i4);
+
+void
+sminloc1_16_i4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_16_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_i8.c
new file mode 100644 (file)
index 0000000..1f3e054
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc1_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(minloc1_16_i8);
+
+void
+minloc1_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_INTEGER_8 minval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       minval = GFC_INTEGER_8_INFINITY;
+#else
+       minval = GFC_INTEGER_8_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_16_i8);
+
+void
+mminloc1_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_8 minval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       minval = GFC_INTEGER_8_INFINITY;
+#else
+       minval = GFC_INTEGER_8_HUGE;
+#endif
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_16_i8 (gfc_array_i16 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_16_i8);
+
+void
+sminloc1_16_i8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_16_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r10.c
new file mode 100644 (file)
index 0000000..6bda151
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc1_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(minloc1_16_r10);
+
+void
+minloc1_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_REAL_10 minval;
+#if defined (GFC_REAL_10_INFINITY)
+       minval = GFC_REAL_10_INFINITY;
+#else
+       minval = GFC_REAL_10_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_10_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_16_r10);
+
+void
+mminloc1_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_10 minval;
+#if defined (GFC_REAL_10_INFINITY)
+       minval = GFC_REAL_10_INFINITY;
+#else
+       minval = GFC_REAL_10_HUGE;
+#endif
+#if defined (GFC_REAL_10_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_10_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_10_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_16_r10 (gfc_array_i16 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_16_r10);
+
+void
+sminloc1_16_r10 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_16_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r16.c
new file mode 100644 (file)
index 0000000..c31cf4b
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc1_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(minloc1_16_r16);
+
+void
+minloc1_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_REAL_16 minval;
+#if defined (GFC_REAL_16_INFINITY)
+       minval = GFC_REAL_16_INFINITY;
+#else
+       minval = GFC_REAL_16_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_16_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_16_r16);
+
+void
+mminloc1_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_16 minval;
+#if defined (GFC_REAL_16_INFINITY)
+       minval = GFC_REAL_16_INFINITY;
+#else
+       minval = GFC_REAL_16_HUGE;
+#endif
+#if defined (GFC_REAL_16_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_16_r16 (gfc_array_i16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_16_r16);
+
+void
+sminloc1_16_r16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_16_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r4.c
new file mode 100644 (file)
index 0000000..52ec2b0
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc1_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(minloc1_16_r4);
+
+void
+minloc1_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_REAL_4 minval;
+#if defined (GFC_REAL_4_INFINITY)
+       minval = GFC_REAL_4_INFINITY;
+#else
+       minval = GFC_REAL_4_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_4_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_16_r4);
+
+void
+mminloc1_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_4 minval;
+#if defined (GFC_REAL_4_INFINITY)
+       minval = GFC_REAL_4_INFINITY;
+#else
+       minval = GFC_REAL_4_HUGE;
+#endif
+#if defined (GFC_REAL_4_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_16_r4 (gfc_array_i16 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_16_r4);
+
+void
+sminloc1_16_r4 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_16_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_16_r8.c
new file mode 100644 (file)
index 0000000..a53ed34
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minloc1_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(minloc1_16_r8);
+
+void
+minloc1_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+       GFC_REAL_8 minval;
+#if defined (GFC_REAL_8_INFINITY)
+       minval = GFC_REAL_8_INFINITY;
+#else
+       minval = GFC_REAL_8_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_8_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_16_r8);
+
+void
+mminloc1_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_8 minval;
+#if defined (GFC_REAL_8_INFINITY)
+       minval = GFC_REAL_8_INFINITY;
+#else
+       minval = GFC_REAL_8_HUGE;
+#endif
+#if defined (GFC_REAL_8_QUIET_NAN)
+       GFC_INTEGER_16 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_16)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_16)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_16)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_16_r8 (gfc_array_i16 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_16_r8);
+
+void
+sminloc1_16_r8 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_16_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i1.c
new file mode 100644 (file)
index 0000000..e8af361
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc1_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(minloc1_4_i1);
+
+void
+minloc1_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_1 minval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       minval = GFC_INTEGER_1_INFINITY;
+#else
+       minval = GFC_INTEGER_1_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_4_i1);
+
+void
+mminloc1_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_1 minval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       minval = GFC_INTEGER_1_INFINITY;
+#else
+       minval = GFC_INTEGER_1_HUGE;
+#endif
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_4_i1 (gfc_array_i4 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_4_i1);
+
+void
+sminloc1_4_i1 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_4_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i16.c
new file mode 100644 (file)
index 0000000..8d3da20
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc1_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(minloc1_4_i16);
+
+void
+minloc1_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_16 minval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       minval = GFC_INTEGER_16_INFINITY;
+#else
+       minval = GFC_INTEGER_16_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_4_i16);
+
+void
+mminloc1_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_16 minval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       minval = GFC_INTEGER_16_INFINITY;
+#else
+       minval = GFC_INTEGER_16_HUGE;
+#endif
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_4_i16 (gfc_array_i4 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_4_i16);
+
+void
+sminloc1_4_i16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_4_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i2.c
new file mode 100644 (file)
index 0000000..e7f2449
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc1_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(minloc1_4_i2);
+
+void
+minloc1_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_2 minval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       minval = GFC_INTEGER_2_INFINITY;
+#else
+       minval = GFC_INTEGER_2_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_4_i2);
+
+void
+mminloc1_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_2 minval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       minval = GFC_INTEGER_2_INFINITY;
+#else
+       minval = GFC_INTEGER_2_HUGE;
+#endif
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_4_i2 (gfc_array_i4 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_4_i2);
+
+void
+sminloc1_4_i2 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_4_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i4.c
new file mode 100644 (file)
index 0000000..94d45c9
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc1_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(minloc1_4_i4);
+
+void
+minloc1_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_4 minval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       minval = GFC_INTEGER_4_INFINITY;
+#else
+       minval = GFC_INTEGER_4_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_4_i4);
+
+void
+mminloc1_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_4 minval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       minval = GFC_INTEGER_4_INFINITY;
+#else
+       minval = GFC_INTEGER_4_HUGE;
+#endif
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_4_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_4_i4);
+
+void
+sminloc1_4_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_4_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_i8.c
new file mode 100644 (file)
index 0000000..fa07bcb
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc1_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(minloc1_4_i8);
+
+void
+minloc1_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_INTEGER_8 minval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       minval = GFC_INTEGER_8_INFINITY;
+#else
+       minval = GFC_INTEGER_8_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_4_i8);
+
+void
+mminloc1_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_8 minval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       minval = GFC_INTEGER_8_INFINITY;
+#else
+       minval = GFC_INTEGER_8_HUGE;
+#endif
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_4_i8 (gfc_array_i4 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_4_i8);
+
+void
+sminloc1_4_i8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_4_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r10.c
new file mode 100644 (file)
index 0000000..5cb23a6
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc1_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(minloc1_4_r10);
+
+void
+minloc1_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_REAL_10 minval;
+#if defined (GFC_REAL_10_INFINITY)
+       minval = GFC_REAL_10_INFINITY;
+#else
+       minval = GFC_REAL_10_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_10_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_4_r10);
+
+void
+mminloc1_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_10 minval;
+#if defined (GFC_REAL_10_INFINITY)
+       minval = GFC_REAL_10_INFINITY;
+#else
+       minval = GFC_REAL_10_HUGE;
+#endif
+#if defined (GFC_REAL_10_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_10_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_10_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_4_r10 (gfc_array_i4 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_4_r10);
+
+void
+sminloc1_4_r10 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_4_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r16.c
new file mode 100644 (file)
index 0000000..40854a1
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc1_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(minloc1_4_r16);
+
+void
+minloc1_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_REAL_16 minval;
+#if defined (GFC_REAL_16_INFINITY)
+       minval = GFC_REAL_16_INFINITY;
+#else
+       minval = GFC_REAL_16_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_16_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_4_r16);
+
+void
+mminloc1_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_16 minval;
+#if defined (GFC_REAL_16_INFINITY)
+       minval = GFC_REAL_16_INFINITY;
+#else
+       minval = GFC_REAL_16_HUGE;
+#endif
+#if defined (GFC_REAL_16_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_4_r16 (gfc_array_i4 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_4_r16);
+
+void
+sminloc1_4_r16 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_4_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r4.c
new file mode 100644 (file)
index 0000000..4231d18
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc1_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(minloc1_4_r4);
+
+void
+minloc1_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_REAL_4 minval;
+#if defined (GFC_REAL_4_INFINITY)
+       minval = GFC_REAL_4_INFINITY;
+#else
+       minval = GFC_REAL_4_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_4_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_4_r4);
+
+void
+mminloc1_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_4 minval;
+#if defined (GFC_REAL_4_INFINITY)
+       minval = GFC_REAL_4_INFINITY;
+#else
+       minval = GFC_REAL_4_HUGE;
+#endif
+#if defined (GFC_REAL_4_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_4_r4 (gfc_array_i4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_4_r4);
+
+void
+sminloc1_4_r4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_4_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_4_r8.c
new file mode 100644 (file)
index 0000000..8e5e5dd
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minloc1_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(minloc1_4_r8);
+
+void
+minloc1_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+       GFC_REAL_8 minval;
+#if defined (GFC_REAL_8_INFINITY)
+       minval = GFC_REAL_8_INFINITY;
+#else
+       minval = GFC_REAL_8_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_8_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_4_r8);
+
+void
+mminloc1_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_8 minval;
+#if defined (GFC_REAL_8_INFINITY)
+       minval = GFC_REAL_8_INFINITY;
+#else
+       minval = GFC_REAL_8_HUGE;
+#endif
+#if defined (GFC_REAL_8_QUIET_NAN)
+       GFC_INTEGER_4 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_4)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_4)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_4)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_4_r8 (gfc_array_i4 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_4_r8);
+
+void
+sminloc1_4_r8 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_4_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i1.c
new file mode 100644 (file)
index 0000000..9a54335
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc1_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(minloc1_8_i1);
+
+void
+minloc1_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_1 minval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       minval = GFC_INTEGER_1_INFINITY;
+#else
+       minval = GFC_INTEGER_1_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_8_i1);
+
+void
+mminloc1_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_1 minval;
+#if defined (GFC_INTEGER_1_INFINITY)
+       minval = GFC_INTEGER_1_INFINITY;
+#else
+       minval = GFC_INTEGER_1_HUGE;
+#endif
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_8_i1 (gfc_array_i8 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_8_i1);
+
+void
+sminloc1_8_i1 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_8_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i16.c
new file mode 100644 (file)
index 0000000..f0b477e
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc1_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(minloc1_8_i16);
+
+void
+minloc1_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_16 minval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       minval = GFC_INTEGER_16_INFINITY;
+#else
+       minval = GFC_INTEGER_16_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_8_i16);
+
+void
+mminloc1_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_16 minval;
+#if defined (GFC_INTEGER_16_INFINITY)
+       minval = GFC_INTEGER_16_INFINITY;
+#else
+       minval = GFC_INTEGER_16_HUGE;
+#endif
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_8_i16 (gfc_array_i8 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_8_i16);
+
+void
+sminloc1_8_i16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_8_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i2.c
new file mode 100644 (file)
index 0000000..9d3d14e
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc1_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(minloc1_8_i2);
+
+void
+minloc1_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_2 minval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       minval = GFC_INTEGER_2_INFINITY;
+#else
+       minval = GFC_INTEGER_2_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_8_i2);
+
+void
+mminloc1_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_2 minval;
+#if defined (GFC_INTEGER_2_INFINITY)
+       minval = GFC_INTEGER_2_INFINITY;
+#else
+       minval = GFC_INTEGER_2_HUGE;
+#endif
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_8_i2 (gfc_array_i8 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_8_i2);
+
+void
+sminloc1_8_i2 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_8_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i4.c
new file mode 100644 (file)
index 0000000..edac05c
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc1_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(minloc1_8_i4);
+
+void
+minloc1_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_4 minval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       minval = GFC_INTEGER_4_INFINITY;
+#else
+       minval = GFC_INTEGER_4_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_8_i4);
+
+void
+mminloc1_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_4 minval;
+#if defined (GFC_INTEGER_4_INFINITY)
+       minval = GFC_INTEGER_4_INFINITY;
+#else
+       minval = GFC_INTEGER_4_HUGE;
+#endif
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_8_i4 (gfc_array_i8 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_8_i4);
+
+void
+sminloc1_8_i4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_8_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_i8.c
new file mode 100644 (file)
index 0000000..3c0f441
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc1_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(minloc1_8_i8);
+
+void
+minloc1_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_INTEGER_8 minval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       minval = GFC_INTEGER_8_INFINITY;
+#else
+       minval = GFC_INTEGER_8_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_8_i8);
+
+void
+mminloc1_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_INTEGER_8 minval;
+#if defined (GFC_INTEGER_8_INFINITY)
+       minval = GFC_INTEGER_8_INFINITY;
+#else
+       minval = GFC_INTEGER_8_HUGE;
+#endif
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_8_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_8_i8);
+
+void
+sminloc1_8_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_8_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r10.c
new file mode 100644 (file)
index 0000000..a9239d2
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc1_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(minloc1_8_r10);
+
+void
+minloc1_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_REAL_10 minval;
+#if defined (GFC_REAL_10_INFINITY)
+       minval = GFC_REAL_10_INFINITY;
+#else
+       minval = GFC_REAL_10_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_10_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_8_r10);
+
+void
+mminloc1_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_10 minval;
+#if defined (GFC_REAL_10_INFINITY)
+       minval = GFC_REAL_10_INFINITY;
+#else
+       minval = GFC_REAL_10_HUGE;
+#endif
+#if defined (GFC_REAL_10_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_10_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_10_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_8_r10 (gfc_array_i8 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_8_r10);
+
+void
+sminloc1_8_r10 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_8_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r16.c
new file mode 100644 (file)
index 0000000..953ada7
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc1_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(minloc1_8_r16);
+
+void
+minloc1_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_REAL_16 minval;
+#if defined (GFC_REAL_16_INFINITY)
+       minval = GFC_REAL_16_INFINITY;
+#else
+       minval = GFC_REAL_16_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_16_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_8_r16);
+
+void
+mminloc1_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_16 minval;
+#if defined (GFC_REAL_16_INFINITY)
+       minval = GFC_REAL_16_INFINITY;
+#else
+       minval = GFC_REAL_16_HUGE;
+#endif
+#if defined (GFC_REAL_16_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_16_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_16_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_8_r16 (gfc_array_i8 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_8_r16);
+
+void
+sminloc1_8_r16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_8_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r4.c
new file mode 100644 (file)
index 0000000..3882000
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc1_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(minloc1_8_r4);
+
+void
+minloc1_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_REAL_4 minval;
+#if defined (GFC_REAL_4_INFINITY)
+       minval = GFC_REAL_4_INFINITY;
+#else
+       minval = GFC_REAL_4_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_4_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_8_r4);
+
+void
+mminloc1_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_4 minval;
+#if defined (GFC_REAL_4_INFINITY)
+       minval = GFC_REAL_4_INFINITY;
+#else
+       minval = GFC_REAL_4_HUGE;
+#endif
+#if defined (GFC_REAL_4_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_4_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_4_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_8_r4 (gfc_array_i8 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_8_r4);
+
+void
+sminloc1_8_r4 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_8_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r8.c
new file mode 100644 (file)
index 0000000..c8d1812
--- /dev/null
@@ -0,0 +1,563 @@
+/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minloc1_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(minloc1_8_r8);
+
+void
+minloc1_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINLOC");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+       GFC_REAL_8 minval;
+#if defined (GFC_REAL_8_INFINITY)
+       minval = GFC_REAL_8_INFINITY;
+#else
+       minval = GFC_REAL_8_HUGE;
+#endif
+       result = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_8_QUIET_NAN)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminloc1_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminloc1_8_r8);
+
+void
+mminloc1_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINLOC intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINLOC");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINLOC");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+       GFC_REAL_8 minval;
+#if defined (GFC_REAL_8_INFINITY)
+       minval = GFC_REAL_8_INFINITY;
+#else
+       minval = GFC_REAL_8_HUGE;
+#endif
+#if defined (GFC_REAL_8_QUIET_NAN)
+       GFC_INTEGER_8 result2 = 0;
+#endif
+       result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_8_QUIET_NAN)
+                   if (!result2)
+                     result2 = (GFC_INTEGER_8)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (GFC_INTEGER_8)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined (GFC_REAL_8_QUIET_NAN)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (GFC_INTEGER_8)n + 1;
+                 }
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminloc1_8_r8 (gfc_array_i8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminloc1_8_r8);
+
+void
+sminloc1_8_r8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minloc1_8_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINLOC intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINLOC intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minval_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/minval_i1.c
new file mode 100644 (file)
index 0000000..d9ee1d7
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_1)
+
+
+extern void minval_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(minval_i1);
+
+void
+minval_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_1 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_1_INFINITY)
+       result = GFC_INTEGER_1_INFINITY;
+#else
+       result = GFC_INTEGER_1_HUGE;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_1_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_1_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminval_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminval_i1);
+
+void
+mminval_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_1 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_1_INFINITY)
+       result = GFC_INTEGER_1_INFINITY;
+#else
+       result = GFC_INTEGER_1_HUGE;
+#endif
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_1_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_1_INFINITY) || defined (GFC_INTEGER_1_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_1_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_1_QUIET_NAN : GFC_INTEGER_1_HUGE;
+#else
+               result = GFC_INTEGER_1_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminval_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminval_i1);
+
+void
+sminval_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minval_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = GFC_INTEGER_1_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minval_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/minval_i16.c
new file mode 100644 (file)
index 0000000..8394547
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void minval_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(minval_i16);
+
+void
+minval_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_16_INFINITY)
+       result = GFC_INTEGER_16_INFINITY;
+#else
+       result = GFC_INTEGER_16_HUGE;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_16_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_16_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminval_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminval_i16);
+
+void
+mminval_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_16_INFINITY)
+       result = GFC_INTEGER_16_INFINITY;
+#else
+       result = GFC_INTEGER_16_HUGE;
+#endif
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_16_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_16_INFINITY) || defined (GFC_INTEGER_16_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_16_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_16_QUIET_NAN : GFC_INTEGER_16_HUGE;
+#else
+               result = GFC_INTEGER_16_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminval_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminval_i16);
+
+void
+sminval_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minval_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = GFC_INTEGER_16_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minval_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/minval_i2.c
new file mode 100644 (file)
index 0000000..9cffe84
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_2)
+
+
+extern void minval_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(minval_i2);
+
+void
+minval_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_2 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_2_INFINITY)
+       result = GFC_INTEGER_2_INFINITY;
+#else
+       result = GFC_INTEGER_2_HUGE;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_2_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_2_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminval_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminval_i2);
+
+void
+mminval_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_2 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_2_INFINITY)
+       result = GFC_INTEGER_2_INFINITY;
+#else
+       result = GFC_INTEGER_2_HUGE;
+#endif
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_2_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_2_INFINITY) || defined (GFC_INTEGER_2_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_2_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_2_QUIET_NAN : GFC_INTEGER_2_HUGE;
+#else
+               result = GFC_INTEGER_2_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminval_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminval_i2);
+
+void
+sminval_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minval_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = GFC_INTEGER_2_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minval_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/minval_i4.c
new file mode 100644 (file)
index 0000000..993116a
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void minval_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(minval_i4);
+
+void
+minval_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_4_INFINITY)
+       result = GFC_INTEGER_4_INFINITY;
+#else
+       result = GFC_INTEGER_4_HUGE;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_4_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_4_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminval_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminval_i4);
+
+void
+mminval_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_4_INFINITY)
+       result = GFC_INTEGER_4_INFINITY;
+#else
+       result = GFC_INTEGER_4_HUGE;
+#endif
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_4_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_4_INFINITY) || defined (GFC_INTEGER_4_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_4_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_4_QUIET_NAN : GFC_INTEGER_4_HUGE;
+#else
+               result = GFC_INTEGER_4_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminval_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminval_i4);
+
+void
+sminval_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minval_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = GFC_INTEGER_4_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minval_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/minval_i8.c
new file mode 100644 (file)
index 0000000..3a52b4b
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void minval_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(minval_i8);
+
+void
+minval_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+#if defined (GFC_INTEGER_8_INFINITY)
+       result = GFC_INTEGER_8_INFINITY;
+#else
+       result = GFC_INTEGER_8_HUGE;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_8_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_INTEGER_8_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminval_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminval_i8);
+
+void
+mminval_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_INTEGER_8_INFINITY)
+       result = GFC_INTEGER_8_INFINITY;
+#else
+       result = GFC_INTEGER_8_HUGE;
+#endif
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = GFC_INTEGER_8_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_INTEGER_8_INFINITY) || defined (GFC_INTEGER_8_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_INTEGER_8_QUIET_NAN)
+               result = non_empty_p ? GFC_INTEGER_8_QUIET_NAN : GFC_INTEGER_8_HUGE;
+#else
+               result = GFC_INTEGER_8_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminval_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminval_i8);
+
+void
+sminval_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minval_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = GFC_INTEGER_8_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minval_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/minval_r10.c
new file mode 100644 (file)
index 0000000..b490b3b
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_REAL_10)
+
+
+extern void minval_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(minval_r10);
+
+void
+minval_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_REAL_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_REAL_10 result;
+      src = base;
+      {
+
+#if defined (GFC_REAL_10_INFINITY)
+       result = GFC_REAL_10_INFINITY;
+#else
+       result = GFC_REAL_10_HUGE;
+#endif
+       if (len <= 0)
+         *dest = GFC_REAL_10_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_10_QUIET_NAN)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_REAL_10_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminval_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminval_r10);
+
+void
+mminval_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_10 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_10 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_REAL_10_INFINITY)
+       result = GFC_REAL_10_INFINITY;
+#else
+       result = GFC_REAL_10_HUGE;
+#endif
+#if defined (GFC_REAL_10_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = GFC_REAL_10_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_REAL_10_INFINITY) || defined (GFC_REAL_10_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_10_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_REAL_10_QUIET_NAN)
+               result = non_empty_p ? GFC_REAL_10_QUIET_NAN : GFC_REAL_10_HUGE;
+#else
+               result = GFC_REAL_10_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminval_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminval_r10);
+
+void
+sminval_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minval_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = GFC_REAL_10_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minval_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/minval_r16.c
new file mode 100644 (file)
index 0000000..701191f
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16)
+
+
+extern void minval_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(minval_r16);
+
+void
+minval_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_REAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_REAL_16 result;
+      src = base;
+      {
+
+#if defined (GFC_REAL_16_INFINITY)
+       result = GFC_REAL_16_INFINITY;
+#else
+       result = GFC_REAL_16_HUGE;
+#endif
+       if (len <= 0)
+         *dest = GFC_REAL_16_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_16_QUIET_NAN)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_REAL_16_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminval_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminval_r16);
+
+void
+mminval_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_16 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_REAL_16_INFINITY)
+       result = GFC_REAL_16_INFINITY;
+#else
+       result = GFC_REAL_16_HUGE;
+#endif
+#if defined (GFC_REAL_16_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = GFC_REAL_16_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_REAL_16_INFINITY) || defined (GFC_REAL_16_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_16_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_REAL_16_QUIET_NAN)
+               result = non_empty_p ? GFC_REAL_16_QUIET_NAN : GFC_REAL_16_HUGE;
+#else
+               result = GFC_REAL_16_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminval_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminval_r16);
+
+void
+sminval_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minval_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = GFC_REAL_16_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minval_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/minval_r4.c
new file mode 100644 (file)
index 0000000..e693765
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_REAL_4)
+
+
+extern void minval_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(minval_r4);
+
+void
+minval_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_REAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_REAL_4 result;
+      src = base;
+      {
+
+#if defined (GFC_REAL_4_INFINITY)
+       result = GFC_REAL_4_INFINITY;
+#else
+       result = GFC_REAL_4_HUGE;
+#endif
+       if (len <= 0)
+         *dest = GFC_REAL_4_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_4_QUIET_NAN)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_REAL_4_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminval_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminval_r4);
+
+void
+mminval_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_4 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_REAL_4_INFINITY)
+       result = GFC_REAL_4_INFINITY;
+#else
+       result = GFC_REAL_4_HUGE;
+#endif
+#if defined (GFC_REAL_4_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = GFC_REAL_4_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_REAL_4_INFINITY) || defined (GFC_REAL_4_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_4_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_REAL_4_QUIET_NAN)
+               result = non_empty_p ? GFC_REAL_4_QUIET_NAN : GFC_REAL_4_HUGE;
+#else
+               result = GFC_REAL_4_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminval_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminval_r4);
+
+void
+sminval_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minval_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = GFC_REAL_4_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/minval_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/minval_r8.c
new file mode 100644 (file)
index 0000000..611ee57
--- /dev/null
@@ -0,0 +1,550 @@
+/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_REAL_8)
+
+
+extern void minval_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(minval_r8);
+
+void
+minval_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_REAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "MINVAL");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_REAL_8 result;
+      src = base;
+      {
+
+#if defined (GFC_REAL_8_INFINITY)
+       result = GFC_REAL_8_INFINITY;
+#else
+       result = GFC_REAL_8_HUGE;
+#endif
+       if (len <= 0)
+         *dest = GFC_REAL_8_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+#if defined (GFC_REAL_8_QUIET_NAN)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = GFC_REAL_8_QUIET_NAN;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mminval_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mminval_r8);
+
+void
+mminval_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_8 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in MINVAL intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "MINVAL");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "MINVAL");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+#if defined (GFC_REAL_8_INFINITY)
+       result = GFC_REAL_8_INFINITY;
+#else
+       result = GFC_REAL_8_HUGE;
+#endif
+#if defined (GFC_REAL_8_QUIET_NAN)
+       int non_empty_p = 0;
+#endif
+       if (len <= 0)
+         *dest = GFC_REAL_8_HUGE;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+#if defined (GFC_REAL_8_INFINITY) || defined (GFC_REAL_8_QUIET_NAN)
+               if (*msrc)
+                 {
+#if defined (GFC_REAL_8_QUIET_NAN)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined (GFC_REAL_8_QUIET_NAN)
+               result = non_empty_p ? GFC_REAL_8_QUIET_NAN : GFC_REAL_8_HUGE;
+#else
+               result = GFC_REAL_8_HUGE;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sminval_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sminval_r8);
+
+void
+sminval_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      minval_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " MINVAL intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " MINVAL intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = GFC_REAL_8_HUGE;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/misc_specifics.F90 b/l4/pkg/libgfortran/lib/contrib/generated/misc_specifics.F90
new file mode 100644 (file)
index 0000000..558494b
--- /dev/null
@@ -0,0 +1,206 @@
+!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.
+
+#include "config.h"
+#include "kinds.inc"
+
+
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_4)
+elemental function _gfortran_specific__nint_4_4 (parm)
+   real (kind=4) , intent (in) :: parm
+   integer (kind=4) :: _gfortran_specific__nint_4_4
+   _gfortran_specific__nint_4_4 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_4)
+elemental function _gfortran_specific__nint_4_8 (parm)
+   real (kind=8) , intent (in) :: parm
+   integer (kind=4) :: _gfortran_specific__nint_4_8
+   _gfortran_specific__nint_4_8 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_4)
+elemental function _gfortran_specific__nint_4_10 (parm)
+   real (kind=10) , intent (in) :: parm
+   integer (kind=4) :: _gfortran_specific__nint_4_10
+   _gfortran_specific__nint_4_10 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_4)
+elemental function _gfortran_specific__nint_4_16 (parm)
+   real (kind=16) , intent (in) :: parm
+   integer (kind=4) :: _gfortran_specific__nint_4_16
+   _gfortran_specific__nint_4_16 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_8)
+elemental function _gfortran_specific__nint_8_4 (parm)
+   real (kind=4) , intent (in) :: parm
+   integer (kind=8) :: _gfortran_specific__nint_8_4
+   _gfortran_specific__nint_8_4 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_8)
+elemental function _gfortran_specific__nint_8_8 (parm)
+   real (kind=8) , intent (in) :: parm
+   integer (kind=8) :: _gfortran_specific__nint_8_8
+   _gfortran_specific__nint_8_8 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_8)
+elemental function _gfortran_specific__nint_8_10 (parm)
+   real (kind=10) , intent (in) :: parm
+   integer (kind=8) :: _gfortran_specific__nint_8_10
+   _gfortran_specific__nint_8_10 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_8)
+elemental function _gfortran_specific__nint_8_16 (parm)
+   real (kind=16) , intent (in) :: parm
+   integer (kind=8) :: _gfortran_specific__nint_8_16
+   _gfortran_specific__nint_8_16 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_16)
+elemental function _gfortran_specific__nint_16_4 (parm)
+   real (kind=4) , intent (in) :: parm
+   integer (kind=16) :: _gfortran_specific__nint_16_4
+   _gfortran_specific__nint_16_4 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_16)
+elemental function _gfortran_specific__nint_16_8 (parm)
+   real (kind=8) , intent (in) :: parm
+   integer (kind=16) :: _gfortran_specific__nint_16_8
+   _gfortran_specific__nint_16_8 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_16)
+elemental function _gfortran_specific__nint_16_10 (parm)
+   real (kind=10) , intent (in) :: parm
+   integer (kind=16) :: _gfortran_specific__nint_16_10
+   _gfortran_specific__nint_16_10 = nint (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_16)
+elemental function _gfortran_specific__nint_16_16 (parm)
+   real (kind=16) , intent (in) :: parm
+   integer (kind=16) :: _gfortran_specific__nint_16_16
+   _gfortran_specific__nint_16_16 = nint (parm)
+end function
+#endif
+
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+elemental function _gfortran_specific__char_1_i4 (parm)
+   integer (kind=4) , intent (in) :: parm
+   character (kind=1,len=1) :: _gfortran_specific__char_1_i4
+   _gfortran_specific__char_1_i4 = char (parm, kind=1)
+end function
+#endif
+
+#if defined (HAVE_GFC_INTEGER_8)
+elemental function _gfortran_specific__char_1_i8 (parm)
+   integer (kind=8) , intent (in) :: parm
+   character (kind=1,len=1) :: _gfortran_specific__char_1_i8
+   _gfortran_specific__char_1_i8 = char (parm, kind=1)
+end function
+#endif
+
+#if defined (HAVE_GFC_INTEGER_16)
+elemental function _gfortran_specific__char_1_i16 (parm)
+   integer (kind=16) , intent (in) :: parm
+   character (kind=1,len=1) :: _gfortran_specific__char_1_i16
+   _gfortran_specific__char_1_i16 = char (parm, kind=1)
+end function
+#endif
+
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+elemental function _gfortran_specific__len_1_i4 (parm)
+   character (kind=1,len=*) , intent (in) :: parm
+   integer (kind=4) :: _gfortran_specific__len_1_i4
+   _gfortran_specific__len_1_i4 = len (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_INTEGER_8)
+elemental function _gfortran_specific__len_1_i8 (parm)
+   character (kind=1,len=*) , intent (in) :: parm
+   integer (kind=8) :: _gfortran_specific__len_1_i8
+   _gfortran_specific__len_1_i8 = len (parm)
+end function
+#endif
+
+#if defined (HAVE_GFC_INTEGER_16)
+elemental function _gfortran_specific__len_1_i16 (parm)
+   character (kind=1,len=*) , intent (in) :: parm
+   integer (kind=16) :: _gfortran_specific__len_1_i16
+   _gfortran_specific__len_1_i16 = len (parm)
+end function
+#endif
+
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+elemental function _gfortran_specific__index_1_i4 (parm1, parm2)
+   character (kind=1,len=*) , intent (in) :: parm1, parm2
+   integer (kind=4) :: _gfortran_specific__index_1_i4
+   _gfortran_specific__index_1_i4 = index (parm1, parm2)
+end function
+#endif
+
+#if defined (HAVE_GFC_INTEGER_8)
+elemental function _gfortran_specific__index_1_i8 (parm1, parm2)
+   character (kind=1,len=*) , intent (in) :: parm1, parm2
+   integer (kind=8) :: _gfortran_specific__index_1_i8
+   _gfortran_specific__index_1_i8 = index (parm1, parm2)
+end function
+#endif
+
+#if defined (HAVE_GFC_INTEGER_16)
+elemental function _gfortran_specific__index_1_i16 (parm1, parm2)
+   character (kind=1,len=*) , intent (in) :: parm1, parm2
+   integer (kind=16) :: _gfortran_specific__index_1_i16
+   _gfortran_specific__index_1_i16 = index (parm1, parm2)
+end function
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/nearest_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/nearest_r10.c
new file mode 100644 (file)
index 0000000..2414bb3
--- /dev/null
@@ -0,0 +1,51 @@
+/* Implementation of the NEAREST intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## l
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_COPYSIGNL) && defined (HAVE_NEXTAFTERL)
+
+extern GFC_REAL_10 nearest_r10 (GFC_REAL_10 s, GFC_REAL_10 dir);
+export_proto(nearest_r10);
+
+GFC_REAL_10
+nearest_r10 (GFC_REAL_10 s, GFC_REAL_10 dir)
+{
+  dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
+  if (FLT_EVAL_METHOD != 0)
+    {
+      /* ??? Work around glibc bug on x86.  */
+      volatile GFC_REAL_10 r = MATHFUNC(nextafter) (s, dir);
+      return r;
+    }
+  else
+    return MATHFUNC(nextafter) (s, dir);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/nearest_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/nearest_r16.c
new file mode 100644 (file)
index 0000000..1e8254f
--- /dev/null
@@ -0,0 +1,55 @@
+/* Implementation of the NEAREST intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_COPYSIGNL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_NEXTAFTERL))
+
+extern GFC_REAL_16 nearest_r16 (GFC_REAL_16 s, GFC_REAL_16 dir);
+export_proto(nearest_r16);
+
+GFC_REAL_16
+nearest_r16 (GFC_REAL_16 s, GFC_REAL_16 dir)
+{
+  dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
+  if (FLT_EVAL_METHOD != 0)
+    {
+      /* ??? Work around glibc bug on x86.  */
+      volatile GFC_REAL_16 r = MATHFUNC(nextafter) (s, dir);
+      return r;
+    }
+  else
+    return MATHFUNC(nextafter) (s, dir);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/nearest_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/nearest_r4.c
new file mode 100644 (file)
index 0000000..b26faea
--- /dev/null
@@ -0,0 +1,51 @@
+/* Implementation of the NEAREST intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## f
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_COPYSIGNF) && defined (HAVE_NEXTAFTERF)
+
+extern GFC_REAL_4 nearest_r4 (GFC_REAL_4 s, GFC_REAL_4 dir);
+export_proto(nearest_r4);
+
+GFC_REAL_4
+nearest_r4 (GFC_REAL_4 s, GFC_REAL_4 dir)
+{
+  dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
+  if (FLT_EVAL_METHOD != 0)
+    {
+      /* ??? Work around glibc bug on x86.  */
+      volatile GFC_REAL_4 r = MATHFUNC(nextafter) (s, dir);
+      return r;
+    }
+  else
+    return MATHFUNC(nextafter) (s, dir);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/nearest_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/nearest_r8.c
new file mode 100644 (file)
index 0000000..81505e9
--- /dev/null
@@ -0,0 +1,51 @@
+/* Implementation of the NEAREST intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_COPYSIGN) && defined (HAVE_NEXTAFTER)
+
+extern GFC_REAL_8 nearest_r8 (GFC_REAL_8 s, GFC_REAL_8 dir);
+export_proto(nearest_r8);
+
+GFC_REAL_8
+nearest_r8 (GFC_REAL_8 s, GFC_REAL_8 dir)
+{
+  dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
+  if (FLT_EVAL_METHOD != 0)
+    {
+      /* ??? Work around glibc bug on x86.  */
+      volatile GFC_REAL_8 r = MATHFUNC(nextafter) (s, dir);
+      return r;
+    }
+  else
+    return MATHFUNC(nextafter) (s, dir);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/norm2_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/norm2_r10.c
new file mode 100644 (file)
index 0000000..5b64803
--- /dev/null
@@ -0,0 +1,211 @@
+/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_REAL_10) && defined (HAVE_SQRTL) && defined (HAVE_FABSL)
+
+#define MATHFUNC(funcname) funcname ## l
+
+
+extern void norm2_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(norm2_r10);
+
+void
+norm2_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_REAL_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " NORM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "NORM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_REAL_10 result;
+      src = base;
+      {
+
+       GFC_REAL_10 scale;
+       result = 0;
+       scale = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+         if (*src != 0)
+           {
+             GFC_REAL_10 absX, val;
+             absX = MATHFUNC(fabs) (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1 + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }
+             }
+           result = scale * MATHFUNC(sqrt) (result);
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/norm2_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/norm2_r16.c
new file mode 100644 (file)
index 0000000..66b6167
--- /dev/null
@@ -0,0 +1,215 @@
+/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_SQRTL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FABSL))
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+
+extern void norm2_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(norm2_r16);
+
+void
+norm2_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_REAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " NORM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "NORM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_REAL_16 result;
+      src = base;
+      {
+
+       GFC_REAL_16 scale;
+       result = 0;
+       scale = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+         if (*src != 0)
+           {
+             GFC_REAL_16 absX, val;
+             absX = MATHFUNC(fabs) (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1 + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }
+             }
+           result = scale * MATHFUNC(sqrt) (result);
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/norm2_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/norm2_r4.c
new file mode 100644 (file)
index 0000000..f2c5c8c
--- /dev/null
@@ -0,0 +1,211 @@
+/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_REAL_4) && defined (HAVE_SQRTF) && defined (HAVE_FABSF)
+
+#define MATHFUNC(funcname) funcname ## f
+
+
+extern void norm2_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(norm2_r4);
+
+void
+norm2_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_REAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " NORM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "NORM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_REAL_4 result;
+      src = base;
+      {
+
+       GFC_REAL_4 scale;
+       result = 0;
+       scale = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+         if (*src != 0)
+           {
+             GFC_REAL_4 absX, val;
+             absX = MATHFUNC(fabs) (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1 + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }
+             }
+           result = scale * MATHFUNC(sqrt) (result);
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/norm2_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/norm2_r8.c
new file mode 100644 (file)
index 0000000..4a47776
--- /dev/null
@@ -0,0 +1,211 @@
+/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_REAL_8) && defined (HAVE_SQRT) && defined (HAVE_FABS)
+
+#define MATHFUNC(funcname) funcname
+
+
+extern void norm2_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(norm2_r8);
+
+void
+norm2_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_REAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " NORM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "NORM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_REAL_8 result;
+      src = base;
+      {
+
+       GFC_REAL_8 scale;
+       result = 0;
+       scale = 1;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+         if (*src != 0)
+           {
+             GFC_REAL_8 absX, val;
+             absX = MATHFUNC(fabs) (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1 + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }
+             }
+           result = scale * MATHFUNC(sqrt) (result);
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_c10.c
new file mode 100644 (file)
index 0000000..621ba8d
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array,
+              const gfc_array_l1 *mask, const gfc_array_c10 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_COMPLEX_10 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_COMPLEX_10 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_10) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_c16.c
new file mode 100644 (file)
index 0000000..e98de98
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array,
+              const gfc_array_l1 *mask, const gfc_array_c16 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_COMPLEX_16 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_COMPLEX_16 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_16) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_c4.c
new file mode 100644 (file)
index 0000000..85e1541
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array,
+              const gfc_array_l1 *mask, const gfc_array_c4 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_COMPLEX_4 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_COMPLEX_4 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_4) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_c8.c
new file mode 100644 (file)
index 0000000..bfaec2f
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array,
+              const gfc_array_l1 *mask, const gfc_array_c8 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_COMPLEX_8 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_COMPLEX_8 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_8) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_i1.c
new file mode 100644 (file)
index 0000000..c168aff
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array,
+              const gfc_array_l1 *mask, const gfc_array_i1 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_INTEGER_1 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_INTEGER_1 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_INTEGER_1) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_i16.c
new file mode 100644 (file)
index 0000000..81ed49a
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array,
+              const gfc_array_l1 *mask, const gfc_array_i16 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_INTEGER_16 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_INTEGER_16 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_i2.c
new file mode 100644 (file)
index 0000000..a04b7af
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array,
+              const gfc_array_l1 *mask, const gfc_array_i2 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_INTEGER_2 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_INTEGER_2 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_INTEGER_2) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_i4.c
new file mode 100644 (file)
index 0000000..c5d112b
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array,
+              const gfc_array_l1 *mask, const gfc_array_i4 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_INTEGER_4 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_INTEGER_4 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_i8.c
new file mode 100644 (file)
index 0000000..7307192
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array,
+              const gfc_array_l1 *mask, const gfc_array_i8 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_INTEGER_8 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_INTEGER_8 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_r10.c
new file mode 100644 (file)
index 0000000..c3b55cc
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array,
+              const gfc_array_l1 *mask, const gfc_array_r10 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_REAL_10 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_REAL_10 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_REAL_10) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_r16.c
new file mode 100644 (file)
index 0000000..489ff95
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array,
+              const gfc_array_l1 *mask, const gfc_array_r16 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_REAL_16 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_REAL_16 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_REAL_16) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_r4.c
new file mode 100644 (file)
index 0000000..05172db
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array,
+              const gfc_array_l1 *mask, const gfc_array_r4 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_REAL_4 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_REAL_4 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_REAL_4) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pack_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/pack_r8.c
new file mode 100644 (file)
index 0000000..df5cc3f
--- /dev/null
@@ -0,0 +1,259 @@
+/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array,
+              const gfc_array_l1 *mask, const gfc_array_r8 *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  GFC_REAL_8 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const GFC_REAL_8 *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_REAL_8) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/parity_l1.c b/l4/pkg/libgfortran/lib/contrib/generated/parity_l1.c
new file mode 100644 (file)
index 0000000..af35169
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_1) && defined (HAVE_GFC_LOGICAL_1)
+
+
+extern void parity_l1 (gfc_array_l1 * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(parity_l1);
+
+void
+parity_l1 (gfc_array_l1 * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  GFC_LOGICAL_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      GFC_LOGICAL_1 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = result != *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/parity_l16.c b/l4/pkg/libgfortran/lib/contrib/generated/parity_l16.c
new file mode 100644 (file)
index 0000000..58c0a3c
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_16) && defined (HAVE_GFC_LOGICAL_16)
+
+
+extern void parity_l16 (gfc_array_l16 * const restrict, 
+       gfc_array_l16 * const restrict, const index_type * const restrict);
+export_proto(parity_l16);
+
+void
+parity_l16 (gfc_array_l16 * const restrict retarray, 
+       gfc_array_l16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_16 * restrict base;
+  GFC_LOGICAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_16 * restrict src;
+      GFC_LOGICAL_16 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = result != *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/parity_l2.c b/l4/pkg/libgfortran/lib/contrib/generated/parity_l2.c
new file mode 100644 (file)
index 0000000..71ffff0
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_2) && defined (HAVE_GFC_LOGICAL_2)
+
+
+extern void parity_l2 (gfc_array_l2 * const restrict, 
+       gfc_array_l2 * const restrict, const index_type * const restrict);
+export_proto(parity_l2);
+
+void
+parity_l2 (gfc_array_l2 * const restrict retarray, 
+       gfc_array_l2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_2 * restrict base;
+  GFC_LOGICAL_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_2 * restrict src;
+      GFC_LOGICAL_2 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = result != *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/parity_l4.c b/l4/pkg/libgfortran/lib/contrib/generated/parity_l4.c
new file mode 100644 (file)
index 0000000..ba9d3fe
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_4) && defined (HAVE_GFC_LOGICAL_4)
+
+
+extern void parity_l4 (gfc_array_l4 * const restrict, 
+       gfc_array_l4 * const restrict, const index_type * const restrict);
+export_proto(parity_l4);
+
+void
+parity_l4 (gfc_array_l4 * const restrict retarray, 
+       gfc_array_l4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_4 * restrict base;
+  GFC_LOGICAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_4 * restrict src;
+      GFC_LOGICAL_4 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = result != *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/parity_l8.c b/l4/pkg/libgfortran/lib/contrib/generated/parity_l8.c
new file mode 100644 (file)
index 0000000..94166ca
--- /dev/null
@@ -0,0 +1,191 @@
+/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_LOGICAL_8) && defined (HAVE_GFC_LOGICAL_8)
+
+
+extern void parity_l8 (gfc_array_l8 * const restrict, 
+       gfc_array_l8 * const restrict, const index_type * const restrict);
+export_proto(parity_l8);
+
+void
+parity_l8 (gfc_array_l8 * const restrict retarray, 
+       gfc_array_l8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_8 * restrict base;
+  GFC_LOGICAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PARITY intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PARITY");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_8 * restrict src;
+      GFC_LOGICAL_8 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result = result != *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c10_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c10_i16.c
new file mode 100644 (file)
index 0000000..48b2fd8
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_10) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_COMPLEX_10 pow_c10_i16 (GFC_COMPLEX_10 a, GFC_INTEGER_16 b);
+export_proto(pow_c10_i16);
+
+GFC_COMPLEX_10
+pow_c10_i16 (GFC_COMPLEX_10 a, GFC_INTEGER_16 b)
+{
+  GFC_COMPLEX_10 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c10_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c10_i4.c
new file mode 100644 (file)
index 0000000..2869f1d
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_10) && defined (HAVE_GFC_INTEGER_4)
+
+GFC_COMPLEX_10 pow_c10_i4 (GFC_COMPLEX_10 a, GFC_INTEGER_4 b);
+export_proto(pow_c10_i4);
+
+GFC_COMPLEX_10
+pow_c10_i4 (GFC_COMPLEX_10 a, GFC_INTEGER_4 b)
+{
+  GFC_COMPLEX_10 pow, x;
+  GFC_INTEGER_4 n;
+  GFC_UINTEGER_4 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c10_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c10_i8.c
new file mode 100644 (file)
index 0000000..32ff9d4
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_10) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_COMPLEX_10 pow_c10_i8 (GFC_COMPLEX_10 a, GFC_INTEGER_8 b);
+export_proto(pow_c10_i8);
+
+GFC_COMPLEX_10
+pow_c10_i8 (GFC_COMPLEX_10 a, GFC_INTEGER_8 b)
+{
+  GFC_COMPLEX_10 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c16_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c16_i16.c
new file mode 100644 (file)
index 0000000..668f85e
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_16) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_COMPLEX_16 pow_c16_i16 (GFC_COMPLEX_16 a, GFC_INTEGER_16 b);
+export_proto(pow_c16_i16);
+
+GFC_COMPLEX_16
+pow_c16_i16 (GFC_COMPLEX_16 a, GFC_INTEGER_16 b)
+{
+  GFC_COMPLEX_16 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c16_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c16_i4.c
new file mode 100644 (file)
index 0000000..2d5be14
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_16) && defined (HAVE_GFC_INTEGER_4)
+
+GFC_COMPLEX_16 pow_c16_i4 (GFC_COMPLEX_16 a, GFC_INTEGER_4 b);
+export_proto(pow_c16_i4);
+
+GFC_COMPLEX_16
+pow_c16_i4 (GFC_COMPLEX_16 a, GFC_INTEGER_4 b)
+{
+  GFC_COMPLEX_16 pow, x;
+  GFC_INTEGER_4 n;
+  GFC_UINTEGER_4 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c16_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c16_i8.c
new file mode 100644 (file)
index 0000000..e599cf0
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_16) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_COMPLEX_16 pow_c16_i8 (GFC_COMPLEX_16 a, GFC_INTEGER_8 b);
+export_proto(pow_c16_i8);
+
+GFC_COMPLEX_16
+pow_c16_i8 (GFC_COMPLEX_16 a, GFC_INTEGER_8 b)
+{
+  GFC_COMPLEX_16 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c4_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c4_i16.c
new file mode 100644 (file)
index 0000000..3f6ff8d
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_4) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_COMPLEX_4 pow_c4_i16 (GFC_COMPLEX_4 a, GFC_INTEGER_16 b);
+export_proto(pow_c4_i16);
+
+GFC_COMPLEX_4
+pow_c4_i16 (GFC_COMPLEX_4 a, GFC_INTEGER_16 b)
+{
+  GFC_COMPLEX_4 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c4_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c4_i4.c
new file mode 100644 (file)
index 0000000..b5cc430
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_4) && defined (HAVE_GFC_INTEGER_4)
+
+GFC_COMPLEX_4 pow_c4_i4 (GFC_COMPLEX_4 a, GFC_INTEGER_4 b);
+export_proto(pow_c4_i4);
+
+GFC_COMPLEX_4
+pow_c4_i4 (GFC_COMPLEX_4 a, GFC_INTEGER_4 b)
+{
+  GFC_COMPLEX_4 pow, x;
+  GFC_INTEGER_4 n;
+  GFC_UINTEGER_4 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c4_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c4_i8.c
new file mode 100644 (file)
index 0000000..0bd0da7
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_4) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_COMPLEX_4 pow_c4_i8 (GFC_COMPLEX_4 a, GFC_INTEGER_8 b);
+export_proto(pow_c4_i8);
+
+GFC_COMPLEX_4
+pow_c4_i8 (GFC_COMPLEX_4 a, GFC_INTEGER_8 b)
+{
+  GFC_COMPLEX_4 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c8_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c8_i16.c
new file mode 100644 (file)
index 0000000..8ac1465
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_8) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_COMPLEX_8 pow_c8_i16 (GFC_COMPLEX_8 a, GFC_INTEGER_16 b);
+export_proto(pow_c8_i16);
+
+GFC_COMPLEX_8
+pow_c8_i16 (GFC_COMPLEX_8 a, GFC_INTEGER_16 b)
+{
+  GFC_COMPLEX_8 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c8_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c8_i4.c
new file mode 100644 (file)
index 0000000..d788c1b
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_8) && defined (HAVE_GFC_INTEGER_4)
+
+GFC_COMPLEX_8 pow_c8_i4 (GFC_COMPLEX_8 a, GFC_INTEGER_4 b);
+export_proto(pow_c8_i4);
+
+GFC_COMPLEX_8
+pow_c8_i4 (GFC_COMPLEX_8 a, GFC_INTEGER_4 b)
+{
+  GFC_COMPLEX_8 pow, x;
+  GFC_INTEGER_4 n;
+  GFC_UINTEGER_4 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_c8_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_c8_i8.c
new file mode 100644 (file)
index 0000000..8051467
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_COMPLEX_8) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_COMPLEX_8 pow_c8_i8 (GFC_COMPLEX_8 a, GFC_INTEGER_8 b);
+export_proto(pow_c8_i8);
+
+GFC_COMPLEX_8
+pow_c8_i8 (GFC_COMPLEX_8 a, GFC_INTEGER_8 b)
+{
+  GFC_COMPLEX_8 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_i16_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_i16_i16.c
new file mode 100644 (file)
index 0000000..62a88b1
--- /dev/null
@@ -0,0 +1,77 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_INTEGER_16 pow_i16_i16 (GFC_INTEGER_16 a, GFC_INTEGER_16 b);
+export_proto(pow_i16_i16);
+
+GFC_INTEGER_16
+pow_i16_i16 (GFC_INTEGER_16 a, GFC_INTEGER_16 b)
+{
+  GFC_INTEGER_16 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_i16_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_i16_i4.c
new file mode 100644 (file)
index 0000000..2d4c87c
--- /dev/null
@@ -0,0 +1,77 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_4)
+
+GFC_INTEGER_16 pow_i16_i4 (GFC_INTEGER_16 a, GFC_INTEGER_4 b);
+export_proto(pow_i16_i4);
+
+GFC_INTEGER_16
+pow_i16_i4 (GFC_INTEGER_16 a, GFC_INTEGER_4 b)
+{
+  GFC_INTEGER_16 pow, x;
+  GFC_INTEGER_4 n;
+  GFC_UINTEGER_4 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_i16_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_i16_i8.c
new file mode 100644 (file)
index 0000000..3c8401c
--- /dev/null
@@ -0,0 +1,77 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_INTEGER_16 pow_i16_i8 (GFC_INTEGER_16 a, GFC_INTEGER_8 b);
+export_proto(pow_i16_i8);
+
+GFC_INTEGER_16
+pow_i16_i8 (GFC_INTEGER_16 a, GFC_INTEGER_8 b)
+{
+  GFC_INTEGER_16 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_i4_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_i4_i16.c
new file mode 100644 (file)
index 0000000..c6a92f0
--- /dev/null
@@ -0,0 +1,77 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_INTEGER_4 pow_i4_i16 (GFC_INTEGER_4 a, GFC_INTEGER_16 b);
+export_proto(pow_i4_i16);
+
+GFC_INTEGER_4
+pow_i4_i16 (GFC_INTEGER_4 a, GFC_INTEGER_16 b)
+{
+  GFC_INTEGER_4 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_i4_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_i4_i4.c
new file mode 100644 (file)
index 0000000..b8ffd72
--- /dev/null
@@ -0,0 +1,77 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+GFC_INTEGER_4 pow_i4_i4 (GFC_INTEGER_4 a, GFC_INTEGER_4 b);
+export_proto(pow_i4_i4);
+
+GFC_INTEGER_4
+pow_i4_i4 (GFC_INTEGER_4 a, GFC_INTEGER_4 b)
+{
+  GFC_INTEGER_4 pow, x;
+  GFC_INTEGER_4 n;
+  GFC_UINTEGER_4 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_i4_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_i4_i8.c
new file mode 100644 (file)
index 0000000..76ac564
--- /dev/null
@@ -0,0 +1,77 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_INTEGER_4 pow_i4_i8 (GFC_INTEGER_4 a, GFC_INTEGER_8 b);
+export_proto(pow_i4_i8);
+
+GFC_INTEGER_4
+pow_i4_i8 (GFC_INTEGER_4 a, GFC_INTEGER_8 b)
+{
+  GFC_INTEGER_4 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_i8_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_i8_i16.c
new file mode 100644 (file)
index 0000000..66a50b6
--- /dev/null
@@ -0,0 +1,77 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_INTEGER_8 pow_i8_i16 (GFC_INTEGER_8 a, GFC_INTEGER_16 b);
+export_proto(pow_i8_i16);
+
+GFC_INTEGER_8
+pow_i8_i16 (GFC_INTEGER_8 a, GFC_INTEGER_16 b)
+{
+  GFC_INTEGER_8 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_i8_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_i8_i4.c
new file mode 100644 (file)
index 0000000..8b85946
--- /dev/null
@@ -0,0 +1,77 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_4)
+
+GFC_INTEGER_8 pow_i8_i4 (GFC_INTEGER_8 a, GFC_INTEGER_4 b);
+export_proto(pow_i8_i4);
+
+GFC_INTEGER_8
+pow_i8_i4 (GFC_INTEGER_8 a, GFC_INTEGER_4 b)
+{
+  GFC_INTEGER_8 pow, x;
+  GFC_INTEGER_4 n;
+  GFC_UINTEGER_4 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_i8_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_i8_i8.c
new file mode 100644 (file)
index 0000000..bc5aa0d
--- /dev/null
@@ -0,0 +1,77 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_INTEGER_8 pow_i8_i8 (GFC_INTEGER_8 a, GFC_INTEGER_8 b);
+export_proto(pow_i8_i8);
+
+GFC_INTEGER_8
+pow_i8_i8 (GFC_INTEGER_8 a, GFC_INTEGER_8 b)
+{
+  GFC_INTEGER_8 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_r10_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_r10_i16.c
new file mode 100644 (file)
index 0000000..d587c47
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_REAL_10 pow_r10_i16 (GFC_REAL_10 a, GFC_INTEGER_16 b);
+export_proto(pow_r10_i16);
+
+GFC_REAL_10
+pow_r10_i16 (GFC_REAL_10 a, GFC_INTEGER_16 b)
+{
+  GFC_REAL_10 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_r10_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_r10_i8.c
new file mode 100644 (file)
index 0000000..d2f66e0
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_REAL_10 pow_r10_i8 (GFC_REAL_10 a, GFC_INTEGER_8 b);
+export_proto(pow_r10_i8);
+
+GFC_REAL_10
+pow_r10_i8 (GFC_REAL_10 a, GFC_INTEGER_8 b)
+{
+  GFC_REAL_10 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_r16_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_r16_i16.c
new file mode 100644 (file)
index 0000000..0e80dd7
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_REAL_16 pow_r16_i16 (GFC_REAL_16 a, GFC_INTEGER_16 b);
+export_proto(pow_r16_i16);
+
+GFC_REAL_16
+pow_r16_i16 (GFC_REAL_16 a, GFC_INTEGER_16 b)
+{
+  GFC_REAL_16 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_r16_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_r16_i4.c
new file mode 100644 (file)
index 0000000..bba2a84
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_4)
+
+GFC_REAL_16 pow_r16_i4 (GFC_REAL_16 a, GFC_INTEGER_4 b);
+export_proto(pow_r16_i4);
+
+GFC_REAL_16
+pow_r16_i4 (GFC_REAL_16 a, GFC_INTEGER_4 b)
+{
+  GFC_REAL_16 pow, x;
+  GFC_INTEGER_4 n;
+  GFC_UINTEGER_4 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_r16_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_r16_i8.c
new file mode 100644 (file)
index 0000000..16ea271
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_REAL_16 pow_r16_i8 (GFC_REAL_16 a, GFC_INTEGER_8 b);
+export_proto(pow_r16_i8);
+
+GFC_REAL_16
+pow_r16_i8 (GFC_REAL_16 a, GFC_INTEGER_8 b)
+{
+  GFC_REAL_16 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_r4_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_r4_i16.c
new file mode 100644 (file)
index 0000000..3ba8d3e
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_REAL_4 pow_r4_i16 (GFC_REAL_4 a, GFC_INTEGER_16 b);
+export_proto(pow_r4_i16);
+
+GFC_REAL_4
+pow_r4_i16 (GFC_REAL_4 a, GFC_INTEGER_16 b)
+{
+  GFC_REAL_4 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_r4_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_r4_i8.c
new file mode 100644 (file)
index 0000000..799adba
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_REAL_4 pow_r4_i8 (GFC_REAL_4 a, GFC_INTEGER_8 b);
+export_proto(pow_r4_i8);
+
+GFC_REAL_4
+pow_r4_i8 (GFC_REAL_4 a, GFC_INTEGER_8 b)
+{
+  GFC_REAL_4 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_r8_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_r8_i16.c
new file mode 100644 (file)
index 0000000..4c7dcb7
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_16)
+
+GFC_REAL_8 pow_r8_i16 (GFC_REAL_8 a, GFC_INTEGER_16 b);
+export_proto(pow_r8_i16);
+
+GFC_REAL_8
+pow_r8_i16 (GFC_REAL_8 a, GFC_INTEGER_16 b)
+{
+  GFC_REAL_8 pow, x;
+  GFC_INTEGER_16 n;
+  GFC_UINTEGER_16 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/pow_r8_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/pow_r8_i8.c
new file mode 100644 (file)
index 0000000..1a6a746
--- /dev/null
@@ -0,0 +1,75 @@
+/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_INTEGER_8)
+
+GFC_REAL_8 pow_r8_i8 (GFC_REAL_8 a, GFC_INTEGER_8 b);
+export_proto(pow_r8_i8);
+
+GFC_REAL_8
+pow_r8_i8 (GFC_REAL_8 a, GFC_INTEGER_8 b)
+{
+  GFC_REAL_8 pow, x;
+  GFC_INTEGER_8 n;
+  GFC_UINTEGER_8 u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+
+         u = -n;
+         x = pow / x;
+       }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/product_c10.c
new file mode 100644 (file)
index 0000000..140aa30
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10) && defined (HAVE_GFC_COMPLEX_10)
+
+
+extern void product_c10 (gfc_array_c10 * const restrict, 
+       gfc_array_c10 * const restrict, const index_type * const restrict);
+export_proto(product_c10);
+
+void
+product_c10 (gfc_array_c10 * const restrict retarray, 
+       gfc_array_c10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_COMPLEX_10 * restrict base;
+  GFC_COMPLEX_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_COMPLEX_10 * restrict src;
+      GFC_COMPLEX_10 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_c10 (gfc_array_c10 * const restrict, 
+       gfc_array_c10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_c10);
+
+void
+mproduct_c10 (gfc_array_c10 * const restrict retarray, 
+       gfc_array_c10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_10 * restrict dest;
+  const GFC_COMPLEX_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_COMPLEX_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_COMPLEX_10 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_c10 (gfc_array_c10 * const restrict, 
+       gfc_array_c10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_c10);
+
+void
+sproduct_c10 (gfc_array_c10 * const restrict retarray, 
+       gfc_array_c10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_c10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/product_c16.c
new file mode 100644 (file)
index 0000000..d595102
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16) && defined (HAVE_GFC_COMPLEX_16)
+
+
+extern void product_c16 (gfc_array_c16 * const restrict, 
+       gfc_array_c16 * const restrict, const index_type * const restrict);
+export_proto(product_c16);
+
+void
+product_c16 (gfc_array_c16 * const restrict retarray, 
+       gfc_array_c16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_COMPLEX_16 * restrict base;
+  GFC_COMPLEX_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_COMPLEX_16 * restrict src;
+      GFC_COMPLEX_16 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_c16 (gfc_array_c16 * const restrict, 
+       gfc_array_c16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_c16);
+
+void
+mproduct_c16 (gfc_array_c16 * const restrict retarray, 
+       gfc_array_c16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_16 * restrict dest;
+  const GFC_COMPLEX_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_COMPLEX_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_COMPLEX_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_c16 (gfc_array_c16 * const restrict, 
+       gfc_array_c16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_c16);
+
+void
+sproduct_c16 (gfc_array_c16 * const restrict retarray, 
+       gfc_array_c16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_c16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/product_c4.c
new file mode 100644 (file)
index 0000000..34c1bde
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4) && defined (HAVE_GFC_COMPLEX_4)
+
+
+extern void product_c4 (gfc_array_c4 * const restrict, 
+       gfc_array_c4 * const restrict, const index_type * const restrict);
+export_proto(product_c4);
+
+void
+product_c4 (gfc_array_c4 * const restrict retarray, 
+       gfc_array_c4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_COMPLEX_4 * restrict base;
+  GFC_COMPLEX_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_COMPLEX_4 * restrict src;
+      GFC_COMPLEX_4 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_c4 (gfc_array_c4 * const restrict, 
+       gfc_array_c4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_c4);
+
+void
+mproduct_c4 (gfc_array_c4 * const restrict retarray, 
+       gfc_array_c4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_4 * restrict dest;
+  const GFC_COMPLEX_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_COMPLEX_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_COMPLEX_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_c4 (gfc_array_c4 * const restrict, 
+       gfc_array_c4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_c4);
+
+void
+sproduct_c4 (gfc_array_c4 * const restrict retarray, 
+       gfc_array_c4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_c4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/product_c8.c
new file mode 100644 (file)
index 0000000..6e34874
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8) && defined (HAVE_GFC_COMPLEX_8)
+
+
+extern void product_c8 (gfc_array_c8 * const restrict, 
+       gfc_array_c8 * const restrict, const index_type * const restrict);
+export_proto(product_c8);
+
+void
+product_c8 (gfc_array_c8 * const restrict retarray, 
+       gfc_array_c8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_COMPLEX_8 * restrict base;
+  GFC_COMPLEX_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_COMPLEX_8 * restrict src;
+      GFC_COMPLEX_8 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_c8 (gfc_array_c8 * const restrict, 
+       gfc_array_c8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_c8);
+
+void
+mproduct_c8 (gfc_array_c8 * const restrict retarray, 
+       gfc_array_c8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_8 * restrict dest;
+  const GFC_COMPLEX_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_COMPLEX_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_COMPLEX_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_c8 (gfc_array_c8 * const restrict, 
+       gfc_array_c8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_c8);
+
+void
+sproduct_c8 (gfc_array_c8 * const restrict retarray, 
+       gfc_array_c8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_c8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/product_i1.c
new file mode 100644 (file)
index 0000000..2e04287
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_1)
+
+
+extern void product_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(product_i1);
+
+void
+product_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_1 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_i1);
+
+void
+mproduct_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_1 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_i1);
+
+void
+sproduct_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/product_i16.c
new file mode 100644 (file)
index 0000000..e487ddf
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void product_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(product_i16);
+
+void
+product_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_i16);
+
+void
+mproduct_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_i16);
+
+void
+sproduct_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/product_i2.c
new file mode 100644 (file)
index 0000000..b4b0a4c
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_2)
+
+
+extern void product_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(product_i2);
+
+void
+product_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_2 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_i2);
+
+void
+mproduct_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_2 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_i2);
+
+void
+sproduct_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/product_i4.c
new file mode 100644 (file)
index 0000000..a0164a1
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void product_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(product_i4);
+
+void
+product_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_i4);
+
+void
+mproduct_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_i4);
+
+void
+sproduct_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/product_i8.c
new file mode 100644 (file)
index 0000000..64c6487
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void product_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(product_i8);
+
+void
+product_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_i8);
+
+void
+mproduct_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_i8);
+
+void
+sproduct_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/product_r10.c
new file mode 100644 (file)
index 0000000..71a70da
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_REAL_10)
+
+
+extern void product_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(product_r10);
+
+void
+product_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_REAL_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_REAL_10 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_r10);
+
+void
+mproduct_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_10 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_10 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_r10);
+
+void
+sproduct_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/product_r16.c
new file mode 100644 (file)
index 0000000..0028ba1
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16)
+
+
+extern void product_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(product_r16);
+
+void
+product_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_REAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_REAL_16 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_r16);
+
+void
+mproduct_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_16 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_r16);
+
+void
+sproduct_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/product_r4.c
new file mode 100644 (file)
index 0000000..492980e
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_REAL_4)
+
+
+extern void product_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(product_r4);
+
+void
+product_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_REAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_REAL_4 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_r4);
+
+void
+mproduct_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_4 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_r4);
+
+void
+sproduct_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/product_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/product_r8.c
new file mode 100644 (file)
index 0000000..cf05af1
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_REAL_8)
+
+
+extern void product_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(product_r8);
+
+void
+product_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_REAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "PRODUCT");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_REAL_8 result;
+      src = base;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result *= *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void mproduct_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(mproduct_r8);
+
+void
+mproduct_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_8 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in PRODUCT intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "PRODUCT");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "PRODUCT");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 1;
+       if (len <= 0)
+         *dest = 1;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result *= *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void sproduct_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(sproduct_r8);
+
+void
+sproduct_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      product_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " PRODUCT intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " PRODUCT intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 1;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_c10.c
new file mode 100644 (file)
index 0000000..44446eb
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_c10 (gfc_array_c10 * const restrict, 
+       gfc_array_c10 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_c10 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_c10);
+
+void
+reshape_c10 (gfc_array_c10 * const restrict ret, 
+       gfc_array_c10 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_c10 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_COMPLEX_10 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_COMPLEX_10 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_COMPLEX_10 *pptr;
+
+  const GFC_COMPLEX_10 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_COMPLEX_10);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_COMPLEX_10);
+      ssize *= sizeof (GFC_COMPLEX_10);
+      psize *= sizeof (GFC_COMPLEX_10);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_c16.c
new file mode 100644 (file)
index 0000000..ca588dc
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_c16 (gfc_array_c16 * const restrict, 
+       gfc_array_c16 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_c16 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_c16);
+
+void
+reshape_c16 (gfc_array_c16 * const restrict ret, 
+       gfc_array_c16 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_c16 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_COMPLEX_16 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_COMPLEX_16 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_COMPLEX_16 *pptr;
+
+  const GFC_COMPLEX_16 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_COMPLEX_16);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_COMPLEX_16);
+      ssize *= sizeof (GFC_COMPLEX_16);
+      psize *= sizeof (GFC_COMPLEX_16);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_c4.c
new file mode 100644 (file)
index 0000000..e16d32c
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_c4 (gfc_array_c4 * const restrict, 
+       gfc_array_c4 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_c4 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_c4);
+
+void
+reshape_c4 (gfc_array_c4 * const restrict ret, 
+       gfc_array_c4 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_c4 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_COMPLEX_4 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_COMPLEX_4 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_COMPLEX_4 *pptr;
+
+  const GFC_COMPLEX_4 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_COMPLEX_4);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_COMPLEX_4);
+      ssize *= sizeof (GFC_COMPLEX_4);
+      psize *= sizeof (GFC_COMPLEX_4);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_c8.c
new file mode 100644 (file)
index 0000000..c8da0bc
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_c8 (gfc_array_c8 * const restrict, 
+       gfc_array_c8 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_c8 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_c8);
+
+void
+reshape_c8 (gfc_array_c8 * const restrict ret, 
+       gfc_array_c8 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_c8 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_COMPLEX_8 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_COMPLEX_8 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_COMPLEX_8 *pptr;
+
+  const GFC_COMPLEX_8 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_COMPLEX_8);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_COMPLEX_8);
+      ssize *= sizeof (GFC_COMPLEX_8);
+      psize *= sizeof (GFC_COMPLEX_8);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_i16.c
new file mode 100644 (file)
index 0000000..43fbefc
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_i16 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_16);
+
+void
+reshape_16 (gfc_array_i16 * const restrict ret, 
+       gfc_array_i16 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_i16 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_INTEGER_16 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_INTEGER_16 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_INTEGER_16 *pptr;
+
+  const GFC_INTEGER_16 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_INTEGER_16);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_INTEGER_16);
+      ssize *= sizeof (GFC_INTEGER_16);
+      psize *= sizeof (GFC_INTEGER_16);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_i4.c
new file mode 100644 (file)
index 0000000..2c136de
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_i4 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_4);
+
+void
+reshape_4 (gfc_array_i4 * const restrict ret, 
+       gfc_array_i4 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_i4 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_INTEGER_4 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_INTEGER_4 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_INTEGER_4 *pptr;
+
+  const GFC_INTEGER_4 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_INTEGER_4);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_INTEGER_4);
+      ssize *= sizeof (GFC_INTEGER_4);
+      psize *= sizeof (GFC_INTEGER_4);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_i8.c
new file mode 100644 (file)
index 0000000..c97b747
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_i8 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_8);
+
+void
+reshape_8 (gfc_array_i8 * const restrict ret, 
+       gfc_array_i8 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_i8 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_INTEGER_8 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_INTEGER_8 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_INTEGER_8 *pptr;
+
+  const GFC_INTEGER_8 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_INTEGER_8);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_INTEGER_8);
+      ssize *= sizeof (GFC_INTEGER_8);
+      psize *= sizeof (GFC_INTEGER_8);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_r10.c
new file mode 100644 (file)
index 0000000..fa3873e
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_r10 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_r10);
+
+void
+reshape_r10 (gfc_array_r10 * const restrict ret, 
+       gfc_array_r10 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_r10 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_REAL_10 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_REAL_10 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_REAL_10 *pptr;
+
+  const GFC_REAL_10 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_REAL_10);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_REAL_10);
+      ssize *= sizeof (GFC_REAL_10);
+      psize *= sizeof (GFC_REAL_10);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_r16.c
new file mode 100644 (file)
index 0000000..c2b6556
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_r16 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_r16);
+
+void
+reshape_r16 (gfc_array_r16 * const restrict ret, 
+       gfc_array_r16 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_r16 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_REAL_16 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_REAL_16 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_REAL_16 *pptr;
+
+  const GFC_REAL_16 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_REAL_16);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_REAL_16);
+      ssize *= sizeof (GFC_REAL_16);
+      psize *= sizeof (GFC_REAL_16);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_r4.c
new file mode 100644 (file)
index 0000000..2b859fc
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_r4 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_r4);
+
+void
+reshape_r4 (gfc_array_r4 * const restrict ret, 
+       gfc_array_r4 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_r4 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_REAL_4 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_REAL_4 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_REAL_4 *pptr;
+
+  const GFC_REAL_4 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_REAL_4);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_REAL_4);
+      ssize *= sizeof (GFC_REAL_4);
+      psize *= sizeof (GFC_REAL_4);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/reshape_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/reshape_r8.c
new file mode 100644 (file)
index 0000000..49b2352
--- /dev/null
@@ -0,0 +1,360 @@
+/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+
+
+extern void reshape_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, 
+       shape_type * const restrict,
+       gfc_array_r8 * const restrict, 
+       shape_type * const restrict);
+export_proto(reshape_r8);
+
+void
+reshape_r8 (gfc_array_r8 * const restrict ret, 
+       gfc_array_r8 * const restrict source, 
+       shape_type * const restrict shape,
+       gfc_array_r8 * const restrict pad, 
+       shape_type * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  GFC_REAL_8 *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const GFC_REAL_8 *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const GFC_REAL_8 *pptr;
+
+  const GFC_REAL_8 *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof (GFC_REAL_8);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof (GFC_REAL_8);
+      ssize *= sizeof (GFC_REAL_8);
+      psize *= sizeof (GFC_REAL_8);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r10.c
new file mode 100644 (file)
index 0000000..78e17d1
--- /dev/null
@@ -0,0 +1,54 @@
+/* Implementation of the RRSPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## l
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FABSL) && defined (HAVE_FREXPL)
+
+extern GFC_REAL_10 rrspacing_r10 (GFC_REAL_10 s, int p);
+export_proto(rrspacing_r10);
+
+GFC_REAL_10
+rrspacing_r10 (GFC_REAL_10 s, int p)
+{
+  int e;
+  GFC_REAL_10 x;
+  x = MATHFUNC(fabs) (s);
+  if (x == 0.)
+    return 0.;
+  MATHFUNC(frexp) (s, &e);
+#if defined (HAVE_LDEXPL)
+  return MATHFUNC(ldexp) (x, p - e);
+#else
+  return MATHFUNC(scalbn) (x, p - e);
+#endif
+
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r16.c
new file mode 100644 (file)
index 0000000..470541e
--- /dev/null
@@ -0,0 +1,58 @@
+/* Implementation of the RRSPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FABSL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
+
+extern GFC_REAL_16 rrspacing_r16 (GFC_REAL_16 s, int p);
+export_proto(rrspacing_r16);
+
+GFC_REAL_16
+rrspacing_r16 (GFC_REAL_16 s, int p)
+{
+  int e;
+  GFC_REAL_16 x;
+  x = MATHFUNC(fabs) (s);
+  if (x == 0.)
+    return 0.;
+  MATHFUNC(frexp) (s, &e);
+#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL))
+  return MATHFUNC(ldexp) (x, p - e);
+#else
+  return MATHFUNC(scalbn) (x, p - e);
+#endif
+
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r4.c
new file mode 100644 (file)
index 0000000..3c5243d
--- /dev/null
@@ -0,0 +1,54 @@
+/* Implementation of the RRSPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## f
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FABSF) && defined (HAVE_FREXPF)
+
+extern GFC_REAL_4 rrspacing_r4 (GFC_REAL_4 s, int p);
+export_proto(rrspacing_r4);
+
+GFC_REAL_4
+rrspacing_r4 (GFC_REAL_4 s, int p)
+{
+  int e;
+  GFC_REAL_4 x;
+  x = MATHFUNC(fabs) (s);
+  if (x == 0.)
+    return 0.;
+  MATHFUNC(frexp) (s, &e);
+#if defined (HAVE_LDEXPF)
+  return MATHFUNC(ldexp) (x, p - e);
+#else
+  return MATHFUNC(scalbn) (x, p - e);
+#endif
+
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/rrspacing_r8.c
new file mode 100644 (file)
index 0000000..1e4c99a
--- /dev/null
@@ -0,0 +1,54 @@
+/* Implementation of the RRSPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FABS) && defined (HAVE_FREXP)
+
+extern GFC_REAL_8 rrspacing_r8 (GFC_REAL_8 s, int p);
+export_proto(rrspacing_r8);
+
+GFC_REAL_8
+rrspacing_r8 (GFC_REAL_8 s, int p)
+{
+  int e;
+  GFC_REAL_8 x;
+  x = MATHFUNC(fabs) (s);
+  if (x == 0.)
+    return 0.;
+  MATHFUNC(frexp) (s, &e);
+#if defined (HAVE_LDEXP)
+  return MATHFUNC(ldexp) (x, p - e);
+#else
+  return MATHFUNC(scalbn) (x, p - e);
+#endif
+
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r10.c
new file mode 100644 (file)
index 0000000..523b602
--- /dev/null
@@ -0,0 +1,44 @@
+/* Implementation of the SET_EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## l
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_SCALBNL) && defined (HAVE_FREXPL)
+
+extern GFC_REAL_10 set_exponent_r10 (GFC_REAL_10 s, GFC_INTEGER_4 i);
+export_proto(set_exponent_r10);
+
+GFC_REAL_10
+set_exponent_r10 (GFC_REAL_10 s, GFC_INTEGER_4 i)
+{
+  int dummy_exp;
+  return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r16.c
new file mode 100644 (file)
index 0000000..f9a7f37
--- /dev/null
@@ -0,0 +1,48 @@
+/* Implementation of the SET_EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_SCALBNL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
+
+extern GFC_REAL_16 set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i);
+export_proto(set_exponent_r16);
+
+GFC_REAL_16
+set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i)
+{
+  int dummy_exp;
+  return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r4.c
new file mode 100644 (file)
index 0000000..4554a40
--- /dev/null
@@ -0,0 +1,44 @@
+/* Implementation of the SET_EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## f
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_SCALBNF) && defined (HAVE_FREXPF)
+
+extern GFC_REAL_4 set_exponent_r4 (GFC_REAL_4 s, GFC_INTEGER_4 i);
+export_proto(set_exponent_r4);
+
+GFC_REAL_4
+set_exponent_r4 (GFC_REAL_4 s, GFC_INTEGER_4 i)
+{
+  int dummy_exp;
+  return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/set_exponent_r8.c
new file mode 100644 (file)
index 0000000..cb291d6
--- /dev/null
@@ -0,0 +1,44 @@
+/* Implementation of the SET_EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_SCALBN) && defined (HAVE_FREXP)
+
+extern GFC_REAL_8 set_exponent_r8 (GFC_REAL_8 s, GFC_INTEGER_4 i);
+export_proto(set_exponent_r8);
+
+GFC_REAL_8
+set_exponent_r8 (GFC_REAL_8 s, GFC_INTEGER_4 i)
+{
+  int dummy_exp;
+  return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/shape_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/shape_i16.c
new file mode 100644 (file)
index 0000000..802e00a
--- /dev/null
@@ -0,0 +1,67 @@
+/* Implementation of the SHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+extern void shape_16 (gfc_array_i16 * const restrict ret, 
+       const gfc_array_i16 * const restrict array);
+export_proto(shape_16);
+
+void
+shape_16 (gfc_array_i16 * const restrict ret, 
+       const gfc_array_i16 * const restrict array)
+{
+  int n;
+  index_type stride;
+  index_type extent;
+  int rank;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (ret->data == NULL)
+    {
+      GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
+      ret->offset = 0;
+      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+    }
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
+    return;
+
+  for (n = 0; n < rank; n++)
+    {
+      extent = GFC_DESCRIPTOR_EXTENT(array,n);
+      ret->data[n * stride] = extent > 0 ? extent : 0 ;
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/shape_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/shape_i4.c
new file mode 100644 (file)
index 0000000..fa2d4eb
--- /dev/null
@@ -0,0 +1,67 @@
+/* Implementation of the SHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+extern void shape_4 (gfc_array_i4 * const restrict ret, 
+       const gfc_array_i4 * const restrict array);
+export_proto(shape_4);
+
+void
+shape_4 (gfc_array_i4 * const restrict ret, 
+       const gfc_array_i4 * const restrict array)
+{
+  int n;
+  index_type stride;
+  index_type extent;
+  int rank;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (ret->data == NULL)
+    {
+      GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
+      ret->offset = 0;
+      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank);
+    }
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
+    return;
+
+  for (n = 0; n < rank; n++)
+    {
+      extent = GFC_DESCRIPTOR_EXTENT(array,n);
+      ret->data[n * stride] = extent > 0 ? extent : 0 ;
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/shape_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/shape_i8.c
new file mode 100644 (file)
index 0000000..d6664de
--- /dev/null
@@ -0,0 +1,67 @@
+/* Implementation of the SHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+extern void shape_8 (gfc_array_i8 * const restrict ret, 
+       const gfc_array_i8 * const restrict array);
+export_proto(shape_8);
+
+void
+shape_8 (gfc_array_i8 * const restrict ret, 
+       const gfc_array_i8 * const restrict array)
+{
+  int n;
+  index_type stride;
+  index_type extent;
+  int rank;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (ret->data == NULL)
+    {
+      GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
+      ret->offset = 0;
+      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank);
+    }
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
+    return;
+
+  for (n = 0; n < rank; n++)
+    {
+      extent = GFC_DESCRIPTOR_EXTENT(array,n);
+      ret->data[n * stride] = extent > 0 ? extent : 0 ;
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spacing_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/spacing_r10.c
new file mode 100644 (file)
index 0000000..6905557
--- /dev/null
@@ -0,0 +1,53 @@
+/* Implementation of the SPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## l
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL)
+
+extern GFC_REAL_10 spacing_r10 (GFC_REAL_10 s, int p, int emin, GFC_REAL_10 tiny);
+export_proto(spacing_r10);
+
+GFC_REAL_10
+spacing_r10 (GFC_REAL_10 s, int p, int emin, GFC_REAL_10 tiny)
+{
+  int e;
+  if (s == 0.)
+    return tiny;
+  MATHFUNC(frexp) (s, &e);
+  e = e - p;
+  e = e > emin ? e : emin;
+#if defined (HAVE_LDEXPL)
+  return MATHFUNC(ldexp) (1., e);
+#else
+  return MATHFUNC(scalbn) (1., e);
+#endif
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spacing_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/spacing_r16.c
new file mode 100644 (file)
index 0000000..f58fa96
--- /dev/null
@@ -0,0 +1,57 @@
+/* Implementation of the SPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
+
+extern GFC_REAL_16 spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny);
+export_proto(spacing_r16);
+
+GFC_REAL_16
+spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny)
+{
+  int e;
+  if (s == 0.)
+    return tiny;
+  MATHFUNC(frexp) (s, &e);
+  e = e - p;
+  e = e > emin ? e : emin;
+#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL))
+  return MATHFUNC(ldexp) (1., e);
+#else
+  return MATHFUNC(scalbn) (1., e);
+#endif
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spacing_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/spacing_r4.c
new file mode 100644 (file)
index 0000000..44cf577
--- /dev/null
@@ -0,0 +1,53 @@
+/* Implementation of the SPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname ## f
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF)
+
+extern GFC_REAL_4 spacing_r4 (GFC_REAL_4 s, int p, int emin, GFC_REAL_4 tiny);
+export_proto(spacing_r4);
+
+GFC_REAL_4
+spacing_r4 (GFC_REAL_4 s, int p, int emin, GFC_REAL_4 tiny)
+{
+  int e;
+  if (s == 0.)
+    return tiny;
+  MATHFUNC(frexp) (s, &e);
+  e = e - p;
+  e = e > emin ? e : emin;
+#if defined (HAVE_LDEXPF)
+  return MATHFUNC(ldexp) (1., e);
+#else
+  return MATHFUNC(scalbn) (1., e);
+#endif
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spacing_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/spacing_r8.c
new file mode 100644 (file)
index 0000000..4329ada
--- /dev/null
@@ -0,0 +1,53 @@
+/* Implementation of the SPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+
+#define MATHFUNC(funcname) funcname
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP)
+
+extern GFC_REAL_8 spacing_r8 (GFC_REAL_8 s, int p, int emin, GFC_REAL_8 tiny);
+export_proto(spacing_r8);
+
+GFC_REAL_8
+spacing_r8 (GFC_REAL_8 s, int p, int emin, GFC_REAL_8 tiny)
+{
+  int e;
+  if (s == 0.)
+    return tiny;
+  MATHFUNC(frexp) (s, &e);
+  e = e - p;
+  e = e > emin ? e : emin;
+#if defined (HAVE_LDEXP)
+  return MATHFUNC(ldexp) (1., e);
+#else
+  return MATHFUNC(scalbn) (1., e);
+#endif
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_c10.c
new file mode 100644 (file)
index 0000000..d8a5baf
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+void
+spread_c10 (gfc_array_c10 *ret, const gfc_array_c10 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_COMPLEX_10 *rptr;
+  GFC_COMPLEX_10 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_COMPLEX_10 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_COMPLEX_10));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_c10 (gfc_array_c10 *ret, const GFC_COMPLEX_10 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_COMPLEX_10 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_COMPLEX_10));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_c16.c
new file mode 100644 (file)
index 0000000..0bfba7f
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+void
+spread_c16 (gfc_array_c16 *ret, const gfc_array_c16 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_COMPLEX_16 *rptr;
+  GFC_COMPLEX_16 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_COMPLEX_16 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_COMPLEX_16));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_c16 (gfc_array_c16 *ret, const GFC_COMPLEX_16 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_COMPLEX_16 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_COMPLEX_16));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_c4.c
new file mode 100644 (file)
index 0000000..e1a475f
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+void
+spread_c4 (gfc_array_c4 *ret, const gfc_array_c4 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_COMPLEX_4 *rptr;
+  GFC_COMPLEX_4 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_COMPLEX_4 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_COMPLEX_4));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_c4 (gfc_array_c4 *ret, const GFC_COMPLEX_4 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_COMPLEX_4 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_COMPLEX_4));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_c8.c
new file mode 100644 (file)
index 0000000..a290290
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+void
+spread_c8 (gfc_array_c8 *ret, const gfc_array_c8 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_COMPLEX_8 *rptr;
+  GFC_COMPLEX_8 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_COMPLEX_8 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_COMPLEX_8));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_c8 (gfc_array_c8 *ret, const GFC_COMPLEX_8 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_COMPLEX_8 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_COMPLEX_8));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_i1.c
new file mode 100644 (file)
index 0000000..111c4cc
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1)
+
+void
+spread_i1 (gfc_array_i1 *ret, const gfc_array_i1 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_INTEGER_1 *rptr;
+  GFC_INTEGER_1 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_INTEGER_1 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_INTEGER_1));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_i1 (gfc_array_i1 *ret, const GFC_INTEGER_1 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_INTEGER_1 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_INTEGER_1));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_i16.c
new file mode 100644 (file)
index 0000000..2a4864b
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+void
+spread_i16 (gfc_array_i16 *ret, const gfc_array_i16 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_INTEGER_16 *rptr;
+  GFC_INTEGER_16 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_INTEGER_16 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_INTEGER_16));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_i16 (gfc_array_i16 *ret, const GFC_INTEGER_16 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_INTEGER_16 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_INTEGER_16));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_i2.c
new file mode 100644 (file)
index 0000000..5a5d870
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2)
+
+void
+spread_i2 (gfc_array_i2 *ret, const gfc_array_i2 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_INTEGER_2 *rptr;
+  GFC_INTEGER_2 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_INTEGER_2 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_INTEGER_2));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_i2 (gfc_array_i2 *ret, const GFC_INTEGER_2 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_INTEGER_2 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_INTEGER_2));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_i4.c
new file mode 100644 (file)
index 0000000..e990408
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+void
+spread_i4 (gfc_array_i4 *ret, const gfc_array_i4 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_INTEGER_4 *rptr;
+  GFC_INTEGER_4 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_INTEGER_4 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_INTEGER_4));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_i4 (gfc_array_i4 *ret, const GFC_INTEGER_4 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_INTEGER_4 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_INTEGER_4));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_i8.c
new file mode 100644 (file)
index 0000000..1e3b305
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+void
+spread_i8 (gfc_array_i8 *ret, const gfc_array_i8 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_INTEGER_8 *rptr;
+  GFC_INTEGER_8 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_INTEGER_8 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_INTEGER_8));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_i8 (gfc_array_i8 *ret, const GFC_INTEGER_8 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_INTEGER_8 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_INTEGER_8));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_r10.c
new file mode 100644 (file)
index 0000000..ef86bc5
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+void
+spread_r10 (gfc_array_r10 *ret, const gfc_array_r10 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_REAL_10 *rptr;
+  GFC_REAL_10 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_REAL_10 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_REAL_10));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_r10 (gfc_array_r10 *ret, const GFC_REAL_10 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_REAL_10 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_REAL_10));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_r16.c
new file mode 100644 (file)
index 0000000..9678e87
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+void
+spread_r16 (gfc_array_r16 *ret, const gfc_array_r16 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_REAL_16 *rptr;
+  GFC_REAL_16 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_REAL_16 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_REAL_16));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_r16 (gfc_array_r16 *ret, const GFC_REAL_16 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_REAL_16 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_REAL_16));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_r4.c
new file mode 100644 (file)
index 0000000..fac0900
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+void
+spread_r4 (gfc_array_r4 *ret, const gfc_array_r4 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_REAL_4 *rptr;
+  GFC_REAL_4 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_REAL_4 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_REAL_4));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_r4 (gfc_array_r4 *ret, const GFC_REAL_4 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_REAL_4 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_REAL_4));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/spread_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/spread_r8.c
new file mode 100644 (file)
index 0000000..0dd9e7b
--- /dev/null
@@ -0,0 +1,269 @@
+/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+void
+spread_r8 (gfc_array_r8 *ret, const gfc_array_r8 *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  GFC_REAL_8 *rptr;
+  GFC_REAL_8 * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const GFC_REAL_8 *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof(GFC_REAL_8));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_r8 (gfc_array_r8 *ret, const GFC_REAL_8 *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  GFC_REAL_8 * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof (GFC_REAL_8));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_c10.c
new file mode 100644 (file)
index 0000000..b982bfe
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10) && defined (HAVE_GFC_COMPLEX_10)
+
+
+extern void sum_c10 (gfc_array_c10 * const restrict, 
+       gfc_array_c10 * const restrict, const index_type * const restrict);
+export_proto(sum_c10);
+
+void
+sum_c10 (gfc_array_c10 * const restrict retarray, 
+       gfc_array_c10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_COMPLEX_10 * restrict base;
+  GFC_COMPLEX_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_COMPLEX_10 * restrict src;
+      GFC_COMPLEX_10 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_c10 (gfc_array_c10 * const restrict, 
+       gfc_array_c10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_c10);
+
+void
+msum_c10 (gfc_array_c10 * const restrict retarray, 
+       gfc_array_c10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_10 * restrict dest;
+  const GFC_COMPLEX_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_COMPLEX_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_COMPLEX_10 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_c10 (gfc_array_c10 * const restrict, 
+       gfc_array_c10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_c10);
+
+void
+ssum_c10 (gfc_array_c10 * const restrict retarray, 
+       gfc_array_c10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_c10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_c16.c
new file mode 100644 (file)
index 0000000..0bf2b69
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16) && defined (HAVE_GFC_COMPLEX_16)
+
+
+extern void sum_c16 (gfc_array_c16 * const restrict, 
+       gfc_array_c16 * const restrict, const index_type * const restrict);
+export_proto(sum_c16);
+
+void
+sum_c16 (gfc_array_c16 * const restrict retarray, 
+       gfc_array_c16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_COMPLEX_16 * restrict base;
+  GFC_COMPLEX_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_COMPLEX_16 * restrict src;
+      GFC_COMPLEX_16 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_c16 (gfc_array_c16 * const restrict, 
+       gfc_array_c16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_c16);
+
+void
+msum_c16 (gfc_array_c16 * const restrict retarray, 
+       gfc_array_c16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_16 * restrict dest;
+  const GFC_COMPLEX_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_COMPLEX_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_COMPLEX_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_c16 (gfc_array_c16 * const restrict, 
+       gfc_array_c16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_c16);
+
+void
+ssum_c16 (gfc_array_c16 * const restrict retarray, 
+       gfc_array_c16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_c16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_c4.c
new file mode 100644 (file)
index 0000000..a34e63c
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4) && defined (HAVE_GFC_COMPLEX_4)
+
+
+extern void sum_c4 (gfc_array_c4 * const restrict, 
+       gfc_array_c4 * const restrict, const index_type * const restrict);
+export_proto(sum_c4);
+
+void
+sum_c4 (gfc_array_c4 * const restrict retarray, 
+       gfc_array_c4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_COMPLEX_4 * restrict base;
+  GFC_COMPLEX_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_COMPLEX_4 * restrict src;
+      GFC_COMPLEX_4 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_c4 (gfc_array_c4 * const restrict, 
+       gfc_array_c4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_c4);
+
+void
+msum_c4 (gfc_array_c4 * const restrict retarray, 
+       gfc_array_c4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_4 * restrict dest;
+  const GFC_COMPLEX_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_COMPLEX_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_COMPLEX_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_c4 (gfc_array_c4 * const restrict, 
+       gfc_array_c4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_c4);
+
+void
+ssum_c4 (gfc_array_c4 * const restrict retarray, 
+       gfc_array_c4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_c4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_c8.c
new file mode 100644 (file)
index 0000000..42dea7b
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8) && defined (HAVE_GFC_COMPLEX_8)
+
+
+extern void sum_c8 (gfc_array_c8 * const restrict, 
+       gfc_array_c8 * const restrict, const index_type * const restrict);
+export_proto(sum_c8);
+
+void
+sum_c8 (gfc_array_c8 * const restrict retarray, 
+       gfc_array_c8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_COMPLEX_8 * restrict base;
+  GFC_COMPLEX_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_COMPLEX_8 * restrict src;
+      GFC_COMPLEX_8 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_c8 (gfc_array_c8 * const restrict, 
+       gfc_array_c8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_c8);
+
+void
+msum_c8 (gfc_array_c8 * const restrict retarray, 
+       gfc_array_c8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_8 * restrict dest;
+  const GFC_COMPLEX_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_COMPLEX_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_COMPLEX_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_c8 (gfc_array_c8 * const restrict, 
+       gfc_array_c8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_c8);
+
+void
+ssum_c8 (gfc_array_c8 * const restrict retarray, 
+       gfc_array_c8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_COMPLEX_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_c8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_i1.c
new file mode 100644 (file)
index 0000000..4eb6d64
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_1)
+
+
+extern void sum_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict);
+export_proto(sum_i1);
+
+void
+sum_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_1 * restrict base;
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      GFC_INTEGER_1 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_i1);
+
+void
+msum_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  const GFC_INTEGER_1 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_1 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_1 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_i1 (gfc_array_i1 * const restrict, 
+       gfc_array_i1 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_i1);
+
+void
+ssum_i1 (gfc_array_i1 * const restrict retarray, 
+       gfc_array_i1 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_1 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_i1 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_i16.c
new file mode 100644 (file)
index 0000000..8e2c7b3
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
+
+
+extern void sum_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict);
+export_proto(sum_i16);
+
+void
+sum_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_16 * restrict base;
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      GFC_INTEGER_16 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_i16);
+
+void
+msum_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  const GFC_INTEGER_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_i16 (gfc_array_i16 * const restrict, 
+       gfc_array_i16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_i16);
+
+void
+ssum_i16 (gfc_array_i16 * const restrict retarray, 
+       gfc_array_i16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_i16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_i2.c
new file mode 100644 (file)
index 0000000..12ef64d
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2) && defined (HAVE_GFC_INTEGER_2)
+
+
+extern void sum_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict);
+export_proto(sum_i2);
+
+void
+sum_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_2 * restrict base;
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      GFC_INTEGER_2 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_i2);
+
+void
+msum_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  const GFC_INTEGER_2 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_2 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_2 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_i2 (gfc_array_i2 * const restrict, 
+       gfc_array_i2 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_i2);
+
+void
+ssum_i2 (gfc_array_i2 * const restrict retarray, 
+       gfc_array_i2 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_2 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_i2 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_i4.c
new file mode 100644 (file)
index 0000000..645ef43
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
+
+
+extern void sum_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict);
+export_proto(sum_i4);
+
+void
+sum_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_4 * restrict base;
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      GFC_INTEGER_4 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_i4);
+
+void
+msum_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  const GFC_INTEGER_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_i4 (gfc_array_i4 * const restrict, 
+       gfc_array_i4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_i4);
+
+void
+ssum_i4 (gfc_array_i4 * const restrict retarray, 
+       gfc_array_i4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_i4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_i8.c
new file mode 100644 (file)
index 0000000..adb29b5
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
+
+
+extern void sum_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict);
+export_proto(sum_i8);
+
+void
+sum_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_INTEGER_8 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      GFC_INTEGER_8 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_i8);
+
+void
+msum_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  const GFC_INTEGER_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_INTEGER_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_INTEGER_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_i8 (gfc_array_i8 * const restrict, 
+       gfc_array_i8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_i8);
+
+void
+ssum_i8 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_i8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_INTEGER_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_i8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_r10.c
new file mode 100644 (file)
index 0000000..9f588a5
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_REAL_10)
+
+
+extern void sum_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict);
+export_proto(sum_r10);
+
+void
+sum_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_10 * restrict base;
+  GFC_REAL_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_10 * restrict src;
+      GFC_REAL_10 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_r10);
+
+void
+msum_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_10 * restrict dest;
+  const GFC_REAL_10 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_10 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_10 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_r10 (gfc_array_r10 * const restrict, 
+       gfc_array_r10 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_r10);
+
+void
+ssum_r10 (gfc_array_r10 * const restrict retarray, 
+       gfc_array_r10 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_10 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_r10 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_r16.c
new file mode 100644 (file)
index 0000000..292e66f
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16)
+
+
+extern void sum_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict);
+export_proto(sum_r16);
+
+void
+sum_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_16 * restrict base;
+  GFC_REAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_16 * restrict src;
+      GFC_REAL_16 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_r16);
+
+void
+msum_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_16 * restrict dest;
+  const GFC_REAL_16 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_16 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_16 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_r16 (gfc_array_r16 * const restrict, 
+       gfc_array_r16 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_r16);
+
+void
+ssum_r16 (gfc_array_r16 * const restrict retarray, 
+       gfc_array_r16 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_16 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_r16 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_r4.c
new file mode 100644 (file)
index 0000000..8fd563f
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_REAL_4)
+
+
+extern void sum_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict);
+export_proto(sum_r4);
+
+void
+sum_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_4 * restrict base;
+  GFC_REAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_4 * restrict src;
+      GFC_REAL_4 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_r4);
+
+void
+msum_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_4 * restrict dest;
+  const GFC_REAL_4 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_4 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_4 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_r4 (gfc_array_r4 * const restrict, 
+       gfc_array_r4 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_r4);
+
+void
+ssum_r4 (gfc_array_r4 * const restrict retarray, 
+       gfc_array_r4 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_4 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_r4 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/sum_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/sum_r8.c
new file mode 100644 (file)
index 0000000..e583980
--- /dev/null
@@ -0,0 +1,508 @@
+/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_REAL_8)
+
+
+extern void sum_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict);
+export_proto(sum_r8);
+
+void
+sum_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_REAL_8 * restrict base;
+  GFC_REAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "SUM");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_REAL_8 * restrict src;
+      GFC_REAL_8 result;
+      src = base;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+
+  result += *src;
+             }
+           
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void msum_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(msum_r8);
+
+void
+msum_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_8 * restrict dest;
+  const GFC_REAL_8 * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in SUM intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "SUM");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "SUM");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const GFC_REAL_8 * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      GFC_REAL_8 result;
+      src = base;
+      msrc = mbase;
+      {
+
+  result = 0;
+       if (len <= 0)
+         *dest = 0;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+
+  if (*msrc)
+    result += *src;
+             }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+
+extern void ssum_r8 (gfc_array_r8 * const restrict, 
+       gfc_array_r8 * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(ssum_r8);
+
+void
+ssum_r8 (gfc_array_r8 * const restrict retarray, 
+       gfc_array_r8 * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  GFC_REAL_8 * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      sum_r8 (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " SUM intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " SUM intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = 0;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_c10.c
new file mode 100644 (file)
index 0000000..e740d12
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+extern void transpose_c10 (gfc_array_c10 * const restrict ret, 
+       gfc_array_c10 * const restrict source);
+export_proto(transpose_c10);
+
+void
+transpose_c10 (gfc_array_c10 * const restrict ret, 
+       gfc_array_c10 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_COMPLEX_10 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_COMPLEX_10 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_c16.c
new file mode 100644 (file)
index 0000000..31115bd
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+extern void transpose_c16 (gfc_array_c16 * const restrict ret, 
+       gfc_array_c16 * const restrict source);
+export_proto(transpose_c16);
+
+void
+transpose_c16 (gfc_array_c16 * const restrict ret, 
+       gfc_array_c16 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_COMPLEX_16 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_COMPLEX_16 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_c4.c
new file mode 100644 (file)
index 0000000..a63f62c
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+extern void transpose_c4 (gfc_array_c4 * const restrict ret, 
+       gfc_array_c4 * const restrict source);
+export_proto(transpose_c4);
+
+void
+transpose_c4 (gfc_array_c4 * const restrict ret, 
+       gfc_array_c4 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_COMPLEX_4 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_COMPLEX_4 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_c8.c
new file mode 100644 (file)
index 0000000..8322394
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+extern void transpose_c8 (gfc_array_c8 * const restrict ret, 
+       gfc_array_c8 * const restrict source);
+export_proto(transpose_c8);
+
+void
+transpose_c8 (gfc_array_c8 * const restrict ret, 
+       gfc_array_c8 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_COMPLEX_8 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_COMPLEX_8 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_i16.c
new file mode 100644 (file)
index 0000000..f8cfd82
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+extern void transpose_i16 (gfc_array_i16 * const restrict ret, 
+       gfc_array_i16 * const restrict source);
+export_proto(transpose_i16);
+
+void
+transpose_i16 (gfc_array_i16 * const restrict ret, 
+       gfc_array_i16 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_INTEGER_16 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_INTEGER_16 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_i4.c
new file mode 100644 (file)
index 0000000..9b15e47
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+extern void transpose_i4 (gfc_array_i4 * const restrict ret, 
+       gfc_array_i4 * const restrict source);
+export_proto(transpose_i4);
+
+void
+transpose_i4 (gfc_array_i4 * const restrict ret, 
+       gfc_array_i4 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_INTEGER_4 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_INTEGER_4 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_i8.c
new file mode 100644 (file)
index 0000000..ddf772b
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+extern void transpose_i8 (gfc_array_i8 * const restrict ret, 
+       gfc_array_i8 * const restrict source);
+export_proto(transpose_i8);
+
+void
+transpose_i8 (gfc_array_i8 * const restrict ret, 
+       gfc_array_i8 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_INTEGER_8 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_INTEGER_8 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_r10.c
new file mode 100644 (file)
index 0000000..2b2e02d
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+extern void transpose_r10 (gfc_array_r10 * const restrict ret, 
+       gfc_array_r10 * const restrict source);
+export_proto(transpose_r10);
+
+void
+transpose_r10 (gfc_array_r10 * const restrict ret, 
+       gfc_array_r10 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_REAL_10 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_REAL_10 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_r16.c
new file mode 100644 (file)
index 0000000..4d2e406
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+extern void transpose_r16 (gfc_array_r16 * const restrict ret, 
+       gfc_array_r16 * const restrict source);
+export_proto(transpose_r16);
+
+void
+transpose_r16 (gfc_array_r16 * const restrict ret, 
+       gfc_array_r16 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_REAL_16 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_REAL_16 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_r4.c
new file mode 100644 (file)
index 0000000..1748c1d
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+extern void transpose_r4 (gfc_array_r4 * const restrict ret, 
+       gfc_array_r4 * const restrict source);
+export_proto(transpose_r4);
+
+void
+transpose_r4 (gfc_array_r4 * const restrict ret, 
+       gfc_array_r4 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_REAL_4 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_REAL_4 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/transpose_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/transpose_r8.c
new file mode 100644 (file)
index 0000000..09054b6
--- /dev/null
@@ -0,0 +1,114 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+extern void transpose_r8 (gfc_array_r8 * const restrict ret, 
+       gfc_array_r8 * const restrict source);
+export_proto(transpose_r8);
+
+void
+transpose_r8 (gfc_array_r8 * const restrict ret, 
+       gfc_array_r8 * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  GFC_REAL_8 * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const GFC_REAL_8 *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_c10.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_c10.c
new file mode 100644 (file)
index 0000000..9b89a5b
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+void
+unpack0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *vector,
+                const gfc_array_l1 *mask, const GFC_COMPLEX_10 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_COMPLEX_10 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_COMPLEX_10 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_COMPLEX_10 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_COMPLEX_10));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_c10 (gfc_array_c10 *ret, const gfc_array_c10 *vector,
+                const gfc_array_l1 *mask, const gfc_array_c10 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_COMPLEX_10 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_COMPLEX_10 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_COMPLEX_10 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_COMPLEX_10));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_c16.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_c16.c
new file mode 100644 (file)
index 0000000..2d9931f
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+void
+unpack0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
+                const gfc_array_l1 *mask, const GFC_COMPLEX_16 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_COMPLEX_16 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_COMPLEX_16 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_COMPLEX_16 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_COMPLEX_16));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
+                const gfc_array_l1 *mask, const gfc_array_c16 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_COMPLEX_16 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_COMPLEX_16 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_COMPLEX_16 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_COMPLEX_16));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_c4.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_c4.c
new file mode 100644 (file)
index 0000000..116f213
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+void
+unpack0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *vector,
+                const gfc_array_l1 *mask, const GFC_COMPLEX_4 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_COMPLEX_4 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_COMPLEX_4 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_COMPLEX_4 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_COMPLEX_4));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_c4 (gfc_array_c4 *ret, const gfc_array_c4 *vector,
+                const gfc_array_l1 *mask, const gfc_array_c4 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_COMPLEX_4 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_COMPLEX_4 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_COMPLEX_4 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_COMPLEX_4));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_c8.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_c8.c
new file mode 100644 (file)
index 0000000..7298eec
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+void
+unpack0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *vector,
+                const gfc_array_l1 *mask, const GFC_COMPLEX_8 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_COMPLEX_8 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_COMPLEX_8 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_COMPLEX_8 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_COMPLEX_8));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_c8 (gfc_array_c8 *ret, const gfc_array_c8 *vector,
+                const gfc_array_l1 *mask, const gfc_array_c8 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_COMPLEX_8 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_COMPLEX_8 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_COMPLEX_8 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_COMPLEX_8));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_i1.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_i1.c
new file mode 100644 (file)
index 0000000..f5dcb93
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1)
+
+void
+unpack0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
+                const gfc_array_l1 *mask, const GFC_INTEGER_1 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_1 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_1 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_INTEGER_1 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_1));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
+                const gfc_array_l1 *mask, const gfc_array_i1 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_1 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_1 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_INTEGER_1 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_1));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_i16.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_i16.c
new file mode 100644 (file)
index 0000000..77920ea
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+void
+unpack0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *vector,
+                const gfc_array_l1 *mask, const GFC_INTEGER_16 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_16 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_16 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_INTEGER_16 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_16));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_i16 (gfc_array_i16 *ret, const gfc_array_i16 *vector,
+                const gfc_array_l1 *mask, const gfc_array_i16 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_16 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_16 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_INTEGER_16 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_16));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_i2.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_i2.c
new file mode 100644 (file)
index 0000000..c7257bb
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2)
+
+void
+unpack0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *vector,
+                const gfc_array_l1 *mask, const GFC_INTEGER_2 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_2 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_2 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_INTEGER_2 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_2));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_i2 (gfc_array_i2 *ret, const gfc_array_i2 *vector,
+                const gfc_array_l1 *mask, const gfc_array_i2 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_2 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_2 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_INTEGER_2 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_2));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_i4.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_i4.c
new file mode 100644 (file)
index 0000000..e3cdde6
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+void
+unpack0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *vector,
+                const gfc_array_l1 *mask, const GFC_INTEGER_4 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_4 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_4 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_INTEGER_4 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_4));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_i4 (gfc_array_i4 *ret, const gfc_array_i4 *vector,
+                const gfc_array_l1 *mask, const gfc_array_i4 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_4 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_4 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_INTEGER_4 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_4));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_i8.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_i8.c
new file mode 100644 (file)
index 0000000..2f72064
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+void
+unpack0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *vector,
+                const gfc_array_l1 *mask, const GFC_INTEGER_8 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_8 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_8 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_INTEGER_8 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_8));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_i8 (gfc_array_i8 *ret, const gfc_array_i8 *vector,
+                const gfc_array_l1 *mask, const gfc_array_i8 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_INTEGER_8 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_INTEGER_8 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_INTEGER_8 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_8));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_r10.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_r10.c
new file mode 100644 (file)
index 0000000..796df2e
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+void
+unpack0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *vector,
+                const gfc_array_l1 *mask, const GFC_REAL_10 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_REAL_10 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_REAL_10 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_REAL_10 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_REAL_10));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_r10 (gfc_array_r10 *ret, const gfc_array_r10 *vector,
+                const gfc_array_l1 *mask, const gfc_array_r10 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_REAL_10 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_REAL_10 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_REAL_10 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_REAL_10));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_r16.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_r16.c
new file mode 100644 (file)
index 0000000..b25d286
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+void
+unpack0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *vector,
+                const gfc_array_l1 *mask, const GFC_REAL_16 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_REAL_16 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_REAL_16 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_REAL_16 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_REAL_16));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_r16 (gfc_array_r16 *ret, const gfc_array_r16 *vector,
+                const gfc_array_l1 *mask, const gfc_array_r16 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_REAL_16 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_REAL_16 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_REAL_16 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_REAL_16));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_r4.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_r4.c
new file mode 100644 (file)
index 0000000..f4b763f
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+void
+unpack0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *vector,
+                const gfc_array_l1 *mask, const GFC_REAL_4 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_REAL_4 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_REAL_4 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_REAL_4 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_REAL_4));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_r4 (gfc_array_r4 *ret, const gfc_array_r4 *vector,
+                const gfc_array_l1 *mask, const gfc_array_r4 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_REAL_4 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_REAL_4 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_REAL_4 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_REAL_4));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/generated/unpack_r8.c b/l4/pkg/libgfortran/lib/contrib/generated/unpack_r8.c
new file mode 100644 (file)
index 0000000..dc9b4d3
--- /dev/null
@@ -0,0 +1,331 @@
+/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+void
+unpack0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *vector,
+                const gfc_array_l1 *mask, const GFC_REAL_8 *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_REAL_8 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_REAL_8 *vptr;
+  /* Value for field, this is constant.  */
+  const GFC_REAL_8 fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_REAL_8));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_r8 (gfc_array_r8 *ret, const gfc_array_r8 *vector,
+                const gfc_array_l1 *mask, const gfc_array_r8 *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  GFC_REAL_8 * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  GFC_REAL_8 *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const GFC_REAL_8 *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof (GFC_REAL_8));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/gfortran.map b/l4/pkg/libgfortran/lib/contrib/gfortran.map
new file mode 100644 (file)
index 0000000..211db00
--- /dev/null
@@ -0,0 +1,1351 @@
+GFORTRAN_1.0 {
+  global:
+    _gfortran_abort;
+    _gfortran_access_func;
+    _gfortran_adjustl;
+    _gfortran_adjustr;
+    _gfortran_alarm_sub_i4;
+    _gfortran_alarm_sub_i8;
+    _gfortran_alarm_sub_int_i4;
+    _gfortran_alarm_sub_int_i8;
+    _gfortran_all_l1;
+    _gfortran_all_l16;
+    _gfortran_all_l2;
+    _gfortran_all_l4;
+    _gfortran_all_l8;
+    _gfortran_any_l1;
+    _gfortran_any_l16;
+    _gfortran_any_l2;
+    _gfortran_any_l4;
+    _gfortran_any_l8;
+    _gfortran_arandom_r10;
+    _gfortran_arandom_r16;
+    _gfortran_arandom_r4;
+    _gfortran_arandom_r8;
+    _gfortran_associated;
+    _gfortran_chdir_i4;
+    _gfortran_chdir_i4_sub;
+    _gfortran_chdir_i8;
+    _gfortran_chdir_i8_sub;
+    _gfortran_chmod_func;
+    _gfortran_chmod_i4_sub;
+    _gfortran_chmod_i8_sub;
+    _gfortran_compare_string;
+    _gfortran_concat_string;
+    _gfortran_count_1_l;
+    _gfortran_count_16_l;
+    _gfortran_count_2_l;
+    _gfortran_count_4_l;
+    _gfortran_count_8_l;
+    _gfortran_cpu_time_10;
+    _gfortran_cpu_time_16;
+    _gfortran_cpu_time_4;
+    _gfortran_cpu_time_8;
+    _gfortran_cshift0_1;
+    _gfortran_cshift0_1_char;
+    _gfortran_cshift0_2;
+    _gfortran_cshift0_2_char;
+    _gfortran_cshift0_4;
+    _gfortran_cshift0_4_char;
+    _gfortran_cshift0_8;
+    _gfortran_cshift0_8_char;
+    _gfortran_cshift1_16;
+    _gfortran_cshift1_16_char;
+    _gfortran_cshift1_4;
+    _gfortran_cshift1_4_char;
+    _gfortran_cshift1_8;
+    _gfortran_cshift1_8_char;
+    _gfortran_ctime;
+    _gfortran_ctime_sub;
+    _gfortran_date_and_time;
+    _gfortran_dtime;
+    _gfortran_dtime_sub;
+    _gfortran_eoshift0_1;
+    _gfortran_eoshift0_1_char;
+    _gfortran_eoshift0_2;
+    _gfortran_eoshift0_2_char;
+    _gfortran_eoshift0_4;
+    _gfortran_eoshift0_4_char;
+    _gfortran_eoshift0_8;
+    _gfortran_eoshift0_8_char;
+    _gfortran_eoshift1_16;
+    _gfortran_eoshift1_16_char;
+    _gfortran_eoshift1_4;
+    _gfortran_eoshift1_4_char;
+    _gfortran_eoshift1_8;
+    _gfortran_eoshift1_8_char;
+    _gfortran_eoshift2_1;
+    _gfortran_eoshift2_1_char;
+    _gfortran_eoshift2_2;
+    _gfortran_eoshift2_2_char;
+    _gfortran_eoshift2_4;
+    _gfortran_eoshift2_4_char;
+    _gfortran_eoshift2_8;
+    _gfortran_eoshift2_8_char;
+    _gfortran_eoshift3_16;
+    _gfortran_eoshift3_16_char;
+    _gfortran_eoshift3_4;
+    _gfortran_eoshift3_4_char;
+    _gfortran_eoshift3_8;
+    _gfortran_eoshift3_8_char;
+    _gfortran_etime;
+    _gfortran_etime_sub;
+    _gfortran_exit_i4;
+    _gfortran_exit_i8;
+    _gfortran_exponent_r10;
+    _gfortran_exponent_r16;
+    _gfortran_exponent_r4;
+    _gfortran_exponent_r8;
+    _gfortran_fdate;
+    _gfortran_fdate_sub;
+    _gfortran_fget;
+    _gfortran_fgetc;
+    _gfortran_fgetc_i1_sub;
+    _gfortran_fgetc_i2_sub;
+    _gfortran_fgetc_i4_sub;
+    _gfortran_fgetc_i8_sub;
+    _gfortran_fget_i1_sub;
+    _gfortran_fget_i2_sub;
+    _gfortran_fget_i4_sub;
+    _gfortran_fget_i8_sub;
+    _gfortran_flush_i4;
+    _gfortran_flush_i8;
+    _gfortran_fnum_i4;
+    _gfortran_fnum_i8;
+    _gfortran_fput;
+    _gfortran_fputc;
+    _gfortran_fputc_i1_sub;
+    _gfortran_fputc_i2_sub;
+    _gfortran_fputc_i4_sub;
+    _gfortran_fputc_i8_sub;
+    _gfortran_fput_i1_sub;
+    _gfortran_fput_i2_sub;
+    _gfortran_fput_i4_sub;
+    _gfortran_fput_i8_sub;
+    _gfortran_fraction_r10;
+    _gfortran_fraction_r16;
+    _gfortran_fraction_r4;
+    _gfortran_fraction_r8;
+    _gfortran_free;
+    _gfortran_fseek_sub;
+    _gfortran_fstat_i4;
+    _gfortran_fstat_i4_sub;
+    _gfortran_fstat_i8;
+    _gfortran_fstat_i8_sub;
+    _gfortran_ftell;
+    _gfortran_ftell_i1_sub;
+    _gfortran_ftell_i2_sub;
+    _gfortran_ftell_i4_sub;
+    _gfortran_ftell_i8_sub;
+    _gfortran_generate_error;
+    _gfortran_gerror;
+    _gfortran_getarg_i4;
+    _gfortran_getarg_i8;
+    _gfortran_get_command_argument_i4;
+    _gfortran_get_command_argument_i8;
+    _gfortran_get_command_i4;
+    _gfortran_get_command_i8;
+    _gfortran_getcwd;
+    _gfortran_getcwd_i4_sub;
+    _gfortran_getcwd_i8_sub;
+    _gfortran_getenv;
+    _gfortran_get_environment_variable_i4;
+    _gfortran_get_environment_variable_i8;
+    _gfortran_getgid;
+    _gfortran_getlog;
+    _gfortran_getpid;
+    _gfortran_getuid;
+    _gfortran_gmtime_i4;
+    _gfortran_gmtime_i8;
+    _gfortran_hostnm;
+    _gfortran_hostnm_i4_sub;
+    _gfortran_hostnm_i8_sub;
+    _gfortran_iargc;
+    _gfortran_idate_i4;
+    _gfortran_idate_i8;
+    _gfortran_ierrno_i4;
+    _gfortran_ierrno_i8;
+    _gfortran_internal_pack;
+    _gfortran_internal_unpack;
+    _gfortran_irand;
+    _gfortran_isatty_l4;
+    _gfortran_isatty_l8;
+    _gfortran_ishftc16;
+    _gfortran_ishftc4;
+    _gfortran_ishftc8;
+    _gfortran_itime_i4;
+    _gfortran_itime_i8;
+    _gfortran_kill_i4;
+    _gfortran_kill_i4_sub;
+    _gfortran_kill_i8;
+    _gfortran_kill_i8_sub;
+    _gfortran_link_i4;
+    _gfortran_link_i4_sub;
+    _gfortran_link_i8;
+    _gfortran_link_i8_sub;
+    _gfortran_lstat_i4;
+    _gfortran_lstat_i4_sub;
+    _gfortran_lstat_i8;
+    _gfortran_lstat_i8_sub;
+    _gfortran_ltime_i4;
+    _gfortran_ltime_i8;
+    _gfortran_malloc;
+    _gfortran_matmul_c10;
+    _gfortran_matmul_c16;
+    _gfortran_matmul_c4;
+    _gfortran_matmul_c8;
+    _gfortran_matmul_i1;
+    _gfortran_matmul_i16;
+    _gfortran_matmul_i2;
+    _gfortran_matmul_i4;
+    _gfortran_matmul_i8;
+    _gfortran_matmul_l16;
+    _gfortran_matmul_l4;
+    _gfortran_matmul_l8;
+    _gfortran_matmul_r10;
+    _gfortran_matmul_r16;
+    _gfortran_matmul_r4;
+    _gfortran_matmul_r8;
+    _gfortran_maxloc0_16_i1;
+    _gfortran_maxloc0_16_i16;
+    _gfortran_maxloc0_16_i2;
+    _gfortran_maxloc0_16_i4;
+    _gfortran_maxloc0_16_i8;
+    _gfortran_maxloc0_16_r10;
+    _gfortran_maxloc0_16_r16;
+    _gfortran_maxloc0_16_r4;
+    _gfortran_maxloc0_16_r8;
+    _gfortran_maxloc0_4_i1;
+    _gfortran_maxloc0_4_i16;
+    _gfortran_maxloc0_4_i2;
+    _gfortran_maxloc0_4_i4;
+    _gfortran_maxloc0_4_i8;
+    _gfortran_maxloc0_4_r10;
+    _gfortran_maxloc0_4_r16;
+    _gfortran_maxloc0_4_r4;
+    _gfortran_maxloc0_4_r8;
+    _gfortran_maxloc0_8_i1;
+    _gfortran_maxloc0_8_i16;
+    _gfortran_maxloc0_8_i2;
+    _gfortran_maxloc0_8_i4;
+    _gfortran_maxloc0_8_i8;
+    _gfortran_maxloc0_8_r10;
+    _gfortran_maxloc0_8_r16;
+    _gfortran_maxloc0_8_r4;
+    _gfortran_maxloc0_8_r8;
+    _gfortran_maxloc1_16_i1;
+    _gfortran_maxloc1_16_i16;
+    _gfortran_maxloc1_16_i2;
+    _gfortran_maxloc1_16_i4;
+    _gfortran_maxloc1_16_i8;
+    _gfortran_maxloc1_16_r10;
+    _gfortran_maxloc1_16_r16;
+    _gfortran_maxloc1_16_r4;
+    _gfortran_maxloc1_16_r8;
+    _gfortran_maxloc1_4_i1;
+    _gfortran_maxloc1_4_i16;
+    _gfortran_maxloc1_4_i2;
+    _gfortran_maxloc1_4_i4;
+    _gfortran_maxloc1_4_i8;
+    _gfortran_maxloc1_4_r10;
+    _gfortran_maxloc1_4_r16;
+    _gfortran_maxloc1_4_r4;
+    _gfortran_maxloc1_4_r8;
+    _gfortran_maxloc1_8_i1;
+    _gfortran_maxloc1_8_i16;
+    _gfortran_maxloc1_8_i2;
+    _gfortran_maxloc1_8_i4;
+    _gfortran_maxloc1_8_i8;
+    _gfortran_maxloc1_8_r10;
+    _gfortran_maxloc1_8_r16;
+    _gfortran_maxloc1_8_r4;
+    _gfortran_maxloc1_8_r8;
+    _gfortran_maxval_i1;
+    _gfortran_maxval_i16;
+    _gfortran_maxval_i2;
+    _gfortran_maxval_i4;
+    _gfortran_maxval_i8;
+    _gfortran_maxval_r10;
+    _gfortran_maxval_r16;
+    _gfortran_maxval_r4;
+    _gfortran_maxval_r8;
+    _gfortran_mclock;
+    _gfortran_mclock8;
+    _gfortran_minloc0_16_i1;
+    _gfortran_minloc0_16_i16;
+    _gfortran_minloc0_16_i2;
+    _gfortran_minloc0_16_i4;
+    _gfortran_minloc0_16_i8;
+    _gfortran_minloc0_16_r10;
+    _gfortran_minloc0_16_r16;
+    _gfortran_minloc0_16_r4;
+    _gfortran_minloc0_16_r8;
+    _gfortran_minloc0_4_i1;
+    _gfortran_minloc0_4_i16;
+    _gfortran_minloc0_4_i2;
+    _gfortran_minloc0_4_i4;
+    _gfortran_minloc0_4_i8;
+    _gfortran_minloc0_4_r10;
+    _gfortran_minloc0_4_r16;
+    _gfortran_minloc0_4_r4;
+    _gfortran_minloc0_4_r8;
+    _gfortran_minloc0_8_i1;
+    _gfortran_minloc0_8_i16;
+    _gfortran_minloc0_8_i2;
+    _gfortran_minloc0_8_i4;
+    _gfortran_minloc0_8_i8;
+    _gfortran_minloc0_8_r10;
+    _gfortran_minloc0_8_r16;
+    _gfortran_minloc0_8_r4;
+    _gfortran_minloc0_8_r8;
+    _gfortran_minloc1_16_i1;
+    _gfortran_minloc1_16_i16;
+    _gfortran_minloc1_16_i2;
+    _gfortran_minloc1_16_i4;
+    _gfortran_minloc1_16_i8;
+    _gfortran_minloc1_16_r10;
+    _gfortran_minloc1_16_r16;
+    _gfortran_minloc1_16_r4;
+    _gfortran_minloc1_16_r8;
+    _gfortran_minloc1_4_i1;
+    _gfortran_minloc1_4_i16;
+    _gfortran_minloc1_4_i2;
+    _gfortran_minloc1_4_i4;
+    _gfortran_minloc1_4_i8;
+    _gfortran_minloc1_4_r10;
+    _gfortran_minloc1_4_r16;
+    _gfortran_minloc1_4_r4;
+    _gfortran_minloc1_4_r8;
+    _gfortran_minloc1_8_i1;
+    _gfortran_minloc1_8_i16;
+    _gfortran_minloc1_8_i2;
+    _gfortran_minloc1_8_i4;
+    _gfortran_minloc1_8_i8;
+    _gfortran_minloc1_8_r10;
+    _gfortran_minloc1_8_r16;
+    _gfortran_minloc1_8_r4;
+    _gfortran_minloc1_8_r8;
+    _gfortran_minval_i1;
+    _gfortran_minval_i16;
+    _gfortran_minval_i2;
+    _gfortran_minval_i4;
+    _gfortran_minval_i8;
+    _gfortran_minval_r10;
+    _gfortran_minval_r16;
+    _gfortran_minval_r4;
+    _gfortran_minval_r8;
+    _gfortran_mmaxloc0_16_i1;
+    _gfortran_mmaxloc0_16_i16;
+    _gfortran_mmaxloc0_16_i2;
+    _gfortran_mmaxloc0_16_i4;
+    _gfortran_mmaxloc0_16_i8;
+    _gfortran_mmaxloc0_16_r10;
+    _gfortran_mmaxloc0_16_r16;
+    _gfortran_mmaxloc0_16_r4;
+    _gfortran_mmaxloc0_16_r8;
+    _gfortran_mmaxloc0_4_i1;
+    _gfortran_mmaxloc0_4_i16;
+    _gfortran_mmaxloc0_4_i2;
+    _gfortran_mmaxloc0_4_i4;
+    _gfortran_mmaxloc0_4_i8;
+    _gfortran_mmaxloc0_4_r10;
+    _gfortran_mmaxloc0_4_r16;
+    _gfortran_mmaxloc0_4_r4;
+    _gfortran_mmaxloc0_4_r8;
+    _gfortran_mmaxloc0_8_i1;
+    _gfortran_mmaxloc0_8_i16;
+    _gfortran_mmaxloc0_8_i2;
+    _gfortran_mmaxloc0_8_i4;
+    _gfortran_mmaxloc0_8_i8;
+    _gfortran_mmaxloc0_8_r10;
+    _gfortran_mmaxloc0_8_r16;
+    _gfortran_mmaxloc0_8_r4;
+    _gfortran_mmaxloc0_8_r8;
+    _gfortran_mmaxloc1_16_i1;
+    _gfortran_mmaxloc1_16_i16;
+    _gfortran_mmaxloc1_16_i2;
+    _gfortran_mmaxloc1_16_i4;
+    _gfortran_mmaxloc1_16_i8;
+    _gfortran_mmaxloc1_16_r10;
+    _gfortran_mmaxloc1_16_r16;
+    _gfortran_mmaxloc1_16_r4;
+    _gfortran_mmaxloc1_16_r8;
+    _gfortran_mmaxloc1_4_i1;
+    _gfortran_mmaxloc1_4_i16;
+    _gfortran_mmaxloc1_4_i2;
+    _gfortran_mmaxloc1_4_i4;
+    _gfortran_mmaxloc1_4_i8;
+    _gfortran_mmaxloc1_4_r10;
+    _gfortran_mmaxloc1_4_r16;
+    _gfortran_mmaxloc1_4_r4;
+    _gfortran_mmaxloc1_4_r8;
+    _gfortran_mmaxloc1_8_i1;
+    _gfortran_mmaxloc1_8_i16;
+    _gfortran_mmaxloc1_8_i2;
+    _gfortran_mmaxloc1_8_i4;
+    _gfortran_mmaxloc1_8_i8;
+    _gfortran_mmaxloc1_8_r10;
+    _gfortran_mmaxloc1_8_r16;
+    _gfortran_mmaxloc1_8_r4;
+    _gfortran_mmaxloc1_8_r8;
+    _gfortran_mmaxval_i1;
+    _gfortran_mmaxval_i16;
+    _gfortran_mmaxval_i2;
+    _gfortran_mmaxval_i4;
+    _gfortran_mmaxval_i8;
+    _gfortran_mmaxval_r10;
+    _gfortran_mmaxval_r16;
+    _gfortran_mmaxval_r4;
+    _gfortran_mmaxval_r8;
+    _gfortran_mminloc0_16_i1;
+    _gfortran_mminloc0_16_i16;
+    _gfortran_mminloc0_16_i2;
+    _gfortran_mminloc0_16_i4;
+    _gfortran_mminloc0_16_i8;
+    _gfortran_mminloc0_16_r10;
+    _gfortran_mminloc0_16_r16;
+    _gfortran_mminloc0_16_r4;
+    _gfortran_mminloc0_16_r8;
+    _gfortran_mminloc0_4_i1;
+    _gfortran_mminloc0_4_i16;
+    _gfortran_mminloc0_4_i2;
+    _gfortran_mminloc0_4_i4;
+    _gfortran_mminloc0_4_i8;
+    _gfortran_mminloc0_4_r10;
+    _gfortran_mminloc0_4_r16;
+    _gfortran_mminloc0_4_r4;
+    _gfortran_mminloc0_4_r8;
+    _gfortran_mminloc0_8_i1;
+    _gfortran_mminloc0_8_i16;
+    _gfortran_mminloc0_8_i2;
+    _gfortran_mminloc0_8_i4;
+    _gfortran_mminloc0_8_i8;
+    _gfortran_mminloc0_8_r10;
+    _gfortran_mminloc0_8_r16;
+    _gfortran_mminloc0_8_r4;
+    _gfortran_mminloc0_8_r8;
+    _gfortran_mminloc1_16_i1;
+    _gfortran_mminloc1_16_i16;
+    _gfortran_mminloc1_16_i2;
+    _gfortran_mminloc1_16_i4;
+    _gfortran_mminloc1_16_i8;
+    _gfortran_mminloc1_16_r10;
+    _gfortran_mminloc1_16_r16;
+    _gfortran_mminloc1_16_r4;
+    _gfortran_mminloc1_16_r8;
+    _gfortran_mminloc1_4_i1;
+    _gfortran_mminloc1_4_i16;
+    _gfortran_mminloc1_4_i2;
+    _gfortran_mminloc1_4_i4;
+    _gfortran_mminloc1_4_i8;
+    _gfortran_mminloc1_4_r10;
+    _gfortran_mminloc1_4_r16;
+    _gfortran_mminloc1_4_r4;
+    _gfortran_mminloc1_4_r8;
+    _gfortran_mminloc1_8_i1;
+    _gfortran_mminloc1_8_i16;
+    _gfortran_mminloc1_8_i2;
+    _gfortran_mminloc1_8_i4;
+    _gfortran_mminloc1_8_i8;
+    _gfortran_mminloc1_8_r10;
+    _gfortran_mminloc1_8_r16;
+    _gfortran_mminloc1_8_r4;
+    _gfortran_mminloc1_8_r8;
+    _gfortran_mminval_i1;
+    _gfortran_mminval_i16;
+    _gfortran_mminval_i2;
+    _gfortran_mminval_i4;
+    _gfortran_mminval_i8;
+    _gfortran_mminval_r10;
+    _gfortran_mminval_r16;
+    _gfortran_mminval_r4;
+    _gfortran_mminval_r8;
+    _gfortran_move_alloc;
+    _gfortran_move_alloc_c;
+    _gfortran_mproduct_c10;
+    _gfortran_mproduct_c16;
+    _gfortran_mproduct_c4;
+    _gfortran_mproduct_c8;
+    _gfortran_mproduct_i1;
+    _gfortran_mproduct_i16;
+    _gfortran_mproduct_i2;
+    _gfortran_mproduct_i4;
+    _gfortran_mproduct_i8;
+    _gfortran_mproduct_r10;
+    _gfortran_mproduct_r16;
+    _gfortran_mproduct_r4;
+    _gfortran_mproduct_r8;
+    _gfortran_msum_c10;
+    _gfortran_msum_c16;
+    _gfortran_msum_c4;
+    _gfortran_msum_c8;
+    _gfortran_msum_i1;
+    _gfortran_msum_i16;
+    _gfortran_msum_i2;
+    _gfortran_msum_i4;
+    _gfortran_msum_i8;
+    _gfortran_msum_r10;
+    _gfortran_msum_r16;
+    _gfortran_msum_r4;
+    _gfortran_msum_r8;
+    _gfortran_mvbits_i1;
+    _gfortran_mvbits_i2;
+    _gfortran_mvbits_i4;
+    _gfortran_mvbits_i8;
+    _gfortran_nearest_r10;
+    _gfortran_nearest_r16;
+    _gfortran_nearest_r4;
+    _gfortran_nearest_r8;
+    _gfortran_os_error;
+    _gfortran_pack;
+    _gfortran_pack_char;
+    _gfortran_pack_s;
+    _gfortran_pack_s_char;
+    _gfortran_pause_numeric;
+    _gfortran_pause_string;
+    _gfortran_perror_sub;
+    _gfortran_pow_c10_i16;
+    _gfortran_pow_c10_i4;
+    _gfortran_pow_c10_i8;
+    _gfortran_pow_c16_i16;
+    _gfortran_pow_c16_i4;
+    _gfortran_pow_c16_i8;
+    _gfortran_pow_c4_i16;
+    _gfortran_pow_c4_i4;
+    _gfortran_pow_c4_i8;
+    _gfortran_pow_c8_i16;
+    _gfortran_pow_c8_i4;
+    _gfortran_pow_c8_i8;
+    _gfortran_pow_i16_i16;
+    _gfortran_pow_i16_i4;
+    _gfortran_pow_i16_i8;
+    _gfortran_pow_i4_i16;
+    _gfortran_pow_i4_i4;
+    _gfortran_pow_i4_i8;
+    _gfortran_pow_i8_i16;
+    _gfortran_pow_i8_i4;
+    _gfortran_pow_i8_i8;
+    _gfortran_pow_r10_i16;
+    _gfortran_pow_r10_i8;
+    _gfortran_pow_r16_i16;
+    _gfortran_pow_r16_i4;
+    _gfortran_pow_r16_i8;
+    _gfortran_pow_r4_i16;
+    _gfortran_pow_r4_i8;
+    _gfortran_pow_r8_i16;
+    _gfortran_pow_r8_i8;
+    _gfortran_product_c10;
+    _gfortran_product_c16;
+    _gfortran_product_c4;
+    _gfortran_product_c8;
+    _gfortran_product_i1;
+    _gfortran_product_i16;
+    _gfortran_product_i2;
+    _gfortran_product_i4;
+    _gfortran_product_i8;
+    _gfortran_product_r10;
+    _gfortran_product_r16;
+    _gfortran_product_r4;
+    _gfortran_product_r8;
+    _gfortran_rand;
+    _gfortran_random_r10;
+    _gfortran_random_r16;
+    _gfortran_random_r4;
+    _gfortran_random_r8;
+    _gfortran_random_seed_i4;
+    _gfortran_random_seed_i8;
+    _gfortran_rename_i4;
+    _gfortran_rename_i4_sub;
+    _gfortran_rename_i8;
+    _gfortran_rename_i8_sub;
+    _gfortran_reshape;
+    _gfortran_reshape_16;
+    _gfortran_reshape_4;
+    _gfortran_reshape_8;
+    _gfortran_reshape_c10;
+    _gfortran_reshape_c16;
+    _gfortran_reshape_c4;
+    _gfortran_reshape_c8;
+    _gfortran_reshape_char;
+    _gfortran_reshape_r10;
+    _gfortran_reshape_r16;
+    _gfortran_reshape_r4;
+    _gfortran_reshape_r8;
+    _gfortran_rrspacing_r10;
+    _gfortran_rrspacing_r16;
+    _gfortran_rrspacing_r4;
+    _gfortran_rrspacing_r8;
+    _gfortran_runtime_error;
+    _gfortran_runtime_error_at;
+    _gfortran_secnds;
+    _gfortran_second;
+    _gfortran_second_sub;
+    _gfortran_selected_int_kind;
+    _gfortran_selected_real_kind;
+    _gfortran_select_string;
+    _gfortran_set_args;
+    _gfortran_set_convert;
+    _gfortran_set_exponent_r10;
+    _gfortran_set_exponent_r16;
+    _gfortran_set_exponent_r4;
+    _gfortran_set_exponent_r8;
+    _gfortran_set_fpe;
+    _gfortran_set_max_subrecord_length;
+    _gfortran_set_record_marker;
+    _gfortran_set_options;
+    _gfortran_shape_16;
+    _gfortran_shape_4;
+    _gfortran_shape_8;
+    _gfortran_signal_func;
+    _gfortran_signal_func_int;
+    _gfortran_signal_sub;
+    _gfortran_signal_sub_int;
+    _gfortran_size0;
+    _gfortran_size1;
+    _gfortran_sleep_i4_sub;
+    _gfortran_sleep_i8_sub;
+    _gfortran_smaxloc0_16_i1;
+    _gfortran_smaxloc0_16_i16;
+    _gfortran_smaxloc0_16_i2;
+    _gfortran_smaxloc0_16_i4;
+    _gfortran_smaxloc0_16_i8;
+    _gfortran_smaxloc0_16_r10;
+    _gfortran_smaxloc0_16_r16;
+    _gfortran_smaxloc0_16_r4;
+    _gfortran_smaxloc0_16_r8;
+    _gfortran_smaxloc0_4_i1;
+    _gfortran_smaxloc0_4_i16;
+    _gfortran_smaxloc0_4_i2;
+    _gfortran_smaxloc0_4_i4;
+    _gfortran_smaxloc0_4_i8;
+    _gfortran_smaxloc0_4_r10;
+    _gfortran_smaxloc0_4_r16;
+    _gfortran_smaxloc0_4_r4;
+    _gfortran_smaxloc0_4_r8;
+    _gfortran_smaxloc0_8_i1;
+    _gfortran_smaxloc0_8_i16;
+    _gfortran_smaxloc0_8_i2;
+    _gfortran_smaxloc0_8_i4;
+    _gfortran_smaxloc0_8_i8;
+    _gfortran_smaxloc0_8_r10;
+    _gfortran_smaxloc0_8_r16;
+    _gfortran_smaxloc0_8_r4;
+    _gfortran_smaxloc0_8_r8;
+    _gfortran_smaxloc1_16_i1;
+    _gfortran_smaxloc1_16_i16;
+    _gfortran_smaxloc1_16_i2;
+    _gfortran_smaxloc1_16_i4;
+    _gfortran_smaxloc1_16_i8;
+    _gfortran_smaxloc1_16_r10;
+    _gfortran_smaxloc1_16_r16;
+    _gfortran_smaxloc1_16_r4;
+    _gfortran_smaxloc1_16_r8;
+    _gfortran_smaxloc1_4_i1;
+    _gfortran_smaxloc1_4_i16;
+    _gfortran_smaxloc1_4_i2;
+    _gfortran_smaxloc1_4_i4;
+    _gfortran_smaxloc1_4_i8;
+    _gfortran_smaxloc1_4_r10;
+    _gfortran_smaxloc1_4_r16;
+    _gfortran_smaxloc1_4_r4;
+    _gfortran_smaxloc1_4_r8;
+    _gfortran_smaxloc1_8_i1;
+    _gfortran_smaxloc1_8_i16;
+    _gfortran_smaxloc1_8_i2;
+    _gfortran_smaxloc1_8_i4;
+    _gfortran_smaxloc1_8_i8;
+    _gfortran_smaxloc1_8_r10;
+    _gfortran_smaxloc1_8_r16;
+    _gfortran_smaxloc1_8_r4;
+    _gfortran_smaxloc1_8_r8;
+    _gfortran_smaxval_i1;
+    _gfortran_smaxval_i16;
+    _gfortran_smaxval_i2;
+    _gfortran_smaxval_i4;
+    _gfortran_smaxval_i8;
+    _gfortran_smaxval_r10;
+    _gfortran_smaxval_r16;
+    _gfortran_smaxval_r4;
+    _gfortran_smaxval_r8;
+    _gfortran_sminloc0_16_i1;
+    _gfortran_sminloc0_16_i16;
+    _gfortran_sminloc0_16_i2;
+    _gfortran_sminloc0_16_i4;
+    _gfortran_sminloc0_16_i8;
+    _gfortran_sminloc0_16_r10;
+    _gfortran_sminloc0_16_r16;
+    _gfortran_sminloc0_16_r4;
+    _gfortran_sminloc0_16_r8;
+    _gfortran_sminloc0_4_i1;
+    _gfortran_sminloc0_4_i16;
+    _gfortran_sminloc0_4_i2;
+    _gfortran_sminloc0_4_i4;
+    _gfortran_sminloc0_4_i8;
+    _gfortran_sminloc0_4_r10;
+    _gfortran_sminloc0_4_r16;
+    _gfortran_sminloc0_4_r4;
+    _gfortran_sminloc0_4_r8;
+    _gfortran_sminloc0_8_i1;
+    _gfortran_sminloc0_8_i16;
+    _gfortran_sminloc0_8_i2;
+    _gfortran_sminloc0_8_i4;
+    _gfortran_sminloc0_8_i8;
+    _gfortran_sminloc0_8_r10;
+    _gfortran_sminloc0_8_r16;
+    _gfortran_sminloc0_8_r4;
+    _gfortran_sminloc0_8_r8;
+    _gfortran_sminloc1_16_i1;
+    _gfortran_sminloc1_16_i16;
+    _gfortran_sminloc1_16_i2;
+    _gfortran_sminloc1_16_i4;
+    _gfortran_sminloc1_16_i8;
+    _gfortran_sminloc1_16_r10;
+    _gfortran_sminloc1_16_r16;
+    _gfortran_sminloc1_16_r4;
+    _gfortran_sminloc1_16_r8;
+    _gfortran_sminloc1_4_i1;
+    _gfortran_sminloc1_4_i16;
+    _gfortran_sminloc1_4_i2;
+    _gfortran_sminloc1_4_i4;
+    _gfortran_sminloc1_4_i8;
+    _gfortran_sminloc1_4_r10;
+    _gfortran_sminloc1_4_r16;
+    _gfortran_sminloc1_4_r4;
+    _gfortran_sminloc1_4_r8;
+    _gfortran_sminloc1_8_i1;
+    _gfortran_sminloc1_8_i16;
+    _gfortran_sminloc1_8_i2;
+    _gfortran_sminloc1_8_i4;
+    _gfortran_sminloc1_8_i8;
+    _gfortran_sminloc1_8_r10;
+    _gfortran_sminloc1_8_r16;
+    _gfortran_sminloc1_8_r4;
+    _gfortran_sminloc1_8_r8;
+    _gfortran_sminval_i1;
+    _gfortran_sminval_i16;
+    _gfortran_sminval_i2;
+    _gfortran_sminval_i4;
+    _gfortran_sminval_i8;
+    _gfortran_sminval_r10;
+    _gfortran_sminval_r16;
+    _gfortran_sminval_r4;
+    _gfortran_sminval_r8;
+    _gfortran_spacing_r10;
+    _gfortran_spacing_r16;
+    _gfortran_spacing_r4;
+    _gfortran_spacing_r8;
+    _gfortran_specific__abs_c10;
+    _gfortran_specific__abs_c16;
+    _gfortran_specific__abs_c4;
+    _gfortran_specific__abs_c8;
+    _gfortran_specific__abs_i16;
+    _gfortran_specific__abs_i4;
+    _gfortran_specific__abs_i8;
+    _gfortran_specific__abs_r10;
+    _gfortran_specific__abs_r16;
+    _gfortran_specific__abs_r4;
+    _gfortran_specific__abs_r8;
+    _gfortran_specific__acosh_r10;
+    _gfortran_specific__acosh_r16;
+    _gfortran_specific__acosh_r4;
+    _gfortran_specific__acosh_r8;
+    _gfortran_specific__acos_r10;
+    _gfortran_specific__acos_r16;
+    _gfortran_specific__acos_r4;
+    _gfortran_specific__acos_r8;
+    _gfortran_specific__aimag_c10;
+    _gfortran_specific__aimag_c16;
+    _gfortran_specific__aimag_c4;
+    _gfortran_specific__aimag_c8;
+    _gfortran_specific__aint_r10;
+    _gfortran_specific__aint_r16;
+    _gfortran_specific__aint_r4;
+    _gfortran_specific__aint_r8;
+    _gfortran_specific__anint_r10;
+    _gfortran_specific__anint_r16;
+    _gfortran_specific__anint_r4;
+    _gfortran_specific__anint_r8;
+    _gfortran_specific__asinh_r10;
+    _gfortran_specific__asinh_r16;
+    _gfortran_specific__asinh_r4;
+    _gfortran_specific__asinh_r8;
+    _gfortran_specific__asin_r10;
+    _gfortran_specific__asin_r16;
+    _gfortran_specific__asin_r4;
+    _gfortran_specific__asin_r8;
+    _gfortran_specific__atan2_r10;
+    _gfortran_specific__atan2_r16;
+    _gfortran_specific__atan2_r4;
+    _gfortran_specific__atan2_r8;
+    _gfortran_specific__atanh_r10;
+    _gfortran_specific__atanh_r16;
+    _gfortran_specific__atanh_r4;
+    _gfortran_specific__atanh_r8;
+    _gfortran_specific__atan_r10;
+    _gfortran_specific__atan_r16;
+    _gfortran_specific__atan_r4;
+    _gfortran_specific__atan_r8;
+    _gfortran_specific__char_1_i16;
+    _gfortran_specific__char_1_i4;
+    _gfortran_specific__char_1_i8;
+    _gfortran_specific__conjg_10;
+    _gfortran_specific__conjg_16;
+    _gfortran_specific__conjg_4;
+    _gfortran_specific__conjg_8;
+    _gfortran_specific__cos_c10;
+    _gfortran_specific__cos_c16;
+    _gfortran_specific__cos_c4;
+    _gfortran_specific__cos_c8;
+    _gfortran_specific__cosh_r10;
+    _gfortran_specific__cosh_r16;
+    _gfortran_specific__cosh_r4;
+    _gfortran_specific__cosh_r8;
+    _gfortran_specific__cos_r10;
+    _gfortran_specific__cos_r16;
+    _gfortran_specific__cos_r4;
+    _gfortran_specific__cos_r8;
+    _gfortran_specific__dim_i16;
+    _gfortran_specific__dim_i4;
+    _gfortran_specific__dim_i8;
+    _gfortran_specific__dim_r10;
+    _gfortran_specific__dim_r16;
+    _gfortran_specific__dim_r4;
+    _gfortran_specific__dim_r8;
+    _gfortran_specific__dprod_r8;
+    _gfortran_specific__exp_c10;
+    _gfortran_specific__exp_c16;
+    _gfortran_specific__exp_c4;
+    _gfortran_specific__exp_c8;
+    _gfortran_specific__exp_r10;
+    _gfortran_specific__exp_r16;
+    _gfortran_specific__exp_r4;
+    _gfortran_specific__exp_r8;
+    _gfortran_specific__index_1_i16;
+    _gfortran_specific__index_1_i4;
+    _gfortran_specific__index_1_i8;
+    _gfortran_specific__len_1_i16;
+    _gfortran_specific__len_1_i4;
+    _gfortran_specific__len_1_i8;
+    _gfortran_specific__log10_r10;
+    _gfortran_specific__log10_r16;
+    _gfortran_specific__log10_r4;
+    _gfortran_specific__log10_r8;
+    _gfortran_specific__log_c10;
+    _gfortran_specific__log_c16;
+    _gfortran_specific__log_c4;
+    _gfortran_specific__log_c8;
+    _gfortran_specific__log_r10;
+    _gfortran_specific__log_r16;
+    _gfortran_specific__log_r4;
+    _gfortran_specific__log_r8;
+    _gfortran_specific__mod_i16;
+    _gfortran_specific__mod_i4;
+    _gfortran_specific__mod_i8;
+    _gfortran_specific__mod_r10;
+    _gfortran_specific__mod_r16;
+    _gfortran_specific__mod_r4;
+    _gfortran_specific__mod_r8;
+    _gfortran_specific__nint_16_10;
+    _gfortran_specific__nint_16_16;
+    _gfortran_specific__nint_16_4;
+    _gfortran_specific__nint_16_8;
+    _gfortran_specific__nint_4_10;
+    _gfortran_specific__nint_4_16;
+    _gfortran_specific__nint_4_4;
+    _gfortran_specific__nint_4_8;
+    _gfortran_specific__nint_8_10;
+    _gfortran_specific__nint_8_16;
+    _gfortran_specific__nint_8_4;
+    _gfortran_specific__nint_8_8;
+    _gfortran_specific__sign_i16;
+    _gfortran_specific__sign_i4;
+    _gfortran_specific__sign_i8;
+    _gfortran_specific__sign_r10;
+    _gfortran_specific__sign_r16;
+    _gfortran_specific__sign_r4;
+    _gfortran_specific__sign_r8;
+    _gfortran_specific__sin_c10;
+    _gfortran_specific__sin_c16;
+    _gfortran_specific__sin_c4;
+    _gfortran_specific__sin_c8;
+    _gfortran_specific__sinh_r10;
+    _gfortran_specific__sinh_r16;
+    _gfortran_specific__sinh_r4;
+    _gfortran_specific__sinh_r8;
+    _gfortran_specific__sin_r10;
+    _gfortran_specific__sin_r16;
+    _gfortran_specific__sin_r4;
+    _gfortran_specific__sin_r8;
+    _gfortran_specific__sqrt_c10;
+    _gfortran_specific__sqrt_c16;
+    _gfortran_specific__sqrt_c4;
+    _gfortran_specific__sqrt_c8;
+    _gfortran_specific__sqrt_r10;
+    _gfortran_specific__sqrt_r16;
+    _gfortran_specific__sqrt_r4;
+    _gfortran_specific__sqrt_r8;
+    _gfortran_specific__tanh_r10;
+    _gfortran_specific__tanh_r16;
+    _gfortran_specific__tanh_r4;
+    _gfortran_specific__tanh_r8;
+    _gfortran_specific__tan_r10;
+    _gfortran_specific__tan_r16;
+    _gfortran_specific__tan_r4;
+    _gfortran_specific__tan_r8;
+    _gfortran_spread;
+    _gfortran_spread_char;
+    _gfortran_spread_char_scalar;
+    _gfortran_spread_scalar;
+    _gfortran_sproduct_c10;
+    _gfortran_sproduct_c16;
+    _gfortran_sproduct_c4;
+    _gfortran_sproduct_c8;
+    _gfortran_sproduct_i1;
+    _gfortran_sproduct_i16;
+    _gfortran_sproduct_i2;
+    _gfortran_sproduct_i4;
+    _gfortran_sproduct_i8;
+    _gfortran_sproduct_r10;
+    _gfortran_sproduct_r16;
+    _gfortran_sproduct_r4;
+    _gfortran_sproduct_r8;
+    _gfortran_srand;
+    _gfortran_ssum_c10;
+    _gfortran_ssum_c16;
+    _gfortran_ssum_c4;
+    _gfortran_ssum_c8;
+    _gfortran_ssum_i1;
+    _gfortran_ssum_i16;
+    _gfortran_ssum_i2;
+    _gfortran_ssum_i4;
+    _gfortran_ssum_i8;
+    _gfortran_ssum_r10;
+    _gfortran_ssum_r16;
+    _gfortran_ssum_r4;
+    _gfortran_ssum_r8;
+    _gfortran_stat_i4;
+    _gfortran_stat_i4_sub;
+    _gfortran_stat_i8;
+    _gfortran_stat_i8_sub;
+    _gfortran_st_backspace;
+    _gfortran_st_close;
+    _gfortran_st_endfile;
+    _gfortran_st_flush;
+    _gfortran_st_inquire;
+    _gfortran_st_iolength;
+    _gfortran_st_iolength_done;
+    _gfortran_st_open;
+    _gfortran_stop_numeric;
+    _gfortran_stop_string;
+    _gfortran_store_exe_path;
+    _gfortran_st_read;
+    _gfortran_st_read_done;
+    _gfortran_st_rewind;
+    _gfortran_string_index;
+    _gfortran_string_len_trim;
+    _gfortran_string_minmax;
+    _gfortran_string_scan;
+    _gfortran_string_trim;
+    _gfortran_string_verify;
+    _gfortran_st_set_nml_var;
+    _gfortran_st_set_nml_var_dim;
+    _gfortran_st_write;
+    _gfortran_st_write_done;
+    _gfortran_sum_c10;
+    _gfortran_sum_c16;
+    _gfortran_sum_c4;
+    _gfortran_sum_c8;
+    _gfortran_sum_i1;
+    _gfortran_sum_i16;
+    _gfortran_sum_i2;
+    _gfortran_sum_i4;
+    _gfortran_sum_i8;
+    _gfortran_sum_r10;
+    _gfortran_sum_r16;
+    _gfortran_sum_r4;
+    _gfortran_sum_r8;
+    _gfortran_symlnk_i4;
+    _gfortran_symlnk_i4_sub;
+    _gfortran_symlnk_i8;
+    _gfortran_symlnk_i8_sub;
+    _gfortran_system;
+    _gfortran_system_clock_4;
+    _gfortran_system_clock_8;
+    _gfortran_system_sub;
+    _gfortran_time8_func;
+    _gfortran_time_func;
+    _gfortran_transfer_array;
+    _gfortran_transfer_character;
+    _gfortran_transfer_complex;
+    _gfortran_transfer_integer;
+    _gfortran_transfer_logical;
+    _gfortran_transfer_real;
+    _gfortran_transpose;
+    _gfortran_transpose_c10;
+    _gfortran_transpose_c16;
+    _gfortran_transpose_c4;
+    _gfortran_transpose_c8;
+    _gfortran_transpose_char;
+    _gfortran_transpose_i16;
+    _gfortran_transpose_i4;
+    _gfortran_transpose_i8;
+    _gfortran_transpose_r10;
+    _gfortran_transpose_r16;
+    _gfortran_transpose_r4;
+    _gfortran_transpose_r8;
+    _gfortran_ttynam;
+    _gfortran_ttynam_sub;
+    _gfortran_umask_i4;
+    _gfortran_umask_i4_sub;
+    _gfortran_umask_i8;
+    _gfortran_umask_i8_sub;
+    _gfortran_unlink;
+    _gfortran_unlink_i4_sub;
+    _gfortran_unlink_i8_sub;
+    _gfortran_unpack0;
+    _gfortran_unpack0_char;
+    _gfortran_unpack1;
+    _gfortran_unpack1_char;
+    __iso_c_binding_c_f_pointer;
+    __iso_c_binding_c_f_pointer_d0;
+    __iso_c_binding_c_f_pointer_i1;
+    __iso_c_binding_c_f_pointer_i2;
+    __iso_c_binding_c_f_pointer_i4;
+    __iso_c_binding_c_f_pointer_i8;
+    __iso_c_binding_c_f_pointer_i16;
+    __iso_c_binding_c_f_pointer_r4;
+    __iso_c_binding_c_f_pointer_r8;
+    __iso_c_binding_c_f_pointer_r10;
+    __iso_c_binding_c_f_pointer_r16;
+    __iso_c_binding_c_f_pointer_c4;
+    __iso_c_binding_c_f_pointer_c8;
+    __iso_c_binding_c_f_pointer_c10;
+    __iso_c_binding_c_f_pointer_c16;
+    __iso_c_binding_c_f_pointer_s0;
+    __iso_c_binding_c_f_pointer_l1;
+    __iso_c_binding_c_f_pointer_l2;
+    __iso_c_binding_c_f_pointer_l4;
+    __iso_c_binding_c_f_pointer_l8;
+    __iso_c_binding_c_f_pointer_u0;
+  local:
+    *;
+};
+
+GFORTRAN_1.1 {
+  global:
+    _gfortran_adjustl_char4;
+    _gfortran_adjustr_char4;
+    _gfortran_compare_string_char4;
+    _gfortran_concat_string_char4;
+    _gfortran_convert_char1_to_char4;
+    _gfortran_convert_char4_to_char1;
+    _gfortran_cshift0_16;
+    _gfortran_cshift0_16_char;
+    _gfortran_cshift0_1_char4;
+    _gfortran_cshift0_2_char4;
+    _gfortran_cshift0_4_char4;
+    _gfortran_cshift0_8_char4;
+    _gfortran_cshift1_16_char4;
+    _gfortran_cshift1_4_char4;
+    _gfortran_cshift1_8_char4;
+    _gfortran_eoshift0_16;
+    _gfortran_eoshift0_16_char;
+    _gfortran_eoshift0_1_char4;
+    _gfortran_eoshift0_2_char4;
+    _gfortran_eoshift0_4_char4;
+    _gfortran_eoshift0_8_char4;
+    _gfortran_eoshift1_16_char4;
+    _gfortran_eoshift1_4_char4;
+    _gfortran_eoshift1_8_char4;
+    _gfortran_eoshift2_16;
+    _gfortran_eoshift2_16_char;
+    _gfortran_eoshift2_1_char4;
+    _gfortran_eoshift2_2_char4;
+    _gfortran_eoshift2_4_char4;
+    _gfortran_eoshift2_8_char4;
+    _gfortran_eoshift3_16_char4;
+    _gfortran_eoshift3_4_char4;
+    _gfortran_eoshift3_8_char4;
+    _gfortran_erfc_scaled_r10;
+    _gfortran_erfc_scaled_r16;
+    _gfortran_erfc_scaled_r4;
+    _gfortran_erfc_scaled_r8;
+    _gfortran_execute_command_line_i4;
+    _gfortran_execute_command_line_i8;
+    _gfortran_pack_char4;
+    _gfortran_pack_s_char4;
+    _gfortran_reshape_char4;
+    _gfortran_runtime_warning_at;
+    _gfortran_selected_char_kind;
+    _gfortran_select_string_char4;
+    _gfortran_spread_char4;
+    _gfortran_spread_char4_scalar;
+    _gfortran_string_index_char4;
+    _gfortran_string_len_trim_char4;
+    _gfortran_string_minmax_char4;
+    _gfortran_string_scan_char4;
+    _gfortran_string_trim_char4;
+    _gfortran_string_verify_char4;
+    _gfortran_st_wait;
+    _gfortran_transfer_character_wide;
+    _gfortran_transpose_char4;
+    _gfortran_unpack0_char4;
+    _gfortran_unpack1_char4;
+} GFORTRAN_1.0; 
+
+
+GFORTRAN_1.2 {
+  global:
+    _gfortran_clz128;
+    _gfortran_ctz128;
+    _gfortran_is_extension_of;
+} GFORTRAN_1.1; 
+
+GFORTRAN_1.3 {
+  global:
+    _gfortran_error_stop_string;
+} GFORTRAN_1.2; 
+
+GFORTRAN_1.4 {
+  global:
+    _gfortran_bessel_jn_r4;
+    _gfortran_bessel_jn_r8;
+    _gfortran_bessel_jn_r10;
+    _gfortran_bessel_jn_r16;
+    _gfortran_bessel_yn_r4;
+    _gfortran_bessel_yn_r8;
+    _gfortran_bessel_yn_r10;
+    _gfortran_bessel_yn_r16;
+    _gfortran_error_stop_numeric;
+    _gfortran_iall_i1;
+    _gfortran_iall_i2;
+    _gfortran_iall_i4;
+    _gfortran_iall_i8;
+    _gfortran_iall_i16;
+    _gfortran_miall_i1;
+    _gfortran_miall_i2;
+    _gfortran_miall_i4;
+    _gfortran_miall_i8;
+    _gfortran_miall_i16;
+    _gfortran_siall_i1;
+    _gfortran_siall_i2;
+    _gfortran_siall_i4;
+    _gfortran_siall_i8;
+    _gfortran_siall_i16;
+    _gfortran_iany_i1;
+    _gfortran_iany_i2;
+    _gfortran_iany_i4;
+    _gfortran_iany_i8;
+    _gfortran_iany_i16;
+    _gfortran_miany_i1;
+    _gfortran_miany_i2;
+    _gfortran_miany_i4;
+    _gfortran_miany_i8;
+    _gfortran_miany_i16;
+    _gfortran_siany_i1;
+    _gfortran_siany_i2;
+    _gfortran_siany_i4;
+    _gfortran_siany_i8;
+    _gfortran_siany_i16;
+    _gfortran_iparity_i1;
+    _gfortran_iparity_i2;
+    _gfortran_iparity_i4;
+    _gfortran_iparity_i8;
+    _gfortran_iparity_i16;
+    _gfortran_miparity_i1;
+    _gfortran_miparity_i2;
+    _gfortran_miparity_i4;
+    _gfortran_miparity_i8;
+    _gfortran_miparity_i16;
+    _gfortran_siparity_i1;
+    _gfortran_siparity_i2;
+    _gfortran_siparity_i4;
+    _gfortran_siparity_i8;
+    _gfortran_siparity_i16;
+    _gfortran_norm2_r4;
+    _gfortran_norm2_r8;
+    _gfortran_norm2_r10;
+    _gfortran_norm2_r16;
+    _gfortran_parity_l1;
+    _gfortran_parity_l2;
+    _gfortran_parity_l4;
+    _gfortran_parity_l8;
+    _gfortran_parity_l16;
+    _gfortran_selected_real_kind2008;
+    _gfortran_stop_numeric_f08;
+    _gfortran_transfer_array_write;
+    _gfortran_transfer_character_write;
+    _gfortran_transfer_character_wide_write;
+    _gfortran_transfer_complex_write;
+    _gfortran_transfer_complex128;
+    _gfortran_transfer_complex128_write;
+    _gfortran_transfer_integer_write;
+    _gfortran_transfer_logical_write;
+    _gfortran_transfer_real_write;
+    _gfortran_transfer_real128;
+    _gfortran_transfer_real128_write;
+    _gfortran_cshift0_16_char4;
+    _gfortran_eoshift0_16_char4;
+    _gfortran_eoshift2_16_char4;
+} GFORTRAN_1.3; 
+
+F2C_1.0 {
+  global:
+    _gfortran_f2c_specific__abs_c4;
+    _gfortran_f2c_specific__abs_r4;
+    _gfortran_f2c_specific__acosh_r4;
+    _gfortran_f2c_specific__acos_r4;
+    _gfortran_f2c_specific__aimag_c4;
+    _gfortran_f2c_specific__aimag_c8;
+    _gfortran_f2c_specific__aint_r4;
+    _gfortran_f2c_specific__anint_r4;
+    _gfortran_f2c_specific__asinh_r4;
+    _gfortran_f2c_specific__asin_r4;
+    _gfortran_f2c_specific__atan2_r4;
+    _gfortran_f2c_specific__atanh_r4;
+    _gfortran_f2c_specific__atan_r4;
+    _gfortran_f2c_specific__conjg_4;
+    _gfortran_f2c_specific__conjg_8;
+    _gfortran_f2c_specific__cos_c4;
+    _gfortran_f2c_specific__cos_c8;
+    _gfortran_f2c_specific__cosh_r4;
+    _gfortran_f2c_specific__cos_r4;
+    _gfortran_f2c_specific__dim_r4;
+    _gfortran_f2c_specific__exp_c4;
+    _gfortran_f2c_specific__exp_c8;
+    _gfortran_f2c_specific__exp_r4;
+    _gfortran_f2c_specific__log10_r4;
+    _gfortran_f2c_specific__log_c4;
+    _gfortran_f2c_specific__log_c8;
+    _gfortran_f2c_specific__log_r4;
+    _gfortran_f2c_specific__mod_r4;
+    _gfortran_f2c_specific__sign_r4;
+    _gfortran_f2c_specific__sin_c4;
+    _gfortran_f2c_specific__sin_c8;
+    _gfortran_f2c_specific__sinh_r4;
+    _gfortran_f2c_specific__sin_r4;
+    _gfortran_f2c_specific__sqrt_c4;
+    _gfortran_f2c_specific__sqrt_c8;
+    _gfortran_f2c_specific__sqrt_r4;
+    _gfortran_f2c_specific__tanh_r4;
+    _gfortran_f2c_specific__tan_r4;
+};
+
+GFORTRAN_C99_1.0 {
+  global:
+    acosf;
+    acoshf;
+    asinf;
+    asinhf;
+    atan2f;
+    atanf;
+    atanhf;
+    cabs;
+    cabsf;
+    cabsl;
+    carg;
+    cargf;
+    cargl;
+    ccos;
+    ccosf;
+    ccosh;
+    ccoshf;
+    ccoshl;
+    ccosl;
+    ceilf;
+    cexp;
+    cexpf;
+    cexpl;
+    clog;
+    clog10;
+    clog10f;
+    clog10l;
+    clogf;
+    clogl;
+    copysignf;
+    cosf;
+    coshf;
+    cpow;
+    cpowf;
+    cpowl;
+    csin;
+    csinf;
+    csinh;
+    csinhf;
+    csinhl;
+    csinl;
+    csqrt;
+    csqrtf;
+    csqrtl;
+    ctan;
+    ctanf;
+    ctanh;
+    ctanhf;
+    ctanhl;
+    ctanl;
+    erfcf;
+    erff;
+    expf;
+    fabsf;
+    floorf;
+    floorl;
+    fmodf;
+    fmodl;
+    frexpf;
+    hypotf;
+    j0f;
+    j1f;
+    jnf;
+    lgamma;
+    lgammaf;
+    log10f;
+    log10l;
+    logf;
+    nextafterf;
+    powf;
+    round;
+    roundf;
+    scalbn;
+    scalbnf;
+    sinf;
+    sinhf;
+    sqrtf;
+    tanf;
+    tanhf;
+    tgamma;
+    tgammaf;
+    trunc;
+    truncf;
+    y0f;
+    y1f;
+    ynf;
+};
+
+GFORTRAN_C99_1.1 {
+  global:
+    cacos;
+    cacosf;
+    cacosh;
+    cacoshf;
+    cacoshl;
+    cacosl;
+    casin;
+    casinf;
+    casinh;
+    casinhf;
+    casinhl;
+    casinl;
+    catan;
+    catanf;
+    catanh;
+    catanhf;
+    catanhl;
+    catanl;
+    llround;
+    llroundf;
+    llroundl;
+    lround;
+    lroundf;
+    lroundl;
+    roundl;
+} GFORTRAN_C99_1.0;
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/abort.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/abort.c
new file mode 100644 (file)
index 0000000..543f8fc
--- /dev/null
@@ -0,0 +1,34 @@
+/* Implementation of the ABORT intrinsic.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+
+void PREFIX(abort) (void);
+export_proto_np(PREFIX(abort));
+
+void PREFIX(abort) (void)
+{
+  sys_abort ();
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/access.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/access.c
new file mode 100644 (file)
index 0000000..9d44531
--- /dev/null
@@ -0,0 +1,90 @@
+/* Implementation of the ACCESS intrinsic.
+   Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+#include <string.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* INTEGER FUNCTION ACCESS(NAME, MODE)
+   CHARACTER(len=*), INTENT(IN) :: NAME, MODE  */
+
+#ifdef HAVE_ACCESS
+extern int access_func (char *, char *, gfc_charlen_type, gfc_charlen_type);
+export_proto(access_func);
+
+int
+access_func (char *name, char *mode, gfc_charlen_type name_len,
+            gfc_charlen_type mode_len)
+{
+  char * file;
+  gfc_charlen_type i;
+  int m;
+
+  /* Parse the MODE string.  */
+  m = F_OK;
+  for (i = 0; i < mode_len && mode[i]; i++)
+    switch (mode[i])
+      {
+       case ' ':
+         break;
+
+       case 'r':
+       case 'R':
+         m |= R_OK;
+         break;
+
+       case 'w':
+       case 'W':
+         m |= W_OK;
+         break;
+
+       case 'x':
+       case 'X':
+         m |= X_OK;
+         break;
+
+       default:
+         return -1;
+         break;
+      }
+
+  /* Trim trailing spaces from NAME argument.  */
+  while (name_len > 0 && name[name_len - 1] == ' ')
+    name_len--;
+
+  /* Make a null terminated copy of the string.  */
+  file = gfc_alloca (name_len + 1);
+  memcpy (file, name, name_len);
+  file[name_len] = '\0';
+
+  /* And make the call to access().  */
+  return (access (file, m) == 0 ? 0 : errno);
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/args.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/args.c
new file mode 100644 (file)
index 0000000..545cfe5
--- /dev/null
@@ -0,0 +1,270 @@
+/* Implementation of the GETARG and IARGC g77, and
+   corresponding F2003, intrinsics. 
+   Copyright (C) 2004, 2005, 2007, 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Bud Davis and Janne Blomqvist.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <string.h>
+
+
+/* Get a commandline argument.  */
+
+extern void getarg_i4 (GFC_INTEGER_4 *, char *, gfc_charlen_type);
+iexport_proto(getarg_i4);
+
+void 
+getarg_i4 (GFC_INTEGER_4 *pos, char  *val, gfc_charlen_type val_len)
+{
+  int argc;
+  int arglen;
+  char **argv;
+
+  get_args (&argc, &argv);
+
+  if (val_len < 1 || !val )
+    return;   /* something is wrong , leave immediately */
+  
+  memset (val, ' ', val_len);
+
+  if ((*pos) + 1 <= argc  && *pos >=0 )
+    {
+      arglen = strlen (argv[*pos]);
+      if (arglen > val_len)
+       arglen = val_len;
+      memcpy (val, argv[*pos], arglen);
+    }
+}
+iexport(getarg_i4);
+
+
+/* INTEGER*8 wrapper of getarg.  */
+
+extern void getarg_i8 (GFC_INTEGER_8 *, char *, gfc_charlen_type);
+export_proto (getarg_i8);
+
+void 
+getarg_i8 (GFC_INTEGER_8 *pos, char  *val, gfc_charlen_type val_len)
+{
+  GFC_INTEGER_4 pos4 = (GFC_INTEGER_4) *pos;
+  getarg_i4 (&pos4, val, val_len);
+}
+
+
+/* Return the number of commandline arguments.  The g77 info page 
+   states that iargc does not include the specification of the
+   program name itself.  */
+
+extern GFC_INTEGER_4 iargc (void);
+export_proto(iargc);
+
+GFC_INTEGER_4
+iargc (void)
+{
+  int argc;
+  char **argv;
+
+  get_args (&argc, &argv);
+
+  return (argc - 1);
+} 
+
+
+/* F2003 intrinsic functions and subroutines related to command line
+   arguments.
+
+   - function command_argument_count() is converted to iargc by the compiler.
+
+   - subroutine get_command([command, length, status]).
+
+   - subroutine get_command_argument(number, [value, length, status]).
+*/
+
+/* These two status codes are specified in the standard. */
+#define GFC_GC_SUCCESS 0
+#define GFC_GC_VALUE_TOO_SHORT -1
+
+/* Processor-specific status failure code. */
+#define GFC_GC_FAILURE 42
+
+
+extern void get_command_argument_i4 (GFC_INTEGER_4 *, char *, GFC_INTEGER_4 *,
+                                    GFC_INTEGER_4 *, gfc_charlen_type);
+iexport_proto(get_command_argument_i4);
+
+/* Get a single commandline argument.  */
+
+void
+get_command_argument_i4 (GFC_INTEGER_4 *number, char *value, 
+                        GFC_INTEGER_4 *length, GFC_INTEGER_4 *status, 
+                        gfc_charlen_type value_len)
+{
+  int argc, arglen = 0, stat_flag = GFC_GC_SUCCESS;
+  char **argv;
+
+  if (number == NULL )
+    /* Should never happen.  */
+    runtime_error ("Missing argument to get_command_argument");
+
+  if (value == NULL && length == NULL && status == NULL)
+    return; /* No need to do anything.  */
+
+  get_args (&argc, &argv);
+
+  if (*number < 0 || *number >= argc)
+    stat_flag = GFC_GC_FAILURE;
+  else
+    arglen = strlen(argv[*number]);    
+
+  if (value != NULL)
+    {
+      if (value_len < 1)
+       stat_flag = GFC_GC_FAILURE;
+      else
+       memset (value, ' ', value_len);
+    }
+
+  if (value != NULL && stat_flag != GFC_GC_FAILURE)
+    {
+      if (arglen > value_len)
+        stat_flag = GFC_GC_VALUE_TOO_SHORT;
+
+      memcpy (value, argv[*number], arglen <= value_len ? arglen : value_len);
+    }
+
+  if (length != NULL)
+    *length = arglen;
+
+  if (status != NULL)
+    *status = stat_flag;
+}
+iexport(get_command_argument_i4);
+
+
+/* INTEGER*8 wrapper for get_command_argument.  */
+
+extern void get_command_argument_i8 (GFC_INTEGER_8 *, char *, GFC_INTEGER_8 *, 
+                                    GFC_INTEGER_8 *, gfc_charlen_type);
+export_proto(get_command_argument_i8);
+
+void
+get_command_argument_i8 (GFC_INTEGER_8 *number, char *value, 
+                        GFC_INTEGER_8 *length, GFC_INTEGER_8 *status, 
+                        gfc_charlen_type value_len)
+{
+  GFC_INTEGER_4 number4;
+  GFC_INTEGER_4 length4;
+  GFC_INTEGER_4 status4;
+
+  number4 = (GFC_INTEGER_4) *number;
+  get_command_argument_i4 (&number4, value, &length4, &status4, value_len);
+  if (length)
+    *length = length4;
+  if (status)
+    *status = status4;
+}
+
+
+/* Return the whole commandline.  */
+
+extern void get_command_i4 (char *, GFC_INTEGER_4 *, GFC_INTEGER_4 *,
+                           gfc_charlen_type);
+iexport_proto(get_command_i4);
+
+void
+get_command_i4 (char *command, GFC_INTEGER_4 *length, GFC_INTEGER_4 *status,
+               gfc_charlen_type command_len)
+{
+  int i, argc, arglen, thisarg;
+  int stat_flag = GFC_GC_SUCCESS;
+  int tot_len = 0;
+  char **argv;
+
+  if (command == NULL && length == NULL && status == NULL)
+    return; /* No need to do anything.  */
+
+  get_args (&argc, &argv);
+
+  if (command != NULL)
+    {
+      /* Initialize the string to blanks.  */
+      if (command_len < 1)
+       stat_flag = GFC_GC_FAILURE;
+      else
+       memset (command, ' ', command_len);
+    }
+
+  for (i = 0; i < argc ; i++)
+    {
+      arglen = strlen(argv[i]);
+
+      if (command != NULL && stat_flag == GFC_GC_SUCCESS)
+       {
+         thisarg = arglen;
+         if (tot_len + thisarg > command_len)
+           {
+             thisarg = command_len - tot_len; /* Truncate.  */
+             stat_flag = GFC_GC_VALUE_TOO_SHORT;
+           }
+         /* Also a space before the next arg.  */
+         else if (i != argc - 1 && tot_len + arglen == command_len)
+           stat_flag = GFC_GC_VALUE_TOO_SHORT;
+
+         memcpy (&command[tot_len], argv[i], thisarg);
+       }
+
+      /* Add the legth of the argument.  */
+      tot_len += arglen;
+      if (i != argc - 1)
+       tot_len++;
+    }
+
+  if (length != NULL)
+    *length = tot_len;
+
+  if (status != NULL)
+    *status = stat_flag;
+}
+iexport(get_command_i4);
+
+
+/* INTEGER*8 wrapper for get_command.  */
+
+extern void get_command_i8 (char *, GFC_INTEGER_8 *, GFC_INTEGER_8 *,
+                           gfc_charlen_type);
+export_proto(get_command_i8);
+
+void
+get_command_i8 (char *command, GFC_INTEGER_8 *length, GFC_INTEGER_8 *status,
+               gfc_charlen_type command_len)
+{
+  GFC_INTEGER_4 length4;
+  GFC_INTEGER_4 status4;
+
+  get_command_i4 (command, &length4, &status4, command_len);
+  if (length)
+    *length = length4;
+  if (status)
+    *status = status4;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/associated.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/associated.c
new file mode 100644 (file)
index 0000000..0aade1d
--- /dev/null
@@ -0,0 +1,58 @@
+/* Implementation of the ASSOCIATED intrinsic
+   Copyright 2003, 2009 Free Software Foundation, Inc.
+   Contributed by kejia Zhao (CCRG) <kejia_zh@yahoo.com.cn>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+extern int associated (const gfc_array_void *, const gfc_array_void *);
+export_proto(associated);
+
+int
+associated (const gfc_array_void *pointer, const gfc_array_void *target)
+{
+  int n, rank;
+
+  if (GFC_DESCRIPTOR_DATA (pointer) == NULL)
+    return 0;
+  if (GFC_DESCRIPTOR_DATA (pointer) != GFC_DESCRIPTOR_DATA (target))
+    return 0;
+  if (GFC_DESCRIPTOR_DTYPE (pointer) != GFC_DESCRIPTOR_DTYPE (target))
+    return 0;
+
+  rank = GFC_DESCRIPTOR_RANK (pointer);
+  for (n = 0; n < rank; n++)
+    {
+      long extent;
+      extent = GFC_DESCRIPTOR_EXTENT(pointer,n);
+
+      if (extent != GFC_DESCRIPTOR_EXTENT(target,n))
+        return 0;
+      if (GFC_DESCRIPTOR_STRIDE(pointer,n) != GFC_DESCRIPTOR_STRIDE(target,n) && extent != 1)
+        return 0;
+      if (extent <= 0)
+       return 0;
+    }
+
+  return 1;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/bit_intrinsics.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/bit_intrinsics.c
new file mode 100644 (file)
index 0000000..92f5f03
--- /dev/null
@@ -0,0 +1,138 @@
+/* Implementation of the bit intrinsics not implemented as GCC builtins.
+   Copyright (C) 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+#ifdef HAVE_GFC_INTEGER_16
+extern int clz128 (GFC_INTEGER_16);
+export_proto(clz128);
+
+int
+clz128 (GFC_INTEGER_16 x)
+{
+  int res = 127;
+
+  // We can't write 0xFFFFFFFFFFFFFFFF0000000000000000, so we work around it
+  if (x & ((__uint128_t) 0xFFFFFFFFFFFFFFFF << 64))
+    {
+      res -= 64;
+      x >>= 64;
+    }
+
+  if (x & 0xFFFFFFFF00000000)
+    {
+      res -= 32;
+      x >>= 32;
+    }
+
+  if (x & 0xFFFF0000)
+    {
+      res -= 16;
+      x >>= 16;
+    }
+
+  if (x & 0xFF00)
+    {
+      res -= 8;
+      x >>= 8;
+    }
+
+  if (x & 0xF0)
+    {
+      res -= 4;
+      x >>= 4;
+    }
+
+  if (x & 0xC)
+    {
+      res -= 2;
+      x >>= 2;
+    }
+
+  if (x & 0x2)
+    {
+      res -= 1;
+      x >>= 1;
+    }
+
+  return res;
+}
+#endif
+
+
+#ifdef HAVE_GFC_INTEGER_16
+extern int ctz128 (GFC_INTEGER_16);
+export_proto(ctz128);
+
+int
+ctz128 (GFC_INTEGER_16 x)
+{
+  int res = 0;
+
+  if ((x & 0xFFFFFFFFFFFFFFFF) == 0)
+    {
+      res += 64;
+      x >>= 64;
+    }
+
+  if ((x & 0xFFFFFFFF) == 0)
+    {
+      res += 32;
+      x >>= 32;
+    }
+
+  if ((x & 0xFFFF) == 0)
+    {
+      res += 16;
+      x >>= 16;
+    }
+
+  if ((x & 0xFF) == 0)
+    {
+      res += 8;
+      x >>= 8;
+    }
+
+  if ((x & 0xF) == 0)
+    {
+      res += 4;
+      x >>= 4;
+    }
+
+  if ((x & 0x3) == 0)
+    {
+      res += 2;
+      x >>= 2;
+    }
+
+  if ((x & 0x1) == 0)
+    {
+      res += 1;
+      x >>= 1;
+    }
+
+  return res;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/c99_functions.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/c99_functions.c
new file mode 100644 (file)
index 0000000..a95f09a
--- /dev/null
@@ -0,0 +1,2136 @@
+/* Implementation of various C99 functions 
+   Copyright (C) 2004, 2009, 2010 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+
+#define C99_PROTOS_H WE_DONT_WANT_PROTOS_NOW
+#include "libgfortran.h"
+
+/* IRIX's <math.h> declares a non-C99 compliant implementation of cabs,
+   which takes two floating point arguments instead of a single complex.
+   If <complex.h> is missing this prevents building of c99_functions.c.
+   To work around this we redirect cabs{,f,l} calls to __gfc_cabs{,f,l}.  */
+
+#if defined(__sgi__) && !defined(HAVE_COMPLEX_H)
+#undef HAVE_CABS
+#undef HAVE_CABSF
+#undef HAVE_CABSL
+#define cabs __gfc_cabs
+#define cabsf __gfc_cabsf
+#define cabsl __gfc_cabsl
+#endif
+        
+/* Tru64's <math.h> declares a non-C99 compliant implementation of cabs,
+   which takes two floating point arguments instead of a single complex.
+   To work around this we redirect cabs{,f,l} calls to __gfc_cabs{,f,l}.  */
+
+#ifdef __osf__
+#undef HAVE_CABS
+#undef HAVE_CABSF
+#undef HAVE_CABSL
+#define cabs __gfc_cabs
+#define cabsf __gfc_cabsf
+#define cabsl __gfc_cabsl
+#endif
+
+/* On a C99 system "I" (with I*I = -1) should be defined in complex.h;
+   if not, we define a fallback version here.  */
+#ifndef I
+# if defined(_Imaginary_I)
+#   define I _Imaginary_I
+# elif defined(_Complex_I)
+#   define I _Complex_I
+# else
+#   define I (1.0fi)
+# endif
+#endif
+
+/* Prototypes are included to silence -Wstrict-prototypes
+   -Wmissing-prototypes.  */
+
+
+/* Wrappers for systems without the various C99 single precision Bessel
+   functions.  */
+
+#if defined(HAVE_J0) && ! defined(HAVE_J0F)
+#define HAVE_J0F 1
+float j0f (float);
+
+float
+j0f (float x)
+{
+  return (float) j0 ((double) x);
+}
+#endif
+
+#if defined(HAVE_J1) && !defined(HAVE_J1F)
+#define HAVE_J1F 1
+float j1f (float);
+
+float j1f (float x)
+{
+  return (float) j1 ((double) x);
+}
+#endif
+
+#if defined(HAVE_JN) && !defined(HAVE_JNF)
+#define HAVE_JNF 1
+float jnf (int, float);
+
+float
+jnf (int n, float x)
+{
+  return (float) jn (n, (double) x);
+}
+#endif
+
+#if defined(HAVE_Y0) && !defined(HAVE_Y0F)
+#define HAVE_Y0F 1
+float y0f (float);
+
+float
+y0f (float x)
+{
+  return (float) y0 ((double) x);
+}
+#endif
+
+#if defined(HAVE_Y1) && !defined(HAVE_Y1F)
+#define HAVE_Y1F 1
+float y1f (float);
+
+float
+y1f (float x)
+{
+  return (float) y1 ((double) x);
+}
+#endif
+
+#if defined(HAVE_YN) && !defined(HAVE_YNF)
+#define HAVE_YNF 1
+float ynf (int, float);
+
+float
+ynf (int n, float x)
+{
+  return (float) yn (n, (double) x);
+}
+#endif
+
+
+/* Wrappers for systems without the C99 erff() and erfcf() functions.  */
+
+#if defined(HAVE_ERF) && !defined(HAVE_ERFF)
+#define HAVE_ERFF 1
+float erff (float);
+
+float
+erff (float x)
+{
+  return (float) erf ((double) x);
+}
+#endif
+
+#if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
+#define HAVE_ERFCF 1
+float erfcf (float);
+
+float
+erfcf (float x)
+{
+  return (float) erfc ((double) x);
+}
+#endif
+
+
+#ifndef HAVE_ACOSF
+#define HAVE_ACOSF 1
+float acosf (float x);
+
+float
+acosf (float x)
+{
+  return (float) acos (x);
+}
+#endif
+
+#if HAVE_ACOSH && !HAVE_ACOSHF
+float acoshf (float x);
+
+float
+acoshf (float x)
+{
+  return (float) acosh ((double) x);
+}
+#endif
+
+#ifndef HAVE_ASINF
+#define HAVE_ASINF 1
+float asinf (float x);
+
+float
+asinf (float x)
+{
+  return (float) asin (x);
+}
+#endif
+
+#if HAVE_ASINH && !HAVE_ASINHF
+float asinhf (float x);
+
+float
+asinhf (float x)
+{
+  return (float) asinh ((double) x);
+}
+#endif
+
+#ifndef HAVE_ATAN2F
+#define HAVE_ATAN2F 1
+float atan2f (float y, float x);
+
+float
+atan2f (float y, float x)
+{
+  return (float) atan2 (y, x);
+}
+#endif
+
+#ifndef HAVE_ATANF
+#define HAVE_ATANF 1
+float atanf (float x);
+
+float
+atanf (float x)
+{
+  return (float) atan (x);
+}
+#endif
+
+#if HAVE_ATANH && !HAVE_ATANHF
+float atanhf (float x);
+
+float
+atanhf (float x)
+{
+  return (float) atanh ((double) x);
+}
+#endif
+
+#ifndef HAVE_CEILF
+#define HAVE_CEILF 1
+float ceilf (float x);
+
+float
+ceilf (float x)
+{
+  return (float) ceil (x);
+}
+#endif
+
+#ifndef HAVE_COPYSIGNF
+#define HAVE_COPYSIGNF 1
+float copysignf (float x, float y);
+
+float
+copysignf (float x, float y)
+{
+  return (float) copysign (x, y);
+}
+#endif
+
+#ifndef HAVE_COSF
+#define HAVE_COSF 1
+float cosf (float x);
+
+float
+cosf (float x)
+{
+  return (float) cos (x);
+}
+#endif
+
+#ifndef HAVE_COSHF
+#define HAVE_COSHF 1
+float coshf (float x);
+
+float
+coshf (float x)
+{
+  return (float) cosh (x);
+}
+#endif
+
+#ifndef HAVE_EXPF
+#define HAVE_EXPF 1
+float expf (float x);
+
+float
+expf (float x)
+{
+  return (float) exp (x);
+}
+#endif
+
+#ifndef HAVE_FABSF
+#define HAVE_FABSF 1
+float fabsf (float x);
+
+float
+fabsf (float x)
+{
+  return (float) fabs (x);
+}
+#endif
+
+#ifndef HAVE_FLOORF
+#define HAVE_FLOORF 1
+float floorf (float x);
+
+float
+floorf (float x)
+{
+  return (float) floor (x);
+}
+#endif
+
+#ifndef HAVE_FMODF
+#define HAVE_FMODF 1
+float fmodf (float x, float y);
+
+float
+fmodf (float x, float y)
+{
+  return (float) fmod (x, y);
+}
+#endif
+
+#ifndef HAVE_FREXPF
+#define HAVE_FREXPF 1
+float frexpf (float x, int *exp);
+
+float
+frexpf (float x, int *exp)
+{
+  return (float) frexp (x, exp);
+}
+#endif
+
+#ifndef HAVE_HYPOTF
+#define HAVE_HYPOTF 1
+float hypotf (float x, float y);
+
+float
+hypotf (float x, float y)
+{
+  return (float) hypot (x, y);
+}
+#endif
+
+#ifndef HAVE_LOGF
+#define HAVE_LOGF 1
+float logf (float x);
+
+float
+logf (float x)
+{
+  return (float) log (x);
+}
+#endif
+
+#ifndef HAVE_LOG10F
+#define HAVE_LOG10F 1
+float log10f (float x);
+
+float
+log10f (float x)
+{
+  return (float) log10 (x);
+}
+#endif
+
+#ifndef HAVE_SCALBN
+#define HAVE_SCALBN 1
+double scalbn (double x, int y);
+
+double
+scalbn (double x, int y)
+{
+#if (FLT_RADIX == 2) && defined(HAVE_LDEXP)
+  return ldexp (x, y);
+#else
+  return x * pow (FLT_RADIX, y);
+#endif
+}
+#endif
+
+#ifndef HAVE_SCALBNF
+#define HAVE_SCALBNF 1
+float scalbnf (float x, int y);
+
+float
+scalbnf (float x, int y)
+{
+  return (float) scalbn (x, y);
+}
+#endif
+
+#ifndef HAVE_SINF
+#define HAVE_SINF 1
+float sinf (float x);
+
+float
+sinf (float x)
+{
+  return (float) sin (x);
+}
+#endif
+
+#ifndef HAVE_SINHF
+#define HAVE_SINHF 1
+float sinhf (float x);
+
+float
+sinhf (float x)
+{
+  return (float) sinh (x);
+}
+#endif
+
+#ifndef HAVE_SQRTF
+#define HAVE_SQRTF 1
+float sqrtf (float x);
+
+float
+sqrtf (float x)
+{
+  return (float) sqrt (x);
+}
+#endif
+
+#ifndef HAVE_TANF
+#define HAVE_TANF 1
+float tanf (float x);
+
+float
+tanf (float x)
+{
+  return (float) tan (x);
+}
+#endif
+
+#ifndef HAVE_TANHF
+#define HAVE_TANHF 1
+float tanhf (float x);
+
+float
+tanhf (float x)
+{
+  return (float) tanh (x);
+}
+#endif
+
+#ifndef HAVE_TRUNC
+#define HAVE_TRUNC 1
+double trunc (double x);
+
+double
+trunc (double x)
+{
+  if (!isfinite (x))
+    return x;
+
+  if (x < 0.0)
+    return - floor (-x);
+  else
+    return floor (x);
+}
+#endif
+
+#ifndef HAVE_TRUNCF
+#define HAVE_TRUNCF 1
+float truncf (float x);
+
+float
+truncf (float x)
+{
+  return (float) trunc (x);
+}
+#endif
+
+#ifndef HAVE_NEXTAFTERF
+#define HAVE_NEXTAFTERF 1
+/* This is a portable implementation of nextafterf that is intended to be
+   independent of the floating point format or its in memory representation.
+   This implementation works correctly with denormalized values.  */
+float nextafterf (float x, float y);
+
+float
+nextafterf (float x, float y)
+{
+  /* This variable is marked volatile to avoid excess precision problems
+     on some platforms, including IA-32.  */
+  volatile float delta;
+  float absx, denorm_min;
+
+  if (isnan (x) || isnan (y))
+    return x + y;
+  if (x == y)
+    return x;
+  if (!isfinite (x))
+    return x > 0 ? __FLT_MAX__ : - __FLT_MAX__;
+
+  /* absx = fabsf (x);  */
+  absx = (x < 0.0) ? -x : x;
+
+  /* __FLT_DENORM_MIN__ is non-zero iff the target supports denormals.  */
+  if (__FLT_DENORM_MIN__ == 0.0f)
+    denorm_min = __FLT_MIN__;
+  else
+    denorm_min = __FLT_DENORM_MIN__;
+
+  if (absx < __FLT_MIN__)
+    delta = denorm_min;
+  else
+    {
+      float frac;
+      int exp;
+
+      /* Discard the fraction from x.  */
+      frac = frexpf (absx, &exp);
+      delta = scalbnf (0.5f, exp);
+
+      /* Scale x by the epsilon of the representation.  By rights we should
+        have been able to combine this with scalbnf, but some targets don't
+        get that correct with denormals.  */
+      delta *= __FLT_EPSILON__;
+
+      /* If we're going to be reducing the absolute value of X, and doing so
+        would reduce the exponent of X, then the delta to be applied is
+        one exponent smaller.  */
+      if (frac == 0.5f && (y < x) == (x > 0))
+       delta *= 0.5f;
+
+      /* If that underflows to zero, then we're back to the minimum.  */
+      if (delta == 0.0f)
+       delta = denorm_min;
+    }
+
+  if (y < x)
+    delta = -delta;
+
+  return x + delta;
+}
+#endif
+
+
+#if !defined(HAVE_POWF) || defined(HAVE_BROKEN_POWF)
+#ifndef HAVE_POWF
+#define HAVE_POWF 1
+#endif
+float powf (float x, float y);
+
+float
+powf (float x, float y)
+{
+  return (float) pow (x, y);
+}
+#endif
+
+
+#ifndef HAVE_ROUND
+#define HAVE_ROUND 1
+/* Round to nearest integral value.  If the argument is halfway between two
+   integral values then round away from zero.  */
+double round (double x);
+
+double
+round (double x)
+{
+   double t;
+   if (!isfinite (x))
+     return (x);
+
+   if (x >= 0.0) 
+    {
+      t = floor (x);
+      if (t - x <= -0.5)
+       t += 1.0;
+      return (t);
+    } 
+   else 
+    {
+      t = floor (-x);
+      if (t + x <= -0.5)
+       t += 1.0;
+      return (-t);
+    }
+}
+#endif
+
+
+/* Algorithm by Steven G. Kargl.  */
+
+#if !defined(HAVE_ROUNDL)
+#define HAVE_ROUNDL 1
+long double roundl (long double x);
+
+#if defined(HAVE_CEILL)
+/* Round to nearest integral value.  If the argument is halfway between two
+   integral values then round away from zero.  */
+
+long double
+roundl (long double x)
+{
+   long double t;
+   if (!isfinite (x))
+     return (x);
+
+   if (x >= 0.0)
+    {
+      t = ceill (x);
+      if (t - x > 0.5)
+       t -= 1.0;
+      return (t);
+    } 
+   else 
+    {
+      t = ceill (-x);
+      if (t + x > 0.5)
+       t -= 1.0;
+      return (-t);
+    }
+}
+#else
+
+/* Poor version of roundl for system that don't have ceill.  */
+long double
+roundl (long double x)
+{
+  if (x > DBL_MAX || x < -DBL_MAX)
+    {
+#ifdef HAVE_NEXTAFTERL
+      long double prechalf = nextafterl (0.5L, LDBL_MAX);
+#else
+      static long double prechalf = 0.5L;
+#endif
+      return (GFC_INTEGER_LARGEST) (x + (x > 0 ? prechalf : -prechalf));
+    }
+  else
+    /* Use round().  */
+    return round ((double) x);
+}
+
+#endif
+#endif
+
+#ifndef HAVE_ROUNDF
+#define HAVE_ROUNDF 1
+/* Round to nearest integral value.  If the argument is halfway between two
+   integral values then round away from zero.  */
+float roundf (float x);
+
+float
+roundf (float x)
+{
+   float t;
+   if (!isfinite (x))
+     return (x);
+
+   if (x >= 0.0) 
+    {
+      t = floorf (x);
+      if (t - x <= -0.5)
+       t += 1.0;
+      return (t);
+    } 
+   else 
+    {
+      t = floorf (-x);
+      if (t + x <= -0.5)
+       t += 1.0;
+      return (-t);
+    }
+}
+#endif
+
+
+/* lround{f,,l} and llround{f,,l} functions.  */
+
+#if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
+#define HAVE_LROUNDF 1
+long int lroundf (float x);
+
+long int
+lroundf (float x)
+{
+  return (long int) roundf (x);
+}
+#endif
+
+#if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
+#define HAVE_LROUND 1
+long int lround (double x);
+
+long int
+lround (double x)
+{
+  return (long int) round (x);
+}
+#endif
+
+#if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
+#define HAVE_LROUNDL 1
+long int lroundl (long double x);
+
+long int
+lroundl (long double x)
+{
+  return (long long int) roundl (x);
+}
+#endif
+
+#if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
+#define HAVE_LLROUNDF 1
+long long int llroundf (float x);
+
+long long int
+llroundf (float x)
+{
+  return (long long int) roundf (x);
+}
+#endif
+
+#if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
+#define HAVE_LLROUND 1
+long long int llround (double x);
+
+long long int
+llround (double x)
+{
+  return (long long int) round (x);
+}
+#endif
+
+#if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
+#define HAVE_LLROUNDL 1
+long long int llroundl (long double x);
+
+long long int
+llroundl (long double x)
+{
+  return (long long int) roundl (x);
+}
+#endif
+
+
+#ifndef HAVE_LOG10L
+#define HAVE_LOG10L 1
+/* log10 function for long double variables. The version provided here
+   reduces the argument until it fits into a double, then use log10.  */
+long double log10l (long double x);
+
+long double
+log10l (long double x)
+{
+#if LDBL_MAX_EXP > DBL_MAX_EXP
+  if (x > DBL_MAX)
+    {
+      double val;
+      int p2_result = 0;
+      if (x > 0x1p16383L) { p2_result += 16383; x /= 0x1p16383L; }
+      if (x > 0x1p8191L) { p2_result += 8191; x /= 0x1p8191L; }
+      if (x > 0x1p4095L) { p2_result += 4095; x /= 0x1p4095L; }
+      if (x > 0x1p2047L) { p2_result += 2047; x /= 0x1p2047L; }
+      if (x > 0x1p1023L) { p2_result += 1023; x /= 0x1p1023L; }
+      val = log10 ((double) x);
+      return (val + p2_result * .30102999566398119521373889472449302L);
+    }
+#endif
+#if LDBL_MIN_EXP < DBL_MIN_EXP
+  if (x < DBL_MIN)
+    {
+      double val;
+      int p2_result = 0;
+      if (x < 0x1p-16380L) { p2_result += 16380; x /= 0x1p-16380L; }
+      if (x < 0x1p-8189L) { p2_result += 8189; x /= 0x1p-8189L; }
+      if (x < 0x1p-4093L) { p2_result += 4093; x /= 0x1p-4093L; }
+      if (x < 0x1p-2045L) { p2_result += 2045; x /= 0x1p-2045L; }
+      if (x < 0x1p-1021L) { p2_result += 1021; x /= 0x1p-1021L; }
+      val = fabs (log10 ((double) x));
+      return (- val - p2_result * .30102999566398119521373889472449302L);
+    }
+#endif
+    return log10 (x);
+}
+#endif
+
+
+#ifndef HAVE_FLOORL
+#define HAVE_FLOORL 1
+long double floorl (long double x);
+
+long double
+floorl (long double x)
+{
+  /* Zero, possibly signed.  */
+  if (x == 0)
+    return x;
+
+  /* Large magnitude.  */
+  if (x > DBL_MAX || x < (-DBL_MAX))
+    return x;
+
+  /* Small positive values.  */
+  if (x >= 0 && x < DBL_MIN)
+    return 0;
+
+  /* Small negative values.  */
+  if (x < 0 && x > (-DBL_MIN))
+    return -1;
+
+  return floor (x);
+}
+#endif
+
+
+#ifndef HAVE_FMODL
+#define HAVE_FMODL 1
+long double fmodl (long double x, long double y);
+
+long double
+fmodl (long double x, long double y)
+{
+  if (y == 0.0L)
+    return 0.0L;
+
+  /* Need to check that the result has the same sign as x and magnitude
+     less than the magnitude of y.  */
+  return x - floorl (x / y) * y;
+}
+#endif
+
+
+#if !defined(HAVE_CABSF)
+#define HAVE_CABSF 1
+float cabsf (float complex z);
+
+float
+cabsf (float complex z)
+{
+  return hypotf (REALPART (z), IMAGPART (z));
+}
+#endif
+
+#if !defined(HAVE_CABS)
+#define HAVE_CABS 1
+double cabs (double complex z);
+
+double
+cabs (double complex z)
+{
+  return hypot (REALPART (z), IMAGPART (z));
+}
+#endif
+
+#if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
+#define HAVE_CABSL 1
+long double cabsl (long double complex z);
+
+long double
+cabsl (long double complex z)
+{
+  return hypotl (REALPART (z), IMAGPART (z));
+}
+#endif
+
+
+#if !defined(HAVE_CARGF)
+#define HAVE_CARGF 1
+float cargf (float complex z);
+
+float
+cargf (float complex z)
+{
+  return atan2f (IMAGPART (z), REALPART (z));
+}
+#endif
+
+#if !defined(HAVE_CARG)
+#define HAVE_CARG 1
+double carg (double complex z);
+
+double
+carg (double complex z)
+{
+  return atan2 (IMAGPART (z), REALPART (z));
+}
+#endif
+
+#if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
+#define HAVE_CARGL 1
+long double cargl (long double complex z);
+
+long double
+cargl (long double complex z)
+{
+  return atan2l (IMAGPART (z), REALPART (z));
+}
+#endif
+
+
+/* exp(z) = exp(a)*(cos(b) + i sin(b))  */
+#if !defined(HAVE_CEXPF)
+#define HAVE_CEXPF 1
+float complex cexpf (float complex z);
+
+float complex
+cexpf (float complex z)
+{
+  float a, b;
+  float complex v;
+
+  a = REALPART (z);
+  b = IMAGPART (z);
+  COMPLEX_ASSIGN (v, cosf (b), sinf (b));
+  return expf (a) * v;
+}
+#endif
+
+#if !defined(HAVE_CEXP)
+#define HAVE_CEXP 1
+double complex cexp (double complex z);
+
+double complex
+cexp (double complex z)
+{
+  double a, b;
+  double complex v;
+
+  a = REALPART (z);
+  b = IMAGPART (z);
+  COMPLEX_ASSIGN (v, cos (b), sin (b));
+  return exp (a) * v;
+}
+#endif
+
+#if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(EXPL)
+#define HAVE_CEXPL 1
+long double complex cexpl (long double complex z);
+
+long double complex
+cexpl (long double complex z)
+{
+  long double a, b;
+  long double complex v;
+
+  a = REALPART (z);
+  b = IMAGPART (z);
+  COMPLEX_ASSIGN (v, cosl (b), sinl (b));
+  return expl (a) * v;
+}
+#endif
+
+
+/* log(z) = log (cabs(z)) + i*carg(z)  */
+#if !defined(HAVE_CLOGF)
+#define HAVE_CLOGF 1
+float complex clogf (float complex z);
+
+float complex
+clogf (float complex z)
+{
+  float complex v;
+
+  COMPLEX_ASSIGN (v, logf (cabsf (z)), cargf (z));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CLOG)
+#define HAVE_CLOG 1
+double complex clog (double complex z);
+
+double complex
+clog (double complex z)
+{
+  double complex v;
+
+  COMPLEX_ASSIGN (v, log (cabs (z)), carg (z));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
+#define HAVE_CLOGL 1
+long double complex clogl (long double complex z);
+
+long double complex
+clogl (long double complex z)
+{
+  long double complex v;
+
+  COMPLEX_ASSIGN (v, logl (cabsl (z)), cargl (z));
+  return v;
+}
+#endif
+
+
+/* log10(z) = log10 (cabs(z)) + i*carg(z)  */
+#if !defined(HAVE_CLOG10F)
+#define HAVE_CLOG10F 1
+float complex clog10f (float complex z);
+
+float complex
+clog10f (float complex z)
+{
+  float complex v;
+
+  COMPLEX_ASSIGN (v, log10f (cabsf (z)), cargf (z));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CLOG10)
+#define HAVE_CLOG10 1
+double complex clog10 (double complex z);
+
+double complex
+clog10 (double complex z)
+{
+  double complex v;
+
+  COMPLEX_ASSIGN (v, log10 (cabs (z)), carg (z));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CLOG10L) && defined(HAVE_LOG10L) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
+#define HAVE_CLOG10L 1
+long double complex clog10l (long double complex z);
+
+long double complex
+clog10l (long double complex z)
+{
+  long double complex v;
+
+  COMPLEX_ASSIGN (v, log10l (cabsl (z)), cargl (z));
+  return v;
+}
+#endif
+
+
+/* pow(base, power) = cexp (power * clog (base))  */
+#if !defined(HAVE_CPOWF)
+#define HAVE_CPOWF 1
+float complex cpowf (float complex base, float complex power);
+
+float complex
+cpowf (float complex base, float complex power)
+{
+  return cexpf (power * clogf (base));
+}
+#endif
+
+#if !defined(HAVE_CPOW)
+#define HAVE_CPOW 1
+double complex cpow (double complex base, double complex power);
+
+double complex
+cpow (double complex base, double complex power)
+{
+  return cexp (power * clog (base));
+}
+#endif
+
+#if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
+#define HAVE_CPOWL 1
+long double complex cpowl (long double complex base, long double complex power);
+
+long double complex
+cpowl (long double complex base, long double complex power)
+{
+  return cexpl (power * clogl (base));
+}
+#endif
+
+
+/* sqrt(z).  Algorithm pulled from glibc.  */
+#if !defined(HAVE_CSQRTF)
+#define HAVE_CSQRTF 1
+float complex csqrtf (float complex z);
+
+float complex
+csqrtf (float complex z)
+{
+  float re, im;
+  float complex v;
+
+  re = REALPART (z);
+  im = IMAGPART (z);
+  if (im == 0)
+    {
+      if (re < 0)
+        {
+          COMPLEX_ASSIGN (v, 0, copysignf (sqrtf (-re), im));
+        }
+      else
+        {
+          COMPLEX_ASSIGN (v, fabsf (sqrtf (re)), copysignf (0, im));
+        }
+    }
+  else if (re == 0)
+    {
+      float r;
+
+      r = sqrtf (0.5 * fabsf (im));
+
+      COMPLEX_ASSIGN (v, r, copysignf (r, im));
+    }
+  else
+    {
+      float d, r, s;
+
+      d = hypotf (re, im);
+      /* Use the identity   2  Re res  Im res = Im x
+         to avoid cancellation error in  d +/- Re x.  */
+      if (re > 0)
+        {
+          r = sqrtf (0.5 * d + 0.5 * re);
+          s = (0.5 * im) / r;
+        }
+      else
+        {
+          s = sqrtf (0.5 * d - 0.5 * re);
+          r = fabsf ((0.5 * im) / s);
+        }
+
+      COMPLEX_ASSIGN (v, r, copysignf (s, im));
+    }
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CSQRT)
+#define HAVE_CSQRT 1
+double complex csqrt (double complex z);
+
+double complex
+csqrt (double complex z)
+{
+  double re, im;
+  double complex v;
+
+  re = REALPART (z);
+  im = IMAGPART (z);
+  if (im == 0)
+    {
+      if (re < 0)
+        {
+          COMPLEX_ASSIGN (v, 0, copysign (sqrt (-re), im));
+        }
+      else
+        {
+          COMPLEX_ASSIGN (v, fabs (sqrt (re)), copysign (0, im));
+        }
+    }
+  else if (re == 0)
+    {
+      double r;
+
+      r = sqrt (0.5 * fabs (im));
+
+      COMPLEX_ASSIGN (v, r, copysign (r, im));
+    }
+  else
+    {
+      double d, r, s;
+
+      d = hypot (re, im);
+      /* Use the identity   2  Re res  Im res = Im x
+         to avoid cancellation error in  d +/- Re x.  */
+      if (re > 0)
+        {
+          r = sqrt (0.5 * d + 0.5 * re);
+          s = (0.5 * im) / r;
+        }
+      else
+        {
+          s = sqrt (0.5 * d - 0.5 * re);
+          r = fabs ((0.5 * im) / s);
+        }
+
+      COMPLEX_ASSIGN (v, r, copysign (s, im));
+    }
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CSQRTL) && defined(HAVE_COPYSIGNL) && defined(HAVE_SQRTL) && defined(HAVE_FABSL) && defined(HAVE_HYPOTL)
+#define HAVE_CSQRTL 1
+long double complex csqrtl (long double complex z);
+
+long double complex
+csqrtl (long double complex z)
+{
+  long double re, im;
+  long double complex v;
+
+  re = REALPART (z);
+  im = IMAGPART (z);
+  if (im == 0)
+    {
+      if (re < 0)
+        {
+          COMPLEX_ASSIGN (v, 0, copysignl (sqrtl (-re), im));
+        }
+      else
+        {
+          COMPLEX_ASSIGN (v, fabsl (sqrtl (re)), copysignl (0, im));
+        }
+    }
+  else if (re == 0)
+    {
+      long double r;
+
+      r = sqrtl (0.5 * fabsl (im));
+
+      COMPLEX_ASSIGN (v, copysignl (r, im), r);
+    }
+  else
+    {
+      long double d, r, s;
+
+      d = hypotl (re, im);
+      /* Use the identity   2  Re res  Im res = Im x
+         to avoid cancellation error in  d +/- Re x.  */
+      if (re > 0)
+        {
+          r = sqrtl (0.5 * d + 0.5 * re);
+          s = (0.5 * im) / r;
+        }
+      else
+        {
+          s = sqrtl (0.5 * d - 0.5 * re);
+          r = fabsl ((0.5 * im) / s);
+        }
+
+      COMPLEX_ASSIGN (v, r, copysignl (s, im));
+    }
+  return v;
+}
+#endif
+
+
+/* sinh(a + i b) = sinh(a) cos(b) + i cosh(a) sin(b)  */
+#if !defined(HAVE_CSINHF)
+#define HAVE_CSINHF 1
+float complex csinhf (float complex a);
+
+float complex
+csinhf (float complex a)
+{
+  float r, i;
+  float complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, sinhf (r) * cosf (i), coshf (r) * sinf (i));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CSINH)
+#define HAVE_CSINH 1
+double complex csinh (double complex a);
+
+double complex
+csinh (double complex a)
+{
+  double r, i;
+  double complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, sinh (r) * cos (i), cosh (r) * sin (i));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CSINHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CSINHL 1
+long double complex csinhl (long double complex a);
+
+long double complex
+csinhl (long double complex a)
+{
+  long double r, i;
+  long double complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, sinhl (r) * cosl (i), coshl (r) * sinl (i));
+  return v;
+}
+#endif
+
+
+/* cosh(a + i b) = cosh(a) cos(b) + i sinh(a) sin(b)  */
+#if !defined(HAVE_CCOSHF)
+#define HAVE_CCOSHF 1
+float complex ccoshf (float complex a);
+
+float complex
+ccoshf (float complex a)
+{
+  float r, i;
+  float complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, coshf (r) * cosf (i), sinhf (r) * sinf (i));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CCOSH)
+#define HAVE_CCOSH 1
+double complex ccosh (double complex a);
+
+double complex
+ccosh (double complex a)
+{
+  double r, i;
+  double complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, cosh (r) * cos (i),  sinh (r) * sin (i));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CCOSHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CCOSHL 1
+long double complex ccoshl (long double complex a);
+
+long double complex
+ccoshl (long double complex a)
+{
+  long double r, i;
+  long double complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, coshl (r) * cosl (i), sinhl (r) * sinl (i));
+  return v;
+}
+#endif
+
+
+/* tanh(a + i b) = (tanh(a) + i tan(b)) / (1 + i tanh(a) tan(b))  */
+#if !defined(HAVE_CTANHF)
+#define HAVE_CTANHF 1
+float complex ctanhf (float complex a);
+
+float complex
+ctanhf (float complex a)
+{
+  float rt, it;
+  float complex n, d;
+
+  rt = tanhf (REALPART (a));
+  it = tanf (IMAGPART (a));
+  COMPLEX_ASSIGN (n, rt, it);
+  COMPLEX_ASSIGN (d, 1, rt * it);
+
+  return n / d;
+}
+#endif
+
+#if !defined(HAVE_CTANH)
+#define HAVE_CTANH 1
+double complex ctanh (double complex a);
+double complex
+ctanh (double complex a)
+{
+  double rt, it;
+  double complex n, d;
+
+  rt = tanh (REALPART (a));
+  it = tan (IMAGPART (a));
+  COMPLEX_ASSIGN (n, rt, it);
+  COMPLEX_ASSIGN (d, 1, rt * it);
+
+  return n / d;
+}
+#endif
+
+#if !defined(HAVE_CTANHL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
+#define HAVE_CTANHL 1
+long double complex ctanhl (long double complex a);
+
+long double complex
+ctanhl (long double complex a)
+{
+  long double rt, it;
+  long double complex n, d;
+
+  rt = tanhl (REALPART (a));
+  it = tanl (IMAGPART (a));
+  COMPLEX_ASSIGN (n, rt, it);
+  COMPLEX_ASSIGN (d, 1, rt * it);
+
+  return n / d;
+}
+#endif
+
+
+/* sin(a + i b) = sin(a) cosh(b) + i cos(a) sinh(b)  */
+#if !defined(HAVE_CSINF)
+#define HAVE_CSINF 1
+float complex csinf (float complex a);
+
+float complex
+csinf (float complex a)
+{
+  float r, i;
+  float complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, sinf (r) * coshf (i), cosf (r) * sinhf (i));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CSIN)
+#define HAVE_CSIN 1
+double complex csin (double complex a);
+
+double complex
+csin (double complex a)
+{
+  double r, i;
+  double complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, sin (r) * cosh (i), cos (r) * sinh (i));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CSINL 1
+long double complex csinl (long double complex a);
+
+long double complex
+csinl (long double complex a)
+{
+  long double r, i;
+  long double complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, sinl (r) * coshl (i), cosl (r) * sinhl (i));
+  return v;
+}
+#endif
+
+
+/* cos(a + i b) = cos(a) cosh(b) - i sin(a) sinh(b)  */
+#if !defined(HAVE_CCOSF)
+#define HAVE_CCOSF 1
+float complex ccosf (float complex a);
+
+float complex
+ccosf (float complex a)
+{
+  float r, i;
+  float complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, cosf (r) * coshf (i), - (sinf (r) * sinhf (i)));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CCOS)
+#define HAVE_CCOS 1
+double complex ccos (double complex a);
+
+double complex
+ccos (double complex a)
+{
+  double r, i;
+  double complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, cos (r) * cosh (i), - (sin (r) * sinh (i)));
+  return v;
+}
+#endif
+
+#if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
+#define HAVE_CCOSL 1
+long double complex ccosl (long double complex a);
+
+long double complex
+ccosl (long double complex a)
+{
+  long double r, i;
+  long double complex v;
+
+  r = REALPART (a);
+  i = IMAGPART (a);
+  COMPLEX_ASSIGN (v, cosl (r) * coshl (i), - (sinl (r) * sinhl (i)));
+  return v;
+}
+#endif
+
+
+/* tan(a + i b) = (tan(a) + i tanh(b)) / (1 - i tan(a) tanh(b))  */
+#if !defined(HAVE_CTANF)
+#define HAVE_CTANF 1
+float complex ctanf (float complex a);
+
+float complex
+ctanf (float complex a)
+{
+  float rt, it;
+  float complex n, d;
+
+  rt = tanf (REALPART (a));
+  it = tanhf (IMAGPART (a));
+  COMPLEX_ASSIGN (n, rt, it);
+  COMPLEX_ASSIGN (d, 1, - (rt * it));
+
+  return n / d;
+}
+#endif
+
+#if !defined(HAVE_CTAN)
+#define HAVE_CTAN 1
+double complex ctan (double complex a);
+
+double complex
+ctan (double complex a)
+{
+  double rt, it;
+  double complex n, d;
+
+  rt = tan (REALPART (a));
+  it = tanh (IMAGPART (a));
+  COMPLEX_ASSIGN (n, rt, it);
+  COMPLEX_ASSIGN (d, 1, - (rt * it));
+
+  return n / d;
+}
+#endif
+
+#if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
+#define HAVE_CTANL 1
+long double complex ctanl (long double complex a);
+
+long double complex
+ctanl (long double complex a)
+{
+  long double rt, it;
+  long double complex n, d;
+
+  rt = tanl (REALPART (a));
+  it = tanhl (IMAGPART (a));
+  COMPLEX_ASSIGN (n, rt, it);
+  COMPLEX_ASSIGN (d, 1, - (rt * it));
+
+  return n / d;
+}
+#endif
+
+
+/* Complex ASIN.  Returns wrongly NaN for infinite arguments.
+   Algorithm taken from Abramowitz & Stegun.  */
+
+#if !defined(HAVE_CASINF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CASINF 1
+complex float casinf (complex float z);
+
+complex float
+casinf (complex float z)
+{
+  return -I*clogf (I*z + csqrtf (1.0f-z*z));
+}
+#endif
+
+
+#if !defined(HAVE_CASIN) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CASIN 1
+complex double casin (complex double z);
+
+complex double
+casin (complex double z)
+{
+  return -I*clog (I*z + csqrt (1.0-z*z));
+}
+#endif
+
+
+#if !defined(HAVE_CASINL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CASINL 1
+complex long double casinl (complex long double z);
+
+complex long double
+casinl (complex long double z)
+{
+  return -I*clogl (I*z + csqrtl (1.0L-z*z));
+}
+#endif
+
+
+/* Complex ACOS.  Returns wrongly NaN for infinite arguments.
+   Algorithm taken from Abramowitz & Stegun.  */
+
+#if !defined(HAVE_CACOSF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CACOSF 1
+complex float cacosf (complex float z);
+
+complex float
+cacosf (complex float z)
+{
+  return -I*clogf (z + I*csqrtf (1.0f-z*z));
+}
+#endif
+
+
+#if !defined(HAVE_CACOS) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CACOS 1
+complex double cacos (complex double z);
+
+complex double
+cacos (complex double z)
+{
+  return -I*clog (z + I*csqrt (1.0-z*z));
+}
+#endif
+
+
+#if !defined(HAVE_CACOSL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CACOSL 1
+complex long double cacosl (complex long double z);
+
+complex long double
+cacosl (complex long double z)
+{
+  return -I*clogl (z + I*csqrtl (1.0L-z*z));
+}
+#endif
+
+
+/* Complex ATAN.  Returns wrongly NaN for infinite arguments.
+   Algorithm taken from Abramowitz & Stegun.  */
+
+#if !defined(HAVE_CATANF) && defined(HAVE_CLOGF)
+#define HAVE_CACOSF 1
+complex float catanf (complex float z);
+
+complex float
+catanf (complex float z)
+{
+  return I*clogf ((I+z)/(I-z))/2.0f;
+}
+#endif
+
+
+#if !defined(HAVE_CATAN) && defined(HAVE_CLOG)
+#define HAVE_CACOS 1
+complex double catan (complex double z);
+
+complex double
+catan (complex double z)
+{
+  return I*clog ((I+z)/(I-z))/2.0;
+}
+#endif
+
+
+#if !defined(HAVE_CATANL) && defined(HAVE_CLOGL)
+#define HAVE_CACOSL 1
+complex long double catanl (complex long double z);
+
+complex long double
+catanl (complex long double z)
+{
+  return I*clogl ((I+z)/(I-z))/2.0L;
+}
+#endif
+
+
+/* Complex ASINH.  Returns wrongly NaN for infinite arguments.
+   Algorithm taken from Abramowitz & Stegun.  */
+
+#if !defined(HAVE_CASINHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CASINHF 1
+complex float casinhf (complex float z);
+
+complex float
+casinhf (complex float z)
+{
+  return clogf (z + csqrtf (z*z+1.0f));
+}
+#endif
+
+
+#if !defined(HAVE_CASINH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CASINH 1
+complex double casinh (complex double z);
+
+complex double
+casinh (complex double z)
+{
+  return clog (z + csqrt (z*z+1.0));
+}
+#endif
+
+
+#if !defined(HAVE_CASINHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CASINHL 1
+complex long double casinhl (complex long double z);
+
+complex long double
+casinhl (complex long double z)
+{
+  return clogl (z + csqrtl (z*z+1.0L));
+}
+#endif
+
+
+/* Complex ACOSH.  Returns wrongly NaN for infinite arguments.
+   Algorithm taken from Abramowitz & Stegun.  */
+
+#if !defined(HAVE_CACOSHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
+#define HAVE_CACOSHF 1
+complex float cacoshf (complex float z);
+
+complex float
+cacoshf (complex float z)
+{
+  return clogf (z + csqrtf (z-1.0f) * csqrtf (z+1.0f));
+}
+#endif
+
+
+#if !defined(HAVE_CACOSH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
+#define HAVE_CACOSH 1
+complex double cacosh (complex double z);
+
+complex double
+cacosh (complex double z)
+{
+  return clog (z + csqrt (z-1.0) * csqrt (z+1.0));
+}
+#endif
+
+
+#if !defined(HAVE_CACOSHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
+#define HAVE_CACOSHL 1
+complex long double cacoshl (complex long double z);
+
+complex long double
+cacoshl (complex long double z)
+{
+  return clogl (z + csqrtl (z-1.0L) * csqrtl (z+1.0L));
+}
+#endif
+
+
+/* Complex ATANH.  Returns wrongly NaN for infinite arguments.
+   Algorithm taken from Abramowitz & Stegun.  */
+
+#if !defined(HAVE_CATANHF) && defined(HAVE_CLOGF)
+#define HAVE_CATANHF 1
+complex float catanhf (complex float z);
+
+complex float
+catanhf (complex float z)
+{
+  return clogf ((1.0f+z)/(1.0f-z))/2.0f;
+}
+#endif
+
+
+#if !defined(HAVE_CATANH) && defined(HAVE_CLOG)
+#define HAVE_CATANH 1
+complex double catanh (complex double z);
+
+complex double
+catanh (complex double z)
+{
+  return clog ((1.0+z)/(1.0-z))/2.0;
+}
+#endif
+
+#if !defined(HAVE_CATANHL) && defined(HAVE_CLOGL)
+#define HAVE_CATANHL 1
+complex long double catanhl (complex long double z);
+
+complex long double
+catanhl (complex long double z)
+{
+  return clogl ((1.0L+z)/(1.0L-z))/2.0L;
+}
+#endif
+
+
+#if !defined(HAVE_TGAMMA)
+#define HAVE_TGAMMA 1
+double tgamma (double); 
+
+/* Fallback tgamma() function. Uses the algorithm from
+   http://www.netlib.org/specfun/gamma and references therein.  */
+
+#undef SQRTPI
+#define SQRTPI 0.9189385332046727417803297
+
+#undef PI
+#define PI 3.1415926535897932384626434
+
+double
+tgamma (double x)
+{
+  int i, n, parity;
+  double fact, res, sum, xden, xnum, y, y1, ysq, z;
+
+  static double p[8] = {
+    -1.71618513886549492533811e0,  2.47656508055759199108314e1,
+    -3.79804256470945635097577e2,  6.29331155312818442661052e2,
+     8.66966202790413211295064e2, -3.14512729688483675254357e4,
+    -3.61444134186911729807069e4,  6.64561438202405440627855e4 };
+
+  static double q[8] = {
+    -3.08402300119738975254353e1,  3.15350626979604161529144e2,
+    -1.01515636749021914166146e3, -3.10777167157231109440444e3,
+     2.25381184209801510330112e4,  4.75584627752788110767815e3,
+    -1.34659959864969306392456e5, -1.15132259675553483497211e5 };
+
+  static double c[7] = {             -1.910444077728e-03,
+     8.4171387781295e-04,            -5.952379913043012e-04,
+     7.93650793500350248e-04,        -2.777777777777681622553e-03,
+     8.333333333333333331554247e-02,  5.7083835261e-03 };
+
+  static const double xminin = 2.23e-308;
+  static const double xbig = 171.624;
+  static const double xnan = __builtin_nan ("0x0"), xinf = __builtin_inf ();
+  static double eps = 0;
+  
+  if (eps == 0)
+    eps = nextafter (1., 2.) - 1.;
+
+  parity = 0;
+  fact = 1;
+  n = 0;
+  y = x;
+
+  if (isnan (x))
+    return x;
+
+  if (y <= 0)
+    {
+      y = -x;
+      y1 = trunc (y);
+      res = y - y1;
+
+      if (res != 0)
+       {
+         if (y1 != trunc (y1*0.5l)*2)
+           parity = 1;
+         fact = -PI / sin (PI*res);
+         y = y + 1;
+       }
+      else
+       return x == 0 ? copysign (xinf, x) : xnan;
+    }
+
+  if (y < eps)
+    {
+      if (y >= xminin)
+        res = 1 / y;
+      else
+       return xinf;
+    }
+  else if (y < 13)
+    {
+      y1 = y;
+      if (y < 1)
+       {
+         z = y;
+         y = y + 1;
+       }
+      else
+       {
+         n = (int)y - 1;
+         y = y - n;
+         z = y - 1;
+       }
+
+      xnum = 0;
+      xden = 1;
+      for (i = 0; i < 8; i++)
+       {
+         xnum = (xnum + p[i]) * z;
+         xden = xden * z + q[i];
+       }
+
+      res = xnum / xden + 1;
+
+      if (y1 < y)
+        res = res / y1;
+      else if (y1 > y)
+       for (i = 1; i <= n; i++)
+         {
+           res = res * y;
+           y = y + 1;
+         }
+    }
+  else
+    {
+      if (y < xbig)
+       {
+         ysq = y * y;
+         sum = c[6];
+         for (i = 0; i < 6; i++)
+           sum = sum / ysq + c[i];
+
+         sum = sum/y - y + SQRTPI;
+         sum = sum + (y - 0.5) * log (y);
+         res = exp (sum);
+       }
+      else
+       return x < 0 ? xnan : xinf;
+    }
+
+  if (parity)
+    res = -res;
+  if (fact != 1)
+    res = fact / res;
+
+  return res;
+}
+#endif
+
+
+
+#if !defined(HAVE_LGAMMA)
+#define HAVE_LGAMMA 1
+double lgamma (double); 
+
+/* Fallback lgamma() function. Uses the algorithm from
+   http://www.netlib.org/specfun/algama and references therein, 
+   except for negative arguments (where netlib would return +Inf)
+   where we use the following identity:
+       lgamma(y) = log(pi/(|y*sin(pi*y)|)) - lgamma(-y)
+ */
+
+double
+lgamma (double y)
+{
+
+#undef SQRTPI
+#define SQRTPI 0.9189385332046727417803297
+
+#undef PI
+#define PI 3.1415926535897932384626434
+
+#define PNT68  0.6796875
+#define D1    -0.5772156649015328605195174
+#define D2     0.4227843350984671393993777
+#define D4     1.791759469228055000094023
+
+  static double p1[8] = {
+              4.945235359296727046734888e0, 2.018112620856775083915565e2,
+              2.290838373831346393026739e3, 1.131967205903380828685045e4,
+              2.855724635671635335736389e4, 3.848496228443793359990269e4,
+              2.637748787624195437963534e4, 7.225813979700288197698961e3 };
+  static double q1[8] = {
+              6.748212550303777196073036e1,  1.113332393857199323513008e3,
+              7.738757056935398733233834e3,  2.763987074403340708898585e4,
+              5.499310206226157329794414e4,  6.161122180066002127833352e4,
+              3.635127591501940507276287e4,  8.785536302431013170870835e3 };
+  static double p2[8] = {
+              4.974607845568932035012064e0,  5.424138599891070494101986e2,
+              1.550693864978364947665077e4,  1.847932904445632425417223e5,
+              1.088204769468828767498470e6,  3.338152967987029735917223e6,
+              5.106661678927352456275255e6,  3.074109054850539556250927e6 };
+  static double q2[8] = {
+              1.830328399370592604055942e2,  7.765049321445005871323047e3,
+              1.331903827966074194402448e5,  1.136705821321969608938755e6,
+              5.267964117437946917577538e6,  1.346701454311101692290052e7,
+              1.782736530353274213975932e7,  9.533095591844353613395747e6 };
+  static double p4[8] = {
+              1.474502166059939948905062e4,  2.426813369486704502836312e6,
+              1.214755574045093227939592e8,  2.663432449630976949898078e9,
+              2.940378956634553899906876e10, 1.702665737765398868392998e11,
+              4.926125793377430887588120e11, 5.606251856223951465078242e11 };
+  static double q4[8] = {
+              2.690530175870899333379843e3,  6.393885654300092398984238e5,
+              4.135599930241388052042842e7,  1.120872109616147941376570e9,
+              1.488613728678813811542398e10, 1.016803586272438228077304e11,
+              3.417476345507377132798597e11, 4.463158187419713286462081e11 };
+  static double  c[7] = {
+             -1.910444077728e-03,            8.4171387781295e-04,
+             -5.952379913043012e-04,         7.93650793500350248e-04,
+             -2.777777777777681622553e-03,   8.333333333333333331554247e-02,
+              5.7083835261e-03 };
+
+  static double xbig = 2.55e305, xinf = __builtin_inf (), eps = 0,
+               frtbig = 2.25e76;
+
+  int i;
+  double corr, res, xden, xm1, xm2, xm4, xnum, ysq;
+
+  if (eps == 0)
+    eps = __builtin_nextafter (1., 2.) - 1.;
+
+  if ((y > 0) && (y <= xbig))
+    {
+      if (y <= eps)
+       res = -log (y);
+      else if (y <= 1.5)
+       {
+         if (y < PNT68)
+           {
+             corr = -log (y);
+             xm1 = y;
+           }
+         else
+           {
+             corr = 0;
+             xm1 = (y - 0.5) - 0.5;
+           }
+
+         if ((y <= 0.5) || (y >= PNT68))
+           {
+             xden = 1;
+             xnum = 0;
+             for (i = 0; i < 8; i++)
+               {
+                 xnum = xnum*xm1 + p1[i];
+                 xden = xden*xm1 + q1[i];
+               }
+             res = corr + (xm1 * (D1 + xm1*(xnum/xden)));
+           }
+         else
+           {
+             xm2 = (y - 0.5) - 0.5;
+             xden = 1;
+             xnum = 0;
+             for (i = 0; i < 8; i++)
+               {
+                 xnum = xnum*xm2 + p2[i];
+                 xden = xden*xm2 + q2[i];
+               }
+             res = corr + xm2 * (D2 + xm2*(xnum/xden));
+           }
+       }
+      else if (y <= 4)
+       {
+         xm2 = y - 2;
+         xden = 1;
+         xnum = 0;
+         for (i = 0; i < 8; i++)
+           {
+             xnum = xnum*xm2 + p2[i];
+             xden = xden*xm2 + q2[i];
+           }
+         res = xm2 * (D2 + xm2*(xnum/xden));
+       }
+      else if (y <= 12)
+       {
+         xm4 = y - 4;
+         xden = -1;
+         xnum = 0;
+         for (i = 0; i < 8; i++)
+           {
+             xnum = xnum*xm4 + p4[i];
+             xden = xden*xm4 + q4[i];
+           }
+         res = D4 + xm4*(xnum/xden);
+       }
+      else
+       {
+         res = 0;
+         if (y <= frtbig)
+           {
+             res = c[6];
+             ysq = y * y;
+             for (i = 0; i < 6; i++)
+               res = res / ysq + c[i];
+           }
+         res = res/y;
+         corr = log (y);
+         res = res + SQRTPI - 0.5*corr;
+         res = res + y*(corr-1);
+       }
+    }
+  else if (y < 0 && __builtin_floor (y) != y)
+    {
+      /* lgamma(y) = log(pi/(|y*sin(pi*y)|)) - lgamma(-y)
+         For abs(y) very close to zero, we use a series expansion to
+        the first order in y to avoid overflow.  */
+      if (y > -1.e-100)
+        res = -2 * log (fabs (y)) - lgamma (-y);
+      else
+        res = log (PI / fabs (y * sin (PI * y))) - lgamma (-y);
+    }
+  else
+    res = xinf;
+
+  return res;
+}
+#endif
+
+
+#if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
+#define HAVE_TGAMMAF 1
+float tgammaf (float);
+
+float
+tgammaf (float x)
+{
+  return (float) tgamma ((double) x);
+}
+#endif
+
+#if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
+#define HAVE_LGAMMAF 1
+float lgammaf (float);
+
+float
+lgammaf (float x)
+{
+  return (float) lgamma ((double) x);
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/chdir.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/chdir.c
new file mode 100644 (file)
index 0000000..62f4693
--- /dev/null
@@ -0,0 +1,111 @@
+/* Implementation of the CHDIR intrinsic.
+   Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+#include <string.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* SUBROUTINE CHDIR(DIR, STATUS)
+   CHARACTER(len=*), INTENT(IN) :: DIR
+   INTEGER, INTENT(OUT), OPTIONAL :: STATUS  */
+
+#ifdef HAVE_CHDIR
+extern void chdir_i4_sub (char *, GFC_INTEGER_4 *, gfc_charlen_type);
+iexport_proto(chdir_i4_sub);
+
+void
+chdir_i4_sub (char *dir, GFC_INTEGER_4 *status, gfc_charlen_type dir_len)
+{
+  int val;
+  char *str;
+
+  /* Trim trailing spaces from paths.  */
+  while (dir_len > 0 && dir[dir_len - 1] == ' ')
+    dir_len--;
+
+  /* Make a null terminated copy of the strings.  */
+  str = gfc_alloca (dir_len + 1);
+  memcpy (str, dir, dir_len);
+  str[dir_len] = '\0';
+
+  val = chdir (str);
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(chdir_i4_sub);
+
+extern void chdir_i8_sub (char *, GFC_INTEGER_8 *, gfc_charlen_type);
+iexport_proto(chdir_i8_sub);
+
+void
+chdir_i8_sub (char *dir, GFC_INTEGER_8 *status, gfc_charlen_type dir_len)
+{
+  int val;
+  char *str;
+
+  /* Trim trailing spaces from paths.  */
+  while (dir_len > 0 && dir[dir_len - 1] == ' ')
+    dir_len--;
+
+  /* Make a null terminated copy of the strings.  */
+  str = gfc_alloca (dir_len + 1);
+  memcpy (str, dir, dir_len);
+  str[dir_len] = '\0';
+
+  val = chdir (str);
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(chdir_i8_sub);
+
+extern GFC_INTEGER_4 chdir_i4 (char *, gfc_charlen_type);
+export_proto(chdir_i4);
+
+GFC_INTEGER_4
+chdir_i4 (char *dir, gfc_charlen_type dir_len)
+{
+  GFC_INTEGER_4 val;
+  chdir_i4_sub (dir, &val, dir_len);
+  return val;
+}
+
+extern GFC_INTEGER_8 chdir_i8 (char *, gfc_charlen_type);
+export_proto(chdir_i8);
+
+GFC_INTEGER_8
+chdir_i8 (char *dir, gfc_charlen_type dir_len)
+{
+  GFC_INTEGER_8 val;
+  chdir_i8_sub (dir, &val, dir_len);
+  return val;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/chmod.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/chmod.c
new file mode 100644 (file)
index 0000000..9156303
--- /dev/null
@@ -0,0 +1,524 @@
+/* Implementation of the CHMOD intrinsic.
+   Copyright (C) 2006, 2007, 2009, 2012 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#if defined(HAVE_SYS_STAT_H)
+
+#include <stdbool.h>
+#include <string.h>    /* For memcpy. */
+#include <sys/stat.h>  /* For stat, chmod and umask.  */
+
+
+/* INTEGER FUNCTION CHMOD (NAME, MODE)
+   CHARACTER(len=*), INTENT(IN) :: NAME, MODE
+
+   Sets the file permission "chmod" using a mode string.
+
+   For MinGW, only _S_IWRITE and _S_IREAD are supported. To set those,
+   only the user attributes are used.
+
+   The mode string allows for the same arguments as POSIX's chmod utility.
+   a) string containing an octal number.
+   b) Comma separated list of clauses of the form:
+      [<who-list>]<op>[<perm-list>|<permcopy>][<op>[<perm-list>|<permcopy>],...]
+      <who> - 'u', 'g', 'o', 'a'
+      <op>  - '+', '-', '='
+      <perm> - 'r', 'w', 'x', 'X', 's', t'
+   If <op> is not followed by a perm-list or permcopy, '-' and '+' do not
+   change the mode while '=' clears all file mode bits. 'u' stands for the
+   user permissions, 'g' for the group and 'o' for the permissions for others.
+   'a' is equivalent to 'ugo'. '+' sets the given permission in addition to
+   the ones of the file, '-' unsets the given permissions of the file, while
+   '=' sets the file to that mode. 'r' sets the read, 'w' the write, and
+   'x' the execute mode. 'X' sets the execute bit if the file is a directory
+   or if the user, group or other executable bit is set. 't' sets the sticky
+   bit, 's' (un)sets the and/or S_ISUID/S_ISGID bit.
+
+   Note that if <who> is omitted, the permissions are filtered by the umask.
+
+   A return value of 0 indicates success, -1 an error of chmod() while 1
+   indicates a mode parsing error.  */
+
+extern int chmod_func (char *, char *, gfc_charlen_type, gfc_charlen_type);
+export_proto(chmod_func);
+
+int
+chmod_func (char *name, char *mode, gfc_charlen_type name_len,
+           gfc_charlen_type mode_len)
+{
+  char * file;
+  int i;
+  bool ugo[3];
+  bool rwxXstugo[9];
+  int set_mode, part;
+  bool is_dir, honor_umask, continue_clause = false;
+  mode_t mode_mask, file_mode, new_mode;
+  struct stat stat_buf;
+
+  /* Trim trailing spaces of the file name.  */
+  while (name_len > 0 && name[name_len - 1] == ' ')
+    name_len--;
+
+  /* Make a null terminated copy of the file name.  */
+  file = gfc_alloca (name_len + 1);
+  memcpy (file, name, name_len);
+  file[name_len] = '\0';
+
+  if (mode_len == 0)
+    return 1;
+
+  if (mode[0] >= '0' && mode[0] <= '9')
+    {
+#ifdef __MINGW32__
+      unsigned mode;
+      if (sscanf (mode, "%o", &mode) != 1)
+       return 1;
+      file_mode = (mode_t) mode;
+#else
+      if (sscanf (mode, "%o", &file_mode) != 1)
+       return 1;
+#endif
+      return chmod (file, file_mode);
+    }
+
+  /* Read the current file mode. */
+  if (stat (file, &stat_buf))
+    return 1;
+
+  file_mode = stat_buf.st_mode & ~S_IFMT;
+  is_dir = stat_buf.st_mode & S_IFDIR;
+
+#ifdef HAVE_UMASK
+  /* Obtain the umask without distroying the setting.  */
+  mode_mask = 0;
+  mode_mask = umask (mode_mask);
+  (void) umask (mode_mask);
+#else
+  honor_umask = false;
+#endif
+
+  for (i = 0; i < mode_len; i++)
+    {
+      if (!continue_clause)
+       {
+         ugo[0] = false;
+         ugo[1] = false;
+         ugo[2] = false;
+#ifdef HAVE_UMASK
+         honor_umask = true;
+#endif
+       }
+      continue_clause = false; 
+      rwxXstugo[0] = false;
+      rwxXstugo[1] = false;
+      rwxXstugo[2] = false;
+      rwxXstugo[3] = false;
+      rwxXstugo[4] = false;
+      rwxXstugo[5] = false;
+      rwxXstugo[6] = false;
+      rwxXstugo[7] = false;
+      rwxXstugo[8] = false;
+      part = 0;
+      set_mode = -1;
+      for (; i < mode_len; i++)
+       {
+         switch (mode[i])
+           {
+           /* User setting: a[ll]/u[ser]/g[roup]/o[ther].  */
+           case 'a':
+             if (part > 1)
+               return 1;
+             ugo[0] = true;
+             ugo[1] = true;
+             ugo[2] = true;
+             part = 1;
+#ifdef HAVE_UMASK
+             honor_umask = false;
+#endif
+             break;
+           case 'u':
+             if (part == 2)
+               {
+                 rwxXstugo[6] = true; 
+                 part = 4;
+                 break; 
+               }
+             if (part > 1)
+               return 1;
+             ugo[0] = true;
+             part = 1;
+#ifdef HAVE_UMASK
+             honor_umask = false;
+#endif
+             break;
+           case 'g':
+             if (part == 2)
+               {
+                 rwxXstugo[7] = true; 
+                 part = 4;
+                 break; 
+               }
+             if (part > 1)
+               return 1;
+                     ugo[1] = true;
+             part = 1;
+#ifdef HAVE_UMASK
+             honor_umask = false;
+#endif
+             break;
+           case 'o':
+             if (part == 2)
+               {
+                 rwxXstugo[8] = true; 
+                 part = 4;
+                 break; 
+               }
+             if (part > 1)
+               return 1;
+             ugo[2] = true;
+             part = 1;
+#ifdef HAVE_UMASK
+             honor_umask = false;
+#endif
+             break;
+
+           /* Mode setting: =+-.  */
+           case '=':
+             if (part > 2)
+               {
+                 continue_clause = true;
+                 i--;
+                 part = 2;
+                 goto clause_done;
+               }
+             set_mode = 1;
+             part = 2;
+             break;
+
+           case '-':
+             if (part > 2)
+               {
+                 continue_clause = true;
+                 i--;
+                 part = 2;
+                 goto clause_done;
+               }
+             set_mode = 2;
+             part = 2;
+             break;
+
+           case '+':
+             if (part > 2)
+               {
+                 continue_clause = true;
+                 i--;
+                 part = 2;
+                 goto clause_done;
+               }
+             set_mode = 3;
+             part = 2;
+             break;
+
+           /* Permissions: rwxXst - for ugo see above.  */
+           case 'r':
+             if (part != 2 && part != 3)
+               return 1;
+             rwxXstugo[0] = true;
+             part = 3;
+             break;
+
+           case 'w':
+             if (part != 2 && part != 3)
+               return 1;
+             rwxXstugo[1] = true;
+             part = 3;
+             break;
+
+           case 'x':
+             if (part != 2 && part != 3)
+               return 1;
+             rwxXstugo[2] = true;
+             part = 3;
+             break;
+
+           case 'X':
+             if (part != 2 && part != 3)
+               return 1;
+             rwxXstugo[3] = true;
+             part = 3;
+             break;
+
+           case 's':
+             if (part != 2 && part != 3)
+               return 1;
+             rwxXstugo[4] = true;
+             part = 3;
+             break;
+
+           case 't':
+             if (part != 2 && part != 3)
+               return 1;
+             rwxXstugo[5] = true;
+             part = 3;
+             break;
+
+           /* Tailing blanks are valid in Fortran.  */
+           case ' ':
+             for (i++; i < mode_len; i++)
+               if (mode[i] != ' ')
+                 break;
+             if (i != mode_len)
+               return 1;
+             goto clause_done;
+
+           case ',':
+             goto clause_done;
+
+           default:
+             return 1;
+           }
+       }
+
+clause_done:
+      if (part < 2)
+       return 1;
+
+      new_mode = 0;
+
+#ifdef __MINGW32__
+
+      /* Read. */
+      if (rwxXstugo[0] && (ugo[0] || honor_umask))
+       new_mode |= _S_IREAD;
+
+      /* Write. */
+      if (rwxXstugo[1] && (ugo[0] || honor_umask))
+       new_mode |= _S_IWRITE;
+
+#else
+
+      /* Read. */
+      if (rwxXstugo[0])
+       {
+         if (ugo[0] || honor_umask)
+           new_mode |= S_IRUSR;
+         if (ugo[1] || honor_umask)
+           new_mode |= S_IRGRP;
+         if (ugo[2] || honor_umask)
+           new_mode |= S_IROTH;
+       }
+
+      /* Write.  */
+      if (rwxXstugo[1])
+       {
+         if (ugo[0] || honor_umask)
+           new_mode |= S_IWUSR;
+         if (ugo[1] || honor_umask)
+           new_mode |= S_IWGRP;
+         if (ugo[2] || honor_umask)
+           new_mode |= S_IWOTH;
+       }
+
+      /* Execute. */
+      if (rwxXstugo[2])
+       {
+         if (ugo[0] || honor_umask)
+           new_mode |= S_IXUSR;
+         if (ugo[1] || honor_umask)
+           new_mode |= S_IXGRP;
+         if (ugo[2] || honor_umask)
+           new_mode |= S_IXOTH;
+       }
+
+      /* 'X' execute.  */
+      if (rwxXstugo[3]
+         && (is_dir || (file_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
+       new_mode |= (S_IXUSR | S_IXGRP | S_IXOTH);
+
+      /* 's'.  */
+      if (rwxXstugo[4])
+       {
+         if (ugo[0] || honor_umask)
+           new_mode |= S_ISUID;
+         if (ugo[1] || honor_umask)
+           new_mode |= S_ISGID;
+       }
+
+      /* As original 'u'.  */
+      if (rwxXstugo[6])
+       {
+         if (ugo[1] || honor_umask)
+           {
+             if (file_mode & S_IRUSR)
+               new_mode |= S_IRGRP;
+             if (file_mode & S_IWUSR)
+               new_mode |= S_IWGRP;
+             if (file_mode & S_IXUSR)
+               new_mode |= S_IXGRP;
+           }
+         if (ugo[2] || honor_umask)
+           {
+             if (file_mode & S_IRUSR)
+               new_mode |= S_IROTH;
+             if (file_mode & S_IWUSR)
+               new_mode |= S_IWOTH;
+             if (file_mode & S_IXUSR)
+               new_mode |= S_IXOTH;
+           }
+       }
+
+      /* As original 'g'.  */
+      if (rwxXstugo[7])
+       {
+         if (ugo[0] || honor_umask)
+           {
+             if (file_mode & S_IRGRP)
+               new_mode |= S_IRUSR;
+             if (file_mode & S_IWGRP)
+               new_mode |= S_IWUSR;
+             if (file_mode & S_IXGRP)
+               new_mode |= S_IXUSR;
+           }
+         if (ugo[2] || honor_umask)
+           {
+             if (file_mode & S_IRGRP)
+               new_mode |= S_IROTH;
+             if (file_mode & S_IWGRP)
+               new_mode |= S_IWOTH;
+             if (file_mode & S_IXGRP)
+               new_mode |= S_IXOTH;
+           }
+       }
+
+      /* As original 'o'.  */
+      if (rwxXstugo[8])
+       {
+         if (ugo[0] || honor_umask)
+           {
+             if (file_mode & S_IROTH)
+               new_mode |= S_IRUSR;
+             if (file_mode & S_IWOTH)
+               new_mode |= S_IWUSR;
+             if (file_mode & S_IXOTH)
+               new_mode |= S_IXUSR;
+           }
+         if (ugo[1] || honor_umask)
+           {
+             if (file_mode & S_IROTH)
+               new_mode |= S_IRGRP;
+             if (file_mode & S_IWOTH)
+               new_mode |= S_IWGRP;
+             if (file_mode & S_IXOTH)
+               new_mode |= S_IXGRP;
+           }
+       }
+#endif  /* __MINGW32__ */
+
+#ifdef HAVE_UMASK
+    if (honor_umask)
+      new_mode &= ~mode_mask;
+#endif
+
+    if (set_mode == 1)
+      {
+#ifdef __MINGW32__
+       if (ugo[0] || honor_umask)
+         file_mode = (file_mode & ~(_S_IWRITE | _S_IREAD))
+                     | (new_mode & (_S_IWRITE | _S_IREAD));
+#else
+       /* Set '='.  */
+       if ((ugo[0] || honor_umask) && !rwxXstugo[6])
+         file_mode = (file_mode & ~(S_ISUID | S_IRUSR | S_IWUSR | S_IXUSR))
+                     | (new_mode & (S_ISUID | S_IRUSR | S_IWUSR | S_IXUSR));
+       if ((ugo[1] || honor_umask) && !rwxXstugo[7])
+         file_mode = (file_mode & ~(S_ISGID | S_IRGRP | S_IWGRP | S_IXGRP))
+                     | (new_mode & (S_ISGID | S_IRGRP | S_IWGRP | S_IXGRP));
+       if ((ugo[2] || honor_umask) && !rwxXstugo[8])
+         file_mode = (file_mode & ~(S_IROTH | S_IWOTH | S_IXOTH))
+                     | (new_mode & (S_IROTH | S_IWOTH | S_IXOTH));
+       if (is_dir && rwxXstugo[5])
+         file_mode |= S_ISVTX;
+       else if (!is_dir)
+         file_mode &= ~S_ISVTX;
+#endif
+      }
+    else if (set_mode == 2)
+      {
+       /* Clear '-'.  */
+       file_mode &= ~new_mode;
+#ifndef __MINGW32__
+       if (rwxXstugo[5] || !is_dir)
+         file_mode &= ~S_ISVTX;
+#endif
+      }
+    else if (set_mode == 3)
+      {
+       file_mode |= new_mode;
+#ifndef __MINGW32__
+       if (rwxXstugo[5] && is_dir)
+         file_mode |= S_ISVTX;
+       else if (!is_dir)
+         file_mode &= ~S_ISVTX;
+#endif
+      }
+  }
+
+  return chmod (file, file_mode);
+}
+
+
+extern void chmod_i4_sub (char *, char *, GFC_INTEGER_4 *,
+                         gfc_charlen_type, gfc_charlen_type);
+export_proto(chmod_i4_sub);
+
+void
+chmod_i4_sub (char *name, char *mode, GFC_INTEGER_4 * status,
+             gfc_charlen_type name_len, gfc_charlen_type mode_len)
+{
+  int val;
+
+  val = chmod_func (name, mode, name_len, mode_len);
+  if (status)
+    *status = val;
+}
+
+
+extern void chmod_i8_sub (char *, char *, GFC_INTEGER_8 *,
+                         gfc_charlen_type, gfc_charlen_type);
+export_proto(chmod_i8_sub);
+
+void
+chmod_i8_sub (char *name, char *mode, GFC_INTEGER_8 * status,
+             gfc_charlen_type name_len, gfc_charlen_type mode_len)
+{
+  int val;
+
+  val = chmod_func (name, mode, name_len, mode_len);
+  if (status)
+    *status = val;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/clock.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/clock.c
new file mode 100644 (file)
index 0000000..29ccc15
--- /dev/null
@@ -0,0 +1,52 @@
+/* Implementation of the MCLOCK and MCLOCK8 g77 intrinsics.
+   Copyright (C) 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <time.h>
+
+
+/* INTEGER(KIND=4) FUNCTION MCLOCK()  */
+
+extern GFC_INTEGER_4 mclock (void);
+export_proto(mclock);
+
+GFC_INTEGER_4
+mclock (void)
+{
+  return (GFC_INTEGER_4) clock ();
+}
+
+
+/* INTEGER(KIND=8) FUNCTION MCLOCK8()  */
+
+extern GFC_INTEGER_8 mclock8 (void);
+export_proto(mclock8);
+
+GFC_INTEGER_8
+mclock8 (void)
+{
+  return (GFC_INTEGER_8) clock ();
+}
+
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/cpu_time.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/cpu_time.c
new file mode 100644 (file)
index 0000000..94636c4
--- /dev/null
@@ -0,0 +1,109 @@
+/* Implementation of the CPU_TIME intrinsic.
+   Copyright (C) 2003, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include "time_1.h"
+
+
+static void
+__cpu_time_1 (long *sec, long *usec)
+{
+  long user_sec, user_usec, system_sec, system_usec;
+  if (gf_cputime (&user_sec, &user_usec, &system_sec, &system_usec) == 0)
+    {
+      *sec = user_sec + system_sec;
+      *usec = user_usec + system_usec;
+    }
+  else
+    {
+      *sec = -1;
+      *usec = 0;
+    }
+}
+
+
+extern void cpu_time_4 (GFC_REAL_4 *);
+iexport_proto(cpu_time_4);
+
+void cpu_time_4 (GFC_REAL_4 *time)
+{
+  long sec, usec;
+  __cpu_time_1 (&sec, &usec);
+  *time = sec + usec * GFC_REAL_4_LITERAL(1.e-6);
+}
+iexport(cpu_time_4);
+
+extern void cpu_time_8 (GFC_REAL_8 *);
+export_proto(cpu_time_8);
+
+void cpu_time_8 (GFC_REAL_8 *time)
+{
+  long sec, usec;
+  __cpu_time_1 (&sec, &usec);
+  *time = sec + usec * GFC_REAL_8_LITERAL(1.e-6);
+}
+
+#ifdef HAVE_GFC_REAL_10
+extern void cpu_time_10 (GFC_REAL_10 *);
+export_proto(cpu_time_10);
+
+void cpu_time_10 (GFC_REAL_10 *time)
+{
+  long sec, usec;
+  __cpu_time_1 (&sec, &usec);
+  *time = sec + usec * GFC_REAL_10_LITERAL(1.e-6);
+}
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+extern void cpu_time_16 (GFC_REAL_16 *);
+export_proto(cpu_time_16);
+
+void cpu_time_16 (GFC_REAL_16 *time)
+{
+  long sec, usec;
+  __cpu_time_1 (&sec, &usec);
+  *time = sec + usec * GFC_REAL_16_LITERAL(1.e-6);
+}
+#endif
+
+extern void second_sub (GFC_REAL_4 *);
+export_proto(second_sub);
+
+void
+second_sub (GFC_REAL_4 *s)
+{
+  cpu_time_4 (s);
+}
+
+extern GFC_REAL_4 second (void);
+export_proto(second);
+
+GFC_REAL_4
+second (void)
+{
+  GFC_REAL_4 s;
+  cpu_time_4 (&s);
+  return s;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/cshift0.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/cshift0.c
new file mode 100644 (file)
index 0000000..026dd1a
--- /dev/null
@@ -0,0 +1,452 @@
+/* Generic implementation of the CSHIFT intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2010 Free Software Foundation, Inc.
+   Contributed by Feng Wang <wf_cs@yahoo.com>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+static void
+cshift0 (gfc_array_char * ret, const gfc_array_char * array,
+        ptrdiff_t shift, int which, index_type size)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type arraysize;
+
+  index_type type_size;
+
+  if (which < 1 || which > GFC_DESCRIPTOR_RANK (array))
+    runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
+
+  arraysize = size0 ((array_t *) array);
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+          ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1) *
+             GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+        }
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "CSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  type_size = GFC_DTYPE_TYPE_SIZE (array);
+
+  switch(type_size)
+    {
+    case GFC_DTYPE_LOGICAL_1:
+    case GFC_DTYPE_INTEGER_1:
+    case GFC_DTYPE_DERIVED_1:
+      cshift0_i1 ((gfc_array_i1 *)ret, (gfc_array_i1 *) array, shift, which);
+      return;
+
+    case GFC_DTYPE_LOGICAL_2:
+    case GFC_DTYPE_INTEGER_2:
+      cshift0_i2 ((gfc_array_i2 *)ret, (gfc_array_i2 *) array, shift, which);
+      return;
+
+    case GFC_DTYPE_LOGICAL_4:
+    case GFC_DTYPE_INTEGER_4:
+      cshift0_i4 ((gfc_array_i4 *)ret, (gfc_array_i4 *) array, shift, which);
+      return;
+
+    case GFC_DTYPE_LOGICAL_8:
+    case GFC_DTYPE_INTEGER_8:
+      cshift0_i8 ((gfc_array_i8 *)ret, (gfc_array_i8 *) array, shift, which);
+      return;
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_LOGICAL_16:
+    case GFC_DTYPE_INTEGER_16:
+      cshift0_i16 ((gfc_array_i16 *)ret, (gfc_array_i16 *) array, shift,
+                  which);
+      return;
+#endif
+
+    case GFC_DTYPE_REAL_4:
+      cshift0_r4 ((gfc_array_r4 *)ret, (gfc_array_r4 *) array, shift, which);
+      return;
+
+    case GFC_DTYPE_REAL_8:
+      cshift0_r8 ((gfc_array_r8 *)ret, (gfc_array_r8 *) array, shift, which);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_REAL_10
+    case GFC_DTYPE_REAL_10:
+      cshift0_r10 ((gfc_array_r10 *)ret, (gfc_array_r10 *) array, shift,
+                  which);
+      return;
+# endif
+
+# ifdef HAVE_GFC_REAL_16
+    case GFC_DTYPE_REAL_16:
+      cshift0_r16 ((gfc_array_r16 *)ret, (gfc_array_r16 *) array, shift,
+                  which);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_COMPLEX_4:
+      cshift0_c4 ((gfc_array_c4 *)ret, (gfc_array_c4 *) array, shift, which);
+      return;
+
+    case GFC_DTYPE_COMPLEX_8:
+      cshift0_c8 ((gfc_array_c8 *)ret, (gfc_array_c8 *) array, shift, which);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_COMPLEX_10
+    case GFC_DTYPE_COMPLEX_10:
+      cshift0_c10 ((gfc_array_c10 *)ret, (gfc_array_c10 *) array, shift,
+                  which);
+      return;
+# endif
+
+# ifdef HAVE_GFC_COMPLEX_16
+    case GFC_DTYPE_COMPLEX_16:
+      cshift0_c16 ((gfc_array_c16 *)ret, (gfc_array_c16 *) array, shift,
+                  which);
+      return;
+# endif
+#endif
+
+    default:
+      break;
+    }
+
+  switch (size)
+    {
+      /* Let's check the actual alignment of the data pointers.  If they
+        are suitably aligned, we can safely call the unpack functions.  */
+
+    case sizeof (GFC_INTEGER_1):
+      cshift0_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) array, shift,
+                 which);
+      break;
+
+    case sizeof (GFC_INTEGER_2):
+      if (GFC_UNALIGNED_2(ret->data) || GFC_UNALIGNED_2(array->data))
+       break;
+      else
+       {
+         cshift0_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) array, shift,
+                     which);
+         return;
+       }
+
+    case sizeof (GFC_INTEGER_4):
+      if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(array->data))
+       break;
+      else
+       {
+         cshift0_i4 ((gfc_array_i4 *)ret, (gfc_array_i4 *) array, shift,
+                     which);
+         return;
+       }
+
+    case sizeof (GFC_INTEGER_8):
+      if (GFC_UNALIGNED_8(ret->data) || GFC_UNALIGNED_8(array->data))
+       {
+         /* Let's try to use the complex routines.  First, a sanity
+            check that the sizes match; this should be optimized to
+            a no-op.  */
+         if (sizeof(GFC_INTEGER_8) != sizeof(GFC_COMPLEX_4))
+           break;
+
+         if (GFC_UNALIGNED_C4(ret->data) || GFC_UNALIGNED_C4(array->data))
+           break;
+
+         cshift0_c4 ((gfc_array_c4 *) ret, (gfc_array_c4 *) array, shift,
+                     which);
+         return;
+       }
+      else
+       {
+         cshift0_i8 ((gfc_array_i8 *)ret, (gfc_array_i8 *) array, shift,
+                     which);
+         return;
+       }
+
+#ifdef HAVE_GFC_INTEGER_16
+    case sizeof (GFC_INTEGER_16):
+      if (GFC_UNALIGNED_16(ret->data) || GFC_UNALIGNED_16(array->data))
+       {
+         /* Let's try to use the complex routines.  First, a sanity
+            check that the sizes match; this should be optimized to
+            a no-op.  */
+         if (sizeof(GFC_INTEGER_16) != sizeof(GFC_COMPLEX_8))
+           break;
+
+         if (GFC_UNALIGNED_C8(ret->data) || GFC_UNALIGNED_C8(array->data))
+           break;
+
+         cshift0_c8 ((gfc_array_c8 *) ret, (gfc_array_c8 *) array, shift,
+                     which);
+         return;
+       }
+      else
+       {
+         cshift0_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) array,
+                      shift, which);
+         return;
+       }
+#else
+    case sizeof (GFC_COMPLEX_8):
+
+      if (GFC_UNALIGNED_C8(ret->data) || GFC_UNALIGNED_C8(array->data))
+       break;
+      else
+       {
+         cshift0_c8 ((gfc_array_c8 *) ret, (gfc_array_c8 *) array, shift,
+                     which);
+         return;
+       }
+#endif
+
+    default:
+      break;
+    }
+
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = size;
+  soffset = size;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == size && roffset == size)
+       {
+         size_t len1 = shift * size;
+         size_t len2 = (len - shift) * size;
+         memcpy (rptr, sptr + len1, len2);
+         memcpy (rptr + len2, sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we'll have to perform the copy one element at
+            a time.  */
+         char *dest = rptr;
+         const char *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             memcpy (dest, src, size);
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             memcpy (dest, src, size);
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+}
+
+#define DEFINE_CSHIFT(N)                                                     \
+  extern void cshift0_##N (gfc_array_char *, const gfc_array_char *,         \
+                          const GFC_INTEGER_##N *, const GFC_INTEGER_##N *); \
+  export_proto(cshift0_##N);                                                 \
+                                                                             \
+  void                                                                       \
+  cshift0_##N (gfc_array_char *ret, const gfc_array_char *array,             \
+              const GFC_INTEGER_##N *pshift, const GFC_INTEGER_##N *pdim)    \
+  {                                                                          \
+    cshift0 (ret, array, *pshift, pdim ? *pdim : 1,                          \
+            GFC_DESCRIPTOR_SIZE (array));                                    \
+  }                                                                          \
+                                                                             \
+  extern void cshift0_##N##_char (gfc_array_char *, GFC_INTEGER_4,           \
+                                 const gfc_array_char *,                     \
+                                 const GFC_INTEGER_##N *,                    \
+                                 const GFC_INTEGER_##N *, GFC_INTEGER_4);    \
+  export_proto(cshift0_##N##_char);                                          \
+                                                                             \
+  void                                                                       \
+  cshift0_##N##_char (gfc_array_char *ret,                                   \
+                     GFC_INTEGER_4 ret_length __attribute__((unused)),       \
+                     const gfc_array_char *array,                            \
+                     const GFC_INTEGER_##N *pshift,                          \
+                     const GFC_INTEGER_##N *pdim,                            \
+                     GFC_INTEGER_4 array_length)                             \
+  {                                                                          \
+    cshift0 (ret, array, *pshift, pdim ? *pdim : 1, array_length);           \
+  }                                                                          \
+                                                                             \
+  extern void cshift0_##N##_char4 (gfc_array_char *, GFC_INTEGER_4,          \
+                                  const gfc_array_char *,                    \
+                                  const GFC_INTEGER_##N *,                   \
+                                  const GFC_INTEGER_##N *, GFC_INTEGER_4);   \
+  export_proto(cshift0_##N##_char4);                                         \
+                                                                             \
+  void                                                                       \
+  cshift0_##N##_char4 (gfc_array_char *ret,                                  \
+                      GFC_INTEGER_4 ret_length __attribute__((unused)),      \
+                      const gfc_array_char *array,                           \
+                      const GFC_INTEGER_##N *pshift,                         \
+                      const GFC_INTEGER_##N *pdim,                           \
+                      GFC_INTEGER_4 array_length)                            \
+  {                                                                          \
+    cshift0 (ret, array, *pshift, pdim ? *pdim : 1,                          \
+            array_length * sizeof (gfc_char4_t));                            \
+  }
+
+DEFINE_CSHIFT (1);
+DEFINE_CSHIFT (2);
+DEFINE_CSHIFT (4);
+DEFINE_CSHIFT (8);
+#ifdef HAVE_GFC_INTEGER_16
+DEFINE_CSHIFT (16);
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/ctime.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/ctime.c
new file mode 100644 (file)
index 0000000..05bf31f
--- /dev/null
@@ -0,0 +1,110 @@
+/* Implementation of the CTIME and FDATE g77 intrinsics.
+   Copyright (C) 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include "time_1.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+
+/* strftime-like function that fills a C string with %c format which
+   is identical to ctime in the default locale. As ctime and ctime_r
+   are poorly specified and their usage not recommended, the
+   implementation instead uses strftime.  */
+
+static size_t
+strctime (char *s, size_t max, const time_t *timep)
+{
+  struct tm ltm;
+  int failed;
+  /* Some targets provide a localtime_r based on a draft of the POSIX
+     standard where the return type is int rather than the
+     standardized struct tm*.  */
+  __builtin_choose_expr (__builtin_classify_type (localtime_r (timep, &ltm)) 
+                        == 5,
+                        failed = localtime_r (timep, &ltm) == NULL,
+                        failed = localtime_r (timep, &ltm) != 0);
+  if (failed)
+    return 0;
+  return strftime (s, max, "%c", &ltm);
+}
+
+/* In the default locale, the date and time representation fits in 26
+   bytes. However, other locales might need more space.  */
+#define CSZ 100
+
+extern void fdate (char **, gfc_charlen_type *);
+export_proto(fdate);
+
+void
+fdate (char ** date, gfc_charlen_type * date_len)
+{
+  time_t now = time(NULL);
+  *date = get_mem (CSZ);
+  *date_len = strctime (*date, CSZ, &now);
+}
+
+
+extern void fdate_sub (char *, gfc_charlen_type);
+export_proto(fdate_sub);
+
+void
+fdate_sub (char * date, gfc_charlen_type date_len)
+{
+  time_t now = time(NULL);
+  char *s = get_mem (date_len + 1);
+  size_t n = strctime (s, date_len + 1, &now);
+  fstrcpy (date, date_len, s, n);
+  free (s);
+}
+
+
+
+extern void PREFIX(ctime) (char **, gfc_charlen_type *, GFC_INTEGER_8);
+export_proto_np(PREFIX(ctime));
+
+void
+PREFIX(ctime) (char ** date, gfc_charlen_type * date_len, GFC_INTEGER_8 t)
+{
+  time_t now = t;
+  *date = get_mem (CSZ);
+  *date_len = strctime (*date, CSZ, &now);
+}
+
+
+extern void ctime_sub (GFC_INTEGER_8 *, char *, gfc_charlen_type);
+export_proto(ctime_sub);
+
+void
+ctime_sub (GFC_INTEGER_8 * t, char * date, gfc_charlen_type date_len)
+{
+  time_t now = *t;
+  char *s = get_mem (date_len + 1);
+  size_t n = strctime (s, date_len + 1, &now);
+  fstrcpy (date, date_len, s, n);
+  free (s);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/date_and_time.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/date_and_time.c
new file mode 100644 (file)
index 0000000..3c38636
--- /dev/null
@@ -0,0 +1,631 @@
+/* Implementation of the DATE_AND_TIME intrinsic.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Steven Bosscher.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <string.h>
+#include <assert.h>
+#include <stdlib.h>
+
+#include "time_1.h"
+
+
+/* If the re-entrant version of gmtime is not available, provide a
+   fallback implementation.  On some targets where the _r version is
+   not available, gmtime uses thread-local storage so it's
+   threadsafe.  */
+
+#ifndef HAVE_GMTIME_R
+/* If _POSIX is defined gmtime_r gets defined by mingw-w64 headers.  */
+#ifdef gmtime_r
+#undef gmtime_r
+#endif
+
+static struct tm *
+gmtime_r (const time_t * timep, struct tm * result)
+{
+  *result = *gmtime (timep);
+  return result;
+}
+#endif
+
+
+/* DATE_AND_TIME ([DATE, TIME, ZONE, VALUES])
+
+   Description: Returns data on the real-time clock and date in a form
+   compatible with the representations defined in ISO 8601:1988.
+
+   Class: Non-elemental subroutine.
+
+   Arguments:
+
+   DATE (optional) shall be scalar and of type default character.
+   It is an INTENT(OUT) argument.  It is assigned a value of the
+   form CCYYMMDD, where CC is the century, YY the year within the
+   century, MM the month within the year, and DD the day within the
+   month.  If there is no date available, they are assigned blanks.
+
+   TIME (optional) shall be scalar and of type default character.
+   It is an INTENT(OUT) argument. It is assigned a value of the
+   form hhmmss.sss, where hh is the hour of the day, mm is the
+   minutes of the hour, and ss.sss is the seconds and milliseconds
+   of the minute.  If there is no clock available, they are assigned
+   blanks.
+
+   ZONE (optional) shall be scalar and of type default character.
+   It is an INTENT(OUT) argument.  It is assigned a value of the
+   form [+-]hhmm, where hh and mm are the time difference with
+   respect to Coordinated Universal Time (UTC) in hours and parts
+   of an hour expressed in minutes, respectively.  If there is no
+   clock available, they are assigned blanks.
+
+   VALUES (optional) shall be of type default integer and of rank
+   one. It is an INTENT(OUT) argument. Its size shall be at least
+   8. The values returned in VALUES are as follows:
+
+      VALUES(1) the year (for example, 2003), or -HUGE(0) if there is
+      no date available;
+
+      VALUES(2) the month of the year, or -HUGE(0) if there
+      is no date available;
+
+      VALUES(3) the day of the month, or -HUGE(0) if there is no date
+      available;
+
+      VALUES(4) the time difference with respect to Coordinated
+      Universal Time (UTC) in minutes, or -HUGE(0) if this information
+      is not available;
+
+      VALUES(5) the hour of the day, in the range of 0 to 23, or
+      -HUGE(0) if there is no clock;
+
+      VALUES(6) the minutes of the hour, in the range 0 to 59, or
+      -HUGE(0) if there is no clock;
+
+      VALUES(7) the seconds of the minute, in the range 0 to 60, or
+      -HUGE(0) if there is no clock;
+
+      VALUES(8) the milliseconds of the second, in the range 0 to
+      999, or -HUGE(0) if there is no clock.
+
+   NULL pointer represent missing OPTIONAL arguments.  All arguments
+   have INTENT(OUT).  Because of the -i8 option, we must implement
+   VALUES for INTEGER(kind=4) and INTEGER(kind=8).
+
+   Based on libU77's date_time_.c.
+
+   TODO :
+   - Check year boundaries.
+*/
+#define DATE_LEN 8
+#define TIME_LEN 10   
+#define ZONE_LEN 5
+#define VALUES_SIZE 8
+
+extern void date_and_time (char *, char *, char *, gfc_array_i4 *,
+                          GFC_INTEGER_4, GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(date_and_time);
+
+void
+date_and_time (char *__date, char *__time, char *__zone,
+              gfc_array_i4 *__values, GFC_INTEGER_4 __date_len,
+              GFC_INTEGER_4 __time_len, GFC_INTEGER_4 __zone_len)
+{
+  int i;
+  char date[DATE_LEN + 1];
+  char timec[TIME_LEN + 1];
+  char zone[ZONE_LEN + 1];
+  GFC_INTEGER_4 values[VALUES_SIZE];
+
+  time_t lt;
+  struct tm local_time;
+  struct tm UTC_time;
+
+  long usecs;
+
+  if (!gf_gettime (&lt, &usecs))
+    {
+      values[7] = usecs / 1000;
+
+      localtime_r (&lt, &local_time);
+      gmtime_r (&lt, &UTC_time);
+
+      /* All arguments can be derived from VALUES.  */
+      values[0] = 1900 + local_time.tm_year;
+      values[1] = 1 + local_time.tm_mon;
+      values[2] = local_time.tm_mday;
+      values[3] = (local_time.tm_min - UTC_time.tm_min +
+                  60 * (local_time.tm_hour - UTC_time.tm_hour +
+                    24 * (local_time.tm_yday - UTC_time.tm_yday)));
+      values[4] = local_time.tm_hour;
+      values[5] = local_time.tm_min;
+      values[6] = local_time.tm_sec;
+
+      if (__date)
+       snprintf (date, DATE_LEN + 1, "%04d%02d%02d",
+                 values[0], values[1], values[2]);
+      if (__time)
+       snprintf (timec, TIME_LEN + 1, "%02d%02d%02d.%03d",
+                 values[4], values[5], values[6], values[7]);
+
+      if (__zone)
+       snprintf (zone, ZONE_LEN + 1, "%+03d%02d",
+                 values[3] / 60, abs (values[3] % 60));
+    }
+  else
+    {
+      memset (date, ' ', DATE_LEN);
+      date[DATE_LEN] = '\0';
+
+      memset (timec, ' ', TIME_LEN);
+      timec[TIME_LEN] = '\0';
+
+      memset (zone, ' ', ZONE_LEN);
+      zone[ZONE_LEN] = '\0';
+
+      for (i = 0; i < VALUES_SIZE; i++)
+       values[i] = - GFC_INTEGER_4_HUGE;
+    }   
+
+  /* Copy the values into the arguments.  */
+  if (__values)
+    {
+      index_type len, delta, elt_size;
+
+      elt_size = GFC_DESCRIPTOR_SIZE (__values);
+      len = GFC_DESCRIPTOR_EXTENT(__values,0);
+      delta = GFC_DESCRIPTOR_STRIDE(__values,0);
+      if (delta == 0)
+       delta = 1;
+      
+      if (unlikely (len < VALUES_SIZE))
+         runtime_error ("Incorrect extent in VALUE argument to"
+                        " DATE_AND_TIME intrinsic: is %ld, should"
+                        " be >=%ld", (long int) len, (long int) VALUES_SIZE);
+
+      /* Cope with different type kinds.  */
+      if (elt_size == 4)
+        {
+         GFC_INTEGER_4 *vptr4 = __values->data;
+
+         for (i = 0; i < VALUES_SIZE; i++, vptr4 += delta)
+           *vptr4 = values[i];
+       }
+      else if (elt_size == 8)
+        {
+         GFC_INTEGER_8 *vptr8 = (GFC_INTEGER_8 *)__values->data;
+
+         for (i = 0; i < VALUES_SIZE; i++, vptr8 += delta)
+           {
+             if (values[i] == - GFC_INTEGER_4_HUGE)
+               *vptr8 = - GFC_INTEGER_8_HUGE;
+             else
+               *vptr8 = values[i];
+           }
+       }
+      else 
+       abort ();
+    }
+
+  if (__zone)
+    fstrcpy (__zone, __zone_len, zone, ZONE_LEN);
+
+  if (__time)
+    fstrcpy (__time, __time_len, timec, TIME_LEN);
+
+  if (__date)
+    fstrcpy (__date, __date_len, date, DATE_LEN);
+}
+
+
+/* SECNDS (X) - Non-standard
+
+   Description: Returns the system time of day, or elapsed time, as a GFC_REAL_4
+   in seconds.
+
+   Class: Non-elemental subroutine.
+
+   Arguments:
+
+   X must be REAL(4) and the result is of the same type.  The accuracy is system
+   dependent.
+
+   Usage:
+
+       T = SECNDS (X)
+
+   yields the time in elapsed seconds since X.  If X is 0.0, T is the time in
+   seconds since midnight. Note that a time that spans midnight but is less than
+   24hours will be calculated correctly.  */
+
+extern GFC_REAL_4 secnds (GFC_REAL_4 *);
+export_proto(secnds);
+
+GFC_REAL_4
+secnds (GFC_REAL_4 *x)
+{
+  GFC_INTEGER_4 values[VALUES_SIZE];
+  GFC_REAL_4 temp1, temp2;
+
+  /* Make the INTEGER*4 array for passing to date_and_time.  */
+  gfc_array_i4 *avalues = internal_malloc_size (sizeof (gfc_array_i4));
+  avalues->data = &values[0];
+  GFC_DESCRIPTOR_DTYPE (avalues) = ((BT_REAL << GFC_DTYPE_TYPE_SHIFT)
+                                       & GFC_DTYPE_TYPE_MASK) +
+                                   (4 << GFC_DTYPE_SIZE_SHIFT);
+
+  GFC_DIMENSION_SET(avalues->dim[0], 0, 7, 1);
+
+  date_and_time (NULL, NULL, NULL, avalues, 0, 0, 0);
+
+  free (avalues);
+
+  temp1 = 3600.0 * (GFC_REAL_4)values[4] +
+           60.0 * (GFC_REAL_4)values[5] +
+                  (GFC_REAL_4)values[6] +
+          0.001 * (GFC_REAL_4)values[7];
+  temp2 = fmod (*x, 86400.0);
+  temp2 = (temp1 - temp2 >= 0.0) ? temp2 : (temp2 - 86400.0);
+  return temp1 - temp2;
+}
+
+
+
+/* ITIME(X) - Non-standard
+
+   Description: Returns the current local time hour, minutes, and seconds
+   in elements 1, 2, and 3 of X, respectively.  */
+
+static void
+itime0 (int x[3])
+{
+  time_t lt;
+  struct tm local_time;
+
+  lt = time (NULL);
+
+  if (lt != (time_t) -1)
+    {
+      localtime_r (&lt, &local_time);
+
+      x[0] = local_time.tm_hour;
+      x[1] = local_time.tm_min;
+      x[2] = local_time.tm_sec;
+    }
+}
+
+extern void itime_i4 (gfc_array_i4 *);
+export_proto(itime_i4);
+
+void
+itime_i4 (gfc_array_i4 *__values)
+{
+  int x[3], i;
+  index_type len, delta;
+  GFC_INTEGER_4 *vptr;
+  
+  /* Call helper function.  */
+  itime0(x);
+
+  /* Copy the value into the array.  */
+  len = GFC_DESCRIPTOR_EXTENT(__values,0);
+  assert (len >= 3);
+  delta = GFC_DESCRIPTOR_STRIDE(__values,0);
+  if (delta == 0)
+    delta = 1;
+
+  vptr = __values->data;
+  for (i = 0; i < 3; i++, vptr += delta)
+    *vptr = x[i];
+}
+
+
+extern void itime_i8 (gfc_array_i8 *);
+export_proto(itime_i8);
+
+void
+itime_i8 (gfc_array_i8 *__values)
+{
+  int x[3], i;
+  index_type len, delta;
+  GFC_INTEGER_8 *vptr;
+  
+  /* Call helper function.  */
+  itime0(x);
+
+  /* Copy the value into the array.  */
+  len = GFC_DESCRIPTOR_EXTENT(__values,0);
+  assert (len >= 3);
+  delta = GFC_DESCRIPTOR_STRIDE(__values,0);
+  if (delta == 0)
+    delta = 1;
+
+  vptr = __values->data;
+  for (i = 0; i < 3; i++, vptr += delta)
+    *vptr = x[i];
+}
+
+
+
+/* IDATE(X) - Non-standard
+
+   Description: Fills TArray with the numerical values at the current
+   local time. The day (in the range 1-31), month (in the range 1-12),
+   and year appear in elements 1, 2, and 3 of X, respectively.
+   The year has four significant digits.  */
+
+static void
+idate0 (int x[3])
+{
+  time_t lt;
+  struct tm local_time;
+
+  lt = time (NULL);
+
+  if (lt != (time_t) -1)
+    {
+      localtime_r (&lt, &local_time);
+
+      x[0] = local_time.tm_mday;
+      x[1] = 1 + local_time.tm_mon;
+      x[2] = 1900 + local_time.tm_year;
+    }
+}
+
+extern void idate_i4 (gfc_array_i4 *);
+export_proto(idate_i4);
+
+void
+idate_i4 (gfc_array_i4 *__values)
+{
+  int x[3], i;
+  index_type len, delta;
+  GFC_INTEGER_4 *vptr;
+  
+  /* Call helper function.  */
+  idate0(x);
+
+  /* Copy the value into the array.  */
+  len = GFC_DESCRIPTOR_EXTENT(__values,0);
+  assert (len >= 3);
+  delta = GFC_DESCRIPTOR_STRIDE(__values,0);
+  if (delta == 0)
+    delta = 1;
+
+  vptr = __values->data;
+  for (i = 0; i < 3; i++, vptr += delta)
+    *vptr = x[i];
+}
+
+
+extern void idate_i8 (gfc_array_i8 *);
+export_proto(idate_i8);
+
+void
+idate_i8 (gfc_array_i8 *__values)
+{
+  int x[3], i;
+  index_type len, delta;
+  GFC_INTEGER_8 *vptr;
+  
+  /* Call helper function.  */
+  idate0(x);
+
+  /* Copy the value into the array.  */
+  len = GFC_DESCRIPTOR_EXTENT(__values,0);
+  assert (len >= 3);
+  delta = GFC_DESCRIPTOR_STRIDE(__values,0);
+  if (delta == 0)
+    delta = 1;
+
+  vptr = __values->data;
+  for (i = 0; i < 3; i++, vptr += delta)
+    *vptr = x[i];
+}
+
+
+
+/* GMTIME(STIME, TARRAY) - Non-standard
+
+   Description: Given a system time value STime, fills TArray with values
+   extracted from it appropriate to the GMT time zone using gmtime_r(3).
+
+   The array elements are as follows:
+
+      1. Seconds after the minute, range 0-59 or 0-61 to allow for leap seconds
+      2. Minutes after the hour, range 0-59
+      3. Hours past midnight, range 0-23
+      4. Day of month, range 0-31
+      5. Number of months since January, range 0-11
+      6. Years since 1900
+      7. Number of days since Sunday, range 0-6
+      8. Days since January 1
+      9. Daylight savings indicator: positive if daylight savings is in effect,
+         zero if not, and negative if the information isn't available.  */
+
+static void
+gmtime_0 (const time_t * t, int x[9])
+{
+  struct tm lt;
+
+  gmtime_r (t, &lt);
+  x[0] = lt.tm_sec;
+  x[1] = lt.tm_min;
+  x[2] = lt.tm_hour;
+  x[3] = lt.tm_mday;
+  x[4] = lt.tm_mon;
+  x[5] = lt.tm_year;
+  x[6] = lt.tm_wday;
+  x[7] = lt.tm_yday;
+  x[8] = lt.tm_isdst;
+}
+
+extern void gmtime_i4 (GFC_INTEGER_4 *, gfc_array_i4 *);
+export_proto(gmtime_i4);
+
+void
+gmtime_i4 (GFC_INTEGER_4 * t, gfc_array_i4 * tarray)
+{
+  int x[9], i;
+  index_type len, delta;
+  GFC_INTEGER_4 *vptr;
+  time_t tt;
+  
+  /* Call helper function.  */
+  tt = (time_t) *t;
+  gmtime_0(&tt, x);
+
+  /* Copy the values into the array.  */
+  len = GFC_DESCRIPTOR_EXTENT(tarray,0);
+  assert (len >= 9);
+  delta = GFC_DESCRIPTOR_STRIDE(tarray,0);
+  if (delta == 0)
+    delta = 1;
+
+  vptr = tarray->data;
+  for (i = 0; i < 9; i++, vptr += delta)
+    *vptr = x[i];
+}
+
+extern void gmtime_i8 (GFC_INTEGER_8 *, gfc_array_i8 *);
+export_proto(gmtime_i8);
+
+void
+gmtime_i8 (GFC_INTEGER_8 * t, gfc_array_i8 * tarray)
+{
+  int x[9], i;
+  index_type len, delta;
+  GFC_INTEGER_8 *vptr;
+  time_t tt;
+  
+  /* Call helper function.  */
+  tt = (time_t) *t;
+  gmtime_0(&tt, x);
+
+  /* Copy the values into the array.  */
+  len = GFC_DESCRIPTOR_EXTENT(tarray,0);
+  assert (len >= 9);
+  delta = GFC_DESCRIPTOR_STRIDE(tarray,0);
+  if (delta == 0)
+    delta = 1;
+
+  vptr = tarray->data;
+  for (i = 0; i < 9; i++, vptr += delta)
+    *vptr = x[i];
+}
+
+
+
+
+/* LTIME(STIME, TARRAY) - Non-standard
+
+   Description: Given a system time value STime, fills TArray with values
+   extracted from it appropriate to the local time zone using localtime_r(3).
+
+   The array elements are as follows:
+
+      1. Seconds after the minute, range 0-59 or 0-61 to allow for leap seconds
+      2. Minutes after the hour, range 0-59
+      3. Hours past midnight, range 0-23
+      4. Day of month, range 0-31
+      5. Number of months since January, range 0-11
+      6. Years since 1900
+      7. Number of days since Sunday, range 0-6
+      8. Days since January 1
+      9. Daylight savings indicator: positive if daylight savings is in effect,
+         zero if not, and negative if the information isn't available.  */
+
+static void
+ltime_0 (const time_t * t, int x[9])
+{
+  struct tm lt;
+
+  localtime_r (t, &lt);
+  x[0] = lt.tm_sec;
+  x[1] = lt.tm_min;
+  x[2] = lt.tm_hour;
+  x[3] = lt.tm_mday;
+  x[4] = lt.tm_mon;
+  x[5] = lt.tm_year;
+  x[6] = lt.tm_wday;
+  x[7] = lt.tm_yday;
+  x[8] = lt.tm_isdst;
+}
+
+extern void ltime_i4 (GFC_INTEGER_4 *, gfc_array_i4 *);
+export_proto(ltime_i4);
+
+void
+ltime_i4 (GFC_INTEGER_4 * t, gfc_array_i4 * tarray)
+{
+  int x[9], i;
+  index_type len, delta;
+  GFC_INTEGER_4 *vptr;
+  time_t tt;
+  
+  /* Call helper function.  */
+  tt = (time_t) *t;
+  ltime_0(&tt, x);
+
+  /* Copy the values into the array.  */
+  len = GFC_DESCRIPTOR_EXTENT(tarray,0);
+  assert (len >= 9);
+  delta = GFC_DESCRIPTOR_STRIDE(tarray,0);
+  if (delta == 0)
+    delta = 1;
+
+  vptr = tarray->data;
+  for (i = 0; i < 9; i++, vptr += delta)
+    *vptr = x[i];
+}
+
+extern void ltime_i8 (GFC_INTEGER_8 *, gfc_array_i8 *);
+export_proto(ltime_i8);
+
+void
+ltime_i8 (GFC_INTEGER_8 * t, gfc_array_i8 * tarray)
+{
+  int x[9], i;
+  index_type len, delta;
+  GFC_INTEGER_8 *vptr;
+  time_t tt;
+  
+  /* Call helper function.  */
+  tt = (time_t) * t;
+  ltime_0(&tt, x);
+
+  /* Copy the values into the array.  */
+  len = GFC_DESCRIPTOR_EXTENT(tarray,0);
+  assert (len >= 9);
+  delta = GFC_DESCRIPTOR_STRIDE(tarray,0);
+  if (delta == 0)
+    delta = 1;
+
+  vptr = tarray->data;
+  for (i = 0; i < 9; i++, vptr += delta)
+    *vptr = x[i];
+}
+
+
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/dprod_r8.f90 b/l4/pkg/libgfortran/lib/contrib/intrinsics/dprod_r8.f90
new file mode 100644 (file)
index 0000000..7eb0ede
--- /dev/null
@@ -0,0 +1,32 @@
+!   Copyright 2003, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!Libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+!
+!Libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+
+
+elemental function _gfortran_specific__dprod_r8 (p1, p2)
+   implicit none
+   real (kind=4), intent (in) :: p1, p2
+   real (kind=8) :: _gfortran_specific__dprod_r8
+
+   _gfortran_specific__dprod_r8 = dprod (p1, p2)
+end function
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/dtime.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/dtime.c
new file mode 100644 (file)
index 0000000..e36e1f1
--- /dev/null
@@ -0,0 +1,87 @@
+/* Implementation of the dtime intrinsic.
+   Copyright (C) 2004, 2005, 2006, 2007, 2009, 2011 Free Software
+   Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include "time_1.h"
+#include <gthr.h>
+
+#ifdef __GTHREAD_MUTEX_INIT
+static __gthread_mutex_t dtime_update_lock = __GTHREAD_MUTEX_INIT;
+#else
+static __gthread_mutex_t dtime_update_lock;
+#endif
+
+extern void dtime_sub (gfc_array_r4 *t, GFC_REAL_4 *result);
+iexport_proto(dtime_sub);
+
+void
+dtime_sub (gfc_array_r4 *t, GFC_REAL_4 *result)
+{
+  GFC_REAL_4 *tp;
+  long user_sec, user_usec, system_sec, system_usec;
+  static long us = 0, uu = 0, ss = 0 , su = 0;
+  GFC_REAL_4 tu, ts, tt;
+
+  if (((GFC_DESCRIPTOR_EXTENT(t,0))) < 2)
+    runtime_error ("Insufficient number of elements in TARRAY.");
+
+  __gthread_mutex_lock (&dtime_update_lock);
+  if (gf_cputime (&user_sec, &user_usec, &system_sec, &system_usec) == 0)
+    {
+      tu = (GFC_REAL_4) ((user_sec - us) + 1.e-6 * (user_usec - uu));
+      ts = (GFC_REAL_4) ((system_sec - ss) + 1.e-6 * (system_usec - su));
+      tt = tu + ts;
+      us = user_sec;
+      uu = user_usec;
+      ss = system_sec;
+      su = system_usec;
+    }
+  else
+    {
+      tu = -1;
+      ts = -1;
+      tt = -1;
+    }
+
+  tp = t->data;
+
+  *tp = tu;
+  tp += GFC_DESCRIPTOR_STRIDE(t,0);
+  *tp = ts;
+  *result = tt;
+  __gthread_mutex_unlock (&dtime_update_lock);
+}
+iexport(dtime_sub);
+
+extern GFC_REAL_4 dtime (gfc_array_r4 *t);
+export_proto(dtime);
+
+GFC_REAL_4
+dtime (gfc_array_r4 *t)
+{
+  GFC_REAL_4 val;
+  dtime_sub (t, &val);
+  return val;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/env.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/env.c
new file mode 100644 (file)
index 0000000..8836038
--- /dev/null
@@ -0,0 +1,195 @@
+/* Implementation of the GETENV g77, and
+   GET_ENVIRONMENT_VARIABLE F2003, intrinsics. 
+   Copyright (C) 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Janne Blomqvist.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+
+
+/* GETENV (NAME, VALUE), g77 intrinsic for retrieving the value of
+   an environment variable. The name of the variable is specified in
+   NAME, and the result is stored into VALUE.  */
+
+void PREFIX(getenv) (char *, char *, gfc_charlen_type, gfc_charlen_type);
+export_proto_np(PREFIX(getenv));
+
+void 
+PREFIX(getenv) (char * name, char * value, gfc_charlen_type name_len, 
+               gfc_charlen_type value_len)
+{
+  char *name_nt;
+  char *res = NULL;
+  int res_len;
+
+  if (name == NULL || value == NULL)
+    runtime_error ("Both arguments to getenv are mandatory.");
+
+  if (value_len < 1 || name_len < 1)
+    runtime_error ("Zero length string(s) passed to getenv.");
+  else
+    memset (value, ' ', value_len); /* Blank the string.  */
+
+  /* Trim trailing spaces from name.  */
+  while (name_len > 0 && name[name_len - 1] == ' ')
+    name_len--;
+
+  /* Make a null terminated copy of the string.  */
+  name_nt = gfc_alloca (name_len + 1);
+  memcpy (name_nt, name, name_len);
+  name_nt[name_len] = '\0'; 
+
+  res = getenv(name_nt);
+
+  /* If res is NULL, it means that the environment variable didn't 
+     exist, so just return.  */
+  if (res == NULL)
+    return;
+
+  res_len = strlen(res);
+  if (value_len < res_len)
+    memcpy (value, res, value_len);
+  else
+    memcpy (value, res, res_len);
+}
+
+
+/* GET_ENVIRONMENT_VARIABLE (name, [value, length, status, trim_name])
+   is a F2003 intrinsic for getting an environment variable.  */
+
+/* Status codes specifyed by the standard. */
+#define GFC_SUCCESS 0
+#define GFC_VALUE_TOO_SHORT -1
+#define GFC_NAME_DOES_NOT_EXIST 1
+
+/* This is also specified by the standard and means that the
+   processor doesn't support environment variables.  At the moment,
+   gfortran doesn't use it.  */
+#define GFC_NOT_SUPPORTED 2
+
+/* Processor-specific failure code.  */
+#define GFC_FAILURE 42
+
+extern void get_environment_variable_i4 (char *, char *, GFC_INTEGER_4 *,
+                                        GFC_INTEGER_4 *, GFC_LOGICAL_4 *,
+                                        gfc_charlen_type, gfc_charlen_type);
+iexport_proto(get_environment_variable_i4);
+
+void
+get_environment_variable_i4 (char *name, char *value, GFC_INTEGER_4 *length,
+                            GFC_INTEGER_4 *status, GFC_LOGICAL_4 *trim_name,
+                            gfc_charlen_type name_len,
+                            gfc_charlen_type value_len)
+{
+  int stat = GFC_SUCCESS, res_len = 0;
+  char *name_nt;
+  char *res;
+
+  if (name == NULL)
+    runtime_error ("Name is required for get_environment_variable.");
+
+  if (value == NULL && length == NULL && status == NULL && trim_name == NULL)
+    return;
+
+  if (name_len < 1)
+    runtime_error ("Zero-length string passed as name to "
+                  "get_environment_variable.");
+
+  if (value != NULL)
+    { 
+      if (value_len < 1)
+       runtime_error ("Zero-length string passed as value to "
+                      "get_environment_variable.");
+      else
+       memset (value, ' ', value_len); /* Blank the string.  */
+    }
+
+  if ((!trim_name) || *trim_name)
+    {
+      /* Trim trailing spaces from name.  */
+      while (name_len > 0 && name[name_len - 1] == ' ')
+       name_len--;
+    }
+  /* Make a null terminated copy of the name.  */
+  name_nt = gfc_alloca (name_len + 1);
+  memcpy (name_nt, name, name_len);
+  name_nt[name_len] = '\0'; 
+  
+  res = getenv(name_nt);
+
+  if (res == NULL)
+    stat = GFC_NAME_DOES_NOT_EXIST;
+  else
+    {
+      res_len = strlen(res);
+      if (value != NULL)
+       {
+         if (value_len < res_len)
+           {
+             memcpy (value, res, value_len);
+             stat = GFC_VALUE_TOO_SHORT;
+           }
+         else
+           memcpy (value, res, res_len);
+       }
+    }
+
+  if (status != NULL)
+    *status = stat;
+
+  if (length != NULL)
+    *length = res_len;
+}
+iexport(get_environment_variable_i4);
+
+
+/* INTEGER*8 wrapper for get_environment_variable.  */
+
+extern void get_environment_variable_i8 (char *, char *, GFC_INTEGER_8 *,
+                                        GFC_INTEGER_8 *, GFC_LOGICAL_8 *,
+                                        gfc_charlen_type, gfc_charlen_type);
+export_proto(get_environment_variable_i8);
+
+void
+get_environment_variable_i8 (char *name, char *value, GFC_INTEGER_8 *length,
+                            GFC_INTEGER_8 *status, GFC_LOGICAL_8 *trim_name,
+                            gfc_charlen_type name_len,
+                            gfc_charlen_type value_len)
+{
+  GFC_INTEGER_4 length4, status4;
+  GFC_LOGICAL_4 trim_name4;
+
+  if (trim_name)
+    trim_name4 = *trim_name;
+
+  get_environment_variable_i4 (name, value, &length4, &status4, 
+                              &trim_name4, name_len, value_len);
+
+  if (length)
+    *length = length4;
+
+  if (status)
+    *status = status4;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/eoshift0.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/eoshift0.c
new file mode 100644 (file)
index 0000000..6ceed20
--- /dev/null
@@ -0,0 +1,299 @@
+/* Generic implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+/* TODO: make this work for large shifts when
+   sizeof(int) < sizeof (index_type).  */
+
+static void
+eoshift0 (gfc_array_char * ret, const gfc_array_char * array,
+         int shift, const char * pbound, int which, index_type size,
+         const char *filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char * restrict rptr;
+  char *dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type arraysize;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  arraysize = size0 ((array_t *) array);
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+          ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+           str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+
+        }
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  which = which - 1;
+
+  extent[0] = 1;
+  count[0] = 0;
+  sstride[0] = -1;
+  rstride[0] = -1;
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  if ((shift >= 0 ? shift : -shift) > len)
+    {
+      shift = len;
+      len = 0;
+    }
+  else
+    {
+      if (shift > 0)
+       len = len - shift;
+      else
+       len = len + shift;
+    }
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      if (shift > 0)
+        {
+          src = &sptr[shift * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[-shift * roffset];
+        }
+      for (n = 0; n < len; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (shift >= 0)
+        {
+          n = shift;
+        }
+      else
+        {
+          dest = rptr;
+          n = -shift;
+        }
+
+      if (pbound)
+       while (n--)
+         {
+           memcpy (dest, pbound, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size ; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+}
+
+
+#define DEFINE_EOSHIFT(N)                                                    \
+  extern void eoshift0_##N (gfc_array_char *, const gfc_array_char *,        \
+                           const GFC_INTEGER_##N *, const char *,            \
+                           const GFC_INTEGER_##N *);                         \
+  export_proto(eoshift0_##N);                                                \
+                                                                             \
+  void                                                                       \
+  eoshift0_##N (gfc_array_char *ret, const gfc_array_char *array,            \
+               const GFC_INTEGER_##N *pshift, const char *pbound,            \
+               const GFC_INTEGER_##N *pdim)                                  \
+  {                                                                          \
+    eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1,                 \
+             GFC_DESCRIPTOR_SIZE (array), "\0", 1);                          \
+  }                                                                          \
+                                                                             \
+  extern void eoshift0_##N##_char (gfc_array_char *, GFC_INTEGER_4,          \
+                                  const gfc_array_char *,                    \
+                                  const GFC_INTEGER_##N *, const char *,     \
+                                  const GFC_INTEGER_##N *, GFC_INTEGER_4,    \
+                                  GFC_INTEGER_4);                            \
+  export_proto(eoshift0_##N##_char);                                         \
+                                                                             \
+  void                                                                       \
+  eoshift0_##N##_char (gfc_array_char *ret,                                  \
+                      GFC_INTEGER_4 ret_length __attribute__((unused)),      \
+                      const gfc_array_char *array,                           \
+                      const GFC_INTEGER_##N *pshift,                         \
+                      const char *pbound,                                    \
+                      const GFC_INTEGER_##N *pdim,                           \
+                      GFC_INTEGER_4 array_length,                            \
+                      GFC_INTEGER_4 bound_length __attribute__((unused)))    \
+  {                                                                          \
+    eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1,                 \
+             array_length, " ", 1);                                          \
+  }                                                                          \
+                                                                             \
+  extern void eoshift0_##N##_char4 (gfc_array_char *, GFC_INTEGER_4,         \
+                                   const gfc_array_char *,                   \
+                                   const GFC_INTEGER_##N *, const char *,    \
+                                   const GFC_INTEGER_##N *, GFC_INTEGER_4,   \
+                                   GFC_INTEGER_4);                           \
+  export_proto(eoshift0_##N##_char4);                                        \
+                                                                             \
+  void                                                                       \
+  eoshift0_##N##_char4 (gfc_array_char *ret,                                 \
+                       GFC_INTEGER_4 ret_length __attribute__((unused)),     \
+                       const gfc_array_char *array,                          \
+                       const GFC_INTEGER_##N *pshift,                        \
+                       const char *pbound,                                   \
+                       const GFC_INTEGER_##N *pdim,                          \
+                       GFC_INTEGER_4 array_length,                           \
+                       GFC_INTEGER_4 bound_length __attribute__((unused)))   \
+  {                                                                          \
+    static const gfc_char4_t space = (unsigned char) ' ';                    \
+    eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1,                 \
+             array_length * sizeof (gfc_char4_t), (const char *) &space,     \
+             sizeof (gfc_char4_t));                                          \
+  }
+
+DEFINE_EOSHIFT (1);
+DEFINE_EOSHIFT (2);
+DEFINE_EOSHIFT (4);
+DEFINE_EOSHIFT (8);
+#ifdef HAVE_GFC_INTEGER_16
+DEFINE_EOSHIFT (16);
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/eoshift2.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/eoshift2.c
new file mode 100644 (file)
index 0000000..c1b326b
--- /dev/null
@@ -0,0 +1,324 @@
+/* Generic implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+/* TODO: make this work for large shifts when
+   sizeof(int) < sizeof (index_type).  */
+
+static void
+eoshift2 (gfc_array_char *ret, const gfc_array_char *array,
+         int shift, const gfc_array_char *bound, int which,
+         const char *filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char * restrict rptr;
+  char *dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* b.* indicates the bound array.  */
+  index_type bstride[GFC_MAX_DIMENSIONS];
+  index_type bstride0;
+  const char *bptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type arraysize;
+  index_type size;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  size = GFC_DESCRIPTOR_SIZE (array);
+
+  arraysize = size0 ((array_t *) array);
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+          ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+           str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+        }
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  which = which - 1;
+
+  extent[0] = 1;
+  count[0] = 0;
+  sstride[0] = -1;
+  rstride[0] = -1;
+  bstride[0] = -1;
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (bound)
+            bstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(bound,n);
+          else
+            bstride[n] = 0;
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (bound && bstride[0] == 0)
+    bstride[0] = size;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  bstride0 = bstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  if ((shift >= 0 ? shift : -shift ) > len)
+    {
+      shift = len;
+      len = 0;
+    }
+  else
+    {
+      if (shift > 0)
+       len = len - shift;
+      else
+       len = len + shift;
+    }
+  
+  if (bound)
+    bptr = bound->data;
+  else
+    bptr = NULL;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      if (shift > 0)
+        {
+          src = &sptr[shift * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[-shift * roffset];
+        }
+      for (n = 0; n < len; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (shift >= 0)
+        {
+          n = shift;
+        }
+      else
+        {
+          dest = rptr;
+          n = -shift;
+        }
+
+      if (bptr)
+       while (n--)
+         {
+           memcpy (dest, bptr, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size ; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      bptr += bstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          bptr -= bstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+              bptr += bstride[n];
+            }
+        }
+    }
+}
+
+
+#define DEFINE_EOSHIFT(N)                                                    \
+  extern void eoshift2_##N (gfc_array_char *, const gfc_array_char *,        \
+                           const GFC_INTEGER_##N *, const gfc_array_char *,  \
+                           const GFC_INTEGER_##N *);                         \
+  export_proto(eoshift2_##N);                                                \
+                                                                             \
+  void                                                                       \
+  eoshift2_##N (gfc_array_char *ret, const gfc_array_char *array,            \
+               const GFC_INTEGER_##N *pshift, const gfc_array_char *pbound,  \
+               const GFC_INTEGER_##N *pdim)                                  \
+  {                                                                          \
+    eoshift2 (ret, array, *pshift, pbound, pdim ? *pdim : 1,                 \
+             "\0", 1);                       \
+  }                                                                          \
+                                                                             \
+  extern void eoshift2_##N##_char (gfc_array_char *, GFC_INTEGER_4,          \
+                                  const gfc_array_char *,                    \
+                                  const GFC_INTEGER_##N *,                   \
+                                  const gfc_array_char *,                    \
+                                  const GFC_INTEGER_##N *,                   \
+                                  GFC_INTEGER_4, GFC_INTEGER_4);             \
+  export_proto(eoshift2_##N##_char);                                         \
+                                                                             \
+  void                                                                       \
+  eoshift2_##N##_char (gfc_array_char *ret,                                  \
+                      GFC_INTEGER_4 ret_length __attribute__((unused)),      \
+                      const gfc_array_char *array,                           \
+                      const GFC_INTEGER_##N *pshift,                         \
+                      const gfc_array_char *pbound,                          \
+                      const GFC_INTEGER_##N *pdim,                           \
+                      GFC_INTEGER_4 array_length __attribute__((unused)),    \
+                      GFC_INTEGER_4 bound_length __attribute__((unused)))    \
+  {                                                                          \
+    eoshift2 (ret, array, *pshift, pbound, pdim ? *pdim : 1,                 \
+             " ", 1);                                                        \
+  }                                                                          \
+                                                                             \
+  extern void eoshift2_##N##_char4 (gfc_array_char *, GFC_INTEGER_4,         \
+                                   const gfc_array_char *,                   \
+                                   const GFC_INTEGER_##N *,                  \
+                                   const gfc_array_char *,                   \
+                                   const GFC_INTEGER_##N *,                  \
+                                   GFC_INTEGER_4, GFC_INTEGER_4);            \
+  export_proto(eoshift2_##N##_char4);                                        \
+                                                                             \
+  void                                                                       \
+  eoshift2_##N##_char4 (gfc_array_char *ret,                                 \
+                       GFC_INTEGER_4 ret_length __attribute__((unused)),     \
+                       const gfc_array_char *array,                          \
+                       const GFC_INTEGER_##N *pshift,                        \
+                       const gfc_array_char *pbound,                         \
+                       const GFC_INTEGER_##N *pdim,                          \
+                       GFC_INTEGER_4 array_length __attribute__((unused)),   \
+                       GFC_INTEGER_4 bound_length __attribute__((unused)))   \
+  {                                                                          \
+    static const gfc_char4_t space = (unsigned char) ' ';                    \
+    eoshift2 (ret, array, *pshift, pbound, pdim ? *pdim : 1,                 \
+             (const char *) &space,                                          \
+             sizeof (gfc_char4_t));                                          \
+  }
+
+DEFINE_EOSHIFT (1);
+DEFINE_EOSHIFT (2);
+DEFINE_EOSHIFT (4);
+DEFINE_EOSHIFT (8);
+#ifdef HAVE_GFC_INTEGER_16
+DEFINE_EOSHIFT (16);
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/erfc_scaled.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/erfc_scaled.c
new file mode 100644 (file)
index 0000000..7ffca40
--- /dev/null
@@ -0,0 +1,52 @@
+/* Implementation of the ERFC_SCALED intrinsic.
+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+/* This implementation of ERFC_SCALED is based on the netlib algorithm
+   available at http://www.netlib.org/specfun/erf  */
+
+#ifdef HAVE_GFC_REAL_4
+#undef KIND
+#define KIND 4
+#include "erfc_scaled_inc.c"
+#endif
+
+#ifdef HAVE_GFC_REAL_8
+#undef KIND
+#define KIND 8
+#include "erfc_scaled_inc.c"
+#endif
+
+#ifdef HAVE_GFC_REAL_10
+#undef KIND
+#define KIND 10
+#include "erfc_scaled_inc.c"
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+#undef KIND
+#define KIND 16
+#include "erfc_scaled_inc.c"
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/erfc_scaled_inc.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/erfc_scaled_inc.c
new file mode 100644 (file)
index 0000000..7886136
--- /dev/null
@@ -0,0 +1,193 @@
+/* Implementation of the ERFC_SCALED intrinsic, to be included by erfc_scaled.c
+   Copyright (c) 2008, 2010 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* This implementation of ERFC_SCALED is based on the netlib algorithm
+   available at http://www.netlib.org/specfun/erf  */
+
+#define TYPE KIND_SUFFIX(GFC_REAL_,KIND)
+#define CONCAT(x,y) x ## y
+#define KIND_SUFFIX(x,y) CONCAT(x,y)
+
+#if (KIND == 4)
+
+# define EXP(x) expf(x)
+# define TRUNC(x) truncf(x)
+
+#elif (KIND == 8)
+
+# define EXP(x) exp(x)
+# define TRUNC(x) trunc(x)
+
+#elif (KIND == 10) || (KIND == 16 && defined(GFC_REAL_16_IS_LONG_DOUBLE))
+
+# ifdef HAVE_EXPL
+#  define EXP(x) expl(x)
+# endif
+# ifdef HAVE_TRUNCL
+#  define TRUNC(x) truncl(x)
+# endif
+
+#elif (KIND == 16 && defined(GFC_REAL_16_IS_FLOAT128))
+
+#  define EXP(x) expq(x)
+#  define TRUNC(x) truncq(x)
+
+#else
+
+# error "What exactly is it that you want me to do?"
+
+#endif
+
+#if defined(EXP) && defined(TRUNC)
+
+extern TYPE KIND_SUFFIX(erfc_scaled_r,KIND) (TYPE);
+export_proto(KIND_SUFFIX(erfc_scaled_r,KIND));
+
+TYPE
+KIND_SUFFIX(erfc_scaled_r,KIND) (TYPE x)
+{
+  /* The main computation evaluates near-minimax approximations
+     from "Rational Chebyshev approximations for the error function"
+     by W. J. Cody, Math. Comp., 1969, PP. 631-638.  This
+     transportable program uses rational functions that theoretically
+     approximate  erf(x)  and  erfc(x)  to at least 18 significant
+     decimal digits.  The accuracy achieved depends on the arithmetic
+     system, the compiler, the intrinsic functions, and proper
+     selection of the machine-dependent constants.  */
+
+  int i;
+  TYPE del, res, xden, xnum, y, ysq;
+
+#if (KIND == 4)
+  static TYPE xneg = -9.382, xsmall = 5.96e-8,
+             xbig = 9.194, xhuge = 2.90e+3, xmax = 4.79e+37;
+#else
+  static TYPE xneg = -26.628, xsmall = 1.11e-16,
+             xbig = 26.543, xhuge = 6.71e+7, xmax = 2.53e+307;
+#endif
+
+#define SQRPI ((TYPE) 0.56418958354775628695L)
+#define THRESH ((TYPE) 0.46875L)
+
+  static TYPE a[5] = { 3.16112374387056560l, 113.864154151050156l,
+    377.485237685302021l, 3209.37758913846947l, 0.185777706184603153l };
+
+  static TYPE b[4] = { 23.6012909523441209l, 244.024637934444173l,
+    1282.61652607737228l, 2844.23683343917062l };
+
+  static TYPE c[9] = { 0.564188496988670089l, 8.88314979438837594l,
+    66.1191906371416295l, 298.635138197400131l, 881.952221241769090l,
+    1712.04761263407058l, 2051.07837782607147l, 1230.33935479799725l,
+    2.15311535474403846e-8l };
+
+  static TYPE d[8] = { 15.7449261107098347l, 117.693950891312499l,
+    537.181101862009858l, 1621.38957456669019l, 3290.79923573345963l,
+    4362.61909014324716l, 3439.36767414372164l, 1230.33935480374942l };
+
+  static TYPE p[6] = { 0.305326634961232344l, 0.360344899949804439l,
+    0.125781726111229246l, 0.0160837851487422766l,
+    0.000658749161529837803l, 0.0163153871373020978l };
+
+  static TYPE q[5] = { 2.56852019228982242l, 1.87295284992346047l,
+    0.527905102951428412l, 0.0605183413124413191l,
+    0.00233520497626869185l };
+
+  y = (x > 0 ? x : -x);
+  if (y <= THRESH)
+    {
+      ysq = 0;
+      if (y > xsmall)
+       ysq = y * y;
+      xnum = a[4]*ysq;
+      xden = ysq;
+      for (i = 0; i <= 2; i++)
+       {
+          xnum = (xnum + a[i]) * ysq;
+          xden = (xden + b[i]) * ysq;
+       }
+      res = x * (xnum + a[3]) / (xden + b[3]);
+      res = 1 - res;
+      res = EXP(ysq) * res;
+      return res;
+    }
+  else if (y <= 4)
+    {
+      xnum = c[8]*y;
+      xden = y;
+      for (i = 0; i <= 6; i++)
+       {
+         xnum = (xnum + c[i]) * y;
+         xden = (xden + d[i]) * y;
+       }
+      res = (xnum + c[7]) / (xden + d[7]);
+    }
+  else
+    {
+      res = 0;
+      if (y >= xbig)
+       {
+          if (y >= xmax)
+           goto finish;
+          if (y >= xhuge)
+           {
+             res = SQRPI / y;
+             goto finish;
+           }
+       }
+      ysq = ((TYPE) 1) / (y * y);
+      xnum = p[5]*ysq;
+      xden = ysq;
+      for (i = 0; i <= 3; i++)
+       {
+          xnum = (xnum + p[i]) * ysq;
+          xden = (xden + q[i]) * ysq;
+       }
+      res = ysq *(xnum + p[4]) / (xden + q[4]);
+      res = (SQRPI -  res) / y;
+    }
+
+finish:
+  if (x < 0)
+    {
+      if (x < xneg)
+       res = __builtin_inf ();
+      else
+       {
+         ysq = TRUNC (x*((TYPE) 16))/((TYPE) 16);
+         del = (x-ysq)*(x+ysq);
+         y = EXP(ysq*ysq) * EXP(del);
+         res = (y+y) - res;
+       }
+    }
+  return res;
+}
+
+#endif
+
+#undef EXP
+#undef TRUNC
+
+#undef CONCAT
+#undef TYPE
+#undef KIND_SUFFIX
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/etime.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/etime.c
new file mode 100644 (file)
index 0000000..d90bc30
--- /dev/null
@@ -0,0 +1,73 @@
+/* Implementation of the ETIME intrinsic.
+   Copyright (C) 2004, 2005, 2006, 2007, 2009, 2011 Free Software
+   Foundation, Inc.
+   Contributed by Steven G. Kargl <kargls@comcast.net>.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include "time_1.h"
+
+extern void etime_sub (gfc_array_r4 *t, GFC_REAL_4 *result);
+iexport_proto(etime_sub);
+
+void
+etime_sub (gfc_array_r4 *t, GFC_REAL_4 *result)
+{
+  GFC_REAL_4 tu, ts, tt, *tp;
+  long user_sec, user_usec, system_sec, system_usec;
+
+  if (((GFC_DESCRIPTOR_EXTENT(t,0))) < 2)
+    runtime_error ("Insufficient number of elements in TARRAY.");
+
+  if (gf_cputime (&user_sec, &user_usec, &system_sec, &system_usec) == 0)
+    {
+      tu = (GFC_REAL_4)(user_sec + 1.e-6 * user_usec);
+      ts = (GFC_REAL_4)(system_sec + 1.e-6 * system_usec);
+      tt = tu + ts;
+    }
+  else
+    {
+      tu = (GFC_REAL_4)-1.0;
+      ts = (GFC_REAL_4)-1.0;
+      tt = (GFC_REAL_4)-1.0;
+    }
+
+  tp = t->data;
+
+  *tp = tu;
+  tp += GFC_DESCRIPTOR_STRIDE(t,0);
+  *tp = ts;
+  *result = tt;
+}
+iexport(etime_sub);
+
+extern GFC_REAL_4 etime (gfc_array_r4 *t);
+export_proto(etime);
+
+GFC_REAL_4
+etime (gfc_array_r4 *t)
+{
+  GFC_REAL_4 val;
+  etime_sub (t, &val);
+  return val;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/execute_command_line.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/execute_command_line.c
new file mode 100644 (file)
index 0000000..25eb4a3
--- /dev/null
@@ -0,0 +1,180 @@
+/* Implementation of the EXECUTE_COMMAND_LINE intrinsic.
+   Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <string.h>
+#include <stdbool.h>
+#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef  HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+
+enum { EXEC_SYNCHRONOUS = -2, EXEC_NOERROR = 0, EXEC_SYSTEMFAILED,
+       EXEC_CHILDFAILED };
+static const char *cmdmsg_values[] =
+  { "",
+    "Termination status of the command-language interpreter cannot be obtained",
+    "Execution of child process impossible" };
+
+
+
+static void
+set_cmdstat (int *cmdstat, int value)
+{
+  if (cmdstat)
+    *cmdstat = value;
+  else if (value > EXEC_NOERROR)
+    runtime_error ("Could not execute command line");
+}
+
+
+static void
+execute_command_line (const char *command, bool wait, int *exitstat,
+                     int *cmdstat, char *cmdmsg,
+                     gfc_charlen_type command_len,
+                     gfc_charlen_type cmdmsg_len)
+{
+  /* Transform the Fortran string to a C string.  */
+  char cmd[command_len + 1];
+  memcpy (cmd, command, command_len);
+  cmd[command_len] = '\0';
+
+  /* Flush all I/O units before executing the command.  */
+  flush_all_units();
+
+#if defined(HAVE_FORK)
+  if (!wait)
+    {
+      /* Asynchronous execution.  */
+      pid_t pid;
+
+      set_cmdstat (cmdstat, EXEC_NOERROR);
+
+      if ((pid = fork()) < 0)
+       set_cmdstat (cmdstat, EXEC_CHILDFAILED);
+      else if (pid == 0)
+       {
+         /* Child process.  */
+         int res = system (cmd);
+         _exit (WIFEXITED(res) ? WEXITSTATUS(res) : res);
+       }
+    }
+  else
+#endif
+    {
+      /* Synchronous execution.  */
+      int res = system (cmd);
+
+      if (res == -1)
+       set_cmdstat (cmdstat, EXEC_SYSTEMFAILED);
+      else if (!wait)
+       set_cmdstat (cmdstat, EXEC_SYNCHRONOUS);
+      else
+       set_cmdstat (cmdstat, EXEC_NOERROR);
+
+      if (res != -1)
+       {
+#if defined(WEXITSTATUS) && defined(WIFEXITED)
+         *exitstat = WIFEXITED(res) ? WEXITSTATUS(res) : res;
+#else
+         *exitstat = res;
+#endif
+       }
+    }
+
+  /* Now copy back to the Fortran string if needed.  */
+  if (cmdstat && *cmdstat > EXEC_NOERROR)
+    {
+      if (cmdmsg)
+       fstrcpy (cmdmsg, cmdmsg_len, cmdmsg_values[*cmdstat],
+               strlen (cmdmsg_values[*cmdstat]));
+      else
+       runtime_error ("Failure in EXECUTE_COMMAND_LINE: %s",
+                      cmdmsg_values[*cmdstat]);
+    }
+}
+
+
+extern void
+execute_command_line_i4 (const char *command, GFC_LOGICAL_4 *wait,
+                        GFC_INTEGER_4 *exitstat, GFC_INTEGER_4 *cmdstat,
+                        char *cmdmsg, gfc_charlen_type command_len,
+                        gfc_charlen_type cmdmsg_len);
+export_proto(execute_command_line_i4);
+
+void
+execute_command_line_i4 (const char *command, GFC_LOGICAL_4 *wait,
+                        GFC_INTEGER_4 *exitstat, GFC_INTEGER_4 *cmdstat,
+                        char *cmdmsg, gfc_charlen_type command_len,
+                        gfc_charlen_type cmdmsg_len)
+{
+  bool w = wait ? *wait : true;
+  int estat, estat_initial, cstat;
+
+  if (exitstat)
+    estat_initial = estat = *exitstat;
+
+  execute_command_line (command, w, &estat, cmdstat ? &cstat : NULL,
+                       cmdmsg, command_len, cmdmsg_len);
+
+  if (exitstat && estat != estat_initial)
+    *exitstat = estat;
+  if (cmdstat)
+    *cmdstat = cstat;
+}
+
+
+extern void
+execute_command_line_i8 (const char *command, GFC_LOGICAL_8 *wait,
+                        GFC_INTEGER_8 *exitstat, GFC_INTEGER_8 *cmdstat,
+                        char *cmdmsg, gfc_charlen_type command_len,
+                        gfc_charlen_type cmdmsg_len);
+export_proto(execute_command_line_i8);
+
+void
+execute_command_line_i8 (const char *command, GFC_LOGICAL_8 *wait,
+                        GFC_INTEGER_8 *exitstat, GFC_INTEGER_8 *cmdstat,
+                        char *cmdmsg, gfc_charlen_type command_len,
+                        gfc_charlen_type cmdmsg_len)
+{
+  bool w = wait ? *wait : true;
+  int estat, estat_initial, cstat;
+
+  if (exitstat)
+    estat_initial = estat = *exitstat;
+
+  execute_command_line (command, w, &estat, cmdstat ? &cstat : NULL,
+                       cmdmsg, command_len, cmdmsg_len);
+
+  if (exitstat && estat != estat_initial)
+    *exitstat = estat;
+  if (cmdstat)
+    *cmdstat = cstat;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/exit.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/exit.c
new file mode 100644 (file)
index 0000000..c7da497
--- /dev/null
@@ -0,0 +1,50 @@
+/* Implementation of the EXIT intrinsic.
+   Copyright (C) 2004, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargls@comcast.net>.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+#include "libgfortran.h"
+#include <stdlib.h>
+
+
+/* SUBROUTINE EXIT(STATUS)
+   INTEGER, INTENT(IN), OPTIONAL :: STATUS  */
+
+extern void exit_i4 (GFC_INTEGER_4 *);
+export_proto(exit_i4);
+
+void
+exit_i4 (GFC_INTEGER_4 * status)
+{
+  exit (status ? *status : 0);
+}
+
+extern void exit_i8 (GFC_INTEGER_8 *);
+export_proto(exit_i8);
+
+void
+exit_i8 (GFC_INTEGER_8 * status)
+{
+  exit (status ? *status : 0);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/extends_type_of.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/extends_type_of.c
new file mode 100644 (file)
index 0000000..2234234
--- /dev/null
@@ -0,0 +1,58 @@
+/* Implementation of the EXTENDS_TYPE_OF intrinsic.
+   Copyright (C) 2004, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Janus Weil <janus@gcc.gnu.org>.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */ 
+
+
+#include "libgfortran.h"
+#include <stdlib.h>
+
+
+typedef struct vtype
+{
+  GFC_INTEGER_4 hash;
+  GFC_INTEGER_4 size;
+  struct vtype *extends;
+}
+vtype;
+
+
+extern GFC_LOGICAL_4 is_extension_of (struct vtype *, struct vtype *);
+export_proto(is_extension_of);
+
+
+/* This is a helper function for the F2003 intrinsic EXTENDS_TYPE_OF.
+   While EXTENDS_TYPE_OF accepts CLASS or TYPE arguments, this one here gets
+   passed the corresponding vtabs. Each call to EXTENDS_TYPE_OF is translated
+   to a call to is_extension_of.  */
+
+GFC_LOGICAL_4
+is_extension_of (struct vtype *v1, struct vtype *v2)
+{
+  while (v1)
+    {
+      if (v1->hash == v2->hash) return 1;
+      v1 = v1->extends;
+    }
+  return 0;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/f2c_specifics.F90 b/l4/pkg/libgfortran/lib/contrib/intrinsics/f2c_specifics.F90
new file mode 100644 (file)
index 0000000..dd7713a
--- /dev/null
@@ -0,0 +1,197 @@
+!   Copyright 2002, 2005, 2009 Free Software Foundation, Inc.
+!   Contributed by Tobias Schl"uter
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+!
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+
+! Specifics for the intrinsics whose calling conventions change if
+! -ff2c is used.
+!
+! There are two annoyances WRT the preprocessor:
+!  - we're using -traditional-cpp, so we can't use the ## operator.
+!  - macros expand to a single line, and Fortran lines can't be wider
+!    than 132 characters, therefore we use two macros to split the lines
+!
+! The cases we need to implement are functions returning default REAL
+! or COMPLEX.  The former need to return DOUBLE PRECISION instead of REAL,
+! the latter become subroutines returning via a hidden first argument.
+
+! one argument functions
+#define REAL_HEAD(NAME) \
+elemental function _gfortran_f2c_specific__/**/NAME/**/_r4 (parm) result(res);
+
+#define REAL_BODY(NAME) \
+  REAL, intent (in) :: parm; \
+  DOUBLE PRECISION :: res; \
+  res = NAME (parm); \
+end function
+
+#define COMPLEX_HEAD(NAME) \
+subroutine _gfortran_f2c_specific__/**/NAME/**/_c4 (res, parm);
+
+#define COMPLEX_BODY(NAME) \
+  COMPLEX, intent (in) :: parm; \
+  COMPLEX, intent (out) :: res; \
+  res = NAME (parm); \
+end subroutine
+
+#define DCOMPLEX_HEAD(NAME) \
+subroutine _gfortran_f2c_specific__/**/NAME/**/_c8 (res, parm);
+
+#define DCOMPLEX_BODY(NAME) \
+  DOUBLE COMPLEX, intent (in) :: parm; \
+  DOUBLE COMPLEX, intent (out) :: res; \
+  res = NAME (parm); \
+end subroutine
+
+REAL_HEAD(abs)
+REAL_BODY(abs)
+
+! abs is special in that the result is real
+elemental function _gfortran_f2c_specific__abs_c4 (parm) result (res)
+  COMPLEX, intent(in) :: parm
+  DOUBLE PRECISION :: res
+  res = abs(parm)
+end function
+
+
+! aimag is special in that the result is real
+elemental function _gfortran_f2c_specific__aimag_c4 (parm)
+  complex(kind=4), intent(in) :: parm
+  double precision :: _gfortran_f2c_specific__aimag_c4
+  _gfortran_f2c_specific__aimag_c4 = aimag(parm)
+end function
+
+elemental function _gfortran_f2c_specific__aimag_c8 (parm)
+  complex(kind=8), intent(in) :: parm
+  double precision :: _gfortran_f2c_specific__aimag_c8
+  _gfortran_f2c_specific__aimag_c8 = aimag(parm)
+end function
+
+
+REAL_HEAD(exp)
+REAL_BODY(exp)
+COMPLEX_HEAD(exp)
+COMPLEX_BODY(exp)
+DCOMPLEX_HEAD(exp)
+DCOMPLEX_BODY(exp)
+
+REAL_HEAD(log)
+REAL_BODY(log)
+COMPLEX_HEAD(log)
+COMPLEX_BODY(log)
+DCOMPLEX_HEAD(log)
+DCOMPLEX_BODY(log)
+
+REAL_HEAD(log10)
+REAL_BODY(log10)
+
+REAL_HEAD(sqrt)
+REAL_BODY(sqrt)
+COMPLEX_HEAD(sqrt)
+COMPLEX_BODY(sqrt)
+DCOMPLEX_HEAD(sqrt)
+DCOMPLEX_BODY(sqrt)
+
+REAL_HEAD(asin)
+REAL_BODY(asin)
+
+REAL_HEAD(acos)
+REAL_BODY(acos)
+
+REAL_HEAD(atan)
+REAL_BODY(atan)
+
+REAL_HEAD(asinh)
+REAL_BODY(asinh)
+
+REAL_HEAD(acosh)
+REAL_BODY(acosh)
+
+REAL_HEAD(atanh)
+REAL_BODY(atanh)
+
+REAL_HEAD(sin)
+REAL_BODY(sin)
+COMPLEX_HEAD(sin)
+COMPLEX_BODY(sin)
+DCOMPLEX_HEAD(sin)
+DCOMPLEX_BODY(sin)
+
+REAL_HEAD(cos)
+REAL_BODY(cos)
+COMPLEX_HEAD(cos)
+COMPLEX_BODY(cos)
+DCOMPLEX_HEAD(cos)
+DCOMPLEX_BODY(cos)
+
+REAL_HEAD(tan)
+REAL_BODY(tan)
+
+REAL_HEAD(sinh)
+REAL_BODY(sinh)
+
+REAL_HEAD(cosh)
+REAL_BODY(cosh)
+
+REAL_HEAD(tanh)
+REAL_BODY(tanh)
+
+REAL_HEAD(aint)
+REAL_BODY(aint)
+
+REAL_HEAD(anint)
+REAL_BODY(anint)
+
+! two argument functions
+#define REAL2_HEAD(NAME) \
+elemental function _gfortran_f2c_specific__/**/NAME/**/_r4 (p1, p2) result(res);
+
+#define REAL2_BODY(NAME) \
+  REAL, intent (in) :: p1, p2; \
+  DOUBLE PRECISION :: res; \
+  res = NAME (p1, p2); \
+end function
+
+REAL2_HEAD(sign)
+REAL2_BODY(sign)
+
+REAL2_HEAD(dim)
+REAL2_BODY(dim)
+
+REAL2_HEAD(atan2)
+REAL2_BODY(atan2)
+
+REAL2_HEAD(mod)
+REAL2_BODY(mod)
+
+! conjg is special-cased because it is not suffixed _c4 but _4
+subroutine _gfortran_f2c_specific__conjg_4 (res, parm)
+  COMPLEX, intent (in) :: parm
+  COMPLEX, intent (out) :: res
+  res = conjg (parm)
+end subroutine
+subroutine _gfortran_f2c_specific__conjg_8 (res, parm)
+  DOUBLE COMPLEX, intent (in) :: parm
+  DOUBLE COMPLEX, intent (out) :: res
+  res = conjg (parm)
+end subroutine
+
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/fnum.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/fnum.c
new file mode 100644 (file)
index 0000000..f155042
--- /dev/null
@@ -0,0 +1,48 @@
+/* Implementation of the FNUM intrinsics.
+   Copyright (C) 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargls@comcast.net>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+/* FUNCTION FNUM(UNIT)
+   INTEGER FNUM
+   INTEGER, INTENT(IN), :: UNIT  */
+
+extern GFC_INTEGER_4 fnum_i4 (GFC_INTEGER_4 *);
+export_proto(fnum_i4);
+
+GFC_INTEGER_4
+fnum_i4 (GFC_INTEGER_4 *unit)
+{
+  return unit_to_fd (*unit);
+}
+
+extern GFC_INTEGER_8 fnum_i8 (GFC_INTEGER_8 *);
+export_proto(fnum_i8);
+
+GFC_INTEGER_8
+fnum_i8 (GFC_INTEGER_8 * unit)
+{
+  return unit_to_fd (*unit);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/gerror.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/gerror.c
new file mode 100644 (file)
index 0000000..492f7af
--- /dev/null
@@ -0,0 +1,57 @@
+/* Implementation of the GERROR g77 intrinsic.
+   Copyright (C) 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+#include <string.h>
+
+
+/* GERROR (MESSAGE), g77 intrinsic for retrieving the system error
+   message corresponding to the last system error (C errno).
+   CHARACTER(len=*), INTENT(OUT) :: MESSAGE  */
+
+void PREFIX(gerror) (char *, gfc_charlen_type);
+export_proto_np(PREFIX(gerror));
+
+void 
+PREFIX(gerror) (char * msg, gfc_charlen_type msg_len)
+{
+  int p_len;
+  char *p;
+
+  p = gf_strerror (errno, msg, msg_len);
+  p_len = strlen (p);
+  /* The returned pointer p might or might not be the same as the msg
+     argument.  */
+  if (p != msg)
+    {
+      if (msg_len < p_len)
+       p_len = msg_len;
+      memcpy (msg, p, p_len);
+    }
+  if (msg_len > p_len)
+    memset (&msg[p_len], ' ', msg_len - p_len);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/getXid.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/getXid.c
new file mode 100644 (file)
index 0000000..9eb60f0
--- /dev/null
@@ -0,0 +1,67 @@
+/* Wrapper for the unix get{g,p,u}id functions.
+Copyright (C) 2004, 2007, 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef __MINGW32__
+#define HAVE_GETPID 1
+#include <process.h>
+#endif
+
+#ifdef HAVE_GETGID
+extern GFC_INTEGER_4 PREFIX(getgid) (void);
+export_proto_np(PREFIX(getgid));
+
+GFC_INTEGER_4
+PREFIX(getgid) (void)
+{
+  return getgid ();
+}
+#endif
+
+#ifdef HAVE_GETPID
+extern GFC_INTEGER_4 PREFIX(getpid) (void);
+export_proto_np(PREFIX(getpid));
+
+GFC_INTEGER_4
+PREFIX(getpid) (void)
+{
+  return getpid ();
+}
+#endif
+
+#ifdef HAVE_GETUID
+extern GFC_INTEGER_4 PREFIX(getuid) (void);
+export_proto_np(PREFIX(getuid));
+
+GFC_INTEGER_4
+PREFIX(getuid) (void)
+{
+  return getuid ();
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/getcwd.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/getcwd.c
new file mode 100644 (file)
index 0000000..15e8e8f
--- /dev/null
@@ -0,0 +1,83 @@
+/* Implementation of the GETCWD intrinsic.
+   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargls@comcast.net>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <string.h>
+#include <errno.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_GETCWD
+
+extern void getcwd_i4_sub (char *, GFC_INTEGER_4 *, gfc_charlen_type);
+iexport_proto(getcwd_i4_sub);
+
+void
+getcwd_i4_sub (char *cwd, GFC_INTEGER_4 *status, gfc_charlen_type cwd_len)
+{
+  char str[cwd_len + 1];
+  GFC_INTEGER_4 stat;
+
+  memset(cwd, ' ', (size_t) cwd_len);
+
+  if (!getcwd (str, (size_t) cwd_len + 1))
+    stat = errno;
+  else
+    {
+      stat = 0;
+      memcpy (cwd, str, strlen (str));
+    }
+  if (status != NULL)
+    *status = stat;
+}
+iexport(getcwd_i4_sub);
+
+extern void getcwd_i8_sub (char *, GFC_INTEGER_8 *, gfc_charlen_type);
+export_proto(getcwd_i8_sub);
+
+void
+getcwd_i8_sub (char *cwd, GFC_INTEGER_8 *status, gfc_charlen_type cwd_len)
+{
+  GFC_INTEGER_4 status4;
+  getcwd_i4_sub (cwd, &status4, cwd_len);
+  if (status)
+    *status = status4;
+}
+
+extern GFC_INTEGER_4 PREFIX(getcwd) (char *, gfc_charlen_type);
+export_proto_np(PREFIX(getcwd));
+
+GFC_INTEGER_4
+PREFIX(getcwd) (char *cwd, gfc_charlen_type cwd_len)
+{
+  GFC_INTEGER_4 status;
+  getcwd_i4_sub (cwd, &status, cwd_len);
+  return status;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/getlog.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/getlog.c
new file mode 100644 (file)
index 0000000..f4fc0f6
--- /dev/null
@@ -0,0 +1,122 @@
+/* Implementation of the GETLOG g77 intrinsic.
+   Copyright (C) 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef HAVE_UNISTD_H
+#  if defined __MINGW32__ && defined  HAVE_GETLOGIN
+#    define _POSIX 1
+#  endif
+#include <unistd.h>
+#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+/* Windows32 version */
+#if defined __MINGW32__ && !defined  HAVE_GETLOGIN
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <lmcons.h>  /* for UNLEN */ 
+
+static char *
+w32_getlogin (void)
+{
+  static char name [UNLEN + 1];
+  DWORD namelen = sizeof (name);
+
+  GetUserName (name, &namelen);
+  return (name[0] == 0 ?  NULL : name);
+}
+
+#undef getlogin
+#define getlogin w32_getlogin
+#define HAVE_GETLOGIN 1
+
+#endif
+
+
+/* GETLOG (LOGIN), g77 intrinsic for retrieving the login name for the
+   process.
+   CHARACTER(len=*), INTENT(OUT) :: LOGIN  */
+
+void PREFIX(getlog) (char *, gfc_charlen_type);
+export_proto_np(PREFIX(getlog));
+
+void
+PREFIX(getlog) (char * login, gfc_charlen_type login_len)
+{
+  int p_len;
+  char *p;
+
+  memset (login, ' ', login_len); /* Blank the string.  */
+
+#if defined(HAVE_POSIX_GETPWUID_R) && defined(HAVE_GETEUID)
+  struct passwd pwd;
+  struct passwd *result;
+  char *buf;
+  int err;
+  /* To be pedantic, buflen should be determined by
+     sysconf(_SC_GETPW_R_SIZE_MAX), which is 1024 on some tested
+     targets; we do something simple in case the target doesn't
+     support sysconf.  */
+  static const size_t buflen = 1024;
+  buf = get_mem (buflen);
+  err = getpwuid_r (geteuid (), &pwd, buf, buflen, &result);
+  if (err != 0 || result == NULL)
+    goto cleanup;
+  p = pwd.pw_name;
+#elif defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
+  {
+    struct passwd *pw = getpwuid (geteuid ());
+    if (pw)
+      p = pw->pw_name;
+    else
+      return;
+  }
+#elif HAVE_GETLOGIN
+  p = getlogin();
+# else
+  return;
+#endif
+
+  if (p == NULL)
+    goto cleanup;
+
+  p_len = strlen (p);
+  if (login_len < p_len)
+    p_len = login_len;
+  memcpy (login, p, p_len);
+
+ cleanup:
+#if defined (HAVE_POSIX_GETPWUID_R) && defined(HAVE_GETEUID)
+  free (buf);
+#else
+  ;
+#endif
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/hostnm.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/hostnm.c
new file mode 100644 (file)
index 0000000..99ab18d
--- /dev/null
@@ -0,0 +1,144 @@
+/* Implementation of the HOSTNM intrinsic.
+   Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+#include <string.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h> 
+#endif
+
+
+/* Windows32 version */
+#if defined __MINGW32__ && !defined  HAVE_GETHOSTNAME
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <errno.h>
+
+static int
+w32_gethostname (char *name, size_t len)
+{
+  /* We could try the WinSock API gethostname, but that will
+     fail if WSAStartup function has has not been called.  We don't
+    really need a name that will be understood by socket API, so avoid
+    unnecessary dependence on WinSock libraries by using
+    GetComputerName instead.  */
+
+  /* On Win9x GetComputerName fails if the input size is less
+     than MAX_COMPUTERNAME_LENGTH + 1.  */
+  char buffer[MAX_COMPUTERNAME_LENGTH + 1];
+  DWORD size =  sizeof (buffer);
+
+  if (!GetComputerName (buffer, &size))
+    return -1;
+
+  if ((size = strlen (buffer) + 1)  > len)
+    {
+      errno = EINVAL;
+      /* Truncate as per POSIX spec.  We do not NUL-terminate. */
+      size = len;
+    }
+  memcpy (name, buffer, (size_t) size);
+
+  return 0;
+}
+
+#undef gethostname
+#define gethostname w32_gethostname
+#define  HAVE_GETHOSTNAME 1
+
+#endif
+
+
+/* SUBROUTINE HOSTNM(NAME, STATUS)
+   CHARACTER(len=*), INTENT(OUT) :: NAME
+   INTEGER, INTENT(OUT), OPTIONAL :: STATUS  */
+
+#ifdef HAVE_GETHOSTNAME
+extern void hostnm_i4_sub (char *, GFC_INTEGER_4 *, gfc_charlen_type);
+iexport_proto(hostnm_i4_sub);
+
+void
+hostnm_i4_sub (char *name, GFC_INTEGER_4 *status, gfc_charlen_type name_len)
+{
+  int val, i;
+  char *p;
+
+  memset (name, ' ', name_len);
+  p = gfc_alloca (name_len + 1);
+
+  val = gethostname (p, name_len);
+
+  if (val == 0)
+  {
+    i = -1;
+    while (i < name_len && p[++i] != '\0')
+      name[i] = p[i];
+  }
+
+  if (status != NULL) 
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(hostnm_i4_sub);
+
+extern void hostnm_i8_sub (char *, GFC_INTEGER_8 *, gfc_charlen_type);
+iexport_proto(hostnm_i8_sub);
+
+void
+hostnm_i8_sub (char *name, GFC_INTEGER_8 *status, gfc_charlen_type name_len)
+{
+  int val, i;
+  char *p;
+
+  memset (name, ' ', name_len);
+  p = gfc_alloca (name_len + 1);
+
+  val = gethostname (p, name_len);
+
+  if (val == 0)
+  {
+    i = -1;
+    while (i < name_len && p[++i] != '\0')
+      name[i] = p[i];
+  }
+
+  if (status != NULL) 
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(hostnm_i8_sub);
+
+extern GFC_INTEGER_4 hostnm (char *, gfc_charlen_type);
+export_proto(hostnm);
+
+GFC_INTEGER_4
+hostnm (char *name, gfc_charlen_type name_len)
+{
+  GFC_INTEGER_4 val;
+  hostnm_i4_sub (name, &val, name_len);
+  return val;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/ierrno.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/ierrno.c
new file mode 100644 (file)
index 0000000..2f5e44f
--- /dev/null
@@ -0,0 +1,49 @@
+/* Implementation of the IERRNO intrinsic.
+   Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+
+
+/* INTEGER FUNCTION IERRNO()  */
+
+extern GFC_INTEGER_4 ierrno_i4 (void);
+export_proto(ierrno_i4);
+
+GFC_INTEGER_4
+ierrno_i4 (void)
+{
+  return (GFC_INTEGER_4) errno;
+}
+
+extern GFC_INTEGER_8 ierrno_i8 (void);
+export_proto(ierrno_i8);
+
+GFC_INTEGER_8
+ierrno_i8 (void)
+{
+  return (GFC_INTEGER_8) errno;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/ishftc.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/ishftc.c
new file mode 100644 (file)
index 0000000..054c316
--- /dev/null
@@ -0,0 +1,100 @@
+/* Implementation of ishftc intrinsic.
+   Copyright 2002, 2004, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+extern GFC_INTEGER_4 ishftc4 (GFC_INTEGER_4, GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(ishftc4);
+
+GFC_INTEGER_4
+ishftc4 (GFC_INTEGER_4 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size)
+{
+  GFC_UINTEGER_4 mask, bits;
+
+  if (shift < 0)
+    shift = shift + size;
+
+  if (shift == 0 || shift == size)
+    return i;
+
+  /* In C, the result of the shift operator is undefined if the right operand
+     is greater than or equal to the number of bits in the left operand. So we
+     have to special case it for fortran.  */
+  mask = ~((size == 32) ? (GFC_UINTEGER_4)0 : (~(GFC_UINTEGER_4)0 << size));
+
+  bits = i & mask;
+  
+  return (i & ~mask) | ((bits << shift) & mask) | (bits >> (size - shift));
+}
+
+extern GFC_INTEGER_8 ishftc8 (GFC_INTEGER_8, GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(ishftc8);
+
+GFC_INTEGER_8
+ishftc8 (GFC_INTEGER_8 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size)
+{
+  GFC_UINTEGER_8 mask, bits;
+
+  if (shift < 0)
+    shift = shift + size;
+
+  if (shift == 0 || shift == size)
+    return i;
+
+  /* In C, the result of the shift operator is undefined if the right operand
+     is greater than or equal to the number of bits in the left operand. So we
+     have to special case it for fortran.  */
+  mask = ~((size == 64) ? (GFC_UINTEGER_8)0 : (~(GFC_UINTEGER_8)0 << size));
+
+  bits = i & mask;
+  
+  return (i & ~mask) | ((bits << shift) & mask) | (bits >> (size - shift));
+}
+
+#ifdef HAVE_GFC_INTEGER_16
+extern GFC_INTEGER_16 ishftc16 (GFC_INTEGER_16, GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(ishftc16);
+
+GFC_INTEGER_16
+ishftc16 (GFC_INTEGER_16 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size)
+{
+  GFC_UINTEGER_16 mask, bits;
+
+  if (shift < 0)
+    shift = shift + size;
+
+  if (shift == 0 || shift == size)
+    return i;
+
+  /* In C, the result of the shift operator is undefined if the right operand
+     is greater than or equal to the number of bits in the left operand. So we
+     have to special case it for fortran.  */
+  mask = ~((size == 128) ? (GFC_UINTEGER_16)0 : (~(GFC_UINTEGER_16)0 << size));
+
+  bits = i & mask;
+  
+  return (i & ~mask) | ((bits << shift) & mask) | (bits >> (size - shift));
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/iso_c_binding.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/iso_c_binding.c
new file mode 100644 (file)
index 0000000..327ad51
--- /dev/null
@@ -0,0 +1,189 @@
+/* Implementation of the ISO_C_BINDING library helper functions.
+   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Christopher Rickett.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* Implement the functions and subroutines provided by the intrinsic
+   iso_c_binding module.  */
+
+#include "libgfortran.h"
+#include "iso_c_binding.h"
+
+#include <stdlib.h>
+
+
+/* Set the fields of a Fortran pointer descriptor to point to the
+   given C address.  It uses c_f_pointer_u0 for the common
+   fields, and will set up the information necessary if this C address
+   is to an array (i.e., offset, type, element size).  The parameter
+   c_ptr_in represents the C address to have Fortran point to.  The
+   parameter f_ptr_out is the Fortran pointer to associate with the C
+   address.  The parameter shape is a one-dimensional array of integers
+   specifying the upper bound(s) of the array pointed to by the given C
+   address, if applicable.  The shape parameter is optional in Fortran,
+   which will cause it to come in here as NULL.  The parameter type is
+   the type of the data being pointed to (i.e.,libgfortran.h). The
+   elem_size parameter is the size, in bytes, of the data element being
+   pointed to.  If the address is for an array, then the size needs to
+   be the size of a single element (i.e., for an array of doubles, it
+   needs to be the number of bytes for the size of one double).  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer) (void *c_ptr_in,
+                                    gfc_array_void *f_ptr_out,
+                                    const array_t *shape,
+                                    int type, int elemSize)
+{
+  if (shape != NULL)
+    {
+      f_ptr_out->offset = 0;
+
+      /* Set the necessary dtype field for all pointers.  */
+      f_ptr_out->dtype = 0;
+
+      /* Put in the element size.  */
+      f_ptr_out->dtype = f_ptr_out->dtype | (elemSize << GFC_DTYPE_SIZE_SHIFT);
+
+      /* Set the data type (e.g., BT_INTEGER).  */
+      f_ptr_out->dtype = f_ptr_out->dtype | (type << GFC_DTYPE_TYPE_SHIFT);
+    }
+  
+  /* Use the generic version of c_f_pointer to set common fields.  */
+  ISO_C_BINDING_PREFIX (c_f_pointer_u0) (c_ptr_in, f_ptr_out, shape);
+}
+
+
+/* A generic function to set the common fields of all descriptors, no
+   matter whether it's to a scalar or an array.  Access is via the array
+   descrptor macros. Parameter shape is a rank 1 array of integers
+   containing the upper bound of each dimension of what f_ptr_out
+   points to.  The length of this array must be EXACTLY the rank of
+   what f_ptr_out points to, as required by the draft (J3/04-007).  If
+   f_ptr_out points to a scalar, then this parameter will be NULL.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_u0) (void *c_ptr_in,
+                                       gfc_array_void *f_ptr_out,
+                                       const array_t *shape)
+{
+  int i = 0;
+  int shapeSize = 0;
+
+  GFC_DESCRIPTOR_DATA (f_ptr_out) = c_ptr_in;
+
+  if (shape != NULL)
+    {
+      index_type source_stride, size;
+      index_type str = 1;
+      char *p;
+
+      f_ptr_out->offset = str;
+      shapeSize = 0;
+      p = shape->data;
+      size = GFC_DESCRIPTOR_SIZE(shape);
+
+      source_stride = GFC_DESCRIPTOR_STRIDE_BYTES(shape,0);
+
+      /* shape's length (rank of the output array) */
+      shapeSize = GFC_DESCRIPTOR_EXTENT(shape,0);
+      for (i = 0; i < shapeSize; i++)
+        {
+         index_type ub;
+
+          /* Have to allow for the SHAPE array to be any valid kind for
+             an INTEGER type.  */
+         switch (size)
+           {
+#ifdef HAVE_GFC_INTEGER_1
+             case 1:
+               ub = *((GFC_INTEGER_1 *) p);
+               break;
+#endif
+#ifdef HAVE_GFC_INTEGER_2
+             case 2:
+               ub = *((GFC_INTEGER_2 *) p);
+               break;
+#endif
+#ifdef HAVE_GFC_INTEGER_4
+             case 4:
+               ub = *((GFC_INTEGER_4 *) p);
+               break;
+#endif
+#ifdef HAVE_GFC_INTEGER_8
+             case 8:
+               ub = *((GFC_INTEGER_8 *) p);
+               break;
+#endif
+#ifdef HAVE_GFC_INTEGER_16
+             case 16:
+               ub = *((GFC_INTEGER_16 *) p);
+               break;
+#endif
+             default:
+               internal_error (NULL, "c_f_pointer_u0: Invalid size");
+           }
+         p += source_stride;
+
+         if (i != 0)
+           {
+             str = str * GFC_DESCRIPTOR_EXTENT(f_ptr_out,i-1);
+             f_ptr_out->offset += str;
+           }
+
+          /* Lower bound is 1, as specified by the draft.  */
+         GFC_DIMENSION_SET(f_ptr_out->dim[i], 1, ub, str);
+        }
+
+      f_ptr_out->offset *= -1;
+
+      /* All we know is the rank, so set it, leaving the rest alone.
+         Make NO assumptions about the state of dtype coming in!  If we
+         shift right by TYPE_SHIFT bits we'll throw away the existing
+         rank.  Then, shift left by the same number to shift in zeros
+         and or with the new rank.  */
+      f_ptr_out->dtype = ((f_ptr_out->dtype >> GFC_DTYPE_TYPE_SHIFT)
+                           << GFC_DTYPE_TYPE_SHIFT) | shapeSize;
+    }
+}
+
+
+/* Sets the descriptor fields for a Fortran pointer to a derived type,
+   using c_f_pointer_u0 for the majority of the work.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_d0) (void *c_ptr_in,
+                                       gfc_array_void *f_ptr_out,
+                                       const array_t *shape)
+{
+  /* Set the common fields.  */
+  ISO_C_BINDING_PREFIX (c_f_pointer_u0) (c_ptr_in, f_ptr_out, shape);
+
+  /* Preserve the size and rank bits, but reset the type.  */
+  if (shape != NULL)
+    {
+      f_ptr_out->dtype = f_ptr_out->dtype & (~GFC_DTYPE_TYPE_MASK);
+      f_ptr_out->dtype = f_ptr_out->dtype
+                        | (BT_DERIVED << GFC_DTYPE_TYPE_SHIFT);
+    }
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/iso_c_binding.h b/l4/pkg/libgfortran/lib/contrib/intrinsics/iso_c_binding.h
new file mode 100644 (file)
index 0000000..e09147a
--- /dev/null
@@ -0,0 +1,55 @@
+/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Christopher Rickett.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* Declarations for ISO_C_BINDING library helper functions.  */
+
+#ifndef GFOR_ISO_C_BINDING_H
+#define GFOR_ISO_C_BINDING_H
+
+#include "libgfortran.h"
+
+typedef struct c_ptr
+{
+  void *c_address;
+}
+c_ptr_t;
+
+typedef struct c_funptr
+{
+  void *c_address;
+}
+c_funptr_t;
+
+#define ISO_C_BINDING_PREFIX(a) __iso_c_binding_##a
+
+void ISO_C_BINDING_PREFIX(c_f_pointer)(void *, gfc_array_void *,
+                                      const array_t *, int, int);
+
+void ISO_C_BINDING_PREFIX(c_f_pointer_u0) (void *, gfc_array_void *,
+                                          const array_t *);
+void ISO_C_BINDING_PREFIX(c_f_pointer_d0) (void *, gfc_array_void *,
+                                          const array_t *);
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/iso_c_generated_procs.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/iso_c_generated_procs.c
new file mode 100644 (file)
index 0000000..8014f64
--- /dev/null
@@ -0,0 +1,466 @@
+/* Implementation of the ISO_C_BINDING library helper generated functions.
+   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Christopher Rickett.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+#include "libgfortran.h"
+#include "iso_c_binding.h"
+
+
+/* TODO: This file needs to be finished so that a function is provided
+   for all possible type/kind combinations!  */
+
+#ifdef HAVE_GFC_INTEGER_1
+void ISO_C_BINDING_PREFIX (c_f_pointer_i1) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_INTEGER_2
+void ISO_C_BINDING_PREFIX (c_f_pointer_i2) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_INTEGER_4
+void ISO_C_BINDING_PREFIX (c_f_pointer_i4) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_INTEGER_8
+void ISO_C_BINDING_PREFIX (c_f_pointer_i8) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_INTEGER_16
+void ISO_C_BINDING_PREFIX (c_f_pointer_i16) (void *, gfc_array_void *,
+                                            const array_t *);
+#endif
+
+#ifdef HAVE_GFC_REAL_4
+void ISO_C_BINDING_PREFIX (c_f_pointer_r4) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_REAL_8
+void ISO_C_BINDING_PREFIX (c_f_pointer_r8) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_REAL_10
+void ISO_C_BINDING_PREFIX (c_f_pointer_r10) (void *, gfc_array_void *,
+                                            const array_t *);
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+void ISO_C_BINDING_PREFIX (c_f_pointer_r16) (void *, gfc_array_void *,
+                                            const array_t *);
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_4
+void ISO_C_BINDING_PREFIX (c_f_pointer_c4) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_8
+void ISO_C_BINDING_PREFIX (c_f_pointer_c8) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_10
+void ISO_C_BINDING_PREFIX (c_f_pointer_c10) (void *, gfc_array_void *,
+                                            const array_t *);
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_16
+void ISO_C_BINDING_PREFIX (c_f_pointer_c16) (void *, gfc_array_void *,
+                                            const array_t *);
+#endif
+
+#ifdef GFC_DEFAULT_CHAR
+void ISO_C_BINDING_PREFIX (c_f_pointer_s0) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_LOGICAL_1
+void ISO_C_BINDING_PREFIX (c_f_pointer_l1) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_LOGICAL_2
+void ISO_C_BINDING_PREFIX (c_f_pointer_l2) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_LOGICAL_4
+void ISO_C_BINDING_PREFIX (c_f_pointer_l4) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+#ifdef HAVE_GFC_LOGICAL_8
+void ISO_C_BINDING_PREFIX (c_f_pointer_l8) (void *, gfc_array_void *,
+                                           const array_t *);
+#endif
+
+
+#ifdef HAVE_GFC_INTEGER_1
+/* Set the given Fortran pointer, 'f_ptr_out', to point to the given C
+   address, 'c_ptr_in'.  The Fortran pointer is of type integer and
+   kind=1.  The function c_f_pointer is used to set up the pointer
+   descriptor.  shape is a one-dimensional array of integers
+   specifying the upper bounds of the array pointed to by the given C
+   address, if applicable.  'shape' is an optional parameter in
+   Fortran, so if the user does not provide it, it will come in here
+   as NULL.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_i1) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have an integer(kind=1).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_INTEGER,
+                                     (int) sizeof (GFC_INTEGER_1));
+}
+#endif
+
+
+#ifdef HAVE_GFC_INTEGER_2
+/* Set the given Fortran pointer, 'f_ptr_out', to point to the given C
+   address, 'c_ptr_in'.  The Fortran pointer is of type integer and
+   kind=2.  The function c_f_pointer is used to set up the pointer
+   descriptor.  shape is a one-dimensional array of integers
+   specifying the upper bounds of the array pointed to by the given C
+   address, if applicable.  'shape' is an optional parameter in
+   Fortran, so if the user does not provide it, it will come in here
+   as NULL.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_i2) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have an integer(kind=2).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_INTEGER,
+                                     (int) sizeof (GFC_INTEGER_2));
+}
+#endif
+
+
+#ifdef HAVE_GFC_INTEGER_4
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type integer and
+   kind=4.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_i4) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have an integer(kind=4).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_INTEGER,
+                                     (int) sizeof (GFC_INTEGER_4));
+}
+#endif
+
+
+#ifdef HAVE_GFC_INTEGER_8
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type integer and
+   kind=8.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_i8) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have an integer(kind=8).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_INTEGER,
+                                     (int) sizeof (GFC_INTEGER_8));
+}
+#endif
+
+
+#ifdef HAVE_GFC_INTEGER_16
+/* Set the given Fortran pointer, 'f_ptr_out', to point to the given C
+   address, 'c_ptr_in'.  The Fortran pointer is of type integer and
+   kind=16.  The function c_f_pointer is used to set up the pointer
+   descriptor.  shape is a one-dimensional array of integers
+   specifying the upper bounds of the array pointed to by the given C
+   address, if applicable.  'shape' is an optional parameter in
+   Fortran, so if the user does not provide it, it will come in here
+   as NULL.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_i16) (void *c_ptr_in,
+                                       gfc_array_void *f_ptr_out,
+                                       const array_t *shape)
+{
+  /* Here we have an integer(kind=16).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_INTEGER,
+                                     (int) sizeof (GFC_INTEGER_16));
+}
+#endif
+
+
+#ifdef HAVE_GFC_REAL_4
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type real and
+   kind=4.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_r4) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have an real(kind=4).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_REAL,
+                                     (int) sizeof (GFC_REAL_4));
+}
+#endif
+
+
+#ifdef HAVE_GFC_REAL_8
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type real and
+   kind=8.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_r8) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have an real(kind=8).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_REAL,
+                                     (int) sizeof (GFC_REAL_8));
+}
+#endif
+
+
+#ifdef HAVE_GFC_REAL_10
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type real and
+   kind=10.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_r10) (void *c_ptr_in,
+                                       gfc_array_void *f_ptr_out,
+                                       const array_t *shape)
+{
+  /* Here we have an real(kind=10).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_REAL,
+                                     (int) sizeof (GFC_REAL_10));
+}
+#endif
+
+
+#ifdef HAVE_GFC_REAL_16
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type real and
+   kind=16.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_r16) (void *c_ptr_in,
+                                       gfc_array_void *f_ptr_out,
+                                       const array_t *shape)
+{
+  /* Here we have an real(kind=16).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_REAL,
+                                     (int) sizeof (GFC_REAL_16));
+}
+#endif
+
+
+#ifdef HAVE_GFC_COMPLEX_4
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type complex and
+   kind=4.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_c4) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have an complex(kind=4).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_COMPLEX,
+                                     (int) sizeof (GFC_COMPLEX_4));
+}
+#endif
+
+
+#ifdef HAVE_GFC_COMPLEX_8
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type complex and
+   kind=8.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_c8) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have an complex(kind=8).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_COMPLEX,
+                                     (int) sizeof (GFC_COMPLEX_8));
+}
+#endif
+
+
+#ifdef HAVE_GFC_COMPLEX_10
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type complex and
+   kind=10.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_c10) (void *c_ptr_in,
+                                       gfc_array_void *f_ptr_out,
+                                       const array_t *shape)
+{
+  /* Here we have an complex(kind=10).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_COMPLEX,
+                                     (int) sizeof (GFC_COMPLEX_10));
+}
+#endif
+
+
+#ifdef HAVE_GFC_COMPLEX_16
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type complex and
+   kind=16.  The function c_f_pointer is used to set up the pointer
+   descriptor.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_c16) (void *c_ptr_in,
+                                       gfc_array_void *f_ptr_out,
+                                       const array_t *shape)
+{
+  /* Here we have an complex(kind=16).  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_COMPLEX,
+                                     (int) sizeof (GFC_COMPLEX_16));
+}
+#endif
+
+
+#ifdef GFC_DEFAULT_CHAR
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type character.  */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_s0) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have a character string of len=1.  */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_CHARACTER,
+                                     (int) sizeof (char));
+}
+#endif
+
+
+#ifdef HAVE_GFC_LOGICAL_1
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type logical, kind=1. */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_l1) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have a logical of kind=1. */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_LOGICAL,
+                                     (int) sizeof (GFC_LOGICAL_1));
+}
+#endif
+
+
+#ifdef HAVE_GFC_LOGICAL_2
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type logical, kind=2. */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_l2) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have a logical of kind=2. */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_LOGICAL,
+                                     (int) sizeof (GFC_LOGICAL_2));
+}
+#endif
+
+
+#ifdef HAVE_GFC_LOGICAL_4
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type logical, kind=4. */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_l4) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have a logical of kind=4. */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_LOGICAL,
+                                     (int) sizeof (GFC_LOGICAL_4));
+}
+#endif
+
+
+#ifdef HAVE_GFC_LOGICAL_8
+/* Set the given Fortran pointer, f_ptr_out, to point to the given C
+   address, c_ptr_in.  The Fortran pointer is of type logical, kind=8. */
+
+void
+ISO_C_BINDING_PREFIX (c_f_pointer_l8) (void *c_ptr_in,
+                                      gfc_array_void *f_ptr_out,
+                                      const array_t *shape)
+{
+  /* Here we have a logical of kind=8. */
+  ISO_C_BINDING_PREFIX (c_f_pointer) (c_ptr_in, f_ptr_out, shape,
+                                     (int) BT_LOGICAL,
+                                     (int) sizeof (GFC_LOGICAL_8));
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/kill.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/kill.c
new file mode 100644 (file)
index 0000000..be36b00
--- /dev/null
@@ -0,0 +1,92 @@
+/* Implementation of the KILL g77 intrinsic.
+   Copyright (C) 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <errno.h>
+#include <signal.h>
+
+
+/* SUBROUTINE KILL(PID, SIGNAL, STATUS)
+   INTEGER, INTENT(IN) :: PID, SIGNAL
+   INTEGER(KIND=1), INTENT(OUT), OPTIONAL :: STATUS
+
+   INTEGER(KIND=1) FUNCTION KILL(PID, SIGNAL)
+   INTEGER, INTENT(IN) :: PID, SIGNAL */
+
+#ifdef HAVE_KILL
+extern void kill_i4_sub (GFC_INTEGER_4 *, GFC_INTEGER_4 *, GFC_INTEGER_4 *);
+iexport_proto(kill_i4_sub);
+
+void
+kill_i4_sub (GFC_INTEGER_4 *pid, GFC_INTEGER_4 *signal,
+            GFC_INTEGER_4 *status)
+{
+  int val;
+
+  val = kill (*pid, *signal);
+
+  if (status != NULL) 
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(kill_i4_sub);
+
+extern void kill_i8_sub (GFC_INTEGER_8 *, GFC_INTEGER_8 *, GFC_INTEGER_8 *);
+iexport_proto(kill_i8_sub);
+
+void
+kill_i8_sub (GFC_INTEGER_8 *pid, GFC_INTEGER_8 *signal,
+            GFC_INTEGER_8 *status)
+{
+  int val;
+
+  val = kill (*pid, *signal);
+
+  if (status != NULL) 
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(kill_i8_sub);
+
+extern GFC_INTEGER_4 kill_i4 (GFC_INTEGER_4 *, GFC_INTEGER_4 *);
+export_proto(kill_i4);
+
+GFC_INTEGER_4
+kill_i4 (GFC_INTEGER_4 *pid, GFC_INTEGER_4 *signal)
+{
+  GFC_INTEGER_4 val;
+  kill_i4_sub (pid, signal, &val);
+  return val;
+}
+
+extern GFC_INTEGER_8 kill_i8 (GFC_INTEGER_8 *, GFC_INTEGER_8 *);
+export_proto(kill_i8);
+
+GFC_INTEGER_8
+kill_i8 (GFC_INTEGER_8 *pid, GFC_INTEGER_8 *signal)
+{
+  GFC_INTEGER_8 val;
+  kill_i8_sub (pid, signal, &val);
+  return val;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/link.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/link.c
new file mode 100644 (file)
index 0000000..21bae40
--- /dev/null
@@ -0,0 +1,131 @@
+/* Implementation of the LINK intrinsic.
+   Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+#include <string.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* SUBROUTINE LINK(PATH1, PATH2, STATUS)
+   CHARACTER(len=*), INTENT(IN) :: PATH1, PATH2
+   INTEGER, INTENT(OUT), OPTIONAL :: STATUS  */
+
+#ifdef HAVE_LINK
+extern void link_i4_sub (char *, char *, GFC_INTEGER_4 *, gfc_charlen_type,
+                        gfc_charlen_type);
+iexport_proto(link_i4_sub);
+
+void
+link_i4_sub (char *path1, char *path2, GFC_INTEGER_4 *status,
+             gfc_charlen_type path1_len, gfc_charlen_type path2_len)
+{
+  int val;
+  char *str1, *str2;
+
+  /* Trim trailing spaces from paths.  */
+  while (path1_len > 0 && path1[path1_len - 1] == ' ')
+    path1_len--;
+  while (path2_len > 0 && path2[path2_len - 1] == ' ')
+    path2_len--;
+
+  /* Make a null terminated copy of the strings.  */
+  str1 = gfc_alloca (path1_len + 1);
+  memcpy (str1, path1, path1_len);
+  str1[path1_len] = '\0';
+
+  str2 = gfc_alloca (path2_len + 1);
+  memcpy (str2, path2, path2_len);
+  str2[path2_len] = '\0';
+
+  val = link (str1, str2);
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(link_i4_sub);
+
+extern void link_i8_sub (char *, char *, GFC_INTEGER_8 *, gfc_charlen_type,
+                        gfc_charlen_type);
+iexport_proto(link_i8_sub);
+
+void
+link_i8_sub (char *path1, char *path2, GFC_INTEGER_8 *status,
+             gfc_charlen_type path1_len, gfc_charlen_type path2_len)
+{
+  int val;
+  char *str1, *str2;
+
+  /* Trim trailing spaces from paths.  */
+  while (path1_len > 0 && path1[path1_len - 1] == ' ')
+    path1_len--;
+  while (path2_len > 0 && path2[path2_len - 1] == ' ')
+    path2_len--;
+
+  /* Make a null terminated copy of the strings.  */
+  str1 = gfc_alloca (path1_len + 1);
+  memcpy (str1, path1, path1_len);
+  str1[path1_len] = '\0';
+
+  str2 = gfc_alloca (path2_len + 1);
+  memcpy (str2, path2, path2_len);
+  str2[path2_len] = '\0';
+
+  val = link (str1, str2);
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(link_i8_sub);
+
+extern GFC_INTEGER_4 link_i4 (char *, char *, gfc_charlen_type,
+                             gfc_charlen_type);
+export_proto(link_i4);
+
+GFC_INTEGER_4
+link_i4 (char *path1, char *path2, gfc_charlen_type path1_len,
+         gfc_charlen_type path2_len)
+{
+  GFC_INTEGER_4 val;
+  link_i4_sub (path1, path2, &val, path1_len, path2_len);
+  return val;
+}
+
+extern GFC_INTEGER_8 link_i8 (char *, char *, gfc_charlen_type,
+                             gfc_charlen_type);
+export_proto(link_i8);
+
+GFC_INTEGER_8
+link_i8 (char *path1, char *path2, gfc_charlen_type path1_len,
+        gfc_charlen_type path2_len)
+{
+  GFC_INTEGER_8 val;
+  link_i8_sub (path1, path2, &val, path1_len, path2_len);
+  return val;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/malloc.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/malloc.c
new file mode 100644 (file)
index 0000000..5edc1be
--- /dev/null
@@ -0,0 +1,47 @@
+/* Implementation of the MALLOC and FREE intrinsics
+   Copyright (C) 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+
+
+extern void PREFIX(free) (void **);
+export_proto_np(PREFIX(free));
+
+void
+PREFIX(free) (void ** ptr)
+{
+  free (*ptr);
+}
+
+
+extern void * PREFIX(malloc) (size_t *);
+export_proto_np(PREFIX(malloc));
+
+void *
+PREFIX(malloc) (size_t * size)
+{
+  return malloc (*size);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/move_alloc.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/move_alloc.c
new file mode 100644 (file)
index 0000000..7b489ad
--- /dev/null
@@ -0,0 +1,66 @@
+/* Generic implementation of the MOVE_ALLOC intrinsic
+   Copyright (C) 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Paul Thomas
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+
+
+extern void move_alloc (gfc_array_char *, gfc_array_char *);
+export_proto(move_alloc);
+
+void
+move_alloc (gfc_array_char * from, gfc_array_char * to)
+{
+  int i;
+
+  free (to->data);
+
+  for (i = 0; i < GFC_DESCRIPTOR_RANK (from); i++)
+    {
+      GFC_DIMENSION_SET(to->dim[i],GFC_DESCRIPTOR_LBOUND(from,i),
+                       GFC_DESCRIPTOR_UBOUND(from,i),
+                       GFC_DESCRIPTOR_STRIDE(from,i));
+      GFC_DIMENSION_SET(from->dim[i],GFC_DESCRIPTOR_LBOUND(from,i),
+                       GFC_DESCRIPTOR_LBOUND(from,i), 0);
+    }
+
+  to->offset = from->offset;
+  to->dtype = from->dtype;
+  to->data = from->data;
+  from->data = NULL;
+}
+
+extern void move_alloc_c (gfc_array_char *, GFC_INTEGER_4,
+                         gfc_array_char *, GFC_INTEGER_4);
+export_proto(move_alloc_c);
+
+void
+move_alloc_c (gfc_array_char * from,
+             GFC_INTEGER_4 from_length __attribute__((unused)),
+             gfc_array_char * to,
+             GFC_INTEGER_4 to_length __attribute__((unused)))
+{
+  move_alloc (from, to);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/mvbits.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/mvbits.c
new file mode 100644 (file)
index 0000000..7c45bfa
--- /dev/null
@@ -0,0 +1,86 @@
+/* Implementation of the MVBITS intrinsic
+   Copyright (C) 2004, 2006, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* TODO: This should be replaced by a compiler builtin.  */
+
+#ifndef SUB_NAME
+#include <libgfortran.h>
+#endif
+
+#ifdef SUB_NAME
+/* MVBITS copies LEN bits starting at bit position FROMPOS from FROM
+   into TO, starting at bit position TOPOS.  */
+
+extern void SUB_NAME (const TYPE *, const int *, const int *, TYPE *,
+                     const int *);
+export_proto(SUB_NAME);
+
+void 
+SUB_NAME (const TYPE *from, const int *frompos, const int *len, TYPE *to,
+         const int *topos)
+{
+  TYPE oldbits, newbits, lenmask;
+
+  lenmask = (*len == sizeof (TYPE)*8) ? ~(TYPE)0 : ((TYPE)1 << *len) - 1;
+  newbits = (((UTYPE)(*from) >> *frompos) & lenmask) << *topos;
+  oldbits = *to & (~(lenmask << *topos));
+
+  *to = newbits | oldbits;
+}
+#endif
+
+#ifndef SUB_NAME
+#  define TYPE GFC_INTEGER_1
+#  define UTYPE GFC_UINTEGER_1
+#  define SUB_NAME mvbits_i1
+#  include "mvbits.c"
+#  undef SUB_NAME
+#  undef TYPE
+#  undef UTYPE
+#  define TYPE GFC_INTEGER_2
+#  define UTYPE GFC_UINTEGER_2
+#  define SUB_NAME mvbits_i2
+#  include "mvbits.c"
+#  undef SUB_NAME
+#  undef TYPE
+#  undef UTYPE
+#  define TYPE GFC_INTEGER_4
+#  define UTYPE GFC_UINTEGER_4
+#  define SUB_NAME mvbits_i4
+#  include "mvbits.c"
+#  undef SUB_NAME
+#  undef TYPE
+#  undef UTYPE
+
+#  define TYPE GFC_INTEGER_8
+#  define UTYPE GFC_UINTEGER_8
+#  define SUB_NAME mvbits_i8
+#  include "mvbits.c"
+#  undef SUB_NAME
+#  undef TYPE
+#  undef UTYPE
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/pack_generic.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/pack_generic.c
new file mode 100644 (file)
index 0000000..de1e07f
--- /dev/null
@@ -0,0 +1,643 @@
+/* Generic implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+static void
+pack_internal (gfc_array_char *ret, const gfc_array_char *array,
+              const gfc_array_l1 *mask, const gfc_array_char *vector,
+              index_type size)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  char * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const char *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  sptr = array->data;
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Don't convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+       }
+      else
+       {
+         /* We have to count the true elements in MASK.  */
+
+         total = count_0 (mask);
+       }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (size * total);
+
+         if (total == 0)
+           return;      /* In this case, nothing remains to be done.  */
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE_BYTES(ret,0);
+  if (rstride0 == 0)
+    rstride0 = size;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+          memcpy (rptr, sptr, size);
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE_BYTES(vector,0);
+          if (sstride0 == 0)
+            sstride0 = size;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+              memcpy (rptr, sptr, size);
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+extern void pack (gfc_array_char *, const gfc_array_char *,
+                 const gfc_array_l1 *, const gfc_array_char *);
+export_proto(pack);
+
+void
+pack (gfc_array_char *ret, const gfc_array_char *array,
+      const gfc_array_l1 *mask, const gfc_array_char *vector)
+{
+  index_type type_size;
+  index_type size;
+
+  type_size = GFC_DTYPE_TYPE_SIZE(array);
+
+  switch(type_size)
+    {
+    case GFC_DTYPE_LOGICAL_1:
+    case GFC_DTYPE_INTEGER_1:
+    case GFC_DTYPE_DERIVED_1:
+      pack_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) array,
+              (gfc_array_l1 *) mask, (gfc_array_i1 *) vector);
+      return;
+
+    case GFC_DTYPE_LOGICAL_2:
+    case GFC_DTYPE_INTEGER_2:
+      pack_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) array,
+              (gfc_array_l1 *) mask, (gfc_array_i2 *) vector);
+      return;
+
+    case GFC_DTYPE_LOGICAL_4:
+    case GFC_DTYPE_INTEGER_4:
+      pack_i4 ((gfc_array_i4 *) ret, (gfc_array_i4 *) array,
+              (gfc_array_l1 *) mask, (gfc_array_i4 *) vector);
+      return;
+
+    case GFC_DTYPE_LOGICAL_8:
+    case GFC_DTYPE_INTEGER_8:
+      pack_i8 ((gfc_array_i8 *) ret, (gfc_array_i8 *) array,
+              (gfc_array_l1 *) mask, (gfc_array_i8 *) vector);
+      return;
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_LOGICAL_16:
+    case GFC_DTYPE_INTEGER_16:
+      pack_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) array,
+               (gfc_array_l1 *) mask, (gfc_array_i16 *) vector);
+      return;
+#endif
+
+    case GFC_DTYPE_REAL_4:
+      pack_r4 ((gfc_array_r4 *) ret, (gfc_array_r4 *) array,
+              (gfc_array_l1 *) mask, (gfc_array_r4 *) vector);
+      return;
+
+    case GFC_DTYPE_REAL_8:
+      pack_r8 ((gfc_array_r8 *) ret, (gfc_array_r8 *) array,
+              (gfc_array_l1 *) mask, (gfc_array_r8 *) vector);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_REAL_10
+    case GFC_DTYPE_REAL_10:
+      pack_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) array,
+               (gfc_array_l1 *) mask, (gfc_array_r10 *) vector);
+      return;
+# endif
+
+# ifdef HAVE_GFC_REAL_16
+    case GFC_DTYPE_REAL_16:
+      pack_r16 ((gfc_array_r16 *) ret, (gfc_array_r16 *) array,
+               (gfc_array_l1 *) mask, (gfc_array_r16 *) vector);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_COMPLEX_4:
+      pack_c4 ((gfc_array_c4 *) ret, (gfc_array_c4 *) array,
+              (gfc_array_l1 *) mask, (gfc_array_c4 *) vector);
+      return;
+
+    case GFC_DTYPE_COMPLEX_8:
+      pack_c8 ((gfc_array_c8 *) ret, (gfc_array_c8 *) array,
+              (gfc_array_l1 *) mask, (gfc_array_c8 *) vector);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_COMPLEX_10
+    case GFC_DTYPE_COMPLEX_10:
+      pack_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) array,
+               (gfc_array_l1 *) mask, (gfc_array_c10 *) vector);
+      return;
+# endif
+
+# ifdef HAVE_GFC_COMPLEX_16
+    case GFC_DTYPE_COMPLEX_16:
+      pack_c16 ((gfc_array_c16 *) ret, (gfc_array_c16 *) array,
+               (gfc_array_l1 *) mask, (gfc_array_c16 *) vector);
+      return;
+# endif
+#endif
+
+      /* For derived types, let's check the actual alignment of the
+        data pointers.  If they are aligned, we can safely call
+        the unpack functions.  */
+
+    case GFC_DTYPE_DERIVED_2:
+      if (GFC_UNALIGNED_2(ret->data) || GFC_UNALIGNED_2(array->data)
+         || (vector && GFC_UNALIGNED_2(vector->data)))
+       break;
+      else
+       {
+         pack_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) array,
+                  (gfc_array_l1 *) mask, (gfc_array_i2 *) vector);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_4:
+      if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(array->data)
+         || (vector && GFC_UNALIGNED_4(vector->data)))
+       break;
+      else
+       {
+         pack_i4 ((gfc_array_i4 *) ret, (gfc_array_i4 *) array,
+                  (gfc_array_l1 *) mask, (gfc_array_i4 *) vector);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_8:
+      if (GFC_UNALIGNED_8(ret->data) || GFC_UNALIGNED_8(array->data)
+         || (vector && GFC_UNALIGNED_8(vector->data)))
+       break;
+      else
+       {
+         pack_i8 ((gfc_array_i8 *) ret, (gfc_array_i8 *) array,
+                  (gfc_array_l1 *) mask, (gfc_array_i8 *) vector);
+         return;
+       }
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_DERIVED_16:
+      if (GFC_UNALIGNED_16(ret->data) || GFC_UNALIGNED_16(array->data)
+         || (vector && GFC_UNALIGNED_16(vector->data)))
+       break;
+      else
+       {
+         pack_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) array,
+                  (gfc_array_l1 *) mask, (gfc_array_i16 *) vector);
+         return;
+       }
+#endif
+
+    }
+
+  size = GFC_DESCRIPTOR_SIZE (array);
+  pack_internal (ret, array, mask, vector, size);
+}
+
+
+extern void pack_char (gfc_array_char *, GFC_INTEGER_4, const gfc_array_char *,
+                      const gfc_array_l1 *, const gfc_array_char *,
+                      GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(pack_char);
+
+void
+pack_char (gfc_array_char *ret,
+          GFC_INTEGER_4 ret_length __attribute__((unused)),
+          const gfc_array_char *array, const gfc_array_l1 *mask,
+          const gfc_array_char *vector, GFC_INTEGER_4 array_length,
+          GFC_INTEGER_4 vector_length __attribute__((unused)))
+{
+  pack_internal (ret, array, mask, vector, array_length);
+}
+
+
+extern void pack_char4 (gfc_array_char *, GFC_INTEGER_4, const gfc_array_char *,
+                       const gfc_array_l1 *, const gfc_array_char *,
+                       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(pack_char4);
+
+void
+pack_char4 (gfc_array_char *ret,
+           GFC_INTEGER_4 ret_length __attribute__((unused)),
+           const gfc_array_char *array, const gfc_array_l1 *mask,
+           const gfc_array_char *vector, GFC_INTEGER_4 array_length,
+           GFC_INTEGER_4 vector_length __attribute__((unused)))
+{
+  pack_internal (ret, array, mask, vector, array_length * sizeof (gfc_char4_t));
+}
+
+
+static void
+pack_s_internal (gfc_array_char *ret, const gfc_array_char *array,
+                const GFC_LOGICAL_4 *mask, const gfc_array_char *vector,
+                index_type size)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  char *rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const char *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ssize;
+  index_type nelem;
+  index_type total;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  ssize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      ssize *= extent[n];
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+
+  sstride0 = sstride[0];
+
+  if (ssize != 0)
+    sptr = array->data;
+  else
+    sptr = NULL;
+
+  if (ret->data == NULL)
+    {
+      /* Allocate the memory for the result.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many elements as there are
+            in vector.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total <= 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+       {
+         if (*mask)
+           {
+             /* The result array will have as many elements as the input
+                array.  */
+             total = extent[0];
+             for (n = 1; n < dim; n++)
+               total *= extent[n];
+           }
+         else
+           /* The result array will be empty.  */
+           total = 0;
+       }
+
+      /* Setup the array descriptor.  */
+      GFC_DIMENSION_SET(ret->dim[0],0,total-1,1);
+
+      ret->offset = 0;
+
+      ret->data = internal_malloc_size (size * total);
+
+      if (total == 0)
+       return;
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE_BYTES(ret,0);
+  if (rstride0 == 0)
+    rstride0 = size;
+  rptr = ret->data;
+
+  /* The remaining possibilities are now:
+       If MASK is .TRUE., we have to copy the source array into the
+     result array. We then have to fill it up with elements from VECTOR.
+       If MASK is .FALSE., we have to copy VECTOR into the result
+     array. If VECTOR were not present we would have already returned.  */
+
+  if (*mask && ssize != 0)
+    {
+      while (sptr)
+       {
+         /* Add this element.  */
+         memcpy (rptr, sptr, size);
+         rptr += rstride0;
+
+         /* Advance to the next element.  */
+         sptr += sstride0;
+         count[0]++;
+         n = 0;
+         while (count[n] == extent[n])
+           {
+             /* When we get to the end of a dimension, reset it and
+                increment the next dimension.  */
+             count[n] = 0;
+             /* We could precalculate these products, but this is a
+                less frequently used path so probably not worth it.  */
+             sptr -= sstride[n] * extent[n];
+             n++;
+             if (n >= dim)
+               {
+                 /* Break out of the loop.  */
+                 sptr = NULL;
+                 break;
+               }
+             else
+               {
+                 count[n]++;
+                 sptr += sstride[n];
+               }
+           }
+       }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE_BYTES(vector,0);
+          if (sstride0 == 0)
+            sstride0 = size;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+              memcpy (rptr, sptr, size);
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+extern void pack_s (gfc_array_char *ret, const gfc_array_char *array,
+                   const GFC_LOGICAL_4 *, const gfc_array_char *);
+export_proto(pack_s);
+
+void
+pack_s (gfc_array_char *ret, const gfc_array_char *array,
+       const GFC_LOGICAL_4 *mask, const gfc_array_char *vector)
+{
+  pack_s_internal (ret, array, mask, vector, GFC_DESCRIPTOR_SIZE (array));
+}
+
+
+extern void pack_s_char (gfc_array_char *ret, GFC_INTEGER_4,
+                        const gfc_array_char *array, const GFC_LOGICAL_4 *,
+                        const gfc_array_char *, GFC_INTEGER_4,
+                        GFC_INTEGER_4);
+export_proto(pack_s_char);
+
+void
+pack_s_char (gfc_array_char *ret,
+            GFC_INTEGER_4 ret_length __attribute__((unused)),
+            const gfc_array_char *array, const GFC_LOGICAL_4 *mask,
+            const gfc_array_char *vector, GFC_INTEGER_4 array_length,
+            GFC_INTEGER_4 vector_length __attribute__((unused)))
+{
+  pack_s_internal (ret, array, mask, vector, array_length);
+}
+
+
+extern void pack_s_char4 (gfc_array_char *ret, GFC_INTEGER_4,
+                         const gfc_array_char *array, const GFC_LOGICAL_4 *,
+                         const gfc_array_char *, GFC_INTEGER_4,
+                         GFC_INTEGER_4);
+export_proto(pack_s_char4);
+
+void
+pack_s_char4 (gfc_array_char *ret,
+             GFC_INTEGER_4 ret_length __attribute__((unused)),
+             const gfc_array_char *array, const GFC_LOGICAL_4 *mask,
+             const gfc_array_char *vector, GFC_INTEGER_4 array_length,
+             GFC_INTEGER_4 vector_length __attribute__((unused)))
+{
+  pack_s_internal (ret, array, mask, vector,
+                  array_length * sizeof (gfc_char4_t));
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/perror.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/perror.c
new file mode 100644 (file)
index 0000000..bb203c4
--- /dev/null
@@ -0,0 +1,53 @@
+/* Implementation of the PERROR intrinsic.
+   Copyright (C) 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+#include <string.h>
+
+/* SUBROUTINE PERROR(STRING)
+   CHARACTER(len=*), INTENT(IN) :: STRING   */
+
+extern void perror_sub (char *, gfc_charlen_type);
+iexport_proto(perror_sub);
+
+void
+perror_sub (char *string, gfc_charlen_type string_len)
+{
+  char * str;
+
+  /* Trim trailing spaces from paths.  */
+  while (string_len > 0 && string[string_len - 1] == ' ')
+    string_len--;
+
+  /* Make a null terminated copy of the strings.  */
+  str = gfc_alloca (string_len + 1);
+  memcpy (str, string, string_len);
+  str[string_len] = '\0';
+
+  perror (str);
+}
+iexport(perror_sub);
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/rand.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/rand.c
new file mode 100644 (file)
index 0000000..369feae
--- /dev/null
@@ -0,0 +1,136 @@
+/* Implementation of the IRAND, RAND, and SRAND intrinsics.
+   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargls@comcast.net>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* Simple multiplicative congruent algorithm.
+   The period of this generator is approximately 2^31-1, which means that
+   it should not be used for anything serious.  The implementation here
+   is based of an algorithm from  S.K. Park and K.W. Miller, Comm. ACM,
+   31, 1192-1201 (1988).  It is also provided solely for compatibility 
+   with G77.  */
+
+#include "libgfortran.h"
+#include <gthr.h>
+
+#define GFC_RAND_A     16807
+#define GFC_RAND_M     2147483647
+#define GFC_RAND_M1    (GFC_RAND_M - 1)
+
+static GFC_UINTEGER_8 rand_seed = 1;
+#ifdef __GTHREAD_MUTEX_INIT
+static __gthread_mutex_t rand_seed_lock = __GTHREAD_MUTEX_INIT;
+#else
+static __gthread_mutex_t rand_seed_lock;
+#endif
+
+
+/* Set the seed of the irand generator.  Note 0 is a bad seed.  */
+
+static void
+srand_internal (GFC_INTEGER_8 i)
+{
+  rand_seed = i ? i : 123459876;
+}
+
+extern void PREFIX(srand) (GFC_INTEGER_4 *i);
+export_proto_np(PREFIX(srand));
+
+void
+PREFIX(srand) (GFC_INTEGER_4 *i)
+{
+  __gthread_mutex_lock (&rand_seed_lock);
+  srand_internal (*i);
+  __gthread_mutex_unlock (&rand_seed_lock);
+}
+
+/* Return an INTEGER in the range [1,GFC_RAND_M-1].  */
+
+extern GFC_INTEGER_4 irand (GFC_INTEGER_4 *);
+iexport_proto(irand);
+
+GFC_INTEGER_4
+irand (GFC_INTEGER_4 *i)
+{
+  GFC_INTEGER_4 j;
+  if (i)
+    j = *i;
+  else
+    j = 0;
+
+  __gthread_mutex_lock (&rand_seed_lock);
+
+  switch (j)
+  {
+    /* Return the next RN. */
+    case 0:
+      break;
+
+    /* Reset the RN sequence to system-dependent sequence and return the
+       first value.  */
+    case 1:
+      srand_internal (0);
+      break;
+    
+    /* Seed the RN sequence with j and return the first value.  */
+    default:
+      srand_internal (j);
+      break;
+   }
+
+   rand_seed = GFC_RAND_A * rand_seed % GFC_RAND_M;
+   j = (GFC_INTEGER_4) rand_seed;
+
+  __gthread_mutex_unlock (&rand_seed_lock);
+
+   return j;
+}
+iexport(irand);
+
+
+/*  Return a random REAL in the range [0,1).  */
+
+extern GFC_REAL_4 PREFIX(rand) (GFC_INTEGER_4 *i);
+export_proto_np(PREFIX(rand));
+
+GFC_REAL_4
+PREFIX(rand) (GFC_INTEGER_4 *i)
+{
+  GFC_UINTEGER_4 mask;
+#if GFC_REAL_4_RADIX == 2
+  mask = ~ (GFC_UINTEGER_4) 0u << (32 - GFC_REAL_4_DIGITS + 1);
+#elif GFC_REAL_4_RADIX == 16
+  mask = ~ (GFC_UINTEGER_4) 0u << ((8 - GFC_REAL_4_DIGITS) * 4 + 1);
+#else
+#error "GFC_REAL_4_RADIX has unknown value"
+#endif
+  return ((GFC_UINTEGER_4) (irand(i) -1) & mask) * (GFC_REAL_4) 0x1.p-31f;
+}
+
+#ifndef __GTHREAD_MUTEX_INIT
+static void __attribute__((constructor))
+init (void)
+{
+  __GTHREAD_MUTEX_INIT_FUNCTION (&rand_seed_lock);
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/random.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/random.c
new file mode 100644 (file)
index 0000000..35576b8
--- /dev/null
@@ -0,0 +1,798 @@
+/* Implementation of the RANDOM intrinsics
+   Copyright 2002, 2004, 2005, 2006, 2007, 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Lars Segerlund <seger@linuxmail.org>
+   and Steve Kargl.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <gthr.h>
+#include <string.h>
+
+extern void random_r4 (GFC_REAL_4 *);
+iexport_proto(random_r4);
+
+extern void random_r8 (GFC_REAL_8 *);
+iexport_proto(random_r8);
+
+extern void arandom_r4 (gfc_array_r4 *);
+export_proto(arandom_r4);
+
+extern void arandom_r8 (gfc_array_r8 *);
+export_proto(arandom_r8);
+
+#ifdef HAVE_GFC_REAL_10
+
+extern void random_r10 (GFC_REAL_10 *);
+iexport_proto(random_r10);
+
+extern void arandom_r10 (gfc_array_r10 *);
+export_proto(arandom_r10);
+
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+
+extern void random_r16 (GFC_REAL_16 *);
+iexport_proto(random_r16);
+
+extern void arandom_r16 (gfc_array_r16 *);
+export_proto(arandom_r16);
+
+#endif
+
+#ifdef __GTHREAD_MUTEX_INIT
+static __gthread_mutex_t random_lock = __GTHREAD_MUTEX_INIT;
+#else
+static __gthread_mutex_t random_lock;
+#endif
+
+/* Helper routines to map a GFC_UINTEGER_* to the corresponding
+   GFC_REAL_* types in the range of [0,1).  If GFC_REAL_*_RADIX are 2
+   or 16, respectively, we mask off the bits that don't fit into the
+   correct GFC_REAL_*, convert to the real type, then multiply by the
+   correct offset.  */
+
+
+static void
+rnumber_4 (GFC_REAL_4 *f, GFC_UINTEGER_4 v)
+{
+  GFC_UINTEGER_4 mask;
+#if GFC_REAL_4_RADIX == 2
+  mask = ~ (GFC_UINTEGER_4) 0u << (32 - GFC_REAL_4_DIGITS);
+#elif GFC_REAL_4_RADIX == 16
+  mask = ~ (GFC_UINTEGER_4) 0u << ((8 - GFC_REAL_4_DIGITS) * 4);
+#else
+#error "GFC_REAL_4_RADIX has unknown value"
+#endif
+  v = v & mask;
+  *f = (GFC_REAL_4) v * GFC_REAL_4_LITERAL(0x1.p-32);
+}
+
+static void
+rnumber_8 (GFC_REAL_8 *f, GFC_UINTEGER_8 v)
+{
+  GFC_UINTEGER_8 mask;
+#if GFC_REAL_8_RADIX == 2
+  mask = ~ (GFC_UINTEGER_8) 0u << (64 - GFC_REAL_8_DIGITS);
+#elif GFC_REAL_8_RADIX == 16
+  mask = ~ (GFC_UINTEGER_8) 0u << (16 - GFC_REAL_8_DIGITS) * 4);
+#else
+#error "GFC_REAL_8_RADIX has unknown value"
+#endif
+  v = v & mask;
+  *f = (GFC_REAL_8) v * GFC_REAL_8_LITERAL(0x1.p-64);
+}
+
+#ifdef HAVE_GFC_REAL_10
+
+static void
+rnumber_10 (GFC_REAL_10 *f, GFC_UINTEGER_8 v)
+{
+  GFC_UINTEGER_8 mask;
+#if GFC_REAL_10_RADIX == 2
+  mask = ~ (GFC_UINTEGER_8) 0u << (64 - GFC_REAL_10_DIGITS);
+#elif GFC_REAL_10_RADIX == 16
+  mask = ~ (GFC_UINTEGER_10) 0u << ((16 - GFC_REAL_10_DIGITS) * 4);
+#else
+#error "GFC_REAL_10_RADIX has unknown value"
+#endif
+  v = v & mask;
+  *f = (GFC_REAL_10) v * GFC_REAL_10_LITERAL(0x1.p-64);
+}
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+
+/* For REAL(KIND=16), we only need to mask off the lower bits.  */
+
+static void
+rnumber_16 (GFC_REAL_16 *f, GFC_UINTEGER_8 v1, GFC_UINTEGER_8 v2)
+{
+  GFC_UINTEGER_8 mask;
+#if GFC_REAL_16_RADIX == 2
+  mask = ~ (GFC_UINTEGER_8) 0u << (128 - GFC_REAL_16_DIGITS);
+#elif GFC_REAL_16_RADIX == 16
+  mask = ~ (GFC_UINTEGER_8) 0u << ((32 - GFC_REAL_16_DIGITS) * 4);
+#else
+#error "GFC_REAL_16_RADIX has unknown value"
+#endif
+  v2 = v2 & mask;
+  *f = (GFC_REAL_16) v1 * GFC_REAL_16_LITERAL(0x1.p-64)
+    + (GFC_REAL_16) v2 * GFC_REAL_16_LITERAL(0x1.p-128);
+}
+#endif
+/* libgfortran previously had a Mersenne Twister, taken from the paper:
+  
+       Mersenne Twister:       623-dimensionally equidistributed
+                               uniform pseudorandom generator.
+
+       by Makoto Matsumoto & Takuji Nishimura
+       which appeared in the: ACM Transactions on Modelling and Computer
+       Simulations: Special Issue on Uniform Random Number
+       Generation. ( Early in 1998 ).
+
+   The Mersenne Twister code was replaced due to
+
+    (1) Simple user specified seeds lead to really bad sequences for
+        nearly 100000 random numbers.
+    (2) open(), read(), and close() were not properly declared via header
+        files.
+    (3) The global index i was abused and caused unexpected behavior with
+        GET and PUT.
+    (4) See PR 15619.
+
+
+   libgfortran currently uses George Marsaglia's KISS (Keep It Simple Stupid)
+   random number generator.  This PRNG combines:
+
+   (1) The congruential generator x(n)=69069*x(n-1)+1327217885 with a period
+       of 2^32,
+   (2) A 3-shift shift-register generator with a period of 2^32-1,
+   (3) Two 16-bit multiply-with-carry generators with a period of
+       597273182964842497 > 2^59.
+
+   The overall period exceeds 2^123.
+
+   http://www.ciphersbyritter.com/NEWS4/RANDC.HTM#369F6FCA.74C7C041@stat.fsu.edu
+
+   The above web site has an archive of a newsgroup posting from George
+   Marsaglia with the statement:
+
+   Subject: Random numbers for C: Improvements.
+   Date: Fri, 15 Jan 1999 11:41:47 -0500
+   From: George Marsaglia <geo@stat.fsu.edu>
+   Message-ID: <369F6FCA.74C7C041@stat.fsu.edu>
+   References: <369B5E30.65A55FD1@stat.fsu.edu>
+   Newsgroups: sci.stat.math,sci.math,sci.math.numer-analysis
+   Lines: 93
+
+   As I hoped, several suggestions have led to
+   improvements in the code for RNG's I proposed for
+   use in C. (See the thread "Random numbers for C: Some
+   suggestions" in previous postings.) The improved code
+   is listed below.
+
+   A question of copyright has also been raised.  Unlike
+   DIEHARD, there is no copyright on the code below. You
+   are free to use it in any way you want, but you may
+   wish to acknowledge the source, as a courtesy.
+
+"There is no copyright on the code below." included the original
+KISS algorithm.  */
+
+/* We use three KISS random number generators, with different
+   seeds.
+   As a matter of Quality of Implementation, the random numbers
+   we generate for different REAL kinds, starting from the same
+   seed, are always the same up to the precision of these types.
+   We do this by using three generators with different seeds, the
+   first one always for the most significant bits, the second one
+   for bits 33..64 (if present in the REAL kind), and the third one
+   (called twice) for REAL(16).  */
+
+#define GFC_SL(k, n)   ((k)^((k)<<(n)))
+#define GFC_SR(k, n)   ((k)^((k)>>(n)))
+
+/*   Reference for the seed:
+   From: "George Marsaglia" <g...@stat.fsu.edu>
+   Newsgroups: sci.math
+   Message-ID: <e7CcnWxczriWssCjXTWc3A@comcast.com>
+  
+   The KISS RNG uses four seeds, x, y, z, c,
+   with 0<=x<2^32, 0<y<2^32, 0<=z<2^32, 0<=c<698769069
+   except that the two pairs
+   z=0,c=0 and z=2^32-1,c=698769068
+   should be avoided.  */
+
+/* Any modifications to the seeds that change kiss_size below need to be
+   reflected in check.c (gfc_check_random_seed) to enable correct
+   compile-time checking of PUT size for the RANDOM_SEED intrinsic.  */
+
+#define KISS_DEFAULT_SEED_1 123456789, 362436069, 521288629, 316191069
+#define KISS_DEFAULT_SEED_2 987654321, 458629013, 582859209, 438195021
+#ifdef HAVE_GFC_REAL_16
+#define KISS_DEFAULT_SEED_3 573658661, 185639104, 582619469, 296736107
+#endif
+
+static GFC_UINTEGER_4 kiss_seed[] = {
+  KISS_DEFAULT_SEED_1,
+  KISS_DEFAULT_SEED_2,
+#ifdef HAVE_GFC_REAL_16
+  KISS_DEFAULT_SEED_3
+#endif
+};
+
+static GFC_UINTEGER_4 kiss_default_seed[] = {
+  KISS_DEFAULT_SEED_1,
+  KISS_DEFAULT_SEED_2,
+#ifdef HAVE_GFC_REAL_16
+  KISS_DEFAULT_SEED_3
+#endif
+};
+
+static const GFC_INTEGER_4 kiss_size = sizeof(kiss_seed)/sizeof(kiss_seed[0]);
+
+static GFC_UINTEGER_4 * const kiss_seed_1 = kiss_seed;
+static GFC_UINTEGER_4 * const kiss_seed_2 = kiss_seed + 4;
+
+#ifdef HAVE_GFC_REAL_16
+static GFC_UINTEGER_4 * const kiss_seed_3 = kiss_seed + 8;
+#endif
+
+/* kiss_random_kernel() returns an integer value in the range of
+   (0, GFC_UINTEGER_4_HUGE].  The distribution of pseudorandom numbers
+   should be uniform.  */
+
+static GFC_UINTEGER_4
+kiss_random_kernel(GFC_UINTEGER_4 * seed)
+{
+  GFC_UINTEGER_4 kiss;
+
+  seed[0] = 69069 * seed[0] + 1327217885;
+  seed[1] = GFC_SL(GFC_SR(GFC_SL(seed[1],13),17),5);
+  seed[2] = 18000 * (seed[2] & 65535) + (seed[2] >> 16);
+  seed[3] = 30903 * (seed[3] & 65535) + (seed[3] >> 16);
+  kiss = seed[0] + seed[1] + (seed[2] << 16) + seed[3];
+
+  return kiss;
+}
+
+/*  This function produces a REAL(4) value from the uniform distribution
+    with range [0,1).  */
+
+void
+random_r4 (GFC_REAL_4 *x)
+{
+  GFC_UINTEGER_4 kiss;
+
+  __gthread_mutex_lock (&random_lock);
+  kiss = kiss_random_kernel (kiss_seed_1);
+  rnumber_4 (x, kiss);
+  __gthread_mutex_unlock (&random_lock);
+}
+iexport(random_r4);
+
+/*  This function produces a REAL(8) value from the uniform distribution
+    with range [0,1).  */
+
+void
+random_r8 (GFC_REAL_8 *x)
+{
+  GFC_UINTEGER_8 kiss;
+
+  __gthread_mutex_lock (&random_lock);
+  kiss = ((GFC_UINTEGER_8) kiss_random_kernel (kiss_seed_1)) << 32;
+  kiss += kiss_random_kernel (kiss_seed_2);
+  rnumber_8 (x, kiss);
+  __gthread_mutex_unlock (&random_lock);
+}
+iexport(random_r8);
+
+#ifdef HAVE_GFC_REAL_10
+
+/*  This function produces a REAL(10) value from the uniform distribution
+    with range [0,1).  */
+
+void
+random_r10 (GFC_REAL_10 *x)
+{
+  GFC_UINTEGER_8 kiss;
+
+  __gthread_mutex_lock (&random_lock);
+  kiss = ((GFC_UINTEGER_8) kiss_random_kernel (kiss_seed_1)) << 32;
+  kiss += kiss_random_kernel (kiss_seed_2);
+  rnumber_10 (x, kiss);
+  __gthread_mutex_unlock (&random_lock);
+}
+iexport(random_r10);
+
+#endif
+
+/*  This function produces a REAL(16) value from the uniform distribution
+    with range [0,1).  */
+
+#ifdef HAVE_GFC_REAL_16
+
+void
+random_r16 (GFC_REAL_16 *x)
+{
+  GFC_UINTEGER_8 kiss1, kiss2;
+
+  __gthread_mutex_lock (&random_lock);
+  kiss1 = ((GFC_UINTEGER_8) kiss_random_kernel (kiss_seed_1)) << 32;
+  kiss1 += kiss_random_kernel (kiss_seed_2);
+
+  kiss2 = ((GFC_UINTEGER_8) kiss_random_kernel (kiss_seed_3)) << 32;
+  kiss2 += kiss_random_kernel (kiss_seed_3);
+
+  rnumber_16 (x, kiss1, kiss2);
+  __gthread_mutex_unlock (&random_lock);
+}
+iexport(random_r16);
+
+
+#endif
+/*  This function fills a REAL(4) array with values from the uniform
+    distribution with range [0,1).  */
+
+void
+arandom_r4 (gfc_array_r4 *x)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  GFC_REAL_4 *dest;
+  GFC_UINTEGER_4 kiss;
+  int n;
+
+  dest = x->data;
+
+  dim = GFC_DESCRIPTOR_RANK (x);
+
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(x,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(x,n);
+      if (extent[n] <= 0)
+        return;
+    }
+
+  stride0 = stride[0];
+
+  __gthread_mutex_lock (&random_lock);
+
+  while (dest)
+    {
+      /* random_r4 (dest);  */
+      kiss = kiss_random_kernel (kiss_seed_1);
+      rnumber_4 (dest, kiss);
+
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+  __gthread_mutex_unlock (&random_lock);
+}
+
+/*  This function fills a REAL(8) array with values from the uniform
+    distribution with range [0,1).  */
+
+void
+arandom_r8 (gfc_array_r8 *x)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  GFC_REAL_8 *dest;
+  GFC_UINTEGER_8 kiss;
+  int n;
+
+  dest = x->data;
+
+  dim = GFC_DESCRIPTOR_RANK (x);
+
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(x,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(x,n);
+      if (extent[n] <= 0)
+        return;
+    }
+
+  stride0 = stride[0];
+
+  __gthread_mutex_lock (&random_lock);
+
+  while (dest)
+    {
+      /* random_r8 (dest);  */
+      kiss = ((GFC_UINTEGER_8) kiss_random_kernel (kiss_seed_1)) << 32;
+      kiss += kiss_random_kernel (kiss_seed_2);
+      rnumber_8 (dest, kiss);
+
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+  __gthread_mutex_unlock (&random_lock);
+}
+
+#ifdef HAVE_GFC_REAL_10
+
+/*  This function fills a REAL(10) array with values from the uniform
+    distribution with range [0,1).  */
+
+void
+arandom_r10 (gfc_array_r10 *x)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  GFC_REAL_10 *dest;
+  GFC_UINTEGER_8 kiss;
+  int n;
+
+  dest = x->data;
+
+  dim = GFC_DESCRIPTOR_RANK (x);
+
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(x,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(x,n);
+      if (extent[n] <= 0)
+        return;
+    }
+
+  stride0 = stride[0];
+
+  __gthread_mutex_lock (&random_lock);
+
+  while (dest)
+    {
+      /* random_r10 (dest);  */
+      kiss = ((GFC_UINTEGER_8) kiss_random_kernel (kiss_seed_1)) << 32;
+      kiss += kiss_random_kernel (kiss_seed_2);
+      rnumber_10 (dest, kiss);
+
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+  __gthread_mutex_unlock (&random_lock);
+}
+
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+
+/*  This function fills a REAL(16) array with values from the uniform
+    distribution with range [0,1).  */
+
+void
+arandom_r16 (gfc_array_r16 *x)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  GFC_REAL_16 *dest;
+  GFC_UINTEGER_8 kiss1, kiss2;
+  int n;
+
+  dest = x->data;
+
+  dim = GFC_DESCRIPTOR_RANK (x);
+
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(x,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(x,n);
+      if (extent[n] <= 0)
+        return;
+    }
+
+  stride0 = stride[0];
+
+  __gthread_mutex_lock (&random_lock);
+
+  while (dest)
+    {
+      /* random_r16 (dest);  */
+      kiss1 = ((GFC_UINTEGER_8) kiss_random_kernel (kiss_seed_1)) << 32;
+      kiss1 += kiss_random_kernel (kiss_seed_2);
+
+      kiss2 = ((GFC_UINTEGER_8) kiss_random_kernel (kiss_seed_3)) << 32;
+      kiss2 += kiss_random_kernel (kiss_seed_3);
+
+      rnumber_16 (dest, kiss1, kiss2);
+
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+  __gthread_mutex_unlock (&random_lock);
+}
+
+#endif
+
+
+
+static void
+scramble_seed (unsigned char *dest, unsigned char *src, int size)
+{
+  int i;
+
+  for (i = 0; i < size; i++)
+    dest[(i % 2) * (size / 2) + i / 2] = src[i];
+}
+
+
+static void
+unscramble_seed (unsigned char *dest, unsigned char *src, int size)
+{
+  int i;
+
+  for (i = 0; i < size; i++)
+    dest[i] = src[(i % 2) * (size / 2) + i / 2];
+}
+
+
+
+/* random_seed is used to seed the PRNG with either a default
+   set of seeds or user specified set of seeds.  random_seed
+   must be called with no argument or exactly one argument.  */
+
+void
+random_seed_i4 (GFC_INTEGER_4 *size, gfc_array_i4 *put, gfc_array_i4 *get)
+{
+  int i;
+  unsigned char seed[4*kiss_size];
+
+  __gthread_mutex_lock (&random_lock);
+
+  /* Check that we only have one argument present.  */
+  if ((size ? 1 : 0) + (put ? 1 : 0) + (get ? 1 : 0) > 1)
+    runtime_error ("RANDOM_SEED should have at most one argument present.");
+
+  /* From the standard: "If no argument is present, the processor assigns
+     a processor-dependent value to the seed."  */
+  if (size == NULL && put == NULL && get == NULL)
+      for (i = 0; i < kiss_size; i++)
+       kiss_seed[i] = kiss_default_seed[i];
+
+  if (size != NULL)
+    *size = kiss_size;
+
+  if (put != NULL)
+    {
+      /* If the rank of the array is not 1, abort.  */
+      if (GFC_DESCRIPTOR_RANK (put) != 1)
+        runtime_error ("Array rank of PUT is not 1.");
+
+      /* If the array is too small, abort.  */
+      if (GFC_DESCRIPTOR_EXTENT(put,0) < kiss_size)
+        runtime_error ("Array size of PUT is too small.");
+
+      /*  We copy the seed given by the user.  */
+      for (i = 0; i < kiss_size; i++)
+       memcpy (seed + i * sizeof(GFC_UINTEGER_4),
+               &(put->data[(kiss_size - 1 - i) * GFC_DESCRIPTOR_STRIDE(put,0)]),
+               sizeof(GFC_UINTEGER_4));
+
+      /* We put it after scrambling the bytes, to paper around users who
+        provide seeds with quality only in the lower or upper part.  */
+      scramble_seed ((unsigned char *) kiss_seed, seed, 4*kiss_size);
+    }
+
+  /* Return the seed to GET data.  */
+  if (get != NULL)
+    {
+      /* If the rank of the array is not 1, abort.  */
+      if (GFC_DESCRIPTOR_RANK (get) != 1)
+       runtime_error ("Array rank of GET is not 1.");
+
+      /* If the array is too small, abort.  */
+      if (GFC_DESCRIPTOR_EXTENT(get,0) < kiss_size)
+       runtime_error ("Array size of GET is too small.");
+
+      /* Unscramble the seed.  */
+      unscramble_seed (seed, (unsigned char *) kiss_seed, 4*kiss_size);
+
+      /*  Then copy it back to the user variable.  */
+      for (i = 0; i < kiss_size; i++)
+       memcpy (&(get->data[(kiss_size - 1 - i) * GFC_DESCRIPTOR_STRIDE(get,0)]),
+               seed + i * sizeof(GFC_UINTEGER_4),
+               sizeof(GFC_UINTEGER_4));
+    }
+
+  __gthread_mutex_unlock (&random_lock);
+}
+iexport(random_seed_i4);
+
+
+void
+random_seed_i8 (GFC_INTEGER_8 *size, gfc_array_i8 *put, gfc_array_i8 *get)
+{
+  int i;
+
+  __gthread_mutex_lock (&random_lock);
+
+  /* Check that we only have one argument present.  */
+  if ((size ? 1 : 0) + (put ? 1 : 0) + (get ? 1 : 0) > 1)
+    runtime_error ("RANDOM_SEED should have at most one argument present.");
+
+  /* From the standard: "If no argument is present, the processor assigns
+     a processor-dependent value to the seed."  */
+  if (size == NULL && put == NULL && get == NULL)
+      for (i = 0; i < kiss_size; i++)
+       kiss_seed[i] = kiss_default_seed[i];
+
+  if (size != NULL)
+    *size = kiss_size / 2;
+
+  if (put != NULL)
+    {
+      /* If the rank of the array is not 1, abort.  */
+      if (GFC_DESCRIPTOR_RANK (put) != 1)
+        runtime_error ("Array rank of PUT is not 1.");
+
+      /* If the array is too small, abort.  */
+      if (GFC_DESCRIPTOR_EXTENT(put,0) < kiss_size / 2)
+        runtime_error ("Array size of PUT is too small.");
+
+      /*  This code now should do correct strides.  */
+      for (i = 0; i < kiss_size / 2; i++)
+       memcpy (&kiss_seed[2*i], &(put->data[i * GFC_DESCRIPTOR_STRIDE(put,0)]),
+               sizeof (GFC_UINTEGER_8));
+    }
+
+  /* Return the seed to GET data.  */
+  if (get != NULL)
+    {
+      /* If the rank of the array is not 1, abort.  */
+      if (GFC_DESCRIPTOR_RANK (get) != 1)
+       runtime_error ("Array rank of GET is not 1.");
+
+      /* If the array is too small, abort.  */
+      if (GFC_DESCRIPTOR_EXTENT(get,0) < kiss_size / 2)
+       runtime_error ("Array size of GET is too small.");
+
+      /*  This code now should do correct strides.  */
+      for (i = 0; i < kiss_size / 2; i++)
+       memcpy (&(get->data[i * GFC_DESCRIPTOR_STRIDE(get,0)]), &kiss_seed[2*i],
+               sizeof (GFC_UINTEGER_8));
+    }
+
+  __gthread_mutex_unlock (&random_lock);
+}
+iexport(random_seed_i8);
+
+
+#ifndef __GTHREAD_MUTEX_INIT
+static void __attribute__((constructor))
+init (void)
+{
+  __GTHREAD_MUTEX_INIT_FUNCTION (&random_lock);
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/rename.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/rename.c
new file mode 100644 (file)
index 0000000..0d7dd16
--- /dev/null
@@ -0,0 +1,125 @@
+/* Implementation of the RENAME intrinsic.
+   Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+#include <string.h>
+
+/* SUBROUTINE RENAME(PATH1, PATH2, STATUS)
+   CHARACTER(len=*), INTENT(IN) :: PATH1, PATH2
+   INTEGER, INTENT(OUT), OPTIONAL :: STATUS  */
+
+extern void rename_i4_sub (char *, char *, GFC_INTEGER_4 *, gfc_charlen_type,
+                          gfc_charlen_type);
+iexport_proto(rename_i4_sub);
+
+void
+rename_i4_sub (char *path1, char *path2, GFC_INTEGER_4 *status,
+              gfc_charlen_type path1_len, gfc_charlen_type path2_len)
+{
+  int val;
+  char *str1, *str2;
+
+  /* Trim trailing spaces from paths.  */
+  while (path1_len > 0 && path1[path1_len - 1] == ' ')
+    path1_len--;
+  while (path2_len > 0 && path2[path2_len - 1] == ' ')
+    path2_len--;
+
+  /* Make a null terminated copy of the strings.  */
+  str1 = gfc_alloca (path1_len + 1);
+  memcpy (str1, path1, path1_len);
+  str1[path1_len] = '\0'; 
+
+  str2 = gfc_alloca (path2_len + 1);
+  memcpy (str2, path2, path2_len);
+  str2[path2_len] = '\0'; 
+
+  val = rename (str1, str2);
+
+  if (status != NULL) 
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(rename_i4_sub);
+
+extern void rename_i8_sub (char *, char *, GFC_INTEGER_8 *, gfc_charlen_type,
+                          gfc_charlen_type);
+iexport_proto(rename_i8_sub);
+
+void
+rename_i8_sub (char *path1, char *path2, GFC_INTEGER_8 *status,
+              gfc_charlen_type path1_len, gfc_charlen_type path2_len)
+{
+  int val;
+  char *str1, *str2;
+
+  /* Trim trailing spaces from paths.  */
+  while (path1_len > 0 && path1[path1_len - 1] == ' ')
+    path1_len--;
+  while (path2_len > 0 && path2[path2_len - 1] == ' ')
+    path2_len--;
+
+  /* Make a null terminated copy of the strings.  */
+  str1 = gfc_alloca (path1_len + 1);
+  memcpy (str1, path1, path1_len);
+  str1[path1_len] = '\0'; 
+
+  str2 = gfc_alloca (path2_len + 1);
+  memcpy (str2, path2, path2_len);
+  str2[path2_len] = '\0'; 
+
+  val = rename (str1, str2);
+
+  if (status != NULL) 
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(rename_i8_sub);
+
+extern GFC_INTEGER_4 rename_i4 (char *, char *, gfc_charlen_type,
+                               gfc_charlen_type);
+export_proto(rename_i4);
+
+GFC_INTEGER_4
+rename_i4 (char *path1, char *path2, gfc_charlen_type path1_len,
+          gfc_charlen_type path2_len)
+{
+  GFC_INTEGER_4 val;
+  rename_i4_sub (path1, path2, &val, path1_len, path2_len);
+  return val;
+}
+
+extern GFC_INTEGER_8 rename_i8 (char *, char *, gfc_charlen_type,
+                               gfc_charlen_type);
+export_proto(rename_i8);
+
+GFC_INTEGER_8
+rename_i8 (char *path1, char *path2, gfc_charlen_type path1_len,
+          gfc_charlen_type path2_len)
+{
+  GFC_INTEGER_8 val;
+  rename_i8_sub (path1, path2, &val, path1_len, path2_len);
+  return val;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/reshape_generic.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/reshape_generic.c
new file mode 100644 (file)
index 0000000..5b39711
--- /dev/null
@@ -0,0 +1,388 @@
+/* Generic implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type;
+typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) parray;
+
+static void
+reshape_internal (parray *ret, parray *source, shape_type *shape,
+                 parray *pad, shape_type *order, index_type size)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  char * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const char *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const char *pptr;
+
+  const char *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+       {
+         shape_data[n] = 0;
+         shape_empty = 1;
+       }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n],0,rex - 1,rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+       alloc_size = 1;
+      else
+       alloc_size = rs * size;
+
+      ret->data = internal_malloc_size (alloc_size);
+
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+              pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= size;
+      ssize *= size;
+      psize *= size;
+      reshape_packed (ret->data, rsize, source->data, ssize,
+                     pad ? pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0] * size;
+  sstride0 = sstride[0] * size;
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0] * size;
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      memcpy(rptr, src, size);
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n] * size;
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n] * size;
+            }
+       }
+
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n] * size;
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0] * size;
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n] * size;
+            }
+        }
+    }
+}
+
+extern void reshape (parray *, parray *, shape_type *, parray *, shape_type *);
+export_proto(reshape);
+
+void
+reshape (parray *ret, parray *source, shape_type *shape, parray *pad,
+        shape_type *order)
+{
+  reshape_internal (ret, source, shape, pad, order,
+                   GFC_DESCRIPTOR_SIZE (source));
+}
+
+
+extern void reshape_char (parray *, gfc_charlen_type, parray *, shape_type *,
+                         parray *, shape_type *, gfc_charlen_type,
+                         gfc_charlen_type);
+export_proto(reshape_char);
+
+void
+reshape_char (parray *ret, gfc_charlen_type ret_length __attribute__((unused)),
+             parray *source, shape_type *shape, parray *pad,
+             shape_type *order, gfc_charlen_type source_length,
+             gfc_charlen_type pad_length __attribute__((unused)))
+{
+  reshape_internal (ret, source, shape, pad, order, source_length);
+}
+
+
+extern void reshape_char4 (parray *, gfc_charlen_type, parray *, shape_type *,
+                          parray *, shape_type *, gfc_charlen_type,
+                          gfc_charlen_type);
+export_proto(reshape_char4);
+
+void
+reshape_char4 (parray *ret, gfc_charlen_type ret_length __attribute__((unused)),
+              parray *source, shape_type *shape, parray *pad,
+              shape_type *order, gfc_charlen_type source_length,
+              gfc_charlen_type pad_length __attribute__((unused)))
+{
+  reshape_internal (ret, source, shape, pad, order,
+                   source_length * sizeof (gfc_char4_t));
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/reshape_packed.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/reshape_packed.c
new file mode 100644 (file)
index 0000000..25cbcf7
--- /dev/null
@@ -0,0 +1,49 @@
+/* Implementation of the RESHAPE intrinsic for packed arrays
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <string.h>
+
+/* Reshape function where all arrays are packed.  Basically just memcpy.  */
+
+void
+reshape_packed (char * restrict ret, index_type rsize, const char * source,
+               index_type ssize, const char * pad, index_type psize)
+{
+  index_type size;
+
+  size = (rsize > ssize) ? ssize : rsize;
+  memcpy (ret, source, size);
+  ret += size;
+  rsize -= size;
+  while (rsize > 0)
+    {
+      size = (rsize > psize) ? psize : rsize;
+      memcpy (ret, pad, size);
+      ret += size;
+      rsize -= size;
+    }
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/selected_char_kind.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/selected_char_kind.c
new file mode 100644 (file)
index 0000000..541c073
--- /dev/null
@@ -0,0 +1,46 @@
+/* Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+#include "libgfortran.h"
+
+#include <string.h>
+
+
+extern GFC_INTEGER_4 selected_char_kind (gfc_charlen_type, char *);
+export_proto(selected_char_kind);
+
+GFC_INTEGER_4
+selected_char_kind (gfc_charlen_type name_len, char *name)
+{
+  gfc_charlen_type len = fstrlen (name, name_len);
+
+  if ((len == 5 && strncasecmp (name, "ascii", 5) == 0)
+      || (len == 7 && strncasecmp (name, "default", 7) == 0))
+    return 1;
+  else if (len == 9 && strncasecmp (name, "iso_10646", 9) == 0)
+    return 4;
+  else
+    return -1;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/selected_int_kind.f90 b/l4/pkg/libgfortran/lib/contrib/intrinsics/selected_int_kind.f90
new file mode 100644 (file)
index 0000000..8b5aa54
--- /dev/null
@@ -0,0 +1,46 @@
+!   Copyright 2003, 2004, 2009 Free Software Foundation, Inc.
+!   Contributed by Kejia Zhao <kejia_zh@yahoo.com.cn>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!Libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+!
+!Libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+
+function _gfortran_selected_int_kind (r)
+  implicit none
+  integer, intent (in) :: r
+  integer :: _gfortran_selected_int_kind
+  integer :: i
+  ! Integer kind_range table
+  type :: int_info
+    integer :: kind
+    integer :: range
+  end type int_info
+
+  include "selected_int_kind.inc"
+
+  do i = 1, c
+    if (r <= int_infos (i) % range) then
+      _gfortran_selected_int_kind = int_infos (i) % kind
+      return
+    end if
+  end do
+  _gfortran_selected_int_kind = -1
+  return
+end function
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/selected_real_kind.f90 b/l4/pkg/libgfortran/lib/contrib/intrinsics/selected_real_kind.f90
new file mode 100644 (file)
index 0000000..92708d7
--- /dev/null
@@ -0,0 +1,95 @@
+!   Copyright 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
+!   Contributed by Kejia Zhao <kejia_zh@yahoo.com.cn>
+!
+!This file is part of the GNU Fortran runtime library (libgfortran).
+!
+!Libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+!
+!Libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+
+function _gfortran_selected_real_kind2008 (p, r, rdx)
+  implicit none
+  integer, optional, intent (in) :: p, r, rdx
+  integer :: _gfortran_selected_real_kind2008
+  integer :: i, p2, r2, radix2
+  logical :: found_p, found_r, found_radix
+  ! Real kind_precision_range table
+  type :: real_info
+    integer :: kind
+    integer :: precision
+    integer :: range
+    integer :: radix
+  end type real_info
+
+  include "selected_real_kind.inc"
+
+  _gfortran_selected_real_kind2008 = 0
+  p2 = 0
+  r2 = 0
+  radix2 = 0
+  found_p = .false.
+  found_r = .false.
+  found_radix = .false.
+
+  if (present (p)) p2 = p
+  if (present (r)) r2 = r
+  if (present (rdx)) radix2 = rdx
+
+  ! Assumes each type has a greater precision and range than previous one.
+
+  do i = 1, c
+    if (p2 <= real_infos (i) % precision) found_p = .true.
+    if (r2 <= real_infos (i) % range) found_r = .true.
+    if (radix2 <= real_infos (i) % radix) found_radix = .true.
+
+    if (p2 <= real_infos (i) % precision   &
+        .and. r2 <= real_infos (i) % range &
+        .and. radix2 <= real_infos (i) % radix) then
+      _gfortran_selected_real_kind2008 = real_infos (i) % kind
+      return
+    end if
+  end do
+
+  if (found_radix .and. found_r .and. .not. found_p) then
+    _gfortran_selected_real_kind2008 = -1
+  elseif (found_radix .and. found_p .and. .not. found_r) then
+    _gfortran_selected_real_kind2008 = -2
+  elseif (found_radix .and. .not. found_p .and. .not. found_r) then
+    _gfortran_selected_real_kind2008 = -3
+  elseif (found_radix) then
+    _gfortran_selected_real_kind2008 = -4
+  else
+    _gfortran_selected_real_kind2008 = -5
+  end if
+end function _gfortran_selected_real_kind2008
+
+function _gfortran_selected_real_kind (p, r)
+  implicit none
+  integer, optional, intent (in) :: p, r
+  integer :: _gfortran_selected_real_kind
+
+  interface
+    function _gfortran_selected_real_kind2008 (p, r, rdx)
+      implicit none
+      integer, optional, intent (in) :: p, r, rdx
+      integer :: _gfortran_selected_real_kind2008
+    end function _gfortran_selected_real_kind2008
+  end interface
+
+  _gfortran_selected_real_kind = _gfortran_selected_real_kind2008 (p, r)
+end function
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/signal.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/signal.c
new file mode 100644 (file)
index 0000000..85179ee
--- /dev/null
@@ -0,0 +1,229 @@
+/* Implementation of the SIGNAL and ALARM g77 intrinsics
+   Copyright (C) 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <signal.h>
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#include <errno.h>
+
+/* SIGNAL subroutine with PROCEDURE as handler  */
+extern void signal_sub (int *, void (*)(int), int *);
+iexport_proto(signal_sub);
+
+void
+signal_sub (int *number, void (*handler)(int), int *status)
+{
+  intptr_t ret;
+
+  if (status != NULL)
+    {
+      ret = (intptr_t) signal (*number, handler);
+      *status = (int) ret;
+    }
+  else
+    signal (*number, handler);
+}
+iexport(signal_sub);
+
+
+/* SIGNAL subroutine with INTEGER as handler  */
+extern void signal_sub_int (int *, int *, int *);
+iexport_proto(signal_sub_int);
+
+void
+signal_sub_int (int *number, int *handler, int *status)
+{
+  intptr_t ptr = *handler, ret;
+
+  if (status != NULL)
+    {
+      ret = (intptr_t) signal (*number, (void (*)(int)) ptr);
+      *status = (int) ret;
+    }
+  else
+    signal (*number, (void (*)(int)) ptr);
+}
+iexport(signal_sub_int);
+
+
+/* SIGNAL function with PROCEDURE as handler  */
+extern int signal_func (int *, void (*)(int));
+iexport_proto(signal_func);
+
+int
+signal_func (int *number, void (*handler)(int))
+{
+  int status;
+  signal_sub (number, handler, &status);
+  return status;
+}
+iexport(signal_func);
+
+
+/* SIGNAL function with INTEGER as handler  */
+extern int signal_func_int (int *, int *);
+iexport_proto(signal_func_int);
+
+int
+signal_func_int (int *number, int *handler)
+{
+  int status;
+  signal_sub_int (number, handler, &status);
+  return status;
+}
+iexport(signal_func_int);
+
+
+
+/* ALARM intrinsic with PROCEDURE as handler  */
+extern void alarm_sub_i4 (int *, void (*)(int), GFC_INTEGER_4 *);
+iexport_proto(alarm_sub_i4);
+
+void
+alarm_sub_i4 (int * seconds __attribute__ ((unused)),
+             void (*handler)(int) __attribute__ ((unused)),
+             GFC_INTEGER_4 *status)
+{
+#if defined (SIGALRM) && defined (HAVE_ALARM) 
+  if (status != NULL)
+    {
+      if (signal (SIGALRM, handler) == SIG_ERR)
+       *status = -1;
+      else
+       *status = alarm (*seconds);
+    }
+  else
+    {
+      signal (SIGALRM, handler);
+      alarm (*seconds);
+    }
+#else
+  errno = ENOSYS;
+  if (status != NULL)
+    *status = -1;
+#endif
+}
+iexport(alarm_sub_i4);
+
+
+extern void alarm_sub_i8 (int *, void (*)(int), GFC_INTEGER_8 *);
+iexport_proto(alarm_sub_i8);
+
+void
+alarm_sub_i8 (int *seconds __attribute__ ((unused)),
+             void (*handler)(int) __attribute__ ((unused)),
+             GFC_INTEGER_8 *status)
+{
+#if defined (SIGALRM) && defined (HAVE_ALARM)
+  if (status != NULL)
+    {
+      if (signal (SIGALRM, handler) == SIG_ERR)
+       *status = -1;
+      else
+       *status = alarm (*seconds);
+    }
+  else
+    {
+      signal (SIGALRM, handler);
+      alarm (*seconds);
+    }
+#else
+  errno = ENOSYS;
+  if (status != NULL)
+    *status = -1;
+#endif
+}
+iexport(alarm_sub_i8);
+
+
+/* ALARM intrinsic with INTEGER as handler  */
+extern void alarm_sub_int_i4 (int *, int *, GFC_INTEGER_4 *);
+iexport_proto(alarm_sub_int_i4);
+
+void
+alarm_sub_int_i4 (int *seconds __attribute__ ((unused)),
+                 int *handler __attribute__ ((unused)),
+                 GFC_INTEGER_4 *status)
+{
+#if defined (SIGALRM) && defined (HAVE_ALARM)
+  if (status != NULL)
+    {
+      if (signal (SIGALRM, (void (*)(int)) (intptr_t) *handler) == SIG_ERR)
+       *status = -1;
+      else
+       *status = alarm (*seconds);
+    }
+  else
+    {
+      signal (SIGALRM, (void (*)(int)) (intptr_t) *handler);
+      alarm (*seconds);
+    }
+#else
+  errno = ENOSYS;
+  if (status != NULL)
+    *status = -1;
+#endif
+}
+iexport(alarm_sub_int_i4);
+
+
+extern void alarm_sub_int_i8 (int *, int *, GFC_INTEGER_8 *);
+iexport_proto(alarm_sub_int_i8);
+
+void
+alarm_sub_int_i8 (int *seconds __attribute__ ((unused)),
+                 int *handler __attribute__ ((unused)),
+                 GFC_INTEGER_8 *status)
+{
+#if defined (SIGALRM) && defined (HAVE_ALARM)
+  if (status != NULL)
+    {
+      if (signal (SIGALRM, (void (*)(int)) (intptr_t) *handler) == SIG_ERR)
+       *status = -1;
+      else
+       *status = alarm (*seconds);
+    }
+  else
+    {
+      signal (SIGALRM, (void (*)(int)) (intptr_t) *handler);
+      alarm (*seconds);
+    }
+#else
+  errno = ENOSYS;
+  if (status != NULL)
+    *status = -1;
+#endif
+}
+iexport(alarm_sub_int_i8);
+
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/size.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/size.c
new file mode 100644 (file)
index 0000000..6127c4e
--- /dev/null
@@ -0,0 +1,61 @@
+/* Implementation of the size intrinsic.
+   Copyright 2002, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+index_type
+size0 (const array_t * array)
+{
+  int n;
+  index_type size;
+  index_type len;
+
+  size = 1;
+  for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++)
+    {
+      len = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (len < 0)
+        len = 0;
+      size *= len;
+    }
+  return size;
+}
+iexport(size0);
+
+extern index_type size1 (const array_t * array, index_type dim);
+export_proto(size1);
+
+index_type
+size1 (const array_t * array, index_type dim)
+{
+  index_type size;
+
+  dim--;
+
+  size = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (size < 0)
+    size = 0;
+  return size;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/sleep.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/sleep.c
new file mode 100644 (file)
index 0000000..6f7ea22
--- /dev/null
@@ -0,0 +1,67 @@
+/* Implementation of the SLEEP intrinsic.
+   Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef __MINGW32__
+# include <windows.h>
+# undef sleep
+# define sleep(x) Sleep(1000*(x))
+# define HAVE_SLEEP 1
+#endif
+
+/* SUBROUTINE SLEEP(SECONDS)
+   INTEGER, INTENT(IN) :: SECONDS
+   
+   A choice had to be made if SECONDS is negative. For g77, this is
+   equivalent to SLEEP(0).  */
+
+#ifdef HAVE_SLEEP
+extern void sleep_i4_sub (GFC_INTEGER_4 *);
+iexport_proto(sleep_i4_sub);
+
+void
+sleep_i4_sub (GFC_INTEGER_4 *seconds)
+{
+  sleep (*seconds < 0 ? 0 : (unsigned int) *seconds);
+}
+iexport(sleep_i4_sub);
+
+extern void sleep_i8_sub (GFC_INTEGER_8 *);
+iexport_proto(sleep_i8_sub);
+
+void
+sleep_i8_sub (GFC_INTEGER_8 *seconds)
+{
+  sleep (*seconds < 0 ? 0 : (unsigned int) *seconds);
+}
+iexport(sleep_i8_sub);
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/spread_generic.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/spread_generic.c
new file mode 100644 (file)
index 0000000..2eeb24b
--- /dev/null
@@ -0,0 +1,652 @@
+/* Generic implementation of the SPREAD intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+static void
+spread_internal (gfc_array_char *ret, const gfc_array_char *source,
+                const index_type *along, const index_type *pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  char *rptr;
+  char *dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const char *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+  index_type size;
+
+  size = GFC_DESCRIPTOR_SIZE(source);
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (*along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = *pncopies;
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+
+      size_t ub, stride;
+
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == *along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs * size;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE_BYTES(source,dim);
+             rstride[dim] = rs * size;
+
+             ub = extent[dim]-1;
+             rs *= extent[dim];
+             dim++;
+           }
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * size);
+
+      if (rs <= 0)
+       return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (compile_options.bounds_check)
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == *along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE_BYTES(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE_BYTES(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == *along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE_BYTES(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE_BYTES(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = size;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+          memcpy (dest, sptr, size);
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+static void
+spread_internal_scalar (gfc_array_char *ret, const char *source,
+                       const index_type *along, const index_type *pncopies)
+{
+  int n;
+  int ncopies = *pncopies;
+  char * dest;
+  size_t size;
+
+  size = GFC_DESCRIPTOR_SIZE(ret);
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (*along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * size);
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0)  - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  for (n = 0; n < ncopies; n++)
+    {
+      dest = (char*)(ret->data + n * GFC_DESCRIPTOR_STRIDE_BYTES(ret,0));
+      memcpy (dest , source, size);
+    }
+}
+
+extern void spread (gfc_array_char *, const gfc_array_char *,
+                   const index_type *, const index_type *);
+export_proto(spread);
+
+void
+spread (gfc_array_char *ret, const gfc_array_char *source,
+       const index_type *along, const index_type *pncopies)
+{
+  index_type type_size;
+
+  type_size = GFC_DTYPE_TYPE_SIZE(ret);
+  switch(type_size)
+    {
+    case GFC_DTYPE_DERIVED_1:
+    case GFC_DTYPE_LOGICAL_1:
+    case GFC_DTYPE_INTEGER_1:
+      spread_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) source,
+                *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_LOGICAL_2:
+    case GFC_DTYPE_INTEGER_2:
+      spread_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) source,
+                *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_LOGICAL_4:
+    case GFC_DTYPE_INTEGER_4:
+      spread_i4 ((gfc_array_i4 *) ret, (gfc_array_i4 *) source,
+                *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_LOGICAL_8:
+    case GFC_DTYPE_INTEGER_8:
+      spread_i8 ((gfc_array_i8 *) ret, (gfc_array_i8 *) source,
+                *along, *pncopies);
+      return;
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_LOGICAL_16:
+    case GFC_DTYPE_INTEGER_16:
+      spread_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) source,
+                *along, *pncopies);
+      return;
+#endif
+
+    case GFC_DTYPE_REAL_4:
+      spread_r4 ((gfc_array_r4 *) ret, (gfc_array_r4 *) source,
+                *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_REAL_8:
+      spread_r8 ((gfc_array_r8 *) ret, (gfc_array_r8 *) source,
+                *along, *pncopies);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef GFC_HAVE_REAL_10
+    case GFC_DTYPE_REAL_10:
+      spread_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) source,
+                *along, *pncopies);
+      return;
+# endif
+
+# ifdef GFC_HAVE_REAL_16
+    case GFC_DTYPE_REAL_16:
+      spread_r16 ((gfc_array_r16 *) ret, (gfc_array_r16 *) source,
+                *along, *pncopies);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_COMPLEX_4:
+      spread_c4 ((gfc_array_c4 *) ret, (gfc_array_c4 *) source,
+                *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_COMPLEX_8:
+      spread_c8 ((gfc_array_c8 *) ret, (gfc_array_c8 *) source,
+                *along, *pncopies);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef GFC_HAVE_COMPLEX_10
+    case GFC_DTYPE_COMPLEX_10:
+      spread_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) source,
+                *along, *pncopies);
+      return;
+# endif
+
+# ifdef GFC_HAVE_COMPLEX_16
+    case GFC_DTYPE_COMPLEX_16:
+      spread_c16 ((gfc_array_c16 *) ret, (gfc_array_c16 *) source,
+                *along, *pncopies);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_DERIVED_2:
+      if (GFC_UNALIGNED_2(ret->data) || GFC_UNALIGNED_2(source->data))
+       break;
+      else
+       {
+         spread_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) source,
+                    *along, *pncopies);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_4:
+      if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(source->data))
+       break;
+      else
+       {
+         spread_i4 ((gfc_array_i4 *) ret, (gfc_array_i4 *) source,
+                    *along, *pncopies);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_8:
+      if (GFC_UNALIGNED_8(ret->data) || GFC_UNALIGNED_8(source->data))
+       break;
+      else
+       {
+         spread_i8 ((gfc_array_i8 *) ret, (gfc_array_i8 *) source,
+                    *along, *pncopies);
+         return;
+       }
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_DERIVED_16:
+      if (GFC_UNALIGNED_16(ret->data) || GFC_UNALIGNED_16(source->data))
+       break;
+      else
+       {
+         spread_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) source,
+                     *along, *pncopies);
+         return;
+       }
+#endif
+    }
+
+  spread_internal (ret, source, along, pncopies);
+}
+
+
+extern void spread_char (gfc_array_char *, GFC_INTEGER_4,
+                        const gfc_array_char *, const index_type *,
+                        const index_type *, GFC_INTEGER_4);
+export_proto(spread_char);
+
+void
+spread_char (gfc_array_char *ret,
+            GFC_INTEGER_4 ret_length __attribute__((unused)),
+            const gfc_array_char *source, const index_type *along,
+            const index_type *pncopies,
+            GFC_INTEGER_4 source_length __attribute__((unused)))
+{
+  spread_internal (ret, source, along, pncopies);
+}
+
+
+extern void spread_char4 (gfc_array_char *, GFC_INTEGER_4,
+                         const gfc_array_char *, const index_type *,
+                         const index_type *, GFC_INTEGER_4);
+export_proto(spread_char4);
+
+void
+spread_char4 (gfc_array_char *ret,
+             GFC_INTEGER_4 ret_length __attribute__((unused)),
+             const gfc_array_char *source, const index_type *along,
+             const index_type *pncopies,
+             GFC_INTEGER_4 source_length __attribute__((unused)))
+{
+  spread_internal (ret, source, along, pncopies);
+}
+
+
+/* The following are the prototypes for the versions of spread with a
+   scalar source.  */
+
+extern void spread_scalar (gfc_array_char *, const char *,
+                          const index_type *, const index_type *);
+export_proto(spread_scalar);
+
+void
+spread_scalar (gfc_array_char *ret, const char *source,
+              const index_type *along, const index_type *pncopies)
+{
+  index_type type_size;
+
+  if (!ret->dtype)
+    runtime_error ("return array missing descriptor in spread()");
+
+  type_size = GFC_DTYPE_TYPE_SIZE(ret);
+  switch(type_size)
+    {
+    case GFC_DTYPE_DERIVED_1:
+    case GFC_DTYPE_LOGICAL_1:
+    case GFC_DTYPE_INTEGER_1:
+      spread_scalar_i1 ((gfc_array_i1 *) ret, (GFC_INTEGER_1 *) source,
+                       *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_LOGICAL_2:
+    case GFC_DTYPE_INTEGER_2:
+      spread_scalar_i2 ((gfc_array_i2 *) ret, (GFC_INTEGER_2 *) source,
+                       *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_LOGICAL_4:
+    case GFC_DTYPE_INTEGER_4:
+      spread_scalar_i4 ((gfc_array_i4 *) ret, (GFC_INTEGER_4 *) source,
+                       *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_LOGICAL_8:
+    case GFC_DTYPE_INTEGER_8:
+      spread_scalar_i8 ((gfc_array_i8 *) ret, (GFC_INTEGER_8 *) source,
+                       *along, *pncopies);
+      return;
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_LOGICAL_16:
+    case GFC_DTYPE_INTEGER_16:
+      spread_scalar_i16 ((gfc_array_i16 *) ret, (GFC_INTEGER_16 *) source,
+                       *along, *pncopies);
+      return;
+#endif
+
+    case GFC_DTYPE_REAL_4:
+      spread_scalar_r4 ((gfc_array_r4 *) ret, (GFC_REAL_4 *) source,
+                       *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_REAL_8:
+      spread_scalar_r8 ((gfc_array_r8 *) ret, (GFC_REAL_8 *) source,
+                       *along, *pncopies);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_REAL_10
+    case GFC_DTYPE_REAL_10:
+      spread_scalar_r10 ((gfc_array_r10 *) ret, (GFC_REAL_10 *) source,
+                       *along, *pncopies);
+      return;
+# endif
+
+# ifdef HAVE_GFC_REAL_16
+    case GFC_DTYPE_REAL_16:
+      spread_scalar_r16 ((gfc_array_r16 *) ret, (GFC_REAL_16 *) source,
+                       *along, *pncopies);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_COMPLEX_4:
+      spread_scalar_c4 ((gfc_array_c4 *) ret, (GFC_COMPLEX_4 *) source,
+                       *along, *pncopies);
+      return;
+
+    case GFC_DTYPE_COMPLEX_8:
+      spread_scalar_c8 ((gfc_array_c8 *) ret, (GFC_COMPLEX_8 *) source,
+                       *along, *pncopies);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_COMPLEX_10
+    case GFC_DTYPE_COMPLEX_10:
+      spread_scalar_c10 ((gfc_array_c10 *) ret, (GFC_COMPLEX_10 *) source,
+                       *along, *pncopies);
+      return;
+# endif
+
+# ifdef HAVE_GFC_COMPLEX_16
+    case GFC_DTYPE_COMPLEX_16:
+      spread_scalar_c16 ((gfc_array_c16 *) ret, (GFC_COMPLEX_16 *) source,
+                       *along, *pncopies);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_DERIVED_2:
+      if (GFC_UNALIGNED_2(ret->data) || GFC_UNALIGNED_2(source))
+       break;
+      else
+       {
+         spread_scalar_i2 ((gfc_array_i2 *) ret, (GFC_INTEGER_2 *) source,
+                           *along, *pncopies);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_4:
+      if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(source))
+       break;
+      else
+       {
+         spread_scalar_i4 ((gfc_array_i4 *) ret, (GFC_INTEGER_4 *) source,
+                           *along, *pncopies);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_8:
+      if (GFC_UNALIGNED_8(ret->data) || GFC_UNALIGNED_8(source))
+       break;
+      else
+       {
+         spread_scalar_i8 ((gfc_array_i8 *) ret, (GFC_INTEGER_8 *) source,
+                           *along, *pncopies);
+         return;
+       }
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_DERIVED_16:
+      if (GFC_UNALIGNED_16(ret->data) || GFC_UNALIGNED_16(source))
+       break;
+      else
+       {
+         spread_scalar_i16 ((gfc_array_i16 *) ret, (GFC_INTEGER_16 *) source,
+                            *along, *pncopies);
+         return;
+       }
+#endif
+    }
+
+  spread_internal_scalar (ret, source, along, pncopies);
+}
+
+
+extern void spread_char_scalar (gfc_array_char *, GFC_INTEGER_4,
+                               const char *, const index_type *,
+                               const index_type *, GFC_INTEGER_4);
+export_proto(spread_char_scalar);
+
+void
+spread_char_scalar (gfc_array_char *ret,
+                   GFC_INTEGER_4 ret_length __attribute__((unused)),
+                   const char *source, const index_type *along,
+                   const index_type *pncopies,
+                   GFC_INTEGER_4 source_length __attribute__((unused)))
+{
+  if (!ret->dtype)
+    runtime_error ("return array missing descriptor in spread()");
+  spread_internal_scalar (ret, source, along, pncopies);
+}
+
+
+extern void spread_char4_scalar (gfc_array_char *, GFC_INTEGER_4,
+                                const char *, const index_type *,
+                                const index_type *, GFC_INTEGER_4);
+export_proto(spread_char4_scalar);
+
+void
+spread_char4_scalar (gfc_array_char *ret,
+                    GFC_INTEGER_4 ret_length __attribute__((unused)),
+                    const char *source, const index_type *along,
+                    const index_type *pncopies,
+                    GFC_INTEGER_4 source_length __attribute__((unused)))
+{
+  if (!ret->dtype)
+    runtime_error ("return array missing descriptor in spread()");
+  spread_internal_scalar (ret, source, along, pncopies);
+
+}
+
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/stat.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/stat.c
new file mode 100644 (file)
index 0000000..28821f1
--- /dev/null
@@ -0,0 +1,556 @@
+/* Implementation of the STAT and FSTAT intrinsics.
+   Copyright (C) 2004, 2005, 2006, 2007, 2009, 2011 
+   Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargls@comcast.net>.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <string.h>
+#include <errno.h>
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#include <stdlib.h>
+
+
+#ifdef HAVE_STAT
+
+/* SUBROUTINE STAT(FILE, SARRAY, STATUS)
+   CHARACTER(len=*), INTENT(IN) :: FILE
+   INTEGER, INTENT(OUT), :: SARRAY(13)
+   INTEGER, INTENT(OUT), OPTIONAL :: STATUS
+
+   FUNCTION STAT(FILE, SARRAY)
+   INTEGER STAT
+   CHARACTER(len=*), INTENT(IN) :: FILE
+   INTEGER, INTENT(OUT), :: SARRAY(13)  */
+
+/*extern void stat_i4_sub_0 (char *, gfc_array_i4 *, GFC_INTEGER_4 *,
+                          gfc_charlen_type, int);
+internal_proto(stat_i4_sub_0);*/
+
+static void
+stat_i4_sub_0 (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status,
+              gfc_charlen_type name_len, int is_lstat __attribute__ ((unused)))
+{
+  int val;
+  char *str;
+  struct stat sb;
+
+  /* If the rank of the array is not 1, abort.  */
+  if (GFC_DESCRIPTOR_RANK (sarray) != 1)
+    runtime_error ("Array rank of SARRAY is not 1.");
+
+  /* If the array is too small, abort.  */
+  if (GFC_DESCRIPTOR_EXTENT(sarray,0) < 13)
+    runtime_error ("Array size of SARRAY is too small.");
+
+  /* Trim trailing spaces from name.  */
+  while (name_len > 0 && name[name_len - 1] == ' ')
+    name_len--;
+
+  /* Make a null terminated copy of the string.  */
+  str = gfc_alloca (name_len + 1);
+  memcpy (str, name, name_len);
+  str[name_len] = '\0';
+
+  /* On platforms that don't provide lstat(), we use stat() instead.  */
+#ifdef HAVE_LSTAT
+  if (is_lstat)
+    val = lstat(str, &sb);
+  else
+#endif
+    val = stat(str, &sb);
+
+  if (val == 0)
+    {
+      index_type stride = GFC_DESCRIPTOR_STRIDE(sarray,0);
+
+      /* Device ID  */
+      sarray->data[0 * stride] = sb.st_dev;
+
+      /* Inode number  */
+      sarray->data[1 * stride] = sb.st_ino;
+
+      /* File mode  */
+      sarray->data[2 * stride] = sb.st_mode;
+
+      /* Number of (hard) links  */
+      sarray->data[3 * stride] = sb.st_nlink;
+
+      /* Owner's uid  */
+      sarray->data[4 * stride] = sb.st_uid;
+
+      /* Owner's gid  */
+      sarray->data[5 * stride] = sb.st_gid;
+
+      /* ID of device containing directory entry for file (0 if not available) */
+#if HAVE_STRUCT_STAT_ST_RDEV
+      sarray->data[6 * stride] = sb.st_rdev;
+#else
+      sarray->data[6 * stride] = 0;
+#endif
+
+      /* File size (bytes)  */
+      sarray->data[7 * stride] = sb.st_size;
+
+      /* Last access time  */
+      sarray->data[8 * stride] = sb.st_atime;
+
+      /* Last modification time  */
+      sarray->data[9 * stride] = sb.st_mtime;
+
+      /* Last file status change time  */
+      sarray->data[10 * stride] = sb.st_ctime;
+
+      /* Preferred I/O block size (-1 if not available)  */
+#if HAVE_STRUCT_STAT_ST_BLKSIZE
+      sarray->data[11 * stride] = sb.st_blksize;
+#else
+      sarray->data[11 * stride] = -1;
+#endif
+
+      /* Number of blocks allocated (-1 if not available)  */
+#if HAVE_STRUCT_STAT_ST_BLOCKS
+      sarray->data[12 * stride] = sb.st_blocks;
+#else
+      sarray->data[12 * stride] = -1;
+#endif
+    }
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+
+
+extern void stat_i4_sub (char *, gfc_array_i4 *, GFC_INTEGER_4 *,
+                        gfc_charlen_type);
+iexport_proto(stat_i4_sub);
+
+void
+stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status,
+            gfc_charlen_type name_len)
+{
+  stat_i4_sub_0 (name, sarray, status, name_len, 0);
+}
+iexport(stat_i4_sub);
+
+
+extern void lstat_i4_sub (char *, gfc_array_i4 *, GFC_INTEGER_4 *,
+                        gfc_charlen_type);
+iexport_proto(lstat_i4_sub);
+
+void
+lstat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status,
+            gfc_charlen_type name_len)
+{
+  stat_i4_sub_0 (name, sarray, status, name_len, 1);
+}
+iexport(lstat_i4_sub);
+
+
+
+static void
+stat_i8_sub_0 (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status,
+              gfc_charlen_type name_len, int is_lstat __attribute__ ((unused)))
+{
+  int val;
+  char *str;
+  struct stat sb;
+
+  /* If the rank of the array is not 1, abort.  */
+  if (GFC_DESCRIPTOR_RANK (sarray) != 1)
+    runtime_error ("Array rank of SARRAY is not 1.");
+
+  /* If the array is too small, abort.  */
+  if (GFC_DESCRIPTOR_EXTENT(sarray,0) < 13)
+    runtime_error ("Array size of SARRAY is too small.");
+
+  /* Trim trailing spaces from name.  */
+  while (name_len > 0 && name[name_len - 1] == ' ')
+    name_len--;
+
+  /* Make a null terminated copy of the string.  */
+  str = gfc_alloca (name_len + 1);
+  memcpy (str, name, name_len);
+  str[name_len] = '\0';
+
+  /* On platforms that don't provide lstat(), we use stat() instead.  */
+#ifdef HAVE_LSTAT
+  if (is_lstat)
+    val = lstat(str, &sb);
+  else
+#endif
+    val = stat(str, &sb);
+
+  if (val == 0)
+    {
+      index_type stride = GFC_DESCRIPTOR_STRIDE(sarray,0);
+
+      /* Device ID  */
+      sarray->data[0] = sb.st_dev;
+
+      /* Inode number  */
+      sarray->data[stride] = sb.st_ino;
+
+      /* File mode  */
+      sarray->data[2 * stride] = sb.st_mode;
+
+      /* Number of (hard) links  */
+      sarray->data[3 * stride] = sb.st_nlink;
+
+      /* Owner's uid  */
+      sarray->data[4 * stride] = sb.st_uid;
+
+      /* Owner's gid  */
+      sarray->data[5 * stride] = sb.st_gid;
+
+      /* ID of device containing directory entry for file (0 if not available) */
+#if HAVE_STRUCT_STAT_ST_RDEV
+      sarray->data[6 * stride] = sb.st_rdev;
+#else
+      sarray->data[6 * stride] = 0;
+#endif
+
+      /* File size (bytes)  */
+      sarray->data[7 * stride] = sb.st_size;
+
+      /* Last access time  */
+      sarray->data[8 * stride] = sb.st_atime;
+
+      /* Last modification time  */
+      sarray->data[9 * stride] = sb.st_mtime;
+
+      /* Last file status change time  */
+      sarray->data[10 * stride] = sb.st_ctime;
+
+      /* Preferred I/O block size (-1 if not available)  */
+#if HAVE_STRUCT_STAT_ST_BLKSIZE
+      sarray->data[11 * stride] = sb.st_blksize;
+#else
+      sarray->data[11 * stride] = -1;
+#endif
+
+      /* Number of blocks allocated (-1 if not available)  */
+#if HAVE_STRUCT_STAT_ST_BLOCKS
+      sarray->data[12 * stride] = sb.st_blocks;
+#else
+      sarray->data[12 * stride] = -1;
+#endif
+    }
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+
+
+extern void stat_i8_sub (char *, gfc_array_i8 *, GFC_INTEGER_8 *,
+                        gfc_charlen_type);
+iexport_proto(stat_i8_sub);
+
+void
+stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status,
+            gfc_charlen_type name_len)
+{
+  stat_i8_sub_0 (name, sarray, status, name_len, 0);
+}
+
+iexport(stat_i8_sub);
+
+
+extern void lstat_i8_sub (char *, gfc_array_i8 *, GFC_INTEGER_8 *,
+                        gfc_charlen_type);
+iexport_proto(lstat_i8_sub);
+
+void
+lstat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status,
+            gfc_charlen_type name_len)
+{
+  stat_i8_sub_0 (name, sarray, status, name_len, 1);
+}
+
+iexport(lstat_i8_sub);
+
+
+extern GFC_INTEGER_4 stat_i4 (char *, gfc_array_i4 *, gfc_charlen_type);
+export_proto(stat_i4);
+
+GFC_INTEGER_4
+stat_i4 (char *name, gfc_array_i4 *sarray, gfc_charlen_type name_len)
+{
+  GFC_INTEGER_4 val;
+  stat_i4_sub (name, sarray, &val, name_len);
+  return val;
+}
+
+extern GFC_INTEGER_8 stat_i8 (char *, gfc_array_i8 *, gfc_charlen_type);
+export_proto(stat_i8);
+
+GFC_INTEGER_8
+stat_i8 (char *name, gfc_array_i8 *sarray, gfc_charlen_type name_len)
+{
+  GFC_INTEGER_8 val;
+  stat_i8_sub (name, sarray, &val, name_len);
+  return val;
+}
+
+
+/* SUBROUTINE LSTAT(FILE, SARRAY, STATUS)
+   CHARACTER(len=*), INTENT(IN) :: FILE
+   INTEGER, INTENT(OUT), :: SARRAY(13)
+   INTEGER, INTENT(OUT), OPTIONAL :: STATUS
+
+   FUNCTION LSTAT(FILE, SARRAY)
+   INTEGER LSTAT
+   CHARACTER(len=*), INTENT(IN) :: FILE
+   INTEGER, INTENT(OUT), :: SARRAY(13)  */
+
+extern GFC_INTEGER_4 lstat_i4 (char *, gfc_array_i4 *, gfc_charlen_type);
+export_proto(lstat_i4);
+
+GFC_INTEGER_4
+lstat_i4 (char *name, gfc_array_i4 *sarray, gfc_charlen_type name_len)
+{
+  GFC_INTEGER_4 val;
+  lstat_i4_sub (name, sarray, &val, name_len);
+  return val;
+}
+
+extern GFC_INTEGER_8 lstat_i8 (char *, gfc_array_i8 *, gfc_charlen_type);
+export_proto(lstat_i8);
+
+GFC_INTEGER_8
+lstat_i8 (char *name, gfc_array_i8 *sarray, gfc_charlen_type name_len)
+{
+  GFC_INTEGER_8 val;
+  lstat_i8_sub (name, sarray, &val, name_len);
+  return val;
+}
+
+#endif
+
+
+#ifdef HAVE_FSTAT
+
+/* SUBROUTINE FSTAT(UNIT, SARRAY, STATUS)
+   INTEGER, INTENT(IN) :: UNIT
+   INTEGER, INTENT(OUT) :: SARRAY(13)
+   INTEGER, INTENT(OUT), OPTIONAL :: STATUS
+
+   FUNCTION FSTAT(UNIT, SARRAY)
+   INTEGER FSTAT
+   INTEGER, INTENT(IN) :: UNIT
+   INTEGER, INTENT(OUT) :: SARRAY(13)  */
+
+extern void fstat_i4_sub (GFC_INTEGER_4 *, gfc_array_i4 *, GFC_INTEGER_4 *);
+iexport_proto(fstat_i4_sub);
+
+void
+fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status)
+{
+  int val;
+  struct stat sb;
+
+  /* If the rank of the array is not 1, abort.  */
+  if (GFC_DESCRIPTOR_RANK (sarray) != 1)
+    runtime_error ("Array rank of SARRAY is not 1.");
+
+  /* If the array is too small, abort.  */
+  if (GFC_DESCRIPTOR_EXTENT(sarray,0) < 13)
+    runtime_error ("Array size of SARRAY is too small.");
+
+  /* Convert Fortran unit number to C file descriptor.  */
+  val = unit_to_fd (*unit);
+  if (val >= 0)
+    val = fstat(val, &sb);
+
+  if (val == 0)
+    {
+      index_type stride = GFC_DESCRIPTOR_STRIDE(sarray,0);
+
+      /* Device ID  */
+      sarray->data[0 * stride] = sb.st_dev;
+
+      /* Inode number  */
+      sarray->data[1 * stride] = sb.st_ino;
+
+      /* File mode  */
+      sarray->data[2 * stride] = sb.st_mode;
+
+      /* Number of (hard) links  */
+      sarray->data[3 * stride] = sb.st_nlink;
+
+      /* Owner's uid  */
+      sarray->data[4 * stride] = sb.st_uid;
+
+      /* Owner's gid  */
+      sarray->data[5 * stride] = sb.st_gid;
+
+      /* ID of device containing directory entry for file (0 if not available) */
+#if HAVE_STRUCT_STAT_ST_RDEV
+      sarray->data[6 * stride] = sb.st_rdev;
+#else
+      sarray->data[6 * stride] = 0;
+#endif
+
+      /* File size (bytes)  */
+      sarray->data[7 * stride] = sb.st_size;
+
+      /* Last access time  */
+      sarray->data[8 * stride] = sb.st_atime;
+
+      /* Last modification time  */
+      sarray->data[9 * stride] = sb.st_mtime;
+
+      /* Last file status change time  */
+      sarray->data[10 * stride] = sb.st_ctime;
+
+      /* Preferred I/O block size (-1 if not available)  */
+#if HAVE_STRUCT_STAT_ST_BLKSIZE
+      sarray->data[11 * stride] = sb.st_blksize;
+#else
+      sarray->data[11 * stride] = -1;
+#endif
+
+      /* Number of blocks allocated (-1 if not available)  */
+#if HAVE_STRUCT_STAT_ST_BLOCKS
+      sarray->data[12 * stride] = sb.st_blocks;
+#else
+      sarray->data[12 * stride] = -1;
+#endif
+    }
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(fstat_i4_sub);
+
+extern void fstat_i8_sub (GFC_INTEGER_8 *, gfc_array_i8 *, GFC_INTEGER_8 *);
+iexport_proto(fstat_i8_sub);
+
+void
+fstat_i8_sub (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray, GFC_INTEGER_8 *status)
+{
+  int val;
+  struct stat sb;
+
+  /* If the rank of the array is not 1, abort.  */
+  if (GFC_DESCRIPTOR_RANK (sarray) != 1)
+    runtime_error ("Array rank of SARRAY is not 1.");
+
+  /* If the array is too small, abort.  */
+  if (GFC_DESCRIPTOR_EXTENT(sarray,0) < 13)
+    runtime_error ("Array size of SARRAY is too small.");
+
+  /* Convert Fortran unit number to C file descriptor.  */
+  val = unit_to_fd ((int) *unit);
+  if (val >= 0)
+    val = fstat(val, &sb);
+
+  if (val == 0)
+    {
+      index_type stride = GFC_DESCRIPTOR_STRIDE(sarray,0);
+
+      /* Device ID  */
+      sarray->data[0] = sb.st_dev;
+
+      /* Inode number  */
+      sarray->data[stride] = sb.st_ino;
+
+      /* File mode  */
+      sarray->data[2 * stride] = sb.st_mode;
+
+      /* Number of (hard) links  */
+      sarray->data[3 * stride] = sb.st_nlink;
+
+      /* Owner's uid  */
+      sarray->data[4 * stride] = sb.st_uid;
+
+      /* Owner's gid  */
+      sarray->data[5 * stride] = sb.st_gid;
+
+      /* ID of device containing directory entry for file (0 if not available) */
+#if HAVE_STRUCT_STAT_ST_RDEV
+      sarray->data[6 * stride] = sb.st_rdev;
+#else
+      sarray->data[6 * stride] = 0;
+#endif
+
+      /* File size (bytes)  */
+      sarray->data[7 * stride] = sb.st_size;
+
+      /* Last access time  */
+      sarray->data[8 * stride] = sb.st_atime;
+
+      /* Last modification time  */
+      sarray->data[9 * stride] = sb.st_mtime;
+
+      /* Last file status change time  */
+      sarray->data[10 * stride] = sb.st_ctime;
+
+      /* Preferred I/O block size (-1 if not available)  */
+#if HAVE_STRUCT_STAT_ST_BLKSIZE
+      sarray->data[11 * stride] = sb.st_blksize;
+#else
+      sarray->data[11 * stride] = -1;
+#endif
+
+      /* Number of blocks allocated (-1 if not available)  */
+#if HAVE_STRUCT_STAT_ST_BLOCKS
+      sarray->data[12 * stride] = sb.st_blocks;
+#else
+      sarray->data[12 * stride] = -1;
+#endif
+    }
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(fstat_i8_sub);
+
+extern GFC_INTEGER_4 fstat_i4 (GFC_INTEGER_4 *, gfc_array_i4 *);
+export_proto(fstat_i4);
+
+GFC_INTEGER_4
+fstat_i4 (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray)
+{
+  GFC_INTEGER_4 val;
+  fstat_i4_sub (unit, sarray, &val);
+  return val;
+}
+
+extern GFC_INTEGER_8 fstat_i8 (GFC_INTEGER_8 *, gfc_array_i8 *);
+export_proto(fstat_i8);
+
+GFC_INTEGER_8
+fstat_i8 (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray)
+{
+  GFC_INTEGER_8 val;
+  fstat_i8_sub (unit, sarray, &val);
+  return val;
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/string_intrinsics.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/string_intrinsics.c
new file mode 100644 (file)
index 0000000..a1d3b31
--- /dev/null
@@ -0,0 +1,102 @@
+/* String intrinsics helper functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* Unlike what the name of this file suggests, we don't actually
+   implement the Fortran intrinsics here.  At least, not with the
+   names they have in the standard.  The functions here provide all
+   the support we need for the standard string intrinsics, and the
+   compiler translates the actual intrinsics calls to calls to
+   functions in this file.  */
+
+#include "libgfortran.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+
+/* Helper function to set parts of wide strings to a constant (usually
+   spaces).  */
+
+static gfc_char4_t *
+memset_char4 (gfc_char4_t *b, gfc_char4_t c, size_t len)
+{
+  size_t i;
+
+  for (i = 0; i < len; i++)
+    b[i] = c;
+
+  return b;
+}
+
+/* Compare wide character types, which are handled internally as
+   unsigned 4-byte integers.  */
+int
+memcmp_char4 (const void *a, const void *b, size_t len)
+{
+  const GFC_UINTEGER_4 *pa = a;
+  const GFC_UINTEGER_4 *pb = b;
+  while (len-- > 0)
+    {
+      if (*pa != *pb)
+       return *pa < *pb ? -1 : 1;
+      pa ++;
+      pb ++;
+    }
+  return 0;
+}
+
+
+/* All other functions are defined using a few generic macros in
+   string_intrinsics_inc.c, so we avoid code duplication between the
+   various character type kinds.  */
+
+#undef  CHARTYPE
+#define CHARTYPE char
+#undef  UCHARTYPE
+#define UCHARTYPE unsigned char
+#undef  SUFFIX
+#define SUFFIX(x) x
+#undef  MEMSET
+#define MEMSET memset
+#undef  MEMCMP
+#define MEMCMP memcmp
+
+#include "string_intrinsics_inc.c"
+
+
+#undef  CHARTYPE
+#define CHARTYPE gfc_char4_t
+#undef  UCHARTYPE
+#define UCHARTYPE gfc_char4_t
+#undef  SUFFIX
+#define SUFFIX(x) x ## _char4
+#undef  MEMSET
+#define MEMSET memset_char4
+#undef  MEMCMP
+#define MEMCMP memcmp_char4
+
+#include "string_intrinsics_inc.c"
+
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/string_intrinsics_inc.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/string_intrinsics_inc.c
new file mode 100644 (file)
index 0000000..8335a38
--- /dev/null
@@ -0,0 +1,453 @@
+/* String intrinsics helper functions.
+   Copyright 2002, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* Rename the functions.  */
+#define concat_string SUFFIX(concat_string)
+#define string_len_trim SUFFIX(string_len_trim)
+#define adjustl SUFFIX(adjustl)
+#define adjustr SUFFIX(adjustr)
+#define string_index SUFFIX(string_index)
+#define string_scan SUFFIX(string_scan)
+#define string_verify SUFFIX(string_verify)
+#define string_trim SUFFIX(string_trim)
+#define string_minmax SUFFIX(string_minmax)
+#define zero_length_string SUFFIX(zero_length_string)
+#define compare_string SUFFIX(compare_string)
+
+
+/* The prototypes.  */
+
+extern void concat_string (gfc_charlen_type, CHARTYPE *,
+                          gfc_charlen_type, const CHARTYPE *,
+                          gfc_charlen_type, const CHARTYPE *);
+export_proto(concat_string);
+
+extern gfc_charlen_type string_len_trim (gfc_charlen_type, const CHARTYPE *);
+export_proto(string_len_trim);
+
+extern void adjustl (CHARTYPE *, gfc_charlen_type, const CHARTYPE *);
+export_proto(adjustl);
+
+extern void adjustr (CHARTYPE *, gfc_charlen_type, const CHARTYPE *);
+export_proto(adjustr);
+
+extern gfc_charlen_type string_index (gfc_charlen_type, const CHARTYPE *,
+                                     gfc_charlen_type, const CHARTYPE *,
+                                     GFC_LOGICAL_4);
+export_proto(string_index);
+
+extern gfc_charlen_type string_scan (gfc_charlen_type, const CHARTYPE *,
+                                    gfc_charlen_type, const CHARTYPE *,
+                                    GFC_LOGICAL_4);
+export_proto(string_scan);
+
+extern gfc_charlen_type string_verify (gfc_charlen_type, const CHARTYPE *,
+                                      gfc_charlen_type, const CHARTYPE *,
+                                      GFC_LOGICAL_4);
+export_proto(string_verify);
+
+extern void string_trim (gfc_charlen_type *, CHARTYPE **, gfc_charlen_type,
+                        const CHARTYPE *);
+export_proto(string_trim);
+
+extern void string_minmax (gfc_charlen_type *, CHARTYPE **, int, int, ...);
+export_proto(string_minmax);
+
+
+/* Use for functions which can return a zero-length string.  */
+static CHARTYPE zero_length_string = 0;
+
+
+/* Strings of unequal length are extended with pad characters.  */
+
+int
+compare_string (gfc_charlen_type len1, const CHARTYPE *s1,
+               gfc_charlen_type len2, const CHARTYPE *s2)
+{
+  const UCHARTYPE *s;
+  gfc_charlen_type len;
+  int res;
+
+  res = MEMCMP (s1, s2, ((len1 < len2) ? len1 : len2));
+  if (res != 0)
+    return res;
+
+  if (len1 == len2)
+    return 0;
+
+  if (len1 < len2)
+    {
+      len = len2 - len1;
+      s = (UCHARTYPE *) &s2[len1];
+      res = -1;
+    }
+  else
+    {
+      len = len1 - len2;
+      s = (UCHARTYPE *) &s1[len2];
+      res = 1;
+    }
+
+  while (len--)
+    {
+      if (*s != ' ')
+        {
+          if (*s > ' ')
+            return res;
+          else
+            return -res;
+        }
+      s++;
+    }
+
+  return 0;
+}
+iexport(compare_string);
+
+
+/* The destination and source should not overlap.  */
+
+void
+concat_string (gfc_charlen_type destlen, CHARTYPE * dest,
+              gfc_charlen_type len1, const CHARTYPE * s1,
+              gfc_charlen_type len2, const CHARTYPE * s2)
+{
+  if (len1 >= destlen)
+    {
+      memcpy (dest, s1, destlen * sizeof (CHARTYPE));
+      return;
+    }
+  memcpy (dest, s1, len1 * sizeof (CHARTYPE));
+  dest += len1;
+  destlen -= len1;
+
+  if (len2 >= destlen)
+    {
+      memcpy (dest, s2, destlen * sizeof (CHARTYPE));
+      return;
+    }
+
+  memcpy (dest, s2, len2 * sizeof (CHARTYPE));
+  MEMSET (&dest[len2], ' ', destlen - len2);
+}
+
+
+/* Return string with all trailing blanks removed.  */
+
+void
+string_trim (gfc_charlen_type *len, CHARTYPE **dest, gfc_charlen_type slen,
+            const CHARTYPE *src)
+{
+  *len = string_len_trim (slen, src);
+
+  if (*len == 0)
+    *dest = &zero_length_string;
+  else
+    {
+      /* Allocate space for result string.  */
+      *dest = internal_malloc_size (*len * sizeof (CHARTYPE));
+
+      /* Copy string if necessary.  */
+      memcpy (*dest, src, *len * sizeof (CHARTYPE));
+    }
+}
+
+
+/* The length of a string not including trailing blanks.  */
+
+gfc_charlen_type
+string_len_trim (gfc_charlen_type len, const CHARTYPE *s)
+{
+  const gfc_charlen_type long_len = (gfc_charlen_type) sizeof (unsigned long);
+  gfc_charlen_type i;
+
+  i = len - 1;
+
+  /* If we've got the standard (KIND=1) character type, we scan the string in
+     long word chunks to speed it up (until a long word is hit that does not
+     consist of ' 's).  */
+  if (sizeof (CHARTYPE) == 1 && i >= long_len)
+    {
+      int starting;
+      unsigned long blank_longword;
+
+      /* Handle the first characters until we're aligned on a long word
+        boundary.  Actually, s + i + 1 must be properly aligned, because
+        s + i will be the last byte of a long word read.  */
+      starting = ((unsigned long)
+#ifdef __INTPTR_TYPE__
+                 (__INTPTR_TYPE__)
+#endif
+                 (s + i + 1)) % long_len;
+      i -= starting;
+      for (; starting > 0; --starting)
+       if (s[i + starting] != ' ')
+         return i + starting + 1;
+
+      /* Handle the others in a batch until first non-blank long word is
+        found.  Here again, s + i is the last byte of the current chunk,
+        to it starts at s + i - sizeof (long) + 1.  */
+
+#if __SIZEOF_LONG__ == 4
+      blank_longword = 0x20202020L;
+#elif __SIZEOF_LONG__ == 8
+      blank_longword = 0x2020202020202020L;
+#else
+      #error Invalid size of long!
+#endif
+
+      while (i >= long_len)
+       {
+         i -= long_len;
+         if (*((unsigned long*) (s + i + 1)) != blank_longword)
+           {
+             i += long_len;
+             break;
+           }
+       }
+
+      /* Now continue for the last characters with naive approach below.  */
+      assert (i >= 0);
+    }
+
+  /* Simply look for the first non-blank character.  */
+  while (i >= 0 && s[i] == ' ')
+    --i;
+  return i + 1;
+}
+
+
+/* Find a substring within a string.  */
+
+gfc_charlen_type
+string_index (gfc_charlen_type slen, const CHARTYPE *str,
+             gfc_charlen_type sslen, const CHARTYPE *sstr,
+             GFC_LOGICAL_4 back)
+{
+  gfc_charlen_type start, last, delta, i;
+
+  if (sslen == 0)
+    return back ? (slen + 1) : 1;
+
+  if (sslen > slen)
+    return 0;
+
+  if (!back)
+    {
+      last = slen + 1 - sslen;
+      start = 0;
+      delta = 1;
+    }
+  else
+    {
+      last = -1;
+      start = slen - sslen;
+      delta = -1;
+    }
+
+  for (; start != last; start+= delta)
+    {
+      for (i = 0; i < sslen; i++)
+        {
+          if (str[start + i] != sstr[i])
+            break;
+        }
+      if (i == sslen)
+        return (start + 1);
+    }
+  return 0;
+}
+
+
+/* Remove leading blanks from a string, padding at end.  The src and dest
+   should not overlap.  */
+
+void
+adjustl (CHARTYPE *dest, gfc_charlen_type len, const CHARTYPE *src)
+{
+  gfc_charlen_type i;
+
+  i = 0;
+  while (i < len && src[i] == ' ')
+    i++;
+
+  if (i < len)
+    memcpy (dest, &src[i], (len - i) * sizeof (CHARTYPE));
+  if (i > 0)
+    MEMSET (&dest[len - i], ' ', i);
+}
+
+
+/* Remove trailing blanks from a string.  */
+
+void
+adjustr (CHARTYPE *dest, gfc_charlen_type len, const CHARTYPE *src)
+{
+  gfc_charlen_type i;
+
+  i = len;
+  while (i > 0 && src[i - 1] == ' ')
+    i--;
+
+  if (i < len)
+    MEMSET (dest, ' ', len - i);
+  memcpy (&dest[len - i], src, i * sizeof (CHARTYPE));
+}
+
+
+/* Scan a string for any one of the characters in a set of characters.  */
+
+gfc_charlen_type
+string_scan (gfc_charlen_type slen, const CHARTYPE *str,
+            gfc_charlen_type setlen, const CHARTYPE *set, GFC_LOGICAL_4 back)
+{
+  gfc_charlen_type i, j;
+
+  if (slen == 0 || setlen == 0)
+    return 0;
+
+  if (back)
+    {
+      for (i = slen - 1; i >= 0; i--)
+       {
+         for (j = 0; j < setlen; j++)
+           {
+             if (str[i] == set[j])
+               return (i + 1);
+           }
+       }
+    }
+  else
+    {
+      for (i = 0; i < slen; i++)
+       {
+         for (j = 0; j < setlen; j++)
+           {
+             if (str[i] == set[j])
+               return (i + 1);
+           }
+       }
+    }
+
+  return 0;
+}
+
+
+/* Verify that a set of characters contains all the characters in a
+   string by identifying the position of the first character in a
+   characters that does not appear in a given set of characters.  */
+
+gfc_charlen_type
+string_verify (gfc_charlen_type slen, const CHARTYPE *str,
+              gfc_charlen_type setlen, const CHARTYPE *set,
+              GFC_LOGICAL_4 back)
+{
+  gfc_charlen_type start, last, delta, i;
+
+  if (slen == 0)
+    return 0;
+
+  if (back)
+    {
+      last = -1;
+      start = slen - 1;
+      delta = -1;
+    }
+  else
+    {
+      last = slen;
+      start = 0;
+      delta = 1;
+    }
+  for (; start != last; start += delta)
+    {
+      for (i = 0; i < setlen; i++)
+        {
+          if (str[start] == set[i])
+            break;
+        }
+      if (i == setlen)
+        return (start + 1);
+    }
+
+  return 0;
+}
+
+
+/* MIN and MAX intrinsics for strings.  The front-end makes sure that
+   nargs is at least 2.  */
+
+void
+string_minmax (gfc_charlen_type *rlen, CHARTYPE **dest, int op, int nargs, ...)
+{
+  va_list ap;
+  int i;
+  CHARTYPE *next, *res;
+  gfc_charlen_type nextlen, reslen;
+
+  va_start (ap, nargs);
+  reslen = va_arg (ap, gfc_charlen_type);
+  res = va_arg (ap, CHARTYPE *);
+  *rlen = reslen;
+
+  if (res == NULL)
+    runtime_error ("First argument of '%s' intrinsic should be present",
+                  op > 0 ? "MAX" : "MIN");
+
+  for (i = 1; i < nargs; i++)
+    {
+      nextlen = va_arg (ap, gfc_charlen_type);
+      next = va_arg (ap, CHARTYPE *);
+
+      if (next == NULL)
+       {
+         if (i == 1)
+           runtime_error ("Second argument of '%s' intrinsic should be "
+                          "present", op > 0 ? "MAX" : "MIN");
+         else
+           continue;
+       }
+
+      if (nextlen > *rlen)
+       *rlen = nextlen;
+
+      if (op * compare_string (reslen, res, nextlen, next) < 0)
+       {
+         reslen = nextlen;
+         res = next;
+       }
+    }
+  va_end (ap);
+
+  if (*rlen == 0)
+    *dest = &zero_length_string;
+  else
+    {
+      CHARTYPE *tmp = internal_malloc_size (*rlen * sizeof (CHARTYPE));
+      memcpy (tmp, res, reslen * sizeof (CHARTYPE));
+      MEMSET (&tmp[reslen], ' ', *rlen - reslen);
+      *dest = tmp;
+    }
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/symlnk.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/symlnk.c
new file mode 100644 (file)
index 0000000..095520f
--- /dev/null
@@ -0,0 +1,131 @@
+/* Implementation of the SYMLNK intrinsic.
+   Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <errno.h>
+#include <string.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* SUBROUTINE SYMLNK(PATH1, PATH2, STATUS)
+   CHARACTER(len=*), INTENT(IN) :: PATH1, PATH2
+   INTEGER, INTENT(OUT), OPTIONAL :: STATUS  */
+
+#ifdef HAVE_SYMLINK
+extern void symlnk_i4_sub (char *, char *, GFC_INTEGER_4 *, gfc_charlen_type,
+                        gfc_charlen_type);
+iexport_proto(symlnk_i4_sub);
+
+void
+symlnk_i4_sub (char *path1, char *path2, GFC_INTEGER_4 *status,
+             gfc_charlen_type path1_len, gfc_charlen_type path2_len)
+{
+  int val;
+  char *str1, *str2;
+
+  /* Trim trailing spaces from paths.  */
+  while (path1_len > 0 && path1[path1_len - 1] == ' ')
+    path1_len--;
+  while (path2_len > 0 && path2[path2_len - 1] == ' ')
+    path2_len--;
+
+  /* Make a null terminated copy of the strings.  */
+  str1 = gfc_alloca (path1_len + 1);
+  memcpy (str1, path1, path1_len);
+  str1[path1_len] = '\0';
+
+  str2 = gfc_alloca (path2_len + 1);
+  memcpy (str2, path2, path2_len);
+  str2[path2_len] = '\0';
+
+  val = symlink (str1, str2);
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(symlnk_i4_sub);
+
+extern void symlnk_i8_sub (char *, char *, GFC_INTEGER_8 *, gfc_charlen_type,
+                        gfc_charlen_type);
+iexport_proto(symlnk_i8_sub);
+
+void
+symlnk_i8_sub (char *path1, char *path2, GFC_INTEGER_8 *status,
+             gfc_charlen_type path1_len, gfc_charlen_type path2_len)
+{
+  int val;
+  char *str1, *str2;
+
+  /* Trim trailing spaces from paths.  */
+  while (path1_len > 0 && path1[path1_len - 1] == ' ')
+    path1_len--;
+  while (path2_len > 0 && path2[path2_len - 1] == ' ')
+    path2_len--;
+
+  /* Make a null terminated copy of the strings.  */
+  str1 = gfc_alloca (path1_len + 1);
+  memcpy (str1, path1, path1_len);
+  str1[path1_len] = '\0';
+
+  str2 = gfc_alloca (path2_len + 1);
+  memcpy (str2, path2, path2_len);
+  str2[path2_len] = '\0';
+
+  val = symlink (str1, str2);
+
+  if (status != NULL)
+    *status = (val == 0) ? 0 : errno;
+}
+iexport(symlnk_i8_sub);
+
+extern GFC_INTEGER_4 symlnk_i4 (char *, char *, gfc_charlen_type,
+                             gfc_charlen_type);
+export_proto(symlnk_i4);
+
+GFC_INTEGER_4
+symlnk_i4 (char *path1, char *path2, gfc_charlen_type path1_len,
+         gfc_charlen_type path2_len)
+{
+  GFC_INTEGER_4 val;
+  symlnk_i4_sub (path1, path2, &val, path1_len, path2_len);
+  return val;
+}
+
+extern GFC_INTEGER_8 symlnk_i8 (char *, char *, gfc_charlen_type,
+                             gfc_charlen_type);
+export_proto(symlnk_i8);
+
+GFC_INTEGER_8
+symlnk_i8 (char *path1, char *path2, gfc_charlen_type path1_len,
+        gfc_charlen_type path2_len)
+{
+  GFC_INTEGER_8 val;
+  symlnk_i8_sub (path1, path2, &val, path1_len, path2_len);
+  return val;
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/system.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/system.c
new file mode 100644 (file)
index 0000000..5bc083a
--- /dev/null
@@ -0,0 +1,61 @@
+/* Implementation of the SYSTEM intrinsic.
+   Copyright (C) 2004, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <string.h>
+#include <stdlib.h>
+
+extern void system_sub (const char *fcmd, GFC_INTEGER_4 * status,
+                       gfc_charlen_type cmd_len);
+iexport_proto(system_sub);
+
+void
+system_sub (const char *fcmd, GFC_INTEGER_4 *status, gfc_charlen_type cmd_len)
+{
+  char cmd[cmd_len + 1];
+  int stat;
+
+  /* Flush all I/O units before executing the command.  */
+  flush_all_units();
+
+  memcpy (cmd, fcmd, cmd_len);
+  cmd[cmd_len] = '\0';
+
+  stat = system (cmd);
+  if (status)
+    *status = stat;
+}
+iexport(system_sub);
+
+extern GFC_INTEGER_4 PREFIX(system) (const char *, gfc_charlen_type);
+export_proto_np(PREFIX(system));
+
+GFC_INTEGER_4
+PREFIX(system) (const char *fcmd, gfc_charlen_type cmd_len)
+{
+  GFC_INTEGER_4 stat;
+  system_sub (fcmd, &stat, cmd_len);
+  return stat;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/system_clock.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/system_clock.c
new file mode 100644 (file)
index 0000000..6385c4f
--- /dev/null
@@ -0,0 +1,207 @@
+/* Implementation of the SYSTEM_CLOCK intrinsic.
+   Copyright (C) 2004, 2005, 2007, 2009, 2010, 2011 Free Software
+   Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <limits.h>
+
+#include "time_1.h"
+
+
+/* POSIX states that CLOCK_REALTIME must be present if clock_gettime
+   is available, others are optional.  */
+#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GETTIME_LIBRT)
+#ifdef CLOCK_MONOTONIC
+#define GF_CLOCK_MONOTONIC CLOCK_MONOTONIC
+#else
+#define GF_CLOCK_MONOTONIC CLOCK_REALTIME
+#endif
+#endif
+
+/* Weakref trickery for clock_gettime().  On Glibc, clock_gettime()
+   requires us to link in librt, which also pulls in libpthread.  In
+   order to avoid this by default, only call clock_gettime() through a
+   weak reference. 
+
+   Some targets don't support weak undefined references; on these
+   GTHREAD_USE_WEAK is 0. So we need to define it to 1 on other
+   targets.  */
+#ifndef GTHREAD_USE_WEAK
+#define GTHREAD_USE_WEAK 1
+#endif
+
+#if SUPPORTS_WEAK && GTHREAD_USE_WEAK && defined(HAVE_CLOCK_GETTIME_LIBRT)
+static int weak_gettime (clockid_t, struct timespec *) 
+  __attribute__((__weakref__("clock_gettime")));
+#endif
+
+
+/* High resolution monotonic clock, falling back to the realtime clock
+   if the target does not support such a clock.
+
+   Arguments:
+   secs     - OUTPUT, seconds
+   nanosecs - OUTPUT, nanoseconds
+
+   If the target supports a monotonic clock, the OUTPUT arguments
+   represent a monotonically incrementing clock starting from some
+   unspecified time in the past.
+
+   If a monotonic clock is not available, falls back to the realtime
+   clock which is not monotonic.
+
+   Return value: 0 for success, -1 for error. In case of error, errno
+   is set.
+*/
+static int
+gf_gettime_mono (time_t * secs, long * nanosecs)
+{
+  int err;
+#ifdef HAVE_CLOCK_GETTIME
+  struct timespec ts;
+  err = clock_gettime (GF_CLOCK_MONOTONIC, &ts);
+  *secs = ts.tv_sec;
+  *nanosecs = ts.tv_nsec;
+  return err;
+#else
+#if defined(HAVE_CLOCK_GETTIME_LIBRT) && SUPPORTS_WEAK && GTHREAD_USE_WEAK
+  if (weak_gettime)
+    {
+      struct timespec ts;
+      err = weak_gettime (GF_CLOCK_MONOTONIC, &ts);
+      *secs = ts.tv_sec;
+      *nanosecs = ts.tv_nsec;
+      return err;
+    }
+#endif
+  err = gf_gettime (secs, nanosecs);
+  *nanosecs *= 1000;
+  return err;
+#endif
+}
+
+extern void system_clock_4 (GFC_INTEGER_4 *, GFC_INTEGER_4 *, GFC_INTEGER_4 *);
+export_proto(system_clock_4);
+
+extern void system_clock_8 (GFC_INTEGER_8 *, GFC_INTEGER_8 *, GFC_INTEGER_8 *);
+export_proto(system_clock_8);
+
+
+/* prefix(system_clock_4) is the INTEGER(4) version of the SYSTEM_CLOCK
+   intrinsic subroutine.  It returns the number of clock ticks for the current
+   system time, the number of ticks per second, and the maximum possible value
+   for COUNT.  On the first call to SYSTEM_CLOCK, COUNT is set to zero. */
+
+void
+system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate,
+              GFC_INTEGER_4 *count_max)
+{
+#undef TCK
+#define TCK 1000
+  GFC_INTEGER_4 cnt;
+  GFC_INTEGER_4 mx;
+
+  time_t secs;
+  long nanosecs;
+
+  if (sizeof (secs) < sizeof (GFC_INTEGER_4))
+    internal_error (NULL, "secs too small");
+
+  if (gf_gettime_mono (&secs, &nanosecs) == 0)
+    {
+      GFC_UINTEGER_4 ucnt = (GFC_UINTEGER_4) secs * TCK;
+      ucnt += (nanosecs + 500000000 / TCK) / (1000000000 / TCK);
+      if (ucnt > GFC_INTEGER_4_HUGE)
+       cnt = ucnt - GFC_INTEGER_4_HUGE - 1;
+      else
+       cnt = ucnt;
+      mx = GFC_INTEGER_4_HUGE;
+    }
+  else
+    {
+      if (count != NULL)
+       *count = - GFC_INTEGER_4_HUGE;
+      if (count_rate != NULL)
+       *count_rate = 0;
+      if (count_max != NULL)
+       *count_max = 0;
+      return;
+    }
+
+  if (count != NULL)
+    *count = cnt;
+  if (count_rate != NULL)
+    *count_rate = TCK;
+  if (count_max != NULL)
+    *count_max = mx;
+}
+
+
+/* INTEGER(8) version of the above routine.  */
+
+void
+system_clock_8 (GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate,
+               GFC_INTEGER_8 *count_max)
+{
+#undef TCK
+#define TCK 1000000000
+  GFC_INTEGER_8 cnt;
+  GFC_INTEGER_8 mx;
+
+  time_t secs;
+  long nanosecs;
+
+  if (sizeof (secs) < sizeof (GFC_INTEGER_4))
+    internal_error (NULL, "secs too small");
+
+  if (gf_gettime_mono (&secs, &nanosecs) == 0)
+    {
+      GFC_UINTEGER_8 ucnt = (GFC_UINTEGER_8) secs * TCK;
+      ucnt += (nanosecs + 500000000 / TCK) / (1000000000 / TCK);
+      if (ucnt > GFC_INTEGER_8_HUGE)
+       cnt = ucnt - GFC_INTEGER_8_HUGE - 1;
+      else
+       cnt = ucnt;
+      mx = GFC_INTEGER_8_HUGE;
+    }
+  else
+    {
+      if (count != NULL)
+       *count = - GFC_INTEGER_8_HUGE;
+      if (count_rate != NULL)
+       *count_rate = 0;
+      if (count_max != NULL)
+       *count_max = 0;
+
+      return;
+    }
+
+  if (count != NULL)
+    *count = cnt;
+  if (count_rate != NULL)
+    *count_rate = TCK;
+  if (count_max != NULL)
+    *count_max = mx;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/time.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/time.c
new file mode 100644 (file)
index 0000000..151466a
--- /dev/null
@@ -0,0 +1,50 @@
+/* Implementation of the TIME and TIME8 g77 intrinsics.
+   Copyright (C) 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <time.h>
+
+
+/* INTEGER(KIND=4) FUNCTION TIME()  */
+
+extern GFC_INTEGER_4 time_func (void);
+export_proto(time_func);
+
+GFC_INTEGER_4
+time_func (void)
+{
+  return (GFC_INTEGER_4) time (NULL);
+}
+
+/* INTEGER(KIND=8) FUNCTION TIME8()  */
+
+extern GFC_INTEGER_8 time8_func (void);
+export_proto(time8_func);
+
+GFC_INTEGER_8
+time8_func (void)
+{
+  return (GFC_INTEGER_8) time (NULL);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/time_1.h b/l4/pkg/libgfortran/lib/contrib/intrinsics/time_1.h
new file mode 100644 (file)
index 0000000..aaca56a
--- /dev/null
@@ -0,0 +1,218 @@
+/* Wrappers for platform timing functions.
+   Copyright (C) 2003, 2007, 2009, 2011 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef LIBGFORTRAN_TIME_H
+#define LIBGFORTRAN_TIME_H
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <errno.h>
+
+/* The time related intrinsics (DTIME, ETIME, CPU_TIME) to "compare
+   different algorithms on the same computer or discover which parts
+   are the most expensive", need a way to get the CPU time with the
+   finest resolution possible. We can only be accurate up to
+   microseconds.
+
+   As usual with UNIX systems, unfortunately no single way is
+   available for all systems.  */
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <time.h>
+
+#ifdef HAVE_SYS_TYPES_H
+     #include <sys/types.h>
+#endif
+
+/* The most accurate way to get the CPU time is getrusage (). */
+#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
+#  include <sys/resource.h>
+#endif  /* HAVE_GETRUSAGE && HAVE_SYS_RESOURCE_H  */
+
+/* The most accurate way to get the CPU time is getrusage ().
+   If we have times(), that's good enough, too.  */
+#if !defined (HAVE_GETRUSAGE) || !defined (HAVE_SYS_RESOURCE_H)
+/* For times(), we _must_ know the number of clock ticks per second.  */
+#  if defined (HAVE_TIMES) && (defined (HZ) || defined (_SC_CLK_TCK) || defined (CLK_TCK))
+#    ifdef HAVE_SYS_PARAM_H
+#      include <sys/param.h>
+#    endif
+#    if defined (HAVE_SYS_TIMES_H)
+#      include <sys/times.h>
+#    endif
+#    ifndef HZ
+#      if defined _SC_CLK_TCK
+#        define HZ  sysconf(_SC_CLK_TCK)
+#      else
+#        define HZ  CLK_TCK
+#      endif
+#    endif
+#  endif  /* HAVE_TIMES etc.  */
+#endif  /* !HAVE_GETRUSAGE || !HAVE_SYS_RESOURCE_H  */
+
+
+/* If the re-entrant version of localtime is not available, provide a
+   fallback implementation.  On some targets where the _r version is
+   not available, localtime uses thread-local storage so it's
+   threadsafe.  */
+
+#ifndef HAVE_LOCALTIME_R
+/* If _POSIX is defined localtime_r gets defined by mingw-w64 headers.  */
+#ifdef localtime_r
+#undef localtime_r
+#endif
+
+static inline struct tm *
+localtime_r (const time_t * timep, struct tm * result)
+{
+  *result = *localtime (timep);
+  return result;
+}
+#endif
+
+
+/* Helper function for the actual implementation of the DTIME, ETIME and
+   CPU_TIME intrinsics.  Returns 0 for success or -1 if no
+   CPU time could be computed.  */
+
+#ifdef __MINGW32__
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+static inline int
+gf_cputime (long *user_sec, long *user_usec, long *system_sec, long *system_usec)
+{
+  union {
+    FILETIME ft;
+    unsigned long long ulltime;
+  } kernel_time,  user_time;
+
+  FILETIME unused1, unused2;
+
+  /* No support for Win9x.  The high order bit of the DWORD
+     returned by GetVersion is 0 for NT and higher. */
+  if (GetVersion () >= 0x80000000)
+    {
+      *user_sec = *system_sec = 0;
+      *user_usec = *system_usec = 0;
+      return -1;
+    }
+
+  /* The FILETIME structs filled in by GetProcessTimes represent
+     time in 100 nanosecond units. */
+  GetProcessTimes (GetCurrentProcess (), &unused1, &unused2,
+                  &kernel_time.ft, &user_time.ft);
+
+  *user_sec = user_time.ulltime / 10000000;
+  *user_usec = (user_time.ulltime % 10000000) / 10;
+
+  *system_sec = kernel_time.ulltime / 10000000;
+  *system_usec = (kernel_time.ulltime % 10000000) / 10;
+  return 0;
+}
+
+#else
+
+static inline int
+gf_cputime (long *user_sec, long *user_usec, long *system_sec, long *system_usec)
+{
+#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
+  struct rusage usage;
+  int err;
+  err = getrusage (RUSAGE_SELF, &usage);
+
+  *user_sec = usage.ru_utime.tv_sec;
+  *user_usec = usage.ru_utime.tv_usec;
+  *system_sec = usage.ru_stime.tv_sec;
+  *system_usec = usage.ru_stime.tv_usec;
+  return err;
+
+#elif defined HAVE_TIMES
+  struct tms buf;
+  clock_t err;
+  err = times (&buf);
+  *user_sec = buf.tms_utime / HZ;
+  *user_usec = buf.tms_utime % HZ * (1000000. / HZ);
+  *system_sec = buf.tms_stime / HZ;
+  *system_usec = buf.tms_stime % HZ * (1000000. / HZ);
+  if ((err == (clock_t) -1) && errno != 0)
+    return -1;
+  return 0;
+
+#else 
+  clock_t c = clock ();
+  *user_sec = c / CLOCKS_PER_SEC;
+  *user_usec = c % CLOCKS_PER_SEC * (1000000. / CLOCKS_PER_SEC);
+  *system_sec = *system_usec = 0;
+  if (c == (clock_t) -1)
+    return -1;
+  return 0;
+
+#endif
+}
+
+#endif
+
+
+/* Realtime clock with microsecond resolution, falling back to less
+   precise functions if the target does not support gettimeofday().
+
+   Arguments:
+   secs     - OUTPUT, seconds
+   usecs    - OUTPUT, microseconds
+
+   The OUTPUT arguments shall represent the number of seconds and
+   nanoseconds since the Epoch.
+
+   Return value: 0 for success, -1 for error. In case of error, errno
+   is set.
+*/
+static inline int
+gf_gettime (time_t * secs, long * usecs)
+{
+#ifdef HAVE_GETTIMEOFDAY
+  struct timeval tv;
+  int err;
+  err = gettimeofday (&tv, NULL);
+  *secs = tv.tv_sec;
+  *usecs = tv.tv_usec;
+  return err;
+#else
+  time_t t = time (NULL);
+  *secs = t;
+  *usecs = 0;
+  if (t == ((time_t)-1))
+    return -1;
+  return 0;
+#endif
+}
+
+
+#endif /* LIBGFORTRAN_TIME_H */
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/transpose_generic.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/transpose_generic.c
new file mode 100644 (file)
index 0000000..b0c2fff
--- /dev/null
@@ -0,0 +1,151 @@
+/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+extern void transpose (gfc_array_char *, gfc_array_char *);
+export_proto(transpose);
+
+static void
+transpose_internal (gfc_array_char *ret, gfc_array_char *source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  char *rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const char *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+  index_type size;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2
+          && GFC_DESCRIPTOR_RANK (ret) == 2);
+
+  size = GFC_DESCRIPTOR_SIZE(ret);
+
+  if (ret->data == NULL)
+    {
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (size * size0 ((array_t*)ret));
+      ret->offset = 0;
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE_BYTES(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE_BYTES(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE_BYTES(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE_BYTES(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y = 0; y < ycount; y++)
+    {
+      for (x = 0; x < xcount; x++)
+        {
+          memcpy (rptr, sptr, size);
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+      sptr += systride - (sxstride * xcount);
+      rptr += rxstride - (rystride * xcount);
+    }
+}
+
+
+extern void transpose (gfc_array_char *, gfc_array_char *);
+export_proto(transpose);
+
+void
+transpose (gfc_array_char *ret, gfc_array_char *source)
+{
+  transpose_internal (ret, source);
+}
+
+
+extern void transpose_char (gfc_array_char *, GFC_INTEGER_4,
+                           gfc_array_char *, GFC_INTEGER_4);
+export_proto(transpose_char);
+
+void
+transpose_char (gfc_array_char *ret,
+               GFC_INTEGER_4 ret_length __attribute__((unused)),
+               gfc_array_char *source,
+               GFC_INTEGER_4 source_length __attribute__((unused)))
+{
+  transpose_internal (ret, source);
+}
+
+
+extern void transpose_char4 (gfc_array_char *, GFC_INTEGER_4,
+                            gfc_array_char *, GFC_INTEGER_4);
+export_proto(transpose_char4);
+
+void
+transpose_char4 (gfc_array_char *ret,
+                GFC_INTEGER_4 ret_length __attribute__((unused)),
+                gfc_array_char *source,
+                GFC_INTEGER_4 source_length __attribute__((unused)))
+{
+  transpose_internal (ret, source);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/umask.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/umask.c
new file mode 100644 (file)
index 0000000..d939e5d
--- /dev/null
@@ -0,0 +1,90 @@
+/* Implementation of the UMASK intrinsic.
+   Copyright (C) 2004, 2007, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargls@comcast.net>.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+#include "libgfortran.h"
+#include <stdlib.h>
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+
+/* SUBROUTINE UMASK(MASK, OLD)
+   INTEGER, INTENT(IN) :: MASK
+   INTEGER, INTENT(OUT), OPTIONAL :: OLD  */
+
+extern void umask_i4_sub (GFC_INTEGER_4 *, GFC_INTEGER_4 *);
+iexport_proto(umask_i4_sub);
+
+void
+umask_i4_sub (GFC_INTEGER_4 *mask, GFC_INTEGER_4 *old)
+{
+  mode_t val = umask((mode_t) *mask);
+  if (old != NULL)
+    *old = (GFC_INTEGER_4) val;
+}
+iexport(umask_i4_sub);
+
+extern void umask_i8_sub (GFC_INTEGER_8 *, GFC_INTEGER_8 *);
+iexport_proto(umask_i8_sub);
+
+void
+umask_i8_sub (GFC_INTEGER_8 *mask, GFC_INTEGER_8 *old)
+{
+  mode_t val = umask((mode_t) *mask);
+  if (old != NULL)
+    *old = (GFC_INTEGER_8) val;
+}
+iexport(umask_i8_sub);
+
+/* INTEGER FUNCTION UMASK(MASK)
+   INTEGER, INTENT(IN) :: MASK  */
+
+extern GFC_INTEGER_4 umask_i4 (GFC_INTEGER_4 *);
+export_proto(umask_i4);
+
+GFC_INTEGER_4
+umask_i4 (GFC_INTEGER_4 *mask)
+{
+  GFC_INTEGER_4 old;
+  umask_i4_sub (mask, &old);
+  return old;
+}
+
+extern GFC_INTEGER_8 umask_i8 (GFC_INTEGER_8 *);
+export_proto(umask_i8);
+
+GFC_INTEGER_8
+umask_i8 (GFC_INTEGER_8 *mask)
+{
+  GFC_INTEGER_8 old;
+  umask_i8_sub (mask, &old);
+  return old;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/unlink.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/unlink.c
new file mode 100644 (file)
index 0000000..7b17dfe
--- /dev/null
@@ -0,0 +1,91 @@
+/* Implementation of the UNLINK intrinsic.
+   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargls@comcast.net>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <string.h>
+#include <errno.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* SUBROUTINE UNLINK(NAME, STATUS)
+   CHARACTER(LEN= ), INTENT(IN) :: NAME
+   INTEGER, INTENT(OUT), OPTIONAL :: STATUS)  */
+
+extern void unlink_i4_sub (char *name, GFC_INTEGER_4 *status,
+                          gfc_charlen_type name_len);
+iexport_proto(unlink_i4_sub);
+
+void
+unlink_i4_sub (char *name, GFC_INTEGER_4 *status, gfc_charlen_type name_len)
+{
+  char *str;
+  GFC_INTEGER_4 stat;
+
+  /* Trim trailing spaces from name.  */
+  while (name_len > 0 && name[name_len - 1] == ' ')
+    name_len--;
+
+  /* Make a null terminated copy of the string.  */
+  str = gfc_alloca (name_len + 1);
+  memcpy (str, name, name_len);
+  str[name_len] = '\0';
+
+  stat = unlink (str);
+
+  if (status != NULL)
+    *status = (stat == 0) ? stat : errno;
+}
+iexport(unlink_i4_sub);
+
+extern void unlink_i8_sub (char *name, GFC_INTEGER_8 *status,
+                          gfc_charlen_type name_len);
+export_proto(unlink_i8_sub);
+
+void
+unlink_i8_sub (char *name, GFC_INTEGER_8 *status, gfc_charlen_type name_len)
+{
+  GFC_INTEGER_4 status4;
+  unlink_i4_sub (name, &status4, name_len);
+  if (status)
+    *status = status4;
+}
+
+
+/* INTEGER FUNCTION UNLINK(NAME)
+   CHARACTER(LEN= ), INTENT(IN) :: NAME  */
+
+extern GFC_INTEGER_4 PREFIX(unlink) (char *, gfc_charlen_type);
+export_proto_np(PREFIX(unlink));
+
+GFC_INTEGER_4
+PREFIX(unlink) (char *name, gfc_charlen_type name_len)
+{
+  GFC_INTEGER_4 status;
+  unlink_i4_sub (name, &status, name_len);
+  return status;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/intrinsics/unpack_generic.c b/l4/pkg/libgfortran/lib/contrib/intrinsics/unpack_generic.c
new file mode 100644 (file)
index 0000000..db62499
--- /dev/null
@@ -0,0 +1,630 @@
+/* Generic implementation of the UNPACK intrinsic
+   Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+/* All the bounds checking for unpack in one function.  If field is NULL,
+   we don't check it, for the unpack0 functions.  */
+
+static void
+unpack_bounds (gfc_array_char *ret, const gfc_array_char *vector,
+        const gfc_array_l1 *mask, const gfc_array_char *field)
+{
+  index_type vec_size, mask_count;
+  vec_size = size0 ((array_t *) vector);
+  mask_count = count_0 (mask);
+  if (vec_size < mask_count)
+    runtime_error ("Incorrect size of return value in UNPACK"
+                  " intrinsic: should be at least %ld, is"
+                  " %ld", (long int) mask_count,
+                  (long int) vec_size);
+
+  if (field != NULL)
+    bounds_equal_extents ((array_t *) field, (array_t *) mask,
+                         "FIELD", "UNPACK");
+
+  if (ret->data != NULL)
+    bounds_equal_extents ((array_t *) ret, (array_t *) mask,
+                         "return value", "UNPACK");
+
+}
+
+static void
+unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
+                const gfc_array_l1 *mask, const gfc_array_char *field,
+                index_type size)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  char * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  char *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const char *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Don't convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret, n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(field, n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * size);
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret, n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(field, n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n);
+       }
+    }
+
+  if (empty)
+    return;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE_BYTES(vector,0);
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+          memcpy (rptr, vptr, size);
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+          memcpy (rptr, fptr, size);
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+extern void unpack1 (gfc_array_char *, const gfc_array_char *,
+                    const gfc_array_l1 *, const gfc_array_char *);
+export_proto(unpack1);
+
+void
+unpack1 (gfc_array_char *ret, const gfc_array_char *vector,
+        const gfc_array_l1 *mask, const gfc_array_char *field)
+{
+  index_type type_size;
+  index_type size;
+
+  if (unlikely(compile_options.bounds_check))
+    unpack_bounds (ret, vector, mask, field);
+
+  type_size = GFC_DTYPE_TYPE_SIZE (vector);
+  size = GFC_DESCRIPTOR_SIZE (vector);
+
+  switch(type_size)
+    {
+    case GFC_DTYPE_LOGICAL_1:
+    case GFC_DTYPE_INTEGER_1:
+    case GFC_DTYPE_DERIVED_1:
+      unpack1_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) vector,
+                 mask, (gfc_array_i1 *) field);
+      return;
+
+    case GFC_DTYPE_LOGICAL_2:
+    case GFC_DTYPE_INTEGER_2:
+      unpack1_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) vector,
+                 mask, (gfc_array_i2 *) field);
+      return;
+
+    case GFC_DTYPE_LOGICAL_4:
+    case GFC_DTYPE_INTEGER_4:
+      unpack1_i4 ((gfc_array_i4 *) ret, (gfc_array_i4 *) vector,
+                 mask, (gfc_array_i4 *) field);
+      return;
+
+    case GFC_DTYPE_LOGICAL_8:
+    case GFC_DTYPE_INTEGER_8:
+      unpack1_i8 ((gfc_array_i8 *) ret, (gfc_array_i8 *) vector,
+                 mask, (gfc_array_i8 *) field);
+      return;
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_LOGICAL_16:
+    case GFC_DTYPE_INTEGER_16:
+      unpack1_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) vector,
+                  mask, (gfc_array_i16 *) field);
+      return;
+#endif
+
+    case GFC_DTYPE_REAL_4:
+      unpack1_r4 ((gfc_array_r4 *) ret, (gfc_array_r4 *) vector,
+                 mask, (gfc_array_r4 *) field);
+      return;
+
+    case GFC_DTYPE_REAL_8:
+      unpack1_r8 ((gfc_array_r8 *) ret, (gfc_array_r8 *) vector,
+                 mask, (gfc_array_r8 *) field);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_REAL_10
+    case GFC_DTYPE_REAL_10:
+      unpack1_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) vector,
+                  mask, (gfc_array_r10 *) field);
+      return;
+# endif
+
+# ifdef HAVE_GFC_REAL_16
+    case GFC_DTYPE_REAL_16:
+      unpack1_r16 ((gfc_array_r16 *) ret, (gfc_array_r16 *) vector,
+                  mask, (gfc_array_r16 *) field);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_COMPLEX_4:
+      unpack1_c4 ((gfc_array_c4 *) ret, (gfc_array_c4 *) vector,
+                 mask, (gfc_array_c4 *) field);
+      return;
+
+    case GFC_DTYPE_COMPLEX_8:
+      unpack1_c8 ((gfc_array_c8 *) ret, (gfc_array_c8 *) vector,
+                 mask, (gfc_array_c8 *) field);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_COMPLEX_10
+    case GFC_DTYPE_COMPLEX_10:
+      unpack1_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) vector,
+                  mask, (gfc_array_c10 *) field);
+      return;
+# endif
+
+# ifdef HAVE_GFC_COMPLEX_16
+    case GFC_DTYPE_COMPLEX_16:
+      unpack1_c16 ((gfc_array_c16 *) ret, (gfc_array_c16 *) vector,
+                  mask, (gfc_array_c16 *) field);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_DERIVED_2:
+      if (GFC_UNALIGNED_2(ret->data) || GFC_UNALIGNED_2(vector->data)
+         || GFC_UNALIGNED_2(field->data))
+       break;
+      else
+       {
+         unpack1_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) vector,
+                     mask, (gfc_array_i2 *) field);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_4:
+      if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(vector->data)
+         || GFC_UNALIGNED_4(field->data))
+       break;
+      else
+       {
+         unpack1_i4 ((gfc_array_i4 *) ret, (gfc_array_i4 *) vector,
+                     mask, (gfc_array_i4 *) field);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_8:
+      if (GFC_UNALIGNED_8(ret->data) || GFC_UNALIGNED_8(vector->data)
+         || GFC_UNALIGNED_8(field->data))
+       break;
+      else
+       {
+         unpack1_i8 ((gfc_array_i8 *) ret, (gfc_array_i8 *) vector,
+                     mask, (gfc_array_i8 *) field);
+         return;
+       }
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_DERIVED_16:
+      if (GFC_UNALIGNED_16(ret->data) || GFC_UNALIGNED_16(vector->data)
+         || GFC_UNALIGNED_16(field->data))
+       break;
+      else
+       {
+         unpack1_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) vector,
+                      mask, (gfc_array_i16 *) field);
+         return;
+       }
+#endif
+    }
+
+  unpack_internal (ret, vector, mask, field, size);
+}
+
+
+extern void unpack1_char (gfc_array_char *, GFC_INTEGER_4,
+                         const gfc_array_char *, const gfc_array_l1 *,
+                         const gfc_array_char *, GFC_INTEGER_4,
+                         GFC_INTEGER_4);
+export_proto(unpack1_char);
+
+void
+unpack1_char (gfc_array_char *ret,
+             GFC_INTEGER_4 ret_length __attribute__((unused)),
+             const gfc_array_char *vector, const gfc_array_l1 *mask,
+             const gfc_array_char *field, GFC_INTEGER_4 vector_length,
+             GFC_INTEGER_4 field_length __attribute__((unused)))
+{
+
+  if (unlikely(compile_options.bounds_check))
+    unpack_bounds (ret, vector, mask, field);
+
+  unpack_internal (ret, vector, mask, field, vector_length);
+}
+
+
+extern void unpack1_char4 (gfc_array_char *, GFC_INTEGER_4,
+                          const gfc_array_char *, const gfc_array_l1 *,
+                          const gfc_array_char *, GFC_INTEGER_4,
+                          GFC_INTEGER_4);
+export_proto(unpack1_char4);
+
+void
+unpack1_char4 (gfc_array_char *ret,
+              GFC_INTEGER_4 ret_length __attribute__((unused)),
+              const gfc_array_char *vector, const gfc_array_l1 *mask,
+              const gfc_array_char *field, GFC_INTEGER_4 vector_length,
+              GFC_INTEGER_4 field_length __attribute__((unused)))
+{
+
+  if (unlikely(compile_options.bounds_check))
+    unpack_bounds (ret, vector, mask, field);
+
+  unpack_internal (ret, vector, mask, field,
+                  vector_length * sizeof (gfc_char4_t));
+}
+
+
+extern void unpack0 (gfc_array_char *, const gfc_array_char *,
+                    const gfc_array_l1 *, char *);
+export_proto(unpack0);
+
+void
+unpack0 (gfc_array_char *ret, const gfc_array_char *vector,
+        const gfc_array_l1 *mask, char *field)
+{
+  gfc_array_char tmp;
+
+  index_type type_size;
+
+  if (unlikely(compile_options.bounds_check))
+    unpack_bounds (ret, vector, mask, NULL);
+
+  type_size = GFC_DTYPE_TYPE_SIZE (vector);
+
+  switch (type_size)
+    {
+    case GFC_DTYPE_LOGICAL_1:
+    case GFC_DTYPE_INTEGER_1:
+    case GFC_DTYPE_DERIVED_1:
+      unpack0_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) vector,
+                 mask, (GFC_INTEGER_1 *) field);
+      return;
+
+    case GFC_DTYPE_LOGICAL_2:
+    case GFC_DTYPE_INTEGER_2:
+      unpack0_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) vector,
+                 mask, (GFC_INTEGER_2 *) field);
+      return;
+
+    case GFC_DTYPE_LOGICAL_4:
+    case GFC_DTYPE_INTEGER_4:
+      unpack0_i4 ((gfc_array_i4 *) ret, (gfc_array_i4 *) vector,
+                 mask, (GFC_INTEGER_4 *) field);
+      return;
+
+    case GFC_DTYPE_LOGICAL_8:
+    case GFC_DTYPE_INTEGER_8:
+      unpack0_i8 ((gfc_array_i8 *) ret, (gfc_array_i8 *) vector,
+                 mask, (GFC_INTEGER_8 *) field);
+      return;
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_LOGICAL_16:
+    case GFC_DTYPE_INTEGER_16:
+      unpack0_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) vector,
+                  mask, (GFC_INTEGER_16 *) field);
+      return;
+#endif
+
+    case GFC_DTYPE_REAL_4:
+      unpack0_r4 ((gfc_array_r4 *) ret, (gfc_array_r4 *) vector,
+                 mask, (GFC_REAL_4 *) field);
+      return;
+
+    case GFC_DTYPE_REAL_8:
+      unpack0_r8 ((gfc_array_r8 *) ret, (gfc_array_r8*) vector,
+                 mask, (GFC_REAL_8  *) field);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_REAL_10
+    case GFC_DTYPE_REAL_10:
+      unpack0_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) vector,
+                  mask, (GFC_REAL_10 *) field);
+      return;
+# endif
+
+# ifdef HAVE_GFC_REAL_16
+    case GFC_DTYPE_REAL_16:
+      unpack0_r16 ((gfc_array_r16 *) ret, (gfc_array_r16 *) vector,
+                  mask, (GFC_REAL_16 *) field);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_COMPLEX_4:
+      unpack0_c4 ((gfc_array_c4 *) ret, (gfc_array_c4 *) vector,
+                 mask, (GFC_COMPLEX_4 *) field);
+      return;
+
+    case GFC_DTYPE_COMPLEX_8:
+      unpack0_c8 ((gfc_array_c8 *) ret, (gfc_array_c8 *) vector,
+                 mask, (GFC_COMPLEX_8 *) field);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# ifdef HAVE_GFC_COMPLEX_10
+    case GFC_DTYPE_COMPLEX_10:
+      unpack0_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) vector,
+                  mask, (GFC_COMPLEX_10 *) field);
+      return;
+# endif
+
+# ifdef HAVE_GFC_COMPLEX_16
+    case GFC_DTYPE_COMPLEX_16:
+      unpack0_c16 ((gfc_array_c16 *) ret, (gfc_array_c16 *) vector,
+                  mask, (GFC_COMPLEX_16 *) field);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_DERIVED_2:
+      if (GFC_UNALIGNED_2(ret->data) || GFC_UNALIGNED_2(vector->data)
+         || GFC_UNALIGNED_2(field))
+       break;
+      else
+       {
+         unpack0_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) vector,
+                     mask, (GFC_INTEGER_2 *) field);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_4:
+      if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(vector->data)
+         || GFC_UNALIGNED_4(field))
+       break;
+      else
+       {
+         unpack0_i4 ((gfc_array_i4 *) ret, (gfc_array_i4 *) vector,
+                     mask, (GFC_INTEGER_4 *) field);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_8:
+      if (GFC_UNALIGNED_8(ret->data) || GFC_UNALIGNED_8(vector->data)
+         || GFC_UNALIGNED_8(field))
+       break;
+      else
+       {
+         unpack0_i8 ((gfc_array_i8 *) ret, (gfc_array_i8 *) vector,
+                     mask, (GFC_INTEGER_8 *) field);
+         return;
+       }
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_DERIVED_16:
+      if (GFC_UNALIGNED_16(ret->data) || GFC_UNALIGNED_16(vector->data)
+         || GFC_UNALIGNED_16(field))
+       break;
+      else
+       {
+         unpack0_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) vector,
+                      mask, (GFC_INTEGER_16 *) field);
+         return;
+       }
+#endif
+
+    }
+
+  memset (&tmp, 0, sizeof (tmp));
+  tmp.dtype = 0;
+  tmp.data = field;
+  unpack_internal (ret, vector, mask, &tmp, GFC_DESCRIPTOR_SIZE (vector));
+}
+
+
+extern void unpack0_char (gfc_array_char *, GFC_INTEGER_4,
+                         const gfc_array_char *, const gfc_array_l1 *,
+                         char *, GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(unpack0_char);
+
+void
+unpack0_char (gfc_array_char *ret,
+             GFC_INTEGER_4 ret_length __attribute__((unused)),
+             const gfc_array_char *vector, const gfc_array_l1 *mask,
+             char *field, GFC_INTEGER_4 vector_length,
+             GFC_INTEGER_4 field_length __attribute__((unused)))
+{
+  gfc_array_char tmp;
+
+  if (unlikely(compile_options.bounds_check))
+    unpack_bounds (ret, vector, mask, NULL);
+
+  memset (&tmp, 0, sizeof (tmp));
+  tmp.dtype = 0;
+  tmp.data = field;
+  unpack_internal (ret, vector, mask, &tmp, vector_length);
+}
+
+
+extern void unpack0_char4 (gfc_array_char *, GFC_INTEGER_4,
+                          const gfc_array_char *, const gfc_array_l1 *,
+                          char *, GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(unpack0_char4);
+
+void
+unpack0_char4 (gfc_array_char *ret,
+              GFC_INTEGER_4 ret_length __attribute__((unused)),
+              const gfc_array_char *vector, const gfc_array_l1 *mask,
+              char *field, GFC_INTEGER_4 vector_length,
+              GFC_INTEGER_4 field_length __attribute__((unused)))
+{
+  gfc_array_char tmp;
+
+  if (unlikely(compile_options.bounds_check))
+    unpack_bounds (ret, vector, mask, NULL);
+
+  memset (&tmp, 0, sizeof (tmp));
+  tmp.dtype = 0;
+  tmp.data = field;
+  unpack_internal (ret, vector, mask, &tmp,
+                  vector_length * sizeof (gfc_char4_t));
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/close.c b/l4/pkg/libgfortran/lib/contrib/io/close.c
new file mode 100644 (file)
index 0000000..1a4d7d1
--- /dev/null
@@ -0,0 +1,102 @@
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "io.h"
+#include "unix.h"
+#include <limits.h>
+
+typedef enum
+{ CLOSE_DELETE, CLOSE_KEEP, CLOSE_UNSPECIFIED }
+close_status;
+
+static const st_option status_opt[] = {
+  {"keep", CLOSE_KEEP},
+  {"delete", CLOSE_DELETE},
+  {NULL, 0}
+};
+
+
+extern void st_close (st_parameter_close *);
+export_proto(st_close);
+
+void
+st_close (st_parameter_close *clp)
+{
+  close_status status;
+  gfc_unit *u;
+#if !HAVE_UNLINK_OPEN_FILE
+  char * path;
+
+  path = NULL;
+#endif
+
+  library_start (&clp->common);
+
+  status = !(clp->common.flags & IOPARM_CLOSE_HAS_STATUS) ? CLOSE_UNSPECIFIED :
+    find_option (&clp->common, clp->status, clp->status_len,
+                status_opt, "Bad STATUS parameter in CLOSE statement");
+
+  if ((clp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+  {
+    library_end ();
+    return;
+  }
+
+  u = find_unit (clp->common.unit);
+  if (u != NULL)
+    {
+      if (u->flags.status == STATUS_SCRATCH)
+       {
+         if (status == CLOSE_KEEP)
+           generate_error (&clp->common, LIBERROR_BAD_OPTION,
+                           "Can't KEEP a scratch file on CLOSE");
+#if !HAVE_UNLINK_OPEN_FILE
+         path = (char *) gfc_alloca (u->file_len + 1);
+          unpack_filename (path, u->file, u->file_len);
+#endif
+       }
+      else
+       {
+         if (status == CLOSE_DELETE)
+            {
+#if HAVE_UNLINK_OPEN_FILE
+             delete_file (u);
+#else
+             path = (char *) gfc_alloca (u->file_len + 1);
+              unpack_filename (path, u->file, u->file_len);
+#endif
+            }
+       }
+
+      close_unit (u);
+
+#if !HAVE_UNLINK_OPEN_FILE
+      if (path != NULL)
+        unlink (path);
+#endif
+    }
+
+  /* CLOSE on unconnected unit is legal and a no-op: F95 std., 9.3.5. */ 
+  library_end ();
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/fbuf.c b/l4/pkg/libgfortran/lib/contrib/io/fbuf.c
new file mode 100644 (file)
index 0000000..353e5ae
--- /dev/null
@@ -0,0 +1,269 @@
+/* Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Janne Blomqvist
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
+#include <string.h>
+#include <stdlib.h>
+
+
+//#define FBUF_DEBUG
+
+
+void
+fbuf_init (gfc_unit * u, int len)
+{
+  if (len == 0)
+    len = 512;                 /* Default size.  */
+
+  u->fbuf = get_mem (sizeof (struct fbuf));
+  u->fbuf->buf = get_mem (len);
+  u->fbuf->len = len;
+  u->fbuf->act = u->fbuf->pos = 0;
+}
+
+
+void
+fbuf_destroy (gfc_unit * u)
+{
+  if (u->fbuf == NULL)
+    return;
+  free (u->fbuf->buf);
+  free (u->fbuf);
+  u->fbuf = NULL;
+}
+
+
+static void
+#ifdef FBUF_DEBUG
+fbuf_debug (gfc_unit * u, const char * format, ...)
+{
+  va_list args;
+  va_start(args, format);
+  vfprintf(stderr, format, args);
+  va_end(args);
+  fprintf (stderr, "fbuf_debug pos: %d, act: %d, buf: ''", 
+           u->fbuf->pos, u->fbuf->act);
+  for (int ii = 0; ii < u->fbuf->act; ii++)
+    {
+      putc (u->fbuf->buf[ii], stderr);
+    }
+  fprintf (stderr, "''\n");
+}
+#else
+fbuf_debug (gfc_unit * u __attribute__ ((unused)),
+            const char * format __attribute__ ((unused)),
+            ...) {}
+#endif
+
+  
+
+/* You should probably call this before doing a physical seek on the
+   underlying device.  Returns how much the physical position was
+   modified.  */
+
+int
+fbuf_reset (gfc_unit * u)
+{
+  int seekval = 0;
+
+  if (!u->fbuf)
+    return 0;
+
+  fbuf_debug (u, "fbuf_reset: ");
+  fbuf_flush (u, u->mode);
+  /* If we read past the current position, seek the underlying device
+     back.  */
+  if (u->mode == READING && u->fbuf->act > u->fbuf->pos)
+    {
+      seekval = - (u->fbuf->act - u->fbuf->pos);
+      fbuf_debug (u, "fbuf_reset seekval %d, ", seekval);
+    }
+  u->fbuf->act = u->fbuf->pos = 0;
+  return seekval;
+}
+
+
+/* Return a pointer to the current position in the buffer, and increase
+   the pointer by len. Makes sure that the buffer is big enough, 
+   reallocating if necessary.  */
+
+char *
+fbuf_alloc (gfc_unit * u, int len)
+{
+  int newlen;
+  char *dest;
+  fbuf_debug (u, "fbuf_alloc len %d, ", len);
+  if (u->fbuf->pos + len > u->fbuf->len)
+    {
+      /* Round up to nearest multiple of the current buffer length.  */
+      newlen = ((u->fbuf->pos + len) / u->fbuf->len + 1) * u->fbuf->len;
+      dest = realloc (u->fbuf->buf, newlen);
+      if (dest == NULL)
+       return NULL;
+      u->fbuf->buf = dest;
+      u->fbuf->len = newlen;
+    }
+
+  dest = u->fbuf->buf + u->fbuf->pos;
+  u->fbuf->pos += len;
+  if (u->fbuf->pos > u->fbuf->act)
+    u->fbuf->act = u->fbuf->pos;
+  return dest;
+}
+
+
+/* mode argument is WRITING for write mode and READING for read
+   mode. Return value is 0 for success, -1 on failure.  */
+
+int
+fbuf_flush (gfc_unit * u, unit_mode mode)
+{
+  int nwritten;
+
+  if (!u->fbuf)
+    return 0;
+
+  fbuf_debug (u, "fbuf_flush with mode %d: ", mode);
+
+  if (mode == WRITING)
+    {
+      if (u->fbuf->pos > 0)
+       {
+         nwritten = swrite (u->s, u->fbuf->buf, u->fbuf->pos);
+         if (nwritten < 0)
+           return -1;
+       }
+    }
+  /* Salvage remaining bytes for both reading and writing. This
+     happens with the combination of advance='no' and T edit
+     descriptors leaving the final position somewhere not at the end
+     of the record. For reading, this also happens if we sread() past
+     the record boundary.  */ 
+  if (u->fbuf->act > u->fbuf->pos && u->fbuf->pos > 0)
+    memmove (u->fbuf->buf, u->fbuf->buf + u->fbuf->pos, 
+             u->fbuf->act - u->fbuf->pos);
+
+  u->fbuf->act -= u->fbuf->pos;
+  u->fbuf->pos = 0;
+
+  return 0;
+}
+
+
+int
+fbuf_seek (gfc_unit * u, int off, int whence)
+{
+  if (!u->fbuf)
+    return -1;
+
+  switch (whence)
+    {
+    case SEEK_SET:
+      break;
+    case SEEK_CUR:
+      off += u->fbuf->pos;
+      break;
+    case SEEK_END:
+      off += u->fbuf->act;
+      break;
+    default:
+      return -1;
+    }
+
+  fbuf_debug (u, "fbuf_seek, off %d ", off);
+  /* The start of the buffer is always equal to the left tab
+     limit. Moving to the left past the buffer is illegal in C and
+     would also imply moving past the left tab limit, which is never
+     allowed in Fortran. Similarly, seeking past the end of the buffer
+     is not possible, in that case the user must make sure to allocate
+     space with fbuf_alloc().  So return error if that is
+     attempted.  */
+  if (off < 0 || off > u->fbuf->act)
+    return -1;
+  u->fbuf->pos = off;
+  return off;
+}
+
+
+/* Fill the buffer with bytes for reading.  Returns a pointer to start
+   reading from. If we hit EOF, returns a short read count. If any
+   other error occurs, return NULL.  After reading, the caller is
+   expected to call fbuf_seek to update the position with the number
+   of bytes actually processed. */
+
+char *
+fbuf_read (gfc_unit * u, int * len)
+{
+  char *ptr;
+  int oldact, oldpos;
+  int readlen = 0;
+
+  fbuf_debug (u, "fbuf_read, len %d: ", *len);
+  oldact = u->fbuf->act;
+  oldpos = u->fbuf->pos;
+  ptr = fbuf_alloc (u, *len);
+  u->fbuf->pos = oldpos;
+  if (oldpos + *len > oldact)
+    {
+      fbuf_debug (u, "reading %d bytes starting at %d ", 
+                  oldpos + *len - oldact, oldact);
+      readlen = sread (u->s, u->fbuf->buf + oldact, oldpos + *len - oldact);
+      if (readlen < 0)
+       return NULL;
+      *len = oldact - oldpos + readlen;
+    }
+  u->fbuf->act = oldact + readlen;
+  fbuf_debug (u, "fbuf_read done: ");
+  return ptr;
+}
+
+
+/* When the fbuf_getc() inline function runs out of buffer space, it
+   calls this function to fill the buffer with bytes for
+   reading. Never call this function directly.  */
+
+int
+fbuf_getc_refill (gfc_unit * u)
+{
+  int nread;
+  char *p;
+
+  fbuf_debug (u, "fbuf_getc_refill ");
+
+  /* Read 80 bytes (average line length?).  This is a compromise
+     between not needing to call the read() syscall all the time and
+     not having to memmove unnecessary stuff when switching to the
+     next record.  */
+  nread = 80;
+
+  p = fbuf_read (u, &nread);
+
+  if (p && nread > 0)
+    return (unsigned char) u->fbuf->buf[u->fbuf->pos++];
+  else
+    return EOF;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/fbuf.h b/l4/pkg/libgfortran/lib/contrib/io/fbuf.h
new file mode 100644 (file)
index 0000000..3a2883b
--- /dev/null
@@ -0,0 +1,87 @@
+/* Copyright (C) 2009
+   Free Software Foundation, Inc.
+   Contributed by Janne Blomqvist
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GFOR_FBUF_H
+#define GFOR_FBUF_H
+
+#include "io.h"
+
+
+/* Formatting buffer. This is a temporary scratch buffer used by
+   formatted read and writes.  After every formatted I/O statement,
+   this buffer is flushed. This buffer is needed since not all devices
+   are seekable, and T or TL edit descriptors require moving backwards
+   in the record.  However, advance='no' complicates the situation, so
+   the buffer must only be partially flushed from the end of the last
+   flush until the current position in the record. */
+
+struct fbuf
+{
+  char *buf;                   /* Start of buffer.  */
+  int len;                     /* Length of buffer.  */
+  int act;                     /* Active bytes in buffer.  */
+  int pos;                     /* Current position in buffer.  */
+};
+
+extern void fbuf_init (gfc_unit *, int);
+internal_proto(fbuf_init);
+
+extern void fbuf_destroy (gfc_unit *);
+internal_proto(fbuf_destroy);
+
+extern int fbuf_reset (gfc_unit *);
+internal_proto(fbuf_reset);
+
+extern char * fbuf_alloc (gfc_unit *, int);
+internal_proto(fbuf_alloc);
+
+extern int fbuf_flush (gfc_unit *, unit_mode);
+internal_proto(fbuf_flush);
+
+extern int fbuf_seek (gfc_unit *, int, int);
+internal_proto(fbuf_seek);
+
+extern char * fbuf_read (gfc_unit *, int *);
+internal_proto(fbuf_read);
+
+/* Never call this function, only use fbuf_getc().  */
+extern int fbuf_getc_refill (gfc_unit *);
+internal_proto(fbuf_getc_refill);
+
+static inline int
+fbuf_getc (gfc_unit * u)
+{
+  if (u->fbuf->pos < u->fbuf->act)
+    return (unsigned char) u->fbuf->buf[u->fbuf->pos++];
+  return fbuf_getc_refill (u);
+}
+
+static inline char *
+fbuf_getptr (gfc_unit * u)
+{
+  return (char*) (u->fbuf->buf + u->fbuf->pos);
+}
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/io/file_pos.c b/l4/pkg/libgfortran/lib/contrib/io/file_pos.c
new file mode 100644 (file)
index 0000000..c8ecc3a
--- /dev/null
@@ -0,0 +1,458 @@
+/* Copyright (C) 2002-2003, 2005, 2006, 2007, 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught and Janne Blomqvist
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
+#include <string.h>
+
+/* file_pos.c-- Implement the file positioning statements, i.e. BACKSPACE,
+   ENDFILE, and REWIND as well as the FLUSH statement.  */
+
+
+/* formatted_backspace(fpp, u)-- Move the file back one line.  The
+   current position is after the newline that terminates the previous
+   record, and we have to sift backwards to find the newline before
+   that or the start of the file, whichever comes first.  */
+
+static const int READ_CHUNK = 4096;
+
+static void
+formatted_backspace (st_parameter_filepos *fpp, gfc_unit *u)
+{
+  gfc_offset base;
+  char p[READ_CHUNK];
+  ssize_t n;
+
+  base = stell (u->s) - 1;
+
+  do
+    {
+      n = (base < READ_CHUNK) ? base : READ_CHUNK;
+      base -= n;
+      if (sseek (u->s, base, SEEK_SET) < 0)
+        goto io_error;
+      if (sread (u->s, p, n) != n)
+       goto io_error;
+
+      /* We have moved backwards from the current position, it should
+         not be possible to get a short read.  Because it is not
+         clear what to do about such thing, we ignore the possibility.  */
+
+      /* There is no memrchr() in the C library, so we have to do it
+         ourselves.  */
+
+      while (n > 0)
+       {
+          n--;
+         if (p[n] == '\n')
+           {
+             base += n + 1;
+             goto done;
+           }
+       }
+
+    }
+  while (base != 0);
+
+  /* base is the new pointer.  Seek to it exactly.  */
+ done:
+  if (sseek (u->s, base, SEEK_SET) < 0)
+    goto io_error;
+  u->last_record--;
+  u->endfile = NO_ENDFILE;
+
+  return;
+
+ io_error:
+  generate_error (&fpp->common, LIBERROR_OS, NULL);
+}
+
+
+/* unformatted_backspace(fpp) -- Move the file backwards for an unformatted
+   sequential file.  We are guaranteed to be between records on entry and 
+   we have to shift to the previous record.  Loop over subrecords.  */
+
+static void
+unformatted_backspace (st_parameter_filepos *fpp, gfc_unit *u)
+{
+  gfc_offset m, slen;
+  GFC_INTEGER_4 m4;
+  GFC_INTEGER_8 m8;
+  ssize_t length;
+  int continued;
+  char p[sizeof (GFC_INTEGER_8)];
+
+  if (compile_options.record_marker == 0)
+    length = sizeof (GFC_INTEGER_4);
+  else
+    length = compile_options.record_marker;
+
+  do
+    {
+      slen = - (gfc_offset) length;
+      if (sseek (u->s, slen, SEEK_CUR) < 0)
+        goto io_error;
+      if (sread (u->s, p, length) != length)
+        goto io_error;
+
+      /* Only GFC_CONVERT_NATIVE and GFC_CONVERT_SWAP are valid here.  */
+      if (likely (u->flags.convert == GFC_CONVERT_NATIVE))
+       {
+         switch (length)
+           {
+           case sizeof(GFC_INTEGER_4):
+             memcpy (&m4, p, sizeof (m4));
+             m = m4;
+             break;
+
+           case sizeof(GFC_INTEGER_8):
+             memcpy (&m8, p, sizeof (m8));
+             m = m8;
+             break;
+
+           default:
+             runtime_error ("Illegal value for record marker");
+             break;
+           }
+       }
+      else
+       {
+         switch (length)
+           {
+           case sizeof(GFC_INTEGER_4):
+             reverse_memcpy (&m4, p, sizeof (m4));
+             m = m4;
+             break;
+
+           case sizeof(GFC_INTEGER_8):
+             reverse_memcpy (&m8, p, sizeof (m8));
+             m = m8;
+             break;
+
+           default:
+             runtime_error ("Illegal value for record marker");
+             break;
+           }
+
+       }
+
+      continued = m < 0;
+      if (continued)
+       m = -m;
+
+      if (sseek (u->s, -m -2 * length, SEEK_CUR) < 0)
+       goto io_error;
+    } while (continued);
+
+  u->last_record--;
+  return;
+
+ io_error:
+  generate_error (&fpp->common, LIBERROR_OS, NULL);
+}
+
+
+extern void st_backspace (st_parameter_filepos *);
+export_proto(st_backspace);
+
+void
+st_backspace (st_parameter_filepos *fpp)
+{
+  gfc_unit *u;
+
+  library_start (&fpp->common);
+
+  u = find_unit (fpp->common.unit);
+  if (u == NULL)
+    {
+      generate_error (&fpp->common, LIBERROR_BAD_UNIT, NULL);
+      goto done;
+    }
+
+  /* Direct access is prohibited, and so is unformatted stream access.  */
+
+
+  if (u->flags.access == ACCESS_DIRECT)
+    {
+      generate_error (&fpp->common, LIBERROR_OPTION_CONFLICT,
+                     "Cannot BACKSPACE a file opened for DIRECT access");
+      goto done;
+    }
+
+  if (u->flags.access == ACCESS_STREAM && u->flags.form == FORM_UNFORMATTED)
+    {
+      generate_error (&fpp->common, LIBERROR_OPTION_CONFLICT,
+                      "Cannot BACKSPACE an unformatted stream file");
+      goto done;
+    }
+
+  /* Make sure format buffer is flushed and reset.  */
+  if (u->flags.form == FORM_FORMATTED)
+    {
+      int pos = fbuf_reset (u);
+      if (pos != 0)
+        sseek (u->s, pos, SEEK_CUR);
+    }
+
+  
+  /* Check for special cases involving the ENDFILE record first.  */
+
+  if (u->endfile == AFTER_ENDFILE)
+    {
+      u->endfile = AT_ENDFILE;
+      u->flags.position = POSITION_APPEND;
+      sflush (u->s);
+    }
+  else
+    {
+      if (stell (u->s) == 0)
+       {
+         u->flags.position = POSITION_REWIND;
+         goto done;            /* Common special case */
+       }
+
+      if (u->mode == WRITING)
+       {
+         /* If there are previously written bytes from a write with
+            ADVANCE="no", add a record marker before performing the
+            BACKSPACE.  */
+
+         if (u->previous_nonadvancing_write)
+           finish_last_advance_record (u);
+
+         u->previous_nonadvancing_write = 0;
+
+         unit_truncate (u, stell (u->s), &fpp->common);
+         u->mode = READING;
+        }
+
+      if (u->flags.form == FORM_FORMATTED)
+       formatted_backspace (fpp, u);
+      else
+       unformatted_backspace (fpp, u);
+
+      u->flags.position = POSITION_UNSPECIFIED;
+      u->endfile = NO_ENDFILE;
+      u->current_record = 0;
+      u->bytes_left = 0;
+    }
+
+ done:
+  if (u != NULL)
+    unlock_unit (u);
+
+  library_end ();
+}
+
+
+extern void st_endfile (st_parameter_filepos *);
+export_proto(st_endfile);
+
+void
+st_endfile (st_parameter_filepos *fpp)
+{
+  gfc_unit *u;
+
+  library_start (&fpp->common);
+
+  u = find_unit (fpp->common.unit);
+  if (u != NULL)
+    {
+      if (u->flags.access == ACCESS_DIRECT)
+       {
+         generate_error (&fpp->common, LIBERROR_OPTION_CONFLICT,
+                         "Cannot perform ENDFILE on a file opened "
+                         "for DIRECT access");
+         goto done;
+       }
+
+      if (u->flags.access == ACCESS_SEQUENTIAL
+         && u->endfile == AFTER_ENDFILE)
+       {
+         generate_error (&fpp->common, LIBERROR_OPTION_CONFLICT,
+                         "Cannot perform ENDFILE on a file already "
+                         "positioned after the EOF marker");
+         goto done;
+       }
+
+      /* If there are previously written bytes from a write with ADVANCE="no",
+        add a record marker before performing the ENDFILE.  */
+
+      if (u->previous_nonadvancing_write)
+       finish_last_advance_record (u);
+
+      u->previous_nonadvancing_write = 0;
+
+      if (u->current_record)
+       {
+         st_parameter_dt dtp;
+         dtp.common = fpp->common;
+         memset (&dtp.u.p, 0, sizeof (dtp.u.p));
+         dtp.u.p.current_unit = u;
+         next_record (&dtp, 1);
+       }
+
+      unit_truncate (u, stell (u->s), &fpp->common);
+      u->endfile = AFTER_ENDFILE;
+      if (0 == stell (u->s))
+        u->flags.position = POSITION_REWIND;
+    }
+  else
+    {
+      if (fpp->common.unit < 0)
+       {
+         generate_error (&fpp->common, LIBERROR_BAD_OPTION,
+                         "Bad unit number in statement");
+         return;
+       }
+
+      u = find_or_create_unit (fpp->common.unit);
+      if (u->s == NULL)
+       {
+         /* Open the unit with some default flags.  */
+         st_parameter_open opp;
+         unit_flags u_flags;
+
+         memset (&u_flags, '\0', sizeof (u_flags));
+         u_flags.access = ACCESS_SEQUENTIAL;
+         u_flags.action = ACTION_READWRITE;
+
+         /* Is it unformatted?  */
+         if (!(fpp->common.flags & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT
+                                    | IOPARM_DT_IONML_SET)))
+           u_flags.form = FORM_UNFORMATTED;
+         else
+           u_flags.form = FORM_UNSPECIFIED;
+
+         u_flags.delim = DELIM_UNSPECIFIED;
+         u_flags.blank = BLANK_UNSPECIFIED;
+         u_flags.pad = PAD_UNSPECIFIED;
+         u_flags.decimal = DECIMAL_UNSPECIFIED;
+         u_flags.encoding = ENCODING_UNSPECIFIED;
+         u_flags.async = ASYNC_UNSPECIFIED;
+         u_flags.round = ROUND_UNSPECIFIED;
+         u_flags.sign = SIGN_UNSPECIFIED;
+         u_flags.status = STATUS_UNKNOWN;
+         u_flags.convert = GFC_CONVERT_NATIVE;
+
+         opp.common = fpp->common;
+         opp.common.flags &= IOPARM_COMMON_MASK;
+         u = new_unit (&opp, u, &u_flags);
+         if (u == NULL)
+           return;
+         u->endfile = AFTER_ENDFILE;
+       }
+    }
+
+  done:
+    unlock_unit (u);
+
+  library_end ();
+}
+
+
+extern void st_rewind (st_parameter_filepos *);
+export_proto(st_rewind);
+
+void
+st_rewind (st_parameter_filepos *fpp)
+{
+  gfc_unit *u;
+
+  library_start (&fpp->common);
+
+  u = find_unit (fpp->common.unit);
+  if (u != NULL)
+    {
+      if (u->flags.access == ACCESS_DIRECT)
+       generate_error (&fpp->common, LIBERROR_BAD_OPTION,
+                       "Cannot REWIND a file opened for DIRECT access");
+      else
+       {
+         /* If there are previously written bytes from a write with ADVANCE="no",
+            add a record marker before performing the ENDFILE.  */
+
+         if (u->previous_nonadvancing_write)
+           finish_last_advance_record (u);
+
+         u->previous_nonadvancing_write = 0;
+
+         fbuf_reset (u);
+
+         u->last_record = 0;
+
+         if (sseek (u->s, 0, SEEK_SET) < 0)
+           generate_error (&fpp->common, LIBERROR_OS, NULL);
+
+         /* Set this for compatibilty with g77 for /dev/null.  */
+         if (ssize (u->s) == 0)
+           u->endfile = AT_ENDFILE;
+         else
+           {
+             /* We are rewinding so we are not at the end.  */
+             u->endfile = NO_ENDFILE;
+           }
+         
+         u->current_record = 0;
+         u->strm_pos = 1;
+         u->read_bad = 0;
+       }
+      /* Update position for INQUIRE.  */
+      u->flags.position = POSITION_REWIND;
+      unlock_unit (u);
+    }
+
+  library_end ();
+}
+
+
+extern void st_flush (st_parameter_filepos *);
+export_proto(st_flush);
+
+void
+st_flush (st_parameter_filepos *fpp)
+{
+  gfc_unit *u;
+
+  library_start (&fpp->common);
+
+  u = find_unit (fpp->common.unit);
+  if (u != NULL)
+    {
+      /* Make sure format buffer is flushed.  */
+      if (u->flags.form == FORM_FORMATTED)
+        fbuf_flush (u, u->mode);
+
+      sflush (u->s);
+      unlock_unit (u);
+    }
+  else
+    /* FLUSH on unconnected unit is illegal: F95 std., 9.3.5. */ 
+    generate_error (&fpp->common, LIBERROR_BAD_OPTION,
+                       "Specified UNIT in FLUSH is not connected");
+
+  library_end ();
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/format.c b/l4/pkg/libgfortran/lib/contrib/io/format.c
new file mode 100644 (file)
index 0000000..1711a75
--- /dev/null
@@ -0,0 +1,1400 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* format.c-- parse a FORMAT string into a binary format suitable for
+ * interpretation during I/O statements */
+
+#include "io.h"
+#include "format.h"
+#include <ctype.h>
+#include <string.h>
+#include <stdbool.h>
+#include <stdlib.h>
+
+
+static const fnode colon_node = { FMT_COLON, 0, NULL, NULL, {{ 0, 0, 0 }}, 0,
+                                 NULL };
+
+/* Error messages. */
+
+static const char posint_required[] = "Positive width required in format",
+  period_required[] = "Period required in format",
+  nonneg_required[] = "Nonnegative width required in format",
+  unexpected_element[] = "Unexpected element '%c' in format\n",
+  unexpected_end[] = "Unexpected end of format string",
+  bad_string[] = "Unterminated character constant in format",
+  bad_hollerith[] = "Hollerith constant extends past the end of the format",
+  reversion_error[] = "Exhausted data descriptors in format",
+  zero_width[] = "Zero width in format descriptor";
+
+/* The following routines support caching format data from parsed format strings
+   into a hash table.  This avoids repeatedly parsing duplicate format strings
+   or format strings in I/O statements that are repeated in loops.  */
+
+
+/* Traverse the table and free all data.  */
+
+void
+free_format_hash_table (gfc_unit *u)
+{
+  size_t i;
+
+  /* free_format_data handles any NULL pointers.  */
+  for (i = 0; i < FORMAT_HASH_SIZE; i++)
+    {
+      if (u->format_hash_table[i].hashed_fmt != NULL)
+       {
+         free_format_data (u->format_hash_table[i].hashed_fmt);
+         free (u->format_hash_table[i].key);
+       }
+      u->format_hash_table[i].key = NULL;
+      u->format_hash_table[i].key_len = 0;      
+      u->format_hash_table[i].hashed_fmt = NULL;
+    }
+}
+
+/* Traverse the format_data structure and reset the fnode counters.  */
+
+static void
+reset_node (fnode *fn)
+{
+  fnode *f;
+
+  fn->count = 0;
+  fn->current = NULL;
+  
+  if (fn->format != FMT_LPAREN)
+    return;
+
+  for (f = fn->u.child; f; f = f->next)
+    {
+      if (f->format == FMT_RPAREN)
+       break;
+      reset_node (f);
+    }
+}
+
+static void
+reset_fnode_counters (st_parameter_dt *dtp)
+{
+  fnode *f;
+  format_data *fmt;
+
+  fmt = dtp->u.p.fmt;
+
+  /* Clear this pointer at the head so things start at the right place.  */
+  fmt->array.array[0].current = NULL;
+
+  for (f = fmt->array.array[0].u.child; f; f = f->next)
+    reset_node (f);
+}
+
+
+/* A simple hashing function to generate an index into the hash table.  */
+
+static uint32_t
+format_hash (st_parameter_dt *dtp)
+{
+  char *key;
+  gfc_charlen_type key_len;
+  uint32_t hash = 0;
+  gfc_charlen_type i;
+
+  /* Hash the format string. Super simple, but what the heck!  */
+  key = dtp->format;
+  key_len = dtp->format_len;
+  for (i = 0; i < key_len; i++)
+    hash ^= key[i];
+  hash &= (FORMAT_HASH_SIZE - 1);
+  return hash;
+}
+
+
+static void
+save_parsed_format (st_parameter_dt *dtp)
+{
+  uint32_t hash;
+  gfc_unit *u;
+
+  hash = format_hash (dtp);
+  u = dtp->u.p.current_unit;
+
+  /* Index into the hash table.  We are simply replacing whatever is there
+     relying on probability.  */
+  if (u->format_hash_table[hash].hashed_fmt != NULL)
+    free_format_data (u->format_hash_table[hash].hashed_fmt);
+  u->format_hash_table[hash].hashed_fmt = NULL;
+
+  free (u->format_hash_table[hash].key);
+  u->format_hash_table[hash].key = get_mem (dtp->format_len);
+  memcpy (u->format_hash_table[hash].key, dtp->format, dtp->format_len);
+
+  u->format_hash_table[hash].key_len = dtp->format_len;
+  u->format_hash_table[hash].hashed_fmt = dtp->u.p.fmt;
+}
+
+
+static format_data *
+find_parsed_format (st_parameter_dt *dtp)
+{
+  uint32_t hash;
+  gfc_unit *u;
+
+  hash = format_hash (dtp);
+  u = dtp->u.p.current_unit;
+
+  if (u->format_hash_table[hash].key != NULL)
+    {
+      /* See if it matches.  */
+      if (u->format_hash_table[hash].key_len == dtp->format_len)
+       {
+         /* So far so good.  */
+         if (strncmp (u->format_hash_table[hash].key,
+             dtp->format, dtp->format_len) == 0)
+           return u->format_hash_table[hash].hashed_fmt;
+       }
+    }
+  return NULL;
+}
+
+
+/* next_char()-- Return the next character in the format string.
+ * Returns -1 when the string is done.  If the literal flag is set,
+ * spaces are significant, otherwise they are not. */
+
+static int
+next_char (format_data *fmt, int literal)
+{
+  int c;
+
+  do
+    {
+      if (fmt->format_string_len == 0)
+       return -1;
+
+      fmt->format_string_len--;
+      c = toupper (*fmt->format_string++);
+      fmt->error_element = c;
+    }
+  while ((c == ' ' || c == '\t') && !literal);
+
+  return c;
+}
+
+
+/* unget_char()-- Back up one character position. */
+
+#define unget_char(fmt) \
+  { fmt->format_string--; fmt->format_string_len++; }
+
+
+/* get_fnode()-- Allocate a new format node, inserting it into the
+ * current singly linked list.  These are initially allocated from the
+ * static buffer. */
+
+static fnode *
+get_fnode (format_data *fmt, fnode **head, fnode **tail, format_token t)
+{
+  fnode *f;
+
+  if (fmt->avail == &fmt->last->array[FARRAY_SIZE])
+    {
+      fmt->last->next = get_mem (sizeof (fnode_array));
+      fmt->last = fmt->last->next;
+      fmt->last->next = NULL;
+      fmt->avail = &fmt->last->array[0];
+    }
+  f = fmt->avail++;
+  memset (f, '\0', sizeof (fnode));
+
+  if (*head == NULL)
+    *head = *tail = f;
+  else
+    {
+      (*tail)->next = f;
+      *tail = f;
+    }
+
+  f->format = t;
+  f->repeat = -1;
+  f->source = fmt->format_string;
+  return f;
+}
+
+
+/* free_format_data()-- Free all allocated format data.  */
+
+void
+free_format_data (format_data *fmt)
+{
+  fnode_array *fa, *fa_next;
+
+
+  if (fmt == NULL)
+    return;
+
+  for (fa = fmt->array.next; fa; fa = fa_next)
+    {
+      fa_next = fa->next;
+      free (fa);
+    }
+
+  free (fmt);
+  fmt = NULL;
+}
+
+
+/* format_lex()-- Simple lexical analyzer for getting the next token
+ * in a FORMAT string.  We support a one-level token pushback in the
+ * fmt->saved_token variable. */
+
+static format_token
+format_lex (format_data *fmt)
+{
+  format_token token;
+  int negative_flag;
+  int c;
+  char delim;
+
+  if (fmt->saved_token != FMT_NONE)
+    {
+      token = fmt->saved_token;
+      fmt->saved_token = FMT_NONE;
+      return token;
+    }
+
+  negative_flag = 0;
+  c = next_char (fmt, 0);
+
+  switch (c)
+    {
+    case '*':
+       token = FMT_STAR;
+       break;
+
+    case '(':
+      token = FMT_LPAREN;
+      break;
+
+    case ')':
+      token = FMT_RPAREN;
+      break;
+
+    case '-':
+      negative_flag = 1;
+      /* Fall Through */
+
+    case '+':
+      c = next_char (fmt, 0);
+      if (!isdigit (c))
+       {
+         token = FMT_UNKNOWN;
+         break;
+       }
+
+      fmt->value = c - '0';
+
+      for (;;)
+       {
+         c = next_char (fmt, 0);
+         if (!isdigit (c))
+           break;
+
+         fmt->value = 10 * fmt->value + c - '0';
+       }
+
+      unget_char (fmt);
+
+      if (negative_flag)
+       fmt->value = -fmt->value;
+      token = FMT_SIGNED_INT;
+      break;
+
+    case '0':
+    case '1':
+    case '2':
+    case '3':
+    case '4':
+    case '5':
+    case '6':
+    case '7':
+    case '8':
+    case '9':
+      fmt->value = c - '0';
+
+      for (;;)
+       {
+         c = next_char (fmt, 0);
+         if (!isdigit (c))
+           break;
+
+         fmt->value = 10 * fmt->value + c - '0';
+       }
+
+      unget_char (fmt);
+      token = (fmt->value == 0) ? FMT_ZERO : FMT_POSINT;
+      break;
+
+    case '.':
+      token = FMT_PERIOD;
+      break;
+
+    case ',':
+      token = FMT_COMMA;
+      break;
+
+    case ':':
+      token = FMT_COLON;
+      break;
+
+    case '/':
+      token = FMT_SLASH;
+      break;
+
+    case '$':
+      token = FMT_DOLLAR;
+      break;
+
+    case 'T':
+      switch (next_char (fmt, 0))
+       {
+       case 'L':
+         token = FMT_TL;
+         break;
+       case 'R':
+         token = FMT_TR;
+         break;
+       default:
+         token = FMT_T;
+         unget_char (fmt);
+         break;
+       }
+
+      break;
+
+    case 'X':
+      token = FMT_X;
+      break;
+
+    case 'S':
+      switch (next_char (fmt, 0))
+       {
+       case 'S':
+         token = FMT_SS;
+         break;
+       case 'P':
+         token = FMT_SP;
+         break;
+       default:
+         token = FMT_S;
+         unget_char (fmt);
+         break;
+       }
+
+      break;
+
+    case 'B':
+      switch (next_char (fmt, 0))
+       {
+       case 'N':
+         token = FMT_BN;
+         break;
+       case 'Z':
+         token = FMT_BZ;
+         break;
+       default:
+         token = FMT_B;
+         unget_char (fmt);
+         break;
+       }
+
+      break;
+
+    case '\'':
+    case '"':
+      delim = c;
+
+      fmt->string = fmt->format_string;
+      fmt->value = 0;          /* This is the length of the string */
+
+      for (;;)
+       {
+         c = next_char (fmt, 1);
+         if (c == -1)
+           {
+             token = FMT_BADSTRING;
+             fmt->error = bad_string;
+             break;
+           }
+
+         if (c == delim)
+           {
+             c = next_char (fmt, 1);
+
+             if (c == -1)
+               {
+                 token = FMT_BADSTRING;
+                 fmt->error = bad_string;
+                 break;
+               }
+
+             if (c != delim)
+               {
+                 unget_char (fmt);
+                 token = FMT_STRING;
+                 break;
+               }
+           }
+
+         fmt->value++;
+       }
+
+      break;
+
+    case 'P':
+      token = FMT_P;
+      break;
+
+    case 'I':
+      token = FMT_I;
+      break;
+
+    case 'O':
+      token = FMT_O;
+      break;
+
+    case 'Z':
+      token = FMT_Z;
+      break;
+
+    case 'F':
+      token = FMT_F;
+      break;
+
+    case 'E':
+      switch (next_char (fmt, 0))
+       {
+       case 'N':
+         token = FMT_EN;
+         break;
+       case 'S':
+         token = FMT_ES;
+         break;
+       default:
+         token = FMT_E;
+         unget_char (fmt);
+         break;
+       }
+      break;
+
+    case 'G':
+      token = FMT_G;
+      break;
+
+    case 'H':
+      token = FMT_H;
+      break;
+
+    case 'L':
+      token = FMT_L;
+      break;
+
+    case 'A':
+      token = FMT_A;
+      break;
+
+    case 'D':
+      switch (next_char (fmt, 0))
+       {
+       case 'P':
+         token = FMT_DP;
+         break;
+       case 'C':
+         token = FMT_DC;
+         break;
+       default:
+         token = FMT_D;
+         unget_char (fmt);
+         break;
+       }
+      break;
+
+    case 'R':
+      switch (next_char (fmt, 0))
+       {
+       case 'C':
+         token = FMT_RC;
+         break;
+       case 'D':
+         token = FMT_RD;
+         break;
+       case 'N':
+         token = FMT_RN;
+         break;
+       case 'P':
+         token = FMT_RP;
+         break;
+       case 'U':
+         token = FMT_RU;
+         break;
+       case 'Z':
+         token = FMT_RZ;
+         break;
+       default:
+         unget_char (fmt);
+         token = FMT_UNKNOWN;
+         break;
+       }
+      break;
+
+    case -1:
+      token = FMT_END;
+      break;
+
+    default:
+      token = FMT_UNKNOWN;
+      break;
+    }
+
+  return token;
+}
+
+
+/* parse_format_list()-- Parse a format list.  Assumes that a left
+ * paren has already been seen.  Returns a list representing the
+ * parenthesis node which contains the rest of the list. */
+
+static fnode *
+parse_format_list (st_parameter_dt *dtp, bool *save_ok, bool *seen_dd)
+{
+  fnode *head, *tail;
+  format_token t, u, t2;
+  int repeat;
+  format_data *fmt = dtp->u.p.fmt;
+  bool saveit, seen_data_desc = false;
+
+  head = tail = NULL;
+  saveit = *save_ok;
+
+  /* Get the next format item */
+ format_item:
+  t = format_lex (fmt);
+ format_item_1:
+  switch (t)
+    {
+    case FMT_STAR:
+      t = format_lex (fmt);
+      if (t != FMT_LPAREN)
+       {
+         fmt->error = "Left parenthesis required after '*'";
+         goto finished;
+       }
+      get_fnode (fmt, &head, &tail, FMT_LPAREN);
+      tail->repeat = -2;  /* Signifies unlimited format.  */
+      tail->u.child = parse_format_list (dtp, &saveit, &seen_data_desc);
+      if (fmt->error != NULL)
+       goto finished;
+      if (!seen_data_desc)
+       {
+         fmt->error = "'*' requires at least one associated data descriptor";
+         goto finished;
+       }
+      goto between_desc;
+
+    case FMT_POSINT:
+      repeat = fmt->value;
+
+      t = format_lex (fmt);
+      switch (t)
+       {
+       case FMT_LPAREN:
+         get_fnode (fmt, &head, &tail, FMT_LPAREN);
+         tail->repeat = repeat;
+         tail->u.child = parse_format_list (dtp, &saveit, &seen_data_desc);
+         *seen_dd = seen_data_desc;
+         if (fmt->error != NULL)
+           goto finished;
+
+         goto between_desc;
+
+       case FMT_SLASH:
+         get_fnode (fmt, &head, &tail, FMT_SLASH);
+         tail->repeat = repeat;
+         goto optional_comma;
+
+       case FMT_X:
+         get_fnode (fmt, &head, &tail, FMT_X);
+         tail->repeat = 1;
+         tail->u.k = fmt->value;
+         goto between_desc;
+
+       case FMT_P:
+         goto p_descriptor;
+
+       default:
+         goto data_desc;
+       }
+
+    case FMT_LPAREN:
+      get_fnode (fmt, &head, &tail, FMT_LPAREN);
+      tail->repeat = 1;
+      tail->u.child = parse_format_list (dtp, &saveit, &seen_data_desc);
+      *seen_dd = seen_data_desc;
+      if (fmt->error != NULL)
+       goto finished;
+
+      goto between_desc;
+
+    case FMT_SIGNED_INT:       /* Signed integer can only precede a P format.  */
+    case FMT_ZERO:             /* Same for zero.  */
+      t = format_lex (fmt);
+      if (t != FMT_P)
+       {
+         fmt->error = "Expected P edit descriptor in format";
+         goto finished;
+       }
+
+    p_descriptor:
+      get_fnode (fmt, &head, &tail, FMT_P);
+      tail->u.k = fmt->value;
+      tail->repeat = 1;
+
+      t = format_lex (fmt);
+      if (t == FMT_F || t == FMT_EN || t == FMT_ES || t == FMT_D
+         || t == FMT_G || t == FMT_E)
+       {
+         repeat = 1;
+         goto data_desc;
+       }
+
+      if (t != FMT_COMMA && t != FMT_RPAREN && t != FMT_SLASH
+         && t != FMT_POSINT)
+       {
+         fmt->error = "Comma required after P descriptor";
+         goto finished;
+       }
+
+      fmt->saved_token = t;
+      goto optional_comma;
+
+    case FMT_P:                /* P and X require a prior number */
+      fmt->error = "P descriptor requires leading scale factor";
+      goto finished;
+
+    case FMT_X:
+/*
+   EXTENSION!
+
+   If we would be pedantic in the library, we would have to reject
+   an X descriptor without an integer prefix:
+
+      fmt->error = "X descriptor requires leading space count";
+      goto finished;
+
+   However, this is an extension supported by many Fortran compilers,
+   including Cray, HP, AIX, and IRIX.  Therefore, we allow it in the
+   runtime library, and make the front end reject it if the compiler
+   is in pedantic mode.  The interpretation of 'X' is '1X'.
+*/
+      get_fnode (fmt, &head, &tail, FMT_X);
+      tail->repeat = 1;
+      tail->u.k = 1;
+      goto between_desc;
+
+    case FMT_STRING:
+      /* TODO: Find out why it is necessary to turn off format caching.  */
+      saveit = false;
+      get_fnode (fmt, &head, &tail, FMT_STRING);
+      tail->u.string.p = fmt->string;
+      tail->u.string.length = fmt->value;
+      tail->repeat = 1;
+      goto optional_comma;
+      
+    case FMT_RC:
+    case FMT_RD:
+    case FMT_RN:
+    case FMT_RP:
+    case FMT_RU:
+    case FMT_RZ:
+      notify_std (&dtp->common, GFC_STD_F2003, "Fortran 2003: Round "
+                 "descriptor not allowed");
+      get_fnode (fmt, &head, &tail, t);
+      tail->repeat = 1;
+      goto between_desc;
+
+    case FMT_DC:
+    case FMT_DP:
+      notify_std (&dtp->common, GFC_STD_F2003, "Fortran 2003: DC or DP "
+                 "descriptor not allowed");
+    /* Fall through.  */
+    case FMT_S:
+    case FMT_SS:
+    case FMT_SP:
+    case FMT_BN:
+    case FMT_BZ:
+      get_fnode (fmt, &head, &tail, t);
+      tail->repeat = 1;
+      goto between_desc;
+
+    case FMT_COLON:
+      get_fnode (fmt, &head, &tail, FMT_COLON);
+      tail->repeat = 1;
+      goto optional_comma;
+
+    case FMT_SLASH:
+      get_fnode (fmt, &head, &tail, FMT_SLASH);
+      tail->repeat = 1;
+      tail->u.r = 1;
+      goto optional_comma;
+
+    case FMT_DOLLAR:
+      get_fnode (fmt, &head, &tail, FMT_DOLLAR);
+      tail->repeat = 1;
+      notify_std (&dtp->common, GFC_STD_GNU, "Extension: $ descriptor");
+      goto between_desc;
+
+    case FMT_T:
+    case FMT_TL:
+    case FMT_TR:
+      t2 = format_lex (fmt);
+      if (t2 != FMT_POSINT)
+       {
+         fmt->error = posint_required;
+         goto finished;
+       }
+      get_fnode (fmt, &head, &tail, t);
+      tail->u.n = fmt->value;
+      tail->repeat = 1;
+      goto between_desc;
+
+    case FMT_I:
+    case FMT_B:
+    case FMT_O:
+    case FMT_Z:
+    case FMT_E:
+    case FMT_EN:
+    case FMT_ES:
+    case FMT_D:
+    case FMT_L:
+    case FMT_A:
+    case FMT_F:
+    case FMT_G:
+      repeat = 1;
+      *seen_dd = true;
+      goto data_desc;
+
+    case FMT_H:
+      get_fnode (fmt, &head, &tail, FMT_STRING);
+      if (fmt->format_string_len < 1)
+       {
+         fmt->error = bad_hollerith;
+         goto finished;
+       }
+
+      tail->u.string.p = fmt->format_string;
+      tail->u.string.length = 1;
+      tail->repeat = 1;
+
+      fmt->format_string++;
+      fmt->format_string_len--;
+
+      goto between_desc;
+
+    case FMT_END:
+      fmt->error = unexpected_end;
+      goto finished;
+
+    case FMT_BADSTRING:
+      goto finished;
+
+    case FMT_RPAREN:
+      goto finished;
+
+    default:
+      fmt->error = unexpected_element;
+      goto finished;
+    }
+
+  /* In this state, t must currently be a data descriptor.  Deal with
+     things that can/must follow the descriptor */
+ data_desc:
+  switch (t)
+    {
+    case FMT_L:
+      t = format_lex (fmt);
+      if (t != FMT_POSINT)
+       {
+         if (notification_std(GFC_STD_GNU) == NOTIFICATION_ERROR)
+           {
+             fmt->error = posint_required;
+             goto finished;
+           }
+         else
+           {
+             fmt->saved_token = t;
+             fmt->value = 1;   /* Default width */
+             notify_std (&dtp->common, GFC_STD_GNU, posint_required);
+           }
+       }
+
+      get_fnode (fmt, &head, &tail, FMT_L);
+      tail->u.n = fmt->value;
+      tail->repeat = repeat;
+      break;
+
+    case FMT_A:
+      t = format_lex (fmt);
+      if (t == FMT_ZERO)
+       {
+         fmt->error = zero_width;
+         goto finished;
+       }
+
+      if (t != FMT_POSINT)
+       {
+         fmt->saved_token = t;
+         fmt->value = -1;              /* Width not present */
+       }
+
+      get_fnode (fmt, &head, &tail, FMT_A);
+      tail->repeat = repeat;
+      tail->u.n = fmt->value;
+      break;
+
+    case FMT_D:
+    case FMT_E:
+    case FMT_F:
+    case FMT_G:
+    case FMT_EN:
+    case FMT_ES:
+      get_fnode (fmt, &head, &tail, t);
+      tail->repeat = repeat;
+
+      u = format_lex (fmt);
+      if (t == FMT_G && u == FMT_ZERO)
+       {
+         if (notification_std (GFC_STD_F2008) == NOTIFICATION_ERROR
+             || dtp->u.p.mode == READING)
+           {
+             fmt->error = zero_width;
+             goto finished;
+           }
+         tail->u.real.w = 0;
+         u = format_lex (fmt);
+         if (u != FMT_PERIOD)
+           {
+             fmt->saved_token = u;
+             break;
+           }
+
+         u = format_lex (fmt);
+         if (u != FMT_POSINT)
+           {
+             fmt->error = posint_required;
+             goto finished;
+           }
+         tail->u.real.d = fmt->value;
+         break;
+       }
+      if (t == FMT_F && dtp->u.p.mode == WRITING)
+       {
+         if (u != FMT_POSINT && u != FMT_ZERO)
+           {
+             fmt->error = nonneg_required;
+             goto finished;
+           }
+       }
+      else if (u != FMT_POSINT)
+       {
+         fmt->error = posint_required;
+         goto finished;
+       }
+
+      tail->u.real.w = fmt->value;
+      t2 = t;
+      t = format_lex (fmt);
+      if (t != FMT_PERIOD)
+       {
+         /* We treat a missing decimal descriptor as 0.  Note: This is only
+            allowed if -std=legacy, otherwise an error occurs.  */
+         if (compile_options.warn_std != 0)
+           {
+             fmt->error = period_required;
+             goto finished;
+           }
+         fmt->saved_token = t;
+         tail->u.real.d = 0;
+         tail->u.real.e = -1;
+         break;
+       }
+
+      t = format_lex (fmt);
+      if (t != FMT_ZERO && t != FMT_POSINT)
+       {
+         fmt->error = nonneg_required;
+         goto finished;
+       }
+
+      tail->u.real.d = fmt->value;
+      tail->u.real.e = -1;
+
+      if (t2 == FMT_D || t2 == FMT_F)
+       break;
+
+
+      /* Look for optional exponent */
+      t = format_lex (fmt);
+      if (t != FMT_E)
+       fmt->saved_token = t;
+      else
+       {
+         t = format_lex (fmt);
+         if (t != FMT_POSINT)
+           {
+             fmt->error = "Positive exponent width required in format";
+             goto finished;
+           }
+
+         tail->u.real.e = fmt->value;
+       }
+
+      break;
+
+    case FMT_H:
+      if (repeat > fmt->format_string_len)
+       {
+         fmt->error = bad_hollerith;
+         goto finished;
+       }
+
+      get_fnode (fmt, &head, &tail, FMT_STRING);
+      tail->u.string.p = fmt->format_string;
+      tail->u.string.length = repeat;
+      tail->repeat = 1;
+
+      fmt->format_string += fmt->value;
+      fmt->format_string_len -= repeat;
+
+      break;
+
+    case FMT_I:
+    case FMT_B:
+    case FMT_O:
+    case FMT_Z:
+      get_fnode (fmt, &head, &tail, t);
+      tail->repeat = repeat;
+
+      t = format_lex (fmt);
+
+      if (dtp->u.p.mode == READING)
+       {
+         if (t != FMT_POSINT)
+           {
+             fmt->error = posint_required;
+             goto finished;
+           }
+       }
+      else
+       {
+         if (t != FMT_ZERO && t != FMT_POSINT)
+           {
+             fmt->error = nonneg_required;
+             goto finished;
+           }
+       }
+
+      tail->u.integer.w = fmt->value;
+      tail->u.integer.m = -1;
+
+      t = format_lex (fmt);
+      if (t != FMT_PERIOD)
+       {
+         fmt->saved_token = t;
+       }
+      else
+       {
+         t = format_lex (fmt);
+         if (t != FMT_ZERO && t != FMT_POSINT)
+           {
+             fmt->error = nonneg_required;
+             goto finished;
+           }
+
+         tail->u.integer.m = fmt->value;
+       }
+
+      if (tail->u.integer.w != 0 && tail->u.integer.m > tail->u.integer.w)
+       {
+         fmt->error = "Minimum digits exceeds field width";
+         goto finished;
+       }
+
+      break;
+
+    default:
+      fmt->error = unexpected_element;
+      goto finished;
+    }
+
+  /* Between a descriptor and what comes next */
+ between_desc:
+  t = format_lex (fmt);
+  switch (t)
+    {
+    case FMT_COMMA:
+      goto format_item;
+
+    case FMT_RPAREN:
+      goto finished;
+
+    case FMT_SLASH:
+    case FMT_COLON:
+      get_fnode (fmt, &head, &tail, t);
+      tail->repeat = 1;
+      goto optional_comma;
+
+    case FMT_END:
+      fmt->error = unexpected_end;
+      goto finished;
+
+    default:
+      /* Assume a missing comma, this is a GNU extension */
+      goto format_item_1;
+    }
+
+  /* Optional comma is a weird between state where we've just finished
+     reading a colon, slash or P descriptor. */
+ optional_comma:
+  t = format_lex (fmt);
+  switch (t)
+    {
+    case FMT_COMMA:
+      break;
+
+    case FMT_RPAREN:
+      goto finished;
+
+    default:                   /* Assume that we have another format item */
+      fmt->saved_token = t;
+      break;
+    }
+
+  goto format_item;
+
+ finished:
+
+  *save_ok = saveit;
+  
+  return head;
+}
+
+
+/* format_error()-- Generate an error message for a format statement.
+ * If the node that gives the location of the error is NULL, the error
+ * is assumed to happen at parse time, and the current location of the
+ * parser is shown.
+ *
+ * We generate a message showing where the problem is.  We take extra
+ * care to print only the relevant part of the format if it is longer
+ * than a standard 80 column display. */
+
+void
+format_error (st_parameter_dt *dtp, const fnode *f, const char *message)
+{
+  int width, i, j, offset;
+#define BUFLEN 300
+  char *p, buffer[BUFLEN];
+  format_data *fmt = dtp->u.p.fmt;
+
+  if (f != NULL)
+    fmt->format_string = f->source;
+
+  if (message == unexpected_element)
+    snprintf (buffer, BUFLEN, message, fmt->error_element);
+  else
+    snprintf (buffer, BUFLEN, "%s\n", message);
+
+  j = fmt->format_string - dtp->format;
+
+  offset = (j > 60) ? j - 40 : 0;
+
+  j -= offset;
+  width = dtp->format_len - offset;
+
+  if (width > 80)
+    width = 80;
+
+  /* Show the format */
+
+  p = strchr (buffer, '\0');
+
+  memcpy (p, dtp->format + offset, width);
+
+  p += width;
+  *p++ = '\n';
+
+  /* Show where the problem is */
+
+  for (i = 1; i < j; i++)
+    *p++ = ' ';
+
+  *p++ = '^';
+  *p = '\0';
+
+  generate_error (&dtp->common, LIBERROR_FORMAT, buffer);
+}
+
+
+/* revert()-- Do reversion of the format.  Control reverts to the left
+ * parenthesis that matches the rightmost right parenthesis.  From our
+ * tree structure, we are looking for the rightmost parenthesis node
+ * at the second level, the first level always being a single
+ * parenthesis node.  If this node doesn't exit, we use the top
+ * level. */
+
+static void
+revert (st_parameter_dt *dtp)
+{
+  fnode *f, *r;
+  format_data *fmt = dtp->u.p.fmt;
+
+  dtp->u.p.reversion_flag = 1;
+
+  r = NULL;
+
+  for (f = fmt->array.array[0].u.child; f; f = f->next)
+    if (f->format == FMT_LPAREN)
+      r = f;
+
+  /* If r is NULL because no node was found, the whole tree will be used */
+
+  fmt->array.array[0].current = r;
+  fmt->array.array[0].count = 0;
+}
+
+/* parse_format()-- Parse a format string.  */
+
+void
+parse_format (st_parameter_dt *dtp)
+{
+  format_data *fmt;
+  bool format_cache_ok, seen_data_desc = false;
+
+  /* Don't cache for internal units and set an arbitrary limit on the size of
+     format strings we will cache.  (Avoids memory issues.)  */
+  format_cache_ok = !is_internal_unit (dtp);
+
+  /* Lookup format string to see if it has already been parsed.  */
+  if (format_cache_ok)
+    {
+      dtp->u.p.fmt = find_parsed_format (dtp);
+
+      if (dtp->u.p.fmt != NULL)
+       {
+         dtp->u.p.fmt->reversion_ok = 0;
+         dtp->u.p.fmt->saved_token = FMT_NONE;
+         dtp->u.p.fmt->saved_format = NULL;
+         reset_fnode_counters (dtp);
+         return;
+       }
+    }
+
+  /* Not found so proceed as follows.  */
+
+  dtp->u.p.fmt = fmt = get_mem (sizeof (format_data));
+  fmt->format_string = dtp->format;
+  fmt->format_string_len = dtp->format_len;
+
+  fmt->string = NULL;
+  fmt->saved_token = FMT_NONE;
+  fmt->error = NULL;
+  fmt->value = 0;
+
+  /* Initialize variables used during traversal of the tree.  */
+
+  fmt->reversion_ok = 0;
+  fmt->saved_format = NULL;
+
+  /* Allocate the first format node as the root of the tree.  */
+
+  fmt->last = &fmt->array;
+  fmt->last->next = NULL;
+  fmt->avail = &fmt->array.array[0];
+
+  memset (fmt->avail, 0, sizeof (*fmt->avail));
+  fmt->avail->format = FMT_LPAREN;
+  fmt->avail->repeat = 1;
+  fmt->avail++;
+
+  if (format_lex (fmt) == FMT_LPAREN)
+    fmt->array.array[0].u.child = parse_format_list (dtp, &format_cache_ok,
+                                                    &seen_data_desc);
+  else
+    fmt->error = "Missing initial left parenthesis in format";
+
+  if (fmt->error)
+    {
+      format_error (dtp, NULL, fmt->error);
+      free_format_hash_table (dtp->u.p.current_unit);
+      return;
+    }
+
+  if (format_cache_ok)
+    save_parsed_format (dtp);
+  else
+    dtp->u.p.format_not_saved = 1;
+}
+
+
+/* next_format0()-- Get the next format node without worrying about
+ * reversion.  Returns NULL when we hit the end of the list.
+ * Parenthesis nodes are incremented after the list has been
+ * exhausted, other nodes are incremented before they are returned. */
+
+static const fnode *
+next_format0 (fnode * f)
+{
+  const fnode *r;
+
+  if (f == NULL)
+    return NULL;
+
+  if (f->format != FMT_LPAREN)
+    {
+      f->count++;
+      if (f->count <= f->repeat)
+       return f;
+
+      f->count = 0;
+      return NULL;
+    }
+
+  /* Deal with a parenthesis node with unlimited format.  */
+
+  if (f->repeat == -2)  /* -2 signifies unlimited.  */
+  for (;;)
+    {
+      if (f->current == NULL)
+       f->current = f->u.child;
+
+      for (; f->current != NULL; f->current = f->current->next)
+       {
+         r = next_format0 (f->current);
+         if (r != NULL)
+           return r;
+       }
+    }
+
+  /* Deal with a parenthesis node with specific repeat count.  */
+  for (; f->count < f->repeat; f->count++)
+    {
+      if (f->current == NULL)
+       f->current = f->u.child;
+
+      for (; f->current != NULL; f->current = f->current->next)
+       {
+         r = next_format0 (f->current);
+         if (r != NULL)
+           return r;
+       }
+    }
+
+  f->count = 0;
+  return NULL;
+}
+
+
+/* next_format()-- Return the next format node.  If the format list
+ * ends up being exhausted, we do reversion.  Reversion is only
+ * allowed if we've seen a data descriptor since the
+ * initialization or the last reversion.  We return NULL if there
+ * are no more data descriptors to return (which is an error
+ * condition). */
+
+const fnode *
+next_format (st_parameter_dt *dtp)
+{
+  format_token t;
+  const fnode *f;
+  format_data *fmt = dtp->u.p.fmt;
+
+  if (fmt->saved_format != NULL)
+    {                          /* Deal with a pushed-back format node */
+      f = fmt->saved_format;
+      fmt->saved_format = NULL;
+      goto done;
+    }
+
+  f = next_format0 (&fmt->array.array[0]);
+  if (f == NULL)
+    {
+      if (!fmt->reversion_ok)
+       return NULL;
+
+      fmt->reversion_ok = 0;
+      revert (dtp);
+
+      f = next_format0 (&fmt->array.array[0]);
+      if (f == NULL)
+       {
+         format_error (dtp, NULL, reversion_error);
+         return NULL;
+       }
+
+      /* Push the first reverted token and return a colon node in case
+       * there are no more data items. */
+
+      fmt->saved_format = f;
+      return &colon_node;
+    }
+
+  /* If this is a data edit descriptor, then reversion has become OK. */
+ done:
+  t = f->format;
+
+  if (!fmt->reversion_ok &&
+      (t == FMT_I || t == FMT_B || t == FMT_O || t == FMT_Z || t == FMT_F ||
+       t == FMT_E || t == FMT_EN || t == FMT_ES || t == FMT_G || t == FMT_L ||
+       t == FMT_A || t == FMT_D))
+    fmt->reversion_ok = 1;
+  return f;
+}
+
+
+/* unget_format()-- Push the given format back so that it will be
+ * returned on the next call to next_format() without affecting
+ * counts.  This is necessary when we've encountered a data
+ * descriptor, but don't know what the data item is yet.  The format
+ * node is pushed back, and we return control to the main program,
+ * which calls the library back with the data item (or not). */
+
+void
+unget_format (st_parameter_dt *dtp, const fnode *f)
+{
+  dtp->u.p.fmt->saved_format = f;
+}
+
diff --git a/l4/pkg/libgfortran/lib/contrib/io/format.h b/l4/pkg/libgfortran/lib/contrib/io/format.h
new file mode 100644 (file)
index 0000000..87d8641
--- /dev/null
@@ -0,0 +1,145 @@
+/* Copyright (C) 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Janne Blomqvist
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GFOR_FORMAT_H
+#define GFOR_FORMAT_H
+
+#include "io.h"
+
+
+/* Format tokens.  Only about half of these can be stored in the
+   format nodes.  */
+
+typedef enum
+{
+  FMT_NONE = 0, FMT_UNKNOWN, FMT_SIGNED_INT, FMT_ZERO, FMT_POSINT, FMT_PERIOD,
+  FMT_COMMA, FMT_COLON, FMT_SLASH, FMT_DOLLAR, FMT_T, FMT_TR, FMT_TL,
+  FMT_LPAREN, FMT_RPAREN, FMT_X, FMT_S, FMT_SS, FMT_SP, FMT_STRING,
+  FMT_BADSTRING, FMT_P, FMT_I, FMT_B, FMT_BN, FMT_BZ, FMT_O, FMT_Z, FMT_F,
+  FMT_E, FMT_EN, FMT_ES, FMT_G, FMT_L, FMT_A, FMT_D, FMT_H, FMT_END, FMT_DC,
+  FMT_DP, FMT_STAR, FMT_RC, FMT_RD, FMT_RN, FMT_RP, FMT_RU, FMT_RZ
+}
+format_token;
+
+
+/* Format nodes.  A format string is converted into a tree of these
+   structures, which is traversed as part of a data transfer statement.  */
+
+struct fnode
+{
+  format_token format;
+  int repeat;
+  struct fnode *next;
+  char *source;
+
+  union
+  {
+    struct
+    {
+      int w, d, e;
+    }
+    real;
+
+    struct
+    {
+      int length;
+      char *p;
+    }
+    string;
+
+    struct
+    {
+      int w, m;
+    }
+    integer;
+
+    int w;
+    int k;
+    int r;
+    int n;
+
+    struct fnode *child;
+  }
+  u;
+
+  /* Members for traversing the tree during data transfer.  */
+
+  int count;
+  struct fnode *current;
+
+};
+
+
+/* A storage structures for format node data.  */
+
+#define FARRAY_SIZE 64
+
+typedef struct fnode_array
+{
+  struct fnode_array *next;
+  fnode array[FARRAY_SIZE];
+}
+fnode_array;
+
+
+typedef struct format_data
+{
+  char *format_string, *string;
+  const char *error;
+  char error_element;
+  format_token saved_token;
+  int value, format_string_len, reversion_ok;
+  fnode *avail;
+  const fnode *saved_format;
+  fnode_array *last;
+  fnode_array array;
+}
+format_data;
+
+extern void parse_format (st_parameter_dt *);
+internal_proto(parse_format);
+
+extern const fnode *next_format (st_parameter_dt *);
+internal_proto(next_format);
+
+extern void unget_format (st_parameter_dt *, const fnode *);
+internal_proto(unget_format);
+
+extern void format_error (st_parameter_dt *, const fnode *, const char *);
+internal_proto(format_error);
+
+extern void free_format_data (struct format_data *);
+internal_proto(free_format_data);
+
+extern void free_format_hash_table (gfc_unit *);
+internal_proto(free_format_hash_table);
+
+extern void init_format_hash (st_parameter_dt *);
+internal_proto(init_format_hash);
+
+extern void free_format_hash (st_parameter_dt *);
+internal_proto(free_format_hash);
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/io/inquire.c b/l4/pkg/libgfortran/lib/contrib/io/inquire.c
new file mode 100644 (file)
index 0000000..a542334
--- /dev/null
@@ -0,0 +1,720 @@
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* Implement the non-IOLENGTH variant of the INQUIRY statement */
+
+#include "io.h"
+#include "unix.h"
+#include <string.h>
+
+
+static const char undefined[] = "UNDEFINED";
+
+
+/* inquire_via_unit()-- Inquiry via unit number.  The unit might not exist. */
+
+static void
+inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
+{
+  const char *p;
+  GFC_INTEGER_4 cf = iqp->common.flags;
+
+  if ((cf & IOPARM_INQUIRE_HAS_EXIST) != 0)
+    {
+      *iqp->exist = (iqp->common.unit >= 0
+                    && iqp->common.unit <= GFC_INTEGER_4_HUGE);
+
+      if ((cf & IOPARM_INQUIRE_HAS_FILE) == 0)
+       {
+         if (!(*iqp->exist))
+           *iqp->common.iostat = LIBERROR_BAD_UNIT;
+         *iqp->exist = *iqp->exist
+                       && (*iqp->common.iostat != LIBERROR_BAD_UNIT);
+       }
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_OPENED) != 0)
+    *iqp->opened = (u != NULL);
+
+  if ((cf & IOPARM_INQUIRE_HAS_NUMBER) != 0)
+    *iqp->number = (u != NULL) ? u->unit_number : -1;
+
+  if ((cf & IOPARM_INQUIRE_HAS_NAMED) != 0)
+    *iqp->named = (u != NULL && u->flags.status != STATUS_SCRATCH);
+
+  if ((cf & IOPARM_INQUIRE_HAS_NAME) != 0
+      && u != NULL && u->flags.status != STATUS_SCRATCH)
+    {
+#if defined(HAVE_TTYNAME_R) || defined(HAVE_TTYNAME)
+      if (u->unit_number == options.stdin_unit
+         || u->unit_number == options.stdout_unit
+         || u->unit_number == options.stderr_unit)
+       {
+         int err = stream_ttyname (u->s, iqp->name, iqp->name_len);
+         if (err == 0)
+           {
+             gfc_charlen_type tmplen = strlen (iqp->name);
+             if (iqp->name_len > tmplen)
+               memset (&iqp->name[tmplen], ' ', iqp->name_len - tmplen);
+           }
+         else /* If ttyname does not work, go with the default.  */
+           fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len);
+       }
+      else
+       fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len);
+#elif defined __MINGW32__
+      if (u->unit_number == options.stdin_unit)
+       fstrcpy (iqp->name, iqp->name_len, "CONIN$", sizeof("CONIN$"));
+      else if (u->unit_number == options.stdout_unit)
+       fstrcpy (iqp->name, iqp->name_len, "CONOUT$", sizeof("CONOUT$"));
+      else if (u->unit_number == options.stderr_unit)
+       fstrcpy (iqp->name, iqp->name_len, "CONERR$", sizeof("CONERR$"));
+      else
+       fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len);
+#else
+    fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len);
+#endif
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_ACCESS) != 0)
+    {
+      if (u == NULL)
+       p = undefined;
+      else
+       switch (u->flags.access)
+         {
+         case ACCESS_SEQUENTIAL:
+           p = "SEQUENTIAL";
+           break;
+         case ACCESS_DIRECT:
+           p = "DIRECT";
+           break;
+         case ACCESS_STREAM:
+           p = "STREAM";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad access");
+         }
+
+      cf_strcpy (iqp->access, iqp->access_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_SEQUENTIAL) != 0)
+    {
+      if (u == NULL)
+       p = inquire_sequential (NULL, 0);
+      else
+       switch (u->flags.access)
+         {
+         case ACCESS_DIRECT:
+         case ACCESS_STREAM:
+           p = "NO";
+           break;
+         case ACCESS_SEQUENTIAL:
+           p = "YES";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad access");
+         }
+
+      cf_strcpy (iqp->sequential, iqp->sequential_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_DIRECT) != 0)
+    {
+      if (u == NULL)
+       p = inquire_direct (NULL, 0);
+      else
+       switch (u->flags.access)
+         {
+         case ACCESS_SEQUENTIAL:
+         case ACCESS_STREAM:
+           p = "NO";
+           break;
+         case ACCESS_DIRECT:
+           p = "YES";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad access");
+         }
+
+      cf_strcpy (iqp->direct, iqp->direct_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_FORM) != 0)
+    {
+      if (u == NULL)
+       p = undefined;
+      else
+       switch (u->flags.form)
+         {
+         case FORM_FORMATTED:
+           p = "FORMATTED";
+           break;
+         case FORM_UNFORMATTED:
+           p = "UNFORMATTED";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad form");
+         }
+
+      cf_strcpy (iqp->form, iqp->form_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_FORMATTED) != 0)
+    {
+      if (u == NULL)
+       p = inquire_formatted (NULL, 0);
+      else
+       switch (u->flags.form)
+         {
+         case FORM_FORMATTED:
+           p = "YES";
+           break;
+         case FORM_UNFORMATTED:
+           p = "NO";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad form");
+         }
+
+      cf_strcpy (iqp->formatted, iqp->formatted_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_UNFORMATTED) != 0)
+    {
+      if (u == NULL)
+       p = inquire_unformatted (NULL, 0);
+      else
+       switch (u->flags.form)
+         {
+         case FORM_FORMATTED:
+           p = "NO";
+           break;
+         case FORM_UNFORMATTED:
+           p = "YES";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad form");
+         }
+
+      cf_strcpy (iqp->unformatted, iqp->unformatted_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_RECL_OUT) != 0)
+    *iqp->recl_out = (u != NULL) ? u->recl : 0;
+
+  if ((cf & IOPARM_INQUIRE_HAS_STRM_POS_OUT) != 0)
+    *iqp->strm_pos_out = (u != NULL) ? u->strm_pos : 0;
+
+  if ((cf & IOPARM_INQUIRE_HAS_NEXTREC) != 0)
+    {
+      /* This only makes sense in the context of DIRECT access.  */
+      if (u != NULL && u->flags.access == ACCESS_DIRECT)
+       *iqp->nextrec = u->last_record + 1;
+      else
+       *iqp->nextrec = 0;
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_BLANK) != 0)
+    {
+      if (u == NULL || u->flags.form != FORM_FORMATTED)
+       p = undefined;
+      else
+       switch (u->flags.blank)
+         {
+         case BLANK_NULL:
+           p = "NULL";
+           break;
+         case BLANK_ZERO:
+           p = "ZERO";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad blank");
+         }
+
+      cf_strcpy (iqp->blank, iqp->blank_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_PAD) != 0)
+    {
+      if (u == NULL || u->flags.form != FORM_FORMATTED)
+       p = undefined;
+      else
+       switch (u->flags.pad)
+         {
+         case PAD_YES:
+           p = "YES";
+           break;
+         case PAD_NO:
+           p = "NO";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad pad");
+         }
+
+      cf_strcpy (iqp->pad, iqp->pad_len, p);
+    }
+
+  if (cf & IOPARM_INQUIRE_HAS_FLAGS2)
+    {
+      GFC_INTEGER_4 cf2 = iqp->flags2;
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_PENDING) != 0)
+       *iqp->pending = 0;
+  
+      if ((cf2 & IOPARM_INQUIRE_HAS_ID) != 0)
+        *iqp->id = 0;
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_ENCODING) != 0)
+       {
+         if (u == NULL || u->flags.form != FORM_FORMATTED)
+           p = undefined;
+          else
+           switch (u->flags.encoding)
+             {
+             case ENCODING_DEFAULT:
+               p = "UNKNOWN";
+               break;
+             case ENCODING_UTF8:
+               p = "UTF-8";
+               break;
+             default:
+               internal_error (&iqp->common, "inquire_via_unit(): Bad encoding");
+             }
+
+         cf_strcpy (iqp->encoding, iqp->encoding_len, p);
+       }
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_DECIMAL) != 0)
+       {
+         if (u == NULL || u->flags.form != FORM_FORMATTED)
+           p = undefined;
+         else
+           switch (u->flags.decimal)
+             {
+             case DECIMAL_POINT:
+               p = "POINT";
+               break;
+             case DECIMAL_COMMA:
+               p = "COMMA";
+               break;
+             default:
+               internal_error (&iqp->common, "inquire_via_unit(): Bad comma");
+             }
+
+         cf_strcpy (iqp->decimal, iqp->decimal_len, p);
+       }
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_ASYNCHRONOUS) != 0)
+       {
+         if (u == NULL)
+           p = undefined;
+         else
+           switch (u->flags.async)
+           {
+             case ASYNC_YES:
+               p = "YES";
+               break;
+             case ASYNC_NO:
+               p = "NO";
+               break;
+             default:
+               internal_error (&iqp->common, "inquire_via_unit(): Bad async");
+           }
+
+         cf_strcpy (iqp->asynchronous, iqp->asynchronous_len, p);
+       }
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_SIGN) != 0)
+       {
+         if (u == NULL)
+           p = undefined;
+         else
+           switch (u->flags.sign)
+           {
+             case SIGN_PROCDEFINED:
+               p = "PROCESSOR_DEFINED";
+               break;
+             case SIGN_SUPPRESS:
+               p = "SUPPRESS";
+               break;
+             case SIGN_PLUS:
+               p = "PLUS";
+               break;
+             default:
+               internal_error (&iqp->common, "inquire_via_unit(): Bad sign");
+           }
+
+         cf_strcpy (iqp->sign, iqp->sign_len, p);
+       }
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_ROUND) != 0)
+       {
+         if (u == NULL)
+           p = undefined;
+         else
+           switch (u->flags.round)
+           {
+             case ROUND_UP:
+               p = "UP";
+               break;
+             case ROUND_DOWN:
+               p = "DOWN";
+               break;
+             case ROUND_ZERO:
+               p = "ZERO";
+               break;
+             case ROUND_NEAREST:
+               p = "NEAREST";
+               break;
+             case ROUND_COMPATIBLE:
+               p = "COMPATIBLE";
+               break;
+             case ROUND_PROCDEFINED:
+               p = "PROCESSOR_DEFINED";
+               break;
+             default:
+               internal_error (&iqp->common, "inquire_via_unit(): Bad round");
+           }
+
+         cf_strcpy (iqp->round, iqp->round_len, p);
+       }
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_SIZE) != 0)
+       {
+         if (u == NULL)
+           *iqp->size = -1;
+         else
+           {
+             sflush (u->s);
+             *iqp->size = ssize (u->s);
+           }
+       }
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_POSITION) != 0)
+    {
+      if (u == NULL || u->flags.access == ACCESS_DIRECT)
+        p = undefined;
+      else
+       {
+         /* If the position is unspecified, check if we can figure
+            out whether it's at the beginning or end.  */
+         if (u->flags.position == POSITION_UNSPECIFIED)
+           {
+             gfc_offset cur = stell (u->s);
+             if (cur == 0)
+               u->flags.position = POSITION_REWIND;
+             else if (cur != -1 && (ssize (u->s) == cur))
+               u->flags.position = POSITION_APPEND;
+           }
+         switch (u->flags.position)
+           {
+           case POSITION_REWIND:
+             p = "REWIND";
+             break;
+           case POSITION_APPEND:
+             p = "APPEND";
+             break;
+           case POSITION_ASIS:
+             p = "ASIS";
+             break;
+           default:
+             /* If the position has changed and is not rewind or
+                append, it must be set to a processor-dependent
+                value.  */
+             p = "UNSPECIFIED";
+             break;
+           }
+       }
+      cf_strcpy (iqp->position, iqp->position_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_ACTION) != 0)
+    {
+      if (u == NULL)
+       p = undefined;
+      else
+       switch (u->flags.action)
+         {
+         case ACTION_READ:
+           p = "READ";
+           break;
+         case ACTION_WRITE:
+           p = "WRITE";
+           break;
+         case ACTION_READWRITE:
+           p = "READWRITE";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad action");
+         }
+
+      cf_strcpy (iqp->action, iqp->action_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_READ) != 0)
+    {
+      p = (u == NULL) ? inquire_read (NULL, 0) :
+       inquire_read (u->file, u->file_len);
+
+      cf_strcpy (iqp->read, iqp->read_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_WRITE) != 0)
+    {
+      p = (u == NULL) ? inquire_write (NULL, 0) :
+       inquire_write (u->file, u->file_len);
+
+      cf_strcpy (iqp->write, iqp->write_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_READWRITE) != 0)
+    {
+      p = (u == NULL) ? inquire_readwrite (NULL, 0) :
+       inquire_readwrite (u->file, u->file_len);
+
+      cf_strcpy (iqp->readwrite, iqp->readwrite_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_DELIM) != 0)
+    {
+      if (u == NULL || u->flags.form != FORM_FORMATTED)
+       p = undefined;
+      else
+       switch (u->flags.delim)
+         {
+         case DELIM_NONE:
+           p = "NONE";
+           break;
+         case DELIM_QUOTE:
+           p = "QUOTE";
+           break;
+         case DELIM_APOSTROPHE:
+           p = "APOSTROPHE";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad delim");
+         }
+
+      cf_strcpy (iqp->delim, iqp->delim_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_PAD) != 0)
+    {
+      if (u == NULL || u->flags.form != FORM_FORMATTED)
+       p = undefined;
+      else
+       switch (u->flags.pad)
+         {
+         case PAD_NO:
+           p = "NO";
+           break;
+         case PAD_YES:
+           p = "YES";
+           break;
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad pad");
+         }
+
+      cf_strcpy (iqp->pad, iqp->pad_len, p);
+    }
+  if ((cf & IOPARM_INQUIRE_HAS_CONVERT) != 0)
+    {
+      if (u == NULL)
+       p = undefined;
+      else
+       switch (u->flags.convert)
+         {
+           /*  big_endian is 0 for little-endian, 1 for big-endian.  */
+         case GFC_CONVERT_NATIVE:
+           p = big_endian ? "BIG_ENDIAN" : "LITTLE_ENDIAN";
+           break;
+
+         case GFC_CONVERT_SWAP:
+           p = big_endian ? "LITTLE_ENDIAN" : "BIG_ENDIAN";
+           break;
+
+         default:
+           internal_error (&iqp->common, "inquire_via_unit(): Bad convert");
+         }
+
+      cf_strcpy (iqp->convert, iqp->convert_len, p);
+    }
+}
+
+
+/* inquire_via_filename()-- Inquiry via filename.  This subroutine is
+ * only used if the filename is *not* connected to a unit number. */
+
+static void
+inquire_via_filename (st_parameter_inquire *iqp)
+{
+  const char *p;
+  GFC_INTEGER_4 cf = iqp->common.flags;
+
+  if ((cf & IOPARM_INQUIRE_HAS_EXIST) != 0)
+    *iqp->exist = file_exists (iqp->file, iqp->file_len);
+
+  if ((cf & IOPARM_INQUIRE_HAS_OPENED) != 0)
+    *iqp->opened = 0;
+
+  if ((cf & IOPARM_INQUIRE_HAS_NUMBER) != 0)
+    *iqp->number = -1;
+
+  if ((cf & IOPARM_INQUIRE_HAS_NAMED) != 0)
+    *iqp->named = 1;
+
+  if ((cf & IOPARM_INQUIRE_HAS_NAME) != 0)
+    fstrcpy (iqp->name, iqp->name_len, iqp->file, iqp->file_len);
+
+  if ((cf & IOPARM_INQUIRE_HAS_ACCESS) != 0)
+    cf_strcpy (iqp->access, iqp->access_len, undefined);
+
+  if ((cf & IOPARM_INQUIRE_HAS_SEQUENTIAL) != 0)
+    {
+      p = "UNKNOWN";
+      cf_strcpy (iqp->sequential, iqp->sequential_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_DIRECT) != 0)
+    {
+      p = "UNKNOWN";
+      cf_strcpy (iqp->direct, iqp->direct_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_FORM) != 0)
+    cf_strcpy (iqp->form, iqp->form_len, undefined);
+
+  if ((cf & IOPARM_INQUIRE_HAS_FORMATTED) != 0)
+    {
+      p = "UNKNOWN";
+      cf_strcpy (iqp->formatted, iqp->formatted_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_UNFORMATTED) != 0)
+    {
+      p = "UNKNOWN";
+      cf_strcpy (iqp->unformatted, iqp->unformatted_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_RECL_OUT) != 0)
+    *iqp->recl_out = 0;
+
+  if ((cf & IOPARM_INQUIRE_HAS_NEXTREC) != 0)
+    *iqp->nextrec = 0;
+
+  if ((cf & IOPARM_INQUIRE_HAS_BLANK) != 0)
+    cf_strcpy (iqp->blank, iqp->blank_len, undefined);
+
+  if ((cf & IOPARM_INQUIRE_HAS_PAD) != 0)
+    cf_strcpy (iqp->pad, iqp->pad_len, undefined);
+
+  if (cf & IOPARM_INQUIRE_HAS_FLAGS2)
+    {
+      GFC_INTEGER_4 cf2 = iqp->flags2;
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_ENCODING) != 0)
+       cf_strcpy (iqp->encoding, iqp->encoding_len, undefined);
+  
+      if ((cf2 & IOPARM_INQUIRE_HAS_DELIM) != 0)
+       cf_strcpy (iqp->delim, iqp->delim_len, undefined);
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_DECIMAL) != 0)
+       cf_strcpy (iqp->decimal, iqp->decimal_len, undefined);
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_DELIM) != 0)
+       cf_strcpy (iqp->delim, iqp->delim_len, undefined);
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_PAD) != 0)
+       cf_strcpy (iqp->pad, iqp->pad_len, undefined);
+  
+      if ((cf2 & IOPARM_INQUIRE_HAS_ENCODING) != 0)
+       cf_strcpy (iqp->encoding, iqp->encoding_len, undefined);
+
+      if ((cf2 & IOPARM_INQUIRE_HAS_SIZE) != 0)
+       *iqp->size = file_size (iqp->file, iqp->file_len);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_POSITION) != 0)
+    cf_strcpy (iqp->position, iqp->position_len, undefined);
+
+  if ((cf & IOPARM_INQUIRE_HAS_ACCESS) != 0)
+    cf_strcpy (iqp->access, iqp->access_len, undefined);
+
+  if ((cf & IOPARM_INQUIRE_HAS_READ) != 0)
+    {
+      p = inquire_read (iqp->file, iqp->file_len);
+      cf_strcpy (iqp->read, iqp->read_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_WRITE) != 0)
+    {
+      p = inquire_write (iqp->file, iqp->file_len);
+      cf_strcpy (iqp->write, iqp->write_len, p);
+    }
+
+  if ((cf & IOPARM_INQUIRE_HAS_READWRITE) != 0)
+    {
+      p = inquire_read (iqp->file, iqp->file_len);
+      cf_strcpy (iqp->readwrite, iqp->readwrite_len, p);
+    }
+}
+
+
+/* Library entry point for the INQUIRE statement (non-IOLENGTH
+   form).  */
+
+extern void st_inquire (st_parameter_inquire *);
+export_proto(st_inquire);
+
+void
+st_inquire (st_parameter_inquire *iqp)
+{
+  gfc_unit *u;
+
+  library_start (&iqp->common);
+
+  if ((iqp->common.flags & IOPARM_INQUIRE_HAS_FILE) == 0)
+    {
+      u = find_unit (iqp->common.unit);
+      inquire_via_unit (iqp, u);
+    }
+  else
+    {
+      u = find_file (iqp->file, iqp->file_len);
+      if (u == NULL)
+       inquire_via_filename (iqp);
+      else
+       inquire_via_unit (iqp, u);
+    }
+  if (u != NULL)
+    unlock_unit (u);
+
+  library_end ();
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/intrinsics.c b/l4/pkg/libgfortran/lib/contrib/io/intrinsics.c
new file mode 100644 (file)
index 0000000..22150e7
--- /dev/null
@@ -0,0 +1,397 @@
+/* Implementation of the FGET, FGETC, FPUT, FPUTC, FLUSH 
+   FTELL, TTYNAM and ISATTY intrinsics.
+   Copyright (C) 2005, 2007, 2009, 2010, 2011 Free Software
+   Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
+#include <stdlib.h>
+#include <string.h>
+
+
+static const int five = 5;
+static const int six = 6;
+
+extern int PREFIX(fgetc) (const int *, char *, gfc_charlen_type);
+export_proto_np(PREFIX(fgetc));
+
+int
+PREFIX(fgetc) (const int * unit, char * c, gfc_charlen_type c_len)
+{
+  int ret;
+  gfc_unit * u = find_unit (*unit);
+
+  if (u == NULL)
+    return -1;
+
+  fbuf_reset (u);
+  if (u->mode == WRITING)
+    {
+      sflush (u->s);
+      u->mode = READING;
+    }
+
+  memset (c, ' ', c_len);
+  ret = sread (u->s, c, 1);
+  unlock_unit (u);
+
+  if (ret < 0)
+    return ret;
+
+  if (ret != 1)
+    return -1;
+  else
+    return 0;
+}
+
+
+#define FGETC_SUB(kind) \
+  extern void fgetc_i ## kind ## _sub \
+    (const int *, char *, GFC_INTEGER_ ## kind *, gfc_charlen_type); \
+  export_proto(fgetc_i ## kind ## _sub); \
+  void fgetc_i ## kind ## _sub \
+  (const int * unit, char * c, GFC_INTEGER_ ## kind * st, gfc_charlen_type c_len) \
+    { if (st != NULL) \
+        *st = PREFIX(fgetc) (unit, c, c_len); \
+      else \
+        PREFIX(fgetc) (unit, c, c_len); }
+
+FGETC_SUB(1)
+FGETC_SUB(2)
+FGETC_SUB(4)
+FGETC_SUB(8)
+
+
+extern int PREFIX(fget) (char *, gfc_charlen_type);
+export_proto_np(PREFIX(fget));
+
+int
+PREFIX(fget) (char * c, gfc_charlen_type c_len)
+{
+  return PREFIX(fgetc) (&five, c, c_len);
+}
+
+
+#define FGET_SUB(kind) \
+  extern void fget_i ## kind ## _sub \
+    (char *, GFC_INTEGER_ ## kind *, gfc_charlen_type); \
+  export_proto(fget_i ## kind ## _sub); \
+  void fget_i ## kind ## _sub \
+  (char * c, GFC_INTEGER_ ## kind * st, gfc_charlen_type c_len) \
+    { if (st != NULL) \
+        *st = PREFIX(fgetc) (&five, c, c_len); \
+      else \
+        PREFIX(fgetc) (&five, c, c_len); }
+
+FGET_SUB(1)
+FGET_SUB(2)
+FGET_SUB(4)
+FGET_SUB(8)
+
+
+
+extern int PREFIX(fputc) (const int *, char *, gfc_charlen_type);
+export_proto_np(PREFIX(fputc));
+
+int
+PREFIX(fputc) (const int * unit, char * c,
+              gfc_charlen_type c_len __attribute__((unused)))
+{
+  ssize_t s;
+  gfc_unit * u = find_unit (*unit);
+
+  if (u == NULL)
+    return -1;
+
+  fbuf_reset (u);
+  if (u->mode == READING)
+    {
+      sflush (u->s);
+      u->mode = WRITING;
+    }
+
+  s = swrite (u->s, c, 1);
+  unlock_unit (u);
+  if (s < 0)
+    return -1;
+  return 0;
+}
+
+
+#define FPUTC_SUB(kind) \
+  extern void fputc_i ## kind ## _sub \
+    (const int *, char *, GFC_INTEGER_ ## kind *, gfc_charlen_type); \
+  export_proto(fputc_i ## kind ## _sub); \
+  void fputc_i ## kind ## _sub \
+  (const int * unit, char * c, GFC_INTEGER_ ## kind * st, gfc_charlen_type c_len) \
+    { if (st != NULL) \
+        *st = PREFIX(fputc) (unit, c, c_len); \
+      else \
+        PREFIX(fputc) (unit, c, c_len); }
+
+FPUTC_SUB(1)
+FPUTC_SUB(2)
+FPUTC_SUB(4)
+FPUTC_SUB(8)
+
+
+extern int PREFIX(fput) (char *, gfc_charlen_type);
+export_proto_np(PREFIX(fput));
+
+int
+PREFIX(fput) (char * c, gfc_charlen_type c_len)
+{
+  return PREFIX(fputc) (&six, c, c_len);
+}
+
+
+#define FPUT_SUB(kind) \
+  extern void fput_i ## kind ## _sub \
+    (char *, GFC_INTEGER_ ## kind *, gfc_charlen_type); \
+  export_proto(fput_i ## kind ## _sub); \
+  void fput_i ## kind ## _sub \
+  (char * c, GFC_INTEGER_ ## kind * st, gfc_charlen_type c_len) \
+    { if (st != NULL) \
+        *st = PREFIX(fputc) (&six, c, c_len); \
+      else \
+        PREFIX(fputc) (&six, c, c_len); }
+
+FPUT_SUB(1)
+FPUT_SUB(2)
+FPUT_SUB(4)
+FPUT_SUB(8)
+
+
+/* SUBROUTINE FLUSH(UNIT)
+   INTEGER, INTENT(IN), OPTIONAL :: UNIT  */
+
+extern void flush_i4 (GFC_INTEGER_4 *);
+export_proto(flush_i4);
+
+void
+flush_i4 (GFC_INTEGER_4 *unit)
+{
+  gfc_unit *us;
+
+  /* flush all streams */
+  if (unit == NULL)
+    flush_all_units ();
+  else
+    {
+      us = find_unit (*unit);
+      if (us != NULL)
+       {
+         sflush (us->s);
+         unlock_unit (us);
+       }
+    }
+}
+
+
+extern void flush_i8 (GFC_INTEGER_8 *);
+export_proto(flush_i8);
+
+void
+flush_i8 (GFC_INTEGER_8 *unit)
+{
+  gfc_unit *us;
+
+  /* flush all streams */
+  if (unit == NULL)
+    flush_all_units ();
+  else
+    {
+      us = find_unit (*unit);
+      if (us != NULL)
+       {
+         sflush (us->s);
+         unlock_unit (us);
+       }
+    }
+}
+
+/* FSEEK intrinsic */
+
+extern void fseek_sub (int *, GFC_IO_INT *, int *, int *);
+export_proto(fseek_sub);
+
+void
+fseek_sub (int * unit, GFC_IO_INT * offset, int * whence, int * status)
+{
+  gfc_unit * u = find_unit (*unit);
+  ssize_t result = -1;
+
+  if (u != NULL)
+    {
+      result = sseek(u->s, *offset, *whence);
+
+      unlock_unit (u);
+    }
+
+  if (status)
+    *status = (result < 0 ? -1 : 0);
+}
+
+
+
+/* FTELL intrinsic */
+
+static gfc_offset
+gf_ftell (int unit)
+{
+  gfc_unit * u = find_unit (unit);
+  if (u == NULL)
+    return -1;
+  int pos = fbuf_reset (u);
+  if (pos != 0)
+    sseek (u->s, pos, SEEK_CUR);
+  gfc_offset ret = stell (u->s);
+  unlock_unit (u);
+  return ret;
+}
+
+extern size_t PREFIX(ftell) (int *);
+export_proto_np(PREFIX(ftell));
+
+size_t
+PREFIX(ftell) (int * unit)
+{
+  return gf_ftell (*unit);
+}
+
+#define FTELL_SUB(kind) \
+  extern void ftell_i ## kind ## _sub (int *, GFC_INTEGER_ ## kind *); \
+  export_proto(ftell_i ## kind ## _sub); \
+  void \
+  ftell_i ## kind ## _sub (int * unit, GFC_INTEGER_ ## kind * offset) \
+  { \
+    *offset = gf_ftell (*unit);                        \
+  }
+
+FTELL_SUB(1)
+FTELL_SUB(2)
+FTELL_SUB(4)
+FTELL_SUB(8)
+
+
+
+/* LOGICAL FUNCTION ISATTY(UNIT)
+   INTEGER, INTENT(IN) :: UNIT */
+
+extern GFC_LOGICAL_4 isatty_l4 (int *);
+export_proto(isatty_l4);
+
+GFC_LOGICAL_4
+isatty_l4 (int *unit)
+{
+  gfc_unit *u;
+  GFC_LOGICAL_4 ret = 0;
+
+  u = find_unit (*unit);
+  if (u != NULL)
+    {
+      ret = (GFC_LOGICAL_4) stream_isatty (u->s);
+      unlock_unit (u);
+    }
+  return ret;
+}
+
+
+extern GFC_LOGICAL_8 isatty_l8 (int *);
+export_proto(isatty_l8);
+
+GFC_LOGICAL_8
+isatty_l8 (int *unit)
+{
+  gfc_unit *u;
+  GFC_LOGICAL_8 ret = 0;
+
+  u = find_unit (*unit);
+  if (u != NULL)
+    {
+      ret = (GFC_LOGICAL_8) stream_isatty (u->s);
+      unlock_unit (u);
+    }
+  return ret;
+}
+
+
+/* SUBROUTINE TTYNAM(UNIT,NAME)
+   INTEGER,SCALAR,INTENT(IN) :: UNIT
+   CHARACTER,SCALAR,INTENT(OUT) :: NAME */
+
+extern void ttynam_sub (int *, char *, gfc_charlen_type);
+export_proto(ttynam_sub);
+
+void
+ttynam_sub (int *unit, char * name, gfc_charlen_type name_len)
+{
+  gfc_unit *u;
+  int nlen;
+  int err = 1;
+
+  u = find_unit (*unit);
+  if (u != NULL)
+    {
+      err = stream_ttyname (u->s, name, name_len);
+      if (err == 0)
+       {
+         nlen = strlen (name);
+         memset (&name[nlen], ' ', name_len - nlen);
+       }
+
+      unlock_unit (u);
+    }
+  if (err != 0)
+    memset (name, ' ', name_len);
+}
+
+
+extern void ttynam (char **, gfc_charlen_type *, int);
+export_proto(ttynam);
+
+void
+ttynam (char ** name, gfc_charlen_type * name_len, int unit)
+{
+  gfc_unit *u;
+
+  u = find_unit (unit);
+  if (u != NULL)
+    {
+      *name = get_mem (TTY_NAME_MAX);
+      int err = stream_ttyname (u->s, *name, TTY_NAME_MAX);
+      if (err == 0)
+       {
+         *name_len = strlen (*name);
+         unlock_unit (u);
+         return;
+       }
+      free (*name);
+      unlock_unit (u);
+    }
+
+  *name_len = 0;
+  *name = NULL;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/io.h b/l4/pkg/libgfortran/lib/contrib/io/io.h
new file mode 100644 (file)
index 0000000..06364e1
--- /dev/null
@@ -0,0 +1,814 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GFOR_IO_H
+#define GFOR_IO_H
+
+/* IO library include.  */
+
+#include "libgfortran.h"
+
+#include <gthr.h>
+
+/* Forward declarations.  */
+struct st_parameter_dt;
+typedef struct stream stream;
+struct fbuf;
+struct format_data;
+typedef struct fnode fnode;
+struct gfc_unit;
+
+
+/* Macros for testing what kinds of I/O we are doing.  */
+
+#define is_array_io(dtp) ((dtp)->internal_unit_desc)
+
+#define is_internal_unit(dtp) ((dtp)->u.p.unit_is_internal)
+
+#define is_stream_io(dtp) ((dtp)->u.p.current_unit->flags.access == ACCESS_STREAM)
+
+#define is_char4_unit(dtp) ((dtp)->u.p.unit_is_internal && (dtp)->common.unit)
+
+/* The array_loop_spec contains the variables for the loops over index ranges
+   that are encountered.  */
+
+typedef struct array_loop_spec
+{
+  /* Index counter for this dimension.  */
+  index_type idx;
+
+  /* Start for the index counter.  */
+  index_type start;
+
+  /* End for the index counter.  */
+  index_type end;
+
+  /* Step for the index counter.  */
+  index_type step;
+}
+array_loop_spec;
+
+/* A stucture to build a hash table for format data.  */
+
+#define FORMAT_HASH_SIZE 16
+
+typedef struct format_hash_entry
+{
+  char *key;
+  gfc_charlen_type key_len;
+  struct format_data *hashed_fmt;
+}
+format_hash_entry;
+
+/* Representation of a namelist object in libgfortran
+
+   Namelist Records
+      &GROUPNAME  OBJECT=value[s] [,OBJECT=value[s]].../
+     or
+      &GROUPNAME  OBJECT=value[s] [,OBJECT=value[s]]...&END
+
+   The object can be a fully qualified, compound name for an intrinsic
+   type, derived types or derived type components.  So, a substring
+   a(:)%b(4)%ch(2:4)(1:7) has to be treated correctly in namelist
+   read. Hence full information about the structure of the object has
+   to be available to list_read.c and write.
+
+   These requirements are met by the following data structures.
+
+   namelist_info type contains all the scalar information about the
+   object and arrays of descriptor_dimension and array_loop_spec types for
+   arrays.  */
+
+typedef struct namelist_type
+{
+  /* Object type.  */
+  bt type;
+
+  /* Object name.  */
+  char * var_name;
+
+  /* Address for the start of the object's data.  */
+  void * mem_pos;
+
+  /* Flag to show that a read is to be attempted for this node.  */
+  int touched;
+
+  /* Length of intrinsic type in bytes.  */
+  int len;
+
+  /* Rank of the object.  */
+  int var_rank;
+
+  /* Overall size of the object in bytes.  */
+  index_type size;
+
+  /* Length of character string.  */
+  index_type string_length;
+
+  descriptor_dimension * dim;
+  array_loop_spec * ls;
+  struct namelist_type * next;
+}
+namelist_info;
+
+/* Options for the OPEN statement.  */
+
+typedef enum
+{ ACCESS_SEQUENTIAL, ACCESS_DIRECT, ACCESS_APPEND, ACCESS_STREAM,
+  ACCESS_UNSPECIFIED
+}
+unit_access;
+
+typedef enum
+{ ACTION_READ, ACTION_WRITE, ACTION_READWRITE,
+  ACTION_UNSPECIFIED
+}
+unit_action;
+
+typedef enum
+{ BLANK_NULL, BLANK_ZERO, BLANK_UNSPECIFIED }
+unit_blank;
+
+typedef enum
+{ DELIM_NONE, DELIM_APOSTROPHE, DELIM_QUOTE,
+  DELIM_UNSPECIFIED
+}
+unit_delim;
+
+typedef enum
+{ FORM_FORMATTED, FORM_UNFORMATTED, FORM_UNSPECIFIED }
+unit_form;
+
+typedef enum
+{ POSITION_ASIS, POSITION_REWIND, POSITION_APPEND,
+  POSITION_UNSPECIFIED
+}
+unit_position;
+
+typedef enum
+{ STATUS_UNKNOWN, STATUS_OLD, STATUS_NEW, STATUS_SCRATCH,
+  STATUS_REPLACE, STATUS_UNSPECIFIED
+}
+unit_status;
+
+typedef enum
+{ PAD_YES, PAD_NO, PAD_UNSPECIFIED }
+unit_pad;
+
+typedef enum
+{ DECIMAL_POINT, DECIMAL_COMMA, DECIMAL_UNSPECIFIED }
+unit_decimal;
+
+typedef enum
+{ ENCODING_UTF8, ENCODING_DEFAULT, ENCODING_UNSPECIFIED }
+unit_encoding;
+
+typedef enum
+{ ROUND_UP, ROUND_DOWN, ROUND_ZERO, ROUND_NEAREST, ROUND_COMPATIBLE,
+  ROUND_PROCDEFINED, ROUND_UNSPECIFIED }
+unit_round;
+
+/* NOTE: unit_sign must correspond with the sign_status enumerator in
+   st_parameter_dt to not break the ABI.  */
+typedef enum
+{ SIGN_PROCDEFINED, SIGN_SUPPRESS, SIGN_PLUS, SIGN_UNSPECIFIED }
+unit_sign;
+
+typedef enum
+{ ADVANCE_YES, ADVANCE_NO, ADVANCE_UNSPECIFIED }
+unit_advance;
+
+typedef enum
+{READING, WRITING}
+unit_mode;
+
+typedef enum
+{ ASYNC_YES, ASYNC_NO, ASYNC_UNSPECIFIED }
+unit_async;
+
+typedef enum
+{ SIGN_S, SIGN_SS, SIGN_SP }
+unit_sign_s;
+
+#define CHARACTER1(name) \
+             char * name; \
+             gfc_charlen_type name ## _len
+#define CHARACTER2(name) \
+             gfc_charlen_type name ## _len; \
+             char * name
+
+typedef struct
+{
+  st_parameter_common common;
+  GFC_INTEGER_4 recl_in;
+  CHARACTER2 (file);
+  CHARACTER1 (status);
+  CHARACTER2 (access);
+  CHARACTER1 (form);
+  CHARACTER2 (blank);
+  CHARACTER1 (position);
+  CHARACTER2 (action);
+  CHARACTER1 (delim);
+  CHARACTER2 (pad);
+  CHARACTER1 (convert);
+  CHARACTER2 (decimal);
+  CHARACTER1 (encoding);
+  CHARACTER2 (round);
+  CHARACTER1 (sign);
+  CHARACTER2 (asynchronous);
+  GFC_INTEGER_4 *newunit;
+}
+st_parameter_open;
+
+#define IOPARM_CLOSE_HAS_STATUS                (1 << 7)
+
+typedef struct
+{
+  st_parameter_common common;
+  CHARACTER1 (status);
+}
+st_parameter_close;
+
+typedef struct
+{
+  st_parameter_common common;
+}
+st_parameter_filepos;
+
+#define IOPARM_INQUIRE_HAS_EXIST       (1 << 7)
+#define IOPARM_INQUIRE_HAS_OPENED      (1 << 8)
+#define IOPARM_INQUIRE_HAS_NUMBER      (1 << 9)
+#define IOPARM_INQUIRE_HAS_NAMED       (1 << 10)
+#define IOPARM_INQUIRE_HAS_NEXTREC     (1 << 11)
+#define IOPARM_INQUIRE_HAS_RECL_OUT    (1 << 12)
+#define IOPARM_INQUIRE_HAS_STRM_POS_OUT (1 << 13)
+#define IOPARM_INQUIRE_HAS_FILE                (1 << 14)
+#define IOPARM_INQUIRE_HAS_ACCESS      (1 << 15)
+#define IOPARM_INQUIRE_HAS_FORM                (1 << 16)
+#define IOPARM_INQUIRE_HAS_BLANK       (1 << 17)
+#define IOPARM_INQUIRE_HAS_POSITION    (1 << 18)
+#define IOPARM_INQUIRE_HAS_ACTION      (1 << 19)
+#define IOPARM_INQUIRE_HAS_DELIM       (1 << 20)
+#define IOPARM_INQUIRE_HAS_PAD         (1 << 21)
+#define IOPARM_INQUIRE_HAS_NAME                (1 << 22)
+#define IOPARM_INQUIRE_HAS_SEQUENTIAL  (1 << 23)
+#define IOPARM_INQUIRE_HAS_DIRECT      (1 << 24)
+#define IOPARM_INQUIRE_HAS_FORMATTED   (1 << 25)
+#define IOPARM_INQUIRE_HAS_UNFORMATTED (1 << 26)
+#define IOPARM_INQUIRE_HAS_READ                (1 << 27)
+#define IOPARM_INQUIRE_HAS_WRITE       (1 << 28)
+#define IOPARM_INQUIRE_HAS_READWRITE   (1 << 29)
+#define IOPARM_INQUIRE_HAS_CONVERT     (1 << 30)
+#define IOPARM_INQUIRE_HAS_FLAGS2      (1 << 31)
+
+#define IOPARM_INQUIRE_HAS_ASYNCHRONOUS        (1 << 0)
+#define IOPARM_INQUIRE_HAS_DECIMAL     (1 << 1)
+#define IOPARM_INQUIRE_HAS_ENCODING    (1 << 2)
+#define IOPARM_INQUIRE_HAS_ROUND       (1 << 3)
+#define IOPARM_INQUIRE_HAS_SIGN                (1 << 4)
+#define IOPARM_INQUIRE_HAS_PENDING     (1 << 5)
+#define IOPARM_INQUIRE_HAS_SIZE                (1 << 6)
+#define IOPARM_INQUIRE_HAS_ID          (1 << 7)
+
+typedef struct
+{
+  st_parameter_common common;
+  GFC_INTEGER_4 *exist, *opened, *number, *named;
+  GFC_INTEGER_4 *nextrec, *recl_out;
+  GFC_IO_INT *strm_pos_out;
+  CHARACTER1 (file);
+  CHARACTER2 (access);
+  CHARACTER1 (form);
+  CHARACTER2 (blank);
+  CHARACTER1 (position);
+  CHARACTER2 (action);
+  CHARACTER1 (delim);
+  CHARACTER2 (pad);
+  CHARACTER1 (name);
+  CHARACTER2 (sequential);
+  CHARACTER1 (direct);
+  CHARACTER2 (formatted);
+  CHARACTER1 (unformatted);
+  CHARACTER2 (read);
+  CHARACTER1 (write);
+  CHARACTER2 (readwrite);
+  CHARACTER1 (convert);
+  GFC_INTEGER_4 flags2;
+  CHARACTER1 (asynchronous);
+  CHARACTER2 (decimal);
+  CHARACTER1 (encoding);
+  CHARACTER2 (round);
+  CHARACTER1 (sign);
+  GFC_INTEGER_4 *pending;
+  GFC_IO_INT *size;
+  GFC_INTEGER_4 *id;
+}
+st_parameter_inquire;
+
+
+#define IOPARM_DT_LIST_FORMAT                  (1 << 7)
+#define IOPARM_DT_NAMELIST_READ_MODE           (1 << 8)
+#define IOPARM_DT_HAS_REC                      (1 << 9)
+#define IOPARM_DT_HAS_SIZE                     (1 << 10)
+#define IOPARM_DT_HAS_IOLENGTH                 (1 << 11)
+#define IOPARM_DT_HAS_FORMAT                   (1 << 12)
+#define IOPARM_DT_HAS_ADVANCE                  (1 << 13)
+#define IOPARM_DT_HAS_INTERNAL_UNIT            (1 << 14)
+#define IOPARM_DT_HAS_NAMELIST_NAME            (1 << 15)
+#define IOPARM_DT_HAS_ID                       (1 << 16)
+#define IOPARM_DT_HAS_POS                      (1 << 17)
+#define IOPARM_DT_HAS_ASYNCHRONOUS             (1 << 18)
+#define IOPARM_DT_HAS_BLANK                    (1 << 19)
+#define IOPARM_DT_HAS_DECIMAL                  (1 << 20)
+#define IOPARM_DT_HAS_DELIM                    (1 << 21)
+#define IOPARM_DT_HAS_PAD                      (1 << 22)
+#define IOPARM_DT_HAS_ROUND                    (1 << 23)
+#define IOPARM_DT_HAS_SIGN                     (1 << 24)
+#define IOPARM_DT_HAS_F2003                     (1 << 25)
+/* Internal use bit.  */
+#define IOPARM_DT_IONML_SET                    (1 << 31)
+
+
+typedef struct st_parameter_dt
+{
+  st_parameter_common common;
+  GFC_IO_INT rec;
+  GFC_IO_INT *size, *iolength;
+  gfc_array_char *internal_unit_desc;
+  CHARACTER1 (format);
+  CHARACTER2 (advance);
+  CHARACTER1 (internal_unit);
+  CHARACTER2 (namelist_name);
+  /* Private part of the structure.  The compiler just needs
+     to reserve enough space.  */
+  union
+    {
+      struct
+       {
+         void (*transfer) (struct st_parameter_dt *, bt, void *, int,
+                           size_t, size_t);
+         struct gfc_unit *current_unit;
+         /* Item number in a formatted data transfer.  Also used in namelist
+            read_logical as an index into line_buffer.  */
+         int item_count;
+         unit_mode mode;
+         unit_blank blank_status;
+         unit_sign sign_status;
+         int scale_factor;
+         int max_pos; /* Maximum righthand column written to.  */
+         /* Number of skips + spaces to be done for T and X-editing.  */
+         int skips;
+         /* Number of spaces to be done for T and X-editing.  */
+         int pending_spaces;
+         /* Whether an EOR condition was encountered. Value is:
+              0 if no EOR was encountered
+              1 if an EOR was encountered due to a 1-byte marker (LF)
+              2 if an EOR was encountered due to a 2-bytes marker (CRLF) */
+         int sf_seen_eor;
+         unit_advance advance_status;
+         unsigned reversion_flag : 1; /* Format reversion has occurred.  */
+         unsigned first_item : 1;
+         unsigned seen_dollar : 1;
+         unsigned eor_condition : 1;
+         unsigned no_leading_blank : 1;
+         unsigned char_flag : 1;
+         unsigned input_complete : 1;
+         unsigned at_eol : 1;
+         unsigned comma_flag : 1;
+         /* A namelist specific flag used in the list directed library
+            to flag that calls are being made from namelist read (eg. to
+            ignore comments or to treat '/' as a terminator)  */
+         unsigned namelist_mode : 1;
+         /* A namelist specific flag used in the list directed library
+            to flag read errors and return, so that an attempt can be
+            made to read a new object name.  */
+         unsigned nml_read_error : 1;
+         /* A sequential formatted read specific flag used to signal that a
+            character string is being read so don't use commas to shorten a
+            formatted field width.  */
+         unsigned sf_read_comma : 1;
+         /* A namelist specific flag used to enable reading input from 
+            line_buffer for logical reads.  */
+         unsigned line_buffer_enabled : 1;
+         /* An internal unit specific flag used to identify that the associated
+            unit is internal.  */
+         unsigned unit_is_internal : 1;
+         /* An internal unit specific flag to signify an EOF condition for list
+            directed read.  */
+         unsigned at_eof : 1;
+         /* Used for g0 floating point output.  */
+         unsigned g0_no_blanks : 1;
+         /* Used to signal use of free_format_data.  */
+         unsigned format_not_saved : 1;
+         /* 14 unused bits.  */
+
+         /* Used for ungetc() style functionality. Possible values
+            are an unsigned char, EOF, or EOF - 1 used to mark the
+            field as not valid.  */
+         int last_char;
+         char nml_delim;
+
+         int repeat_count;
+         int saved_length;
+         int saved_used;
+         bt saved_type;
+         char *saved_string;
+         char *scratch;
+         char *line_buffer;
+         struct format_data *fmt;
+         namelist_info *ionml;
+         /* A flag used to identify when a non-standard expanded namelist read
+            has occurred.  */
+         int expanded_read;
+         /* Storage area for values except for strings.  Must be
+            large enough to hold a complex value (two reals) of the
+            largest kind.  */
+         char value[32];
+         GFC_IO_INT size_used;
+       } p;
+      /* This pad size must be equal to the pad_size declared in
+        trans-io.c (gfc_build_io_library_fndecls).  The above structure
+        must be smaller or equal to this array.  */
+      char pad[16 * sizeof (char *) + 32 * sizeof (int)];
+    } u;
+  GFC_INTEGER_4 *id;
+  GFC_IO_INT pos;
+  CHARACTER1 (asynchronous);
+  CHARACTER2 (blank);
+  CHARACTER1 (decimal);
+  CHARACTER2 (delim);
+  CHARACTER1 (pad);
+  CHARACTER2 (round);
+  CHARACTER1 (sign);
+}
+st_parameter_dt;
+
+/* Ensure st_parameter_dt's u.pad is bigger or equal to u.p.  */
+extern char check_st_parameter_dt[sizeof (((st_parameter_dt *) 0)->u.pad)
+                                 >= sizeof (((st_parameter_dt *) 0)->u.p)
+                                 ? 1 : -1];
+
+#define IOPARM_WAIT_HAS_ID             (1 << 7)
+
+typedef struct
+{
+  st_parameter_common common;
+  CHARACTER1 (id);
+}
+st_parameter_wait;
+
+
+#undef CHARACTER1
+#undef CHARACTER2
+
+typedef struct
+{
+  unit_access access;
+  unit_action action;
+  unit_blank blank;
+  unit_delim delim;
+  unit_form form;
+  int is_notpadded;
+  unit_position position;
+  unit_status status;
+  unit_pad pad;
+  unit_convert convert;
+  int has_recl;
+  unit_decimal decimal;
+  unit_encoding encoding;
+  unit_round round;
+  unit_sign sign;
+  unit_async async;
+}
+unit_flags;
+
+
+typedef struct gfc_unit
+{
+  int unit_number;
+  stream *s;
+  
+  /* Treap links.  */
+  struct gfc_unit *left, *right;
+  int priority;
+
+  int read_bad, current_record, saved_pos, previous_nonadvancing_write;
+
+  enum
+  { NO_ENDFILE, AT_ENDFILE, AFTER_ENDFILE }
+  endfile;
+
+  unit_mode mode;
+  unit_flags flags;
+  unit_pad pad_status;
+  unit_decimal decimal_status;
+  unit_delim delim_status;
+  unit_round round_status;
+
+  /* recl                 -- Record length of the file.
+     last_record          -- Last record number read or written
+     maxrec               -- Maximum record number in a direct access file
+     bytes_left           -- Bytes left in current record.
+     strm_pos             -- Current position in file for STREAM I/O.
+     recl_subrecord       -- Maximum length for subrecord.
+     bytes_left_subrecord -- Bytes left in current subrecord.  */
+  gfc_offset recl, last_record, maxrec, bytes_left, strm_pos,
+    recl_subrecord, bytes_left_subrecord;
+
+  /* Set to 1 if we have read a subrecord.  */
+
+  int continued;
+
+  __gthread_mutex_t lock;
+  /* Number of threads waiting to acquire this unit's lock.
+     When non-zero, close_unit doesn't only removes the unit
+     from the UNIT_ROOT tree, but doesn't free it and the
+     last of the waiting threads will do that.
+     This must be either atomically increased/decreased, or
+     always guarded by UNIT_LOCK.  */
+  int waiting;
+  /* Flag set by close_unit if the unit as been closed.
+     Must be manipulated under unit's lock.  */
+  int closed;
+
+  /* For traversing arrays */
+  array_loop_spec *ls;
+  int rank;
+
+  int file_len;
+  char *file;
+
+  /* The format hash table.  */
+  struct format_hash_entry format_hash_table[FORMAT_HASH_SIZE];
+  
+  /* Formatting buffer.  */
+  struct fbuf *fbuf;
+}
+gfc_unit;
+
+
+/* unit.c */
+
+/* Maximum file offset, computed at library initialization time.  */
+extern gfc_offset max_offset;
+internal_proto(max_offset);
+
+/* Unit tree root.  */
+extern gfc_unit *unit_root;
+internal_proto(unit_root);
+
+extern __gthread_mutex_t unit_lock;
+internal_proto(unit_lock);
+
+extern int close_unit (gfc_unit *);
+internal_proto(close_unit);
+
+extern gfc_unit *get_internal_unit (st_parameter_dt *);
+internal_proto(get_internal_unit);
+
+extern void free_internal_unit (st_parameter_dt *);
+internal_proto(free_internal_unit);
+
+extern gfc_unit *find_unit (int);
+internal_proto(find_unit);
+
+extern gfc_unit *find_or_create_unit (int);
+internal_proto(find_or_create_unit);
+
+extern gfc_unit *get_unit (st_parameter_dt *, int);
+internal_proto(get_unit);
+
+extern void unlock_unit (gfc_unit *);
+internal_proto(unlock_unit);
+
+extern void finish_last_advance_record (gfc_unit *u);
+internal_proto (finish_last_advance_record);
+
+extern int unit_truncate (gfc_unit *, gfc_offset, st_parameter_common *);
+internal_proto (unit_truncate);
+
+extern GFC_INTEGER_4 get_unique_unit_number (st_parameter_open *);
+internal_proto(get_unique_unit_number);
+
+/* open.c */
+
+extern gfc_unit *new_unit (st_parameter_open *, gfc_unit *, unit_flags *);
+internal_proto(new_unit);
+
+
+/* transfer.c */
+
+#define SCRATCH_SIZE 300
+
+extern const char *type_name (bt);
+internal_proto(type_name);
+
+extern void * read_block_form (st_parameter_dt *, int *);
+internal_proto(read_block_form);
+
+extern void * read_block_form4 (st_parameter_dt *, int *);
+internal_proto(read_block_form4);
+
+extern void *write_block (st_parameter_dt *, int);
+internal_proto(write_block);
+
+extern gfc_offset next_array_record (st_parameter_dt *, array_loop_spec *,
+                                    int*);
+internal_proto(next_array_record);
+
+extern gfc_offset init_loop_spec (gfc_array_char *, array_loop_spec *,
+                                 gfc_offset *);
+internal_proto(init_loop_spec);
+
+extern void next_record (st_parameter_dt *, int);
+internal_proto(next_record);
+
+extern void reverse_memcpy (void *, const void *, size_t);
+internal_proto (reverse_memcpy);
+
+extern void st_wait (st_parameter_wait *);
+export_proto(st_wait);
+
+extern void hit_eof (st_parameter_dt *);
+internal_proto(hit_eof);
+
+/* read.c */
+
+extern void set_integer (void *, GFC_INTEGER_LARGEST, int);
+internal_proto(set_integer);
+
+extern GFC_UINTEGER_LARGEST max_value (int, int);
+internal_proto(max_value);
+
+extern int convert_real (st_parameter_dt *, void *, const char *, int);
+internal_proto(convert_real);
+
+extern int convert_infnan (st_parameter_dt *, void *, const char *, int);
+internal_proto(convert_infnan);
+
+extern void read_a (st_parameter_dt *, const fnode *, char *, int);
+internal_proto(read_a);
+
+extern void read_a_char4 (st_parameter_dt *, const fnode *, char *, int);
+internal_proto(read_a);
+
+extern void read_f (st_parameter_dt *, const fnode *, char *, int);
+internal_proto(read_f);
+
+extern void read_l (st_parameter_dt *, const fnode *, char *, int);
+internal_proto(read_l);
+
+extern void read_x (st_parameter_dt *, int);
+internal_proto(read_x);
+
+extern void read_radix (st_parameter_dt *, const fnode *, char *, int, int);
+internal_proto(read_radix);
+
+extern void read_decimal (st_parameter_dt *, const fnode *, char *, int);
+internal_proto(read_decimal);
+
+/* list_read.c */
+
+extern void list_formatted_read (st_parameter_dt *, bt, void *, int, size_t,
+                                size_t);
+internal_proto(list_formatted_read);
+
+extern void finish_list_read (st_parameter_dt *);
+internal_proto(finish_list_read);
+
+extern void namelist_read (st_parameter_dt *);
+internal_proto(namelist_read);
+
+extern void namelist_write (st_parameter_dt *);
+internal_proto(namelist_write);
+
+/* write.c */
+
+extern void write_a (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_a);
+
+extern void write_a_char4 (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_a_char4);
+
+extern void write_b (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_b);
+
+extern void write_d (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_d);
+
+extern void write_e (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_e);
+
+extern void write_en (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_en);
+
+extern void write_es (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_es);
+
+extern void write_f (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_f);
+
+extern void write_i (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_i);
+
+extern void write_l (st_parameter_dt *, const fnode *, char *, int);
+internal_proto(write_l);
+
+extern void write_o (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_o);
+
+extern void write_real (st_parameter_dt *, const char *, int);
+internal_proto(write_real);
+
+extern void write_real_g0 (st_parameter_dt *, const char *, int, int);
+internal_proto(write_real_g0);
+
+extern void write_x (st_parameter_dt *, int, int);
+internal_proto(write_x);
+
+extern void write_z (st_parameter_dt *, const fnode *, const char *, int);
+internal_proto(write_z);
+
+extern void list_formatted_write (st_parameter_dt *, bt, void *, int, size_t,
+                                 size_t);
+internal_proto(list_formatted_write);
+
+/* size_from_kind.c */
+extern size_t size_from_real_kind (int);
+internal_proto(size_from_real_kind);
+
+extern size_t size_from_complex_kind (int);
+internal_proto(size_from_complex_kind);
+
+
+/* lock.c */
+extern void free_ionml (st_parameter_dt *);
+internal_proto(free_ionml);
+
+static inline void
+inc_waiting_locked (gfc_unit *u)
+{
+#ifdef HAVE_SYNC_FETCH_AND_ADD
+  (void) __sync_fetch_and_add (&u->waiting, 1);
+#else
+  u->waiting++;
+#endif
+}
+
+static inline int
+predec_waiting_locked (gfc_unit *u)
+{
+#ifdef HAVE_SYNC_FETCH_AND_ADD
+  return __sync_add_and_fetch (&u->waiting, -1);
+#else
+  return --u->waiting;
+#endif
+}
+
+static inline void
+dec_waiting_unlocked (gfc_unit *u)
+{
+#ifdef HAVE_SYNC_FETCH_AND_ADD
+  (void) __sync_fetch_and_add (&u->waiting, -1);
+#else
+  __gthread_mutex_lock (&unit_lock);
+  u->waiting--;
+  __gthread_mutex_unlock (&unit_lock);
+#endif
+}
+
+
+static inline void
+memset4 (gfc_char4_t *p, gfc_char4_t c, int k)
+{
+  int j;
+  for (j = 0; j < k; j++)
+    *p++ = c;
+}
+
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/io/list_read.c b/l4/pkg/libgfortran/lib/contrib/io/list_read.c
new file mode 100644 (file)
index 0000000..11a35c9
--- /dev/null
@@ -0,0 +1,3107 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   Namelist input contributed by Paul Thomas
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+
+/* List directed input.  Several parsing subroutines are practically
+   reimplemented from formatted input, the reason being that there are
+   all kinds of small differences between formatted and list directed
+   parsing.  */
+
+
+/* Subroutines for reading characters from the input.  Because a
+   repeat count is ambiguous with an integer, we have to read the
+   whole digit string before seeing if there is a '*' which signals
+   the repeat count.  Since we can have a lot of potential leading
+   zeros, we have to be able to back up by arbitrary amount.  Because
+   the input might not be seekable, we have to buffer the data
+   ourselves.  */
+
+#define CASE_DIGITS   case '0': case '1': case '2': case '3': case '4': \
+                      case '5': case '6': case '7': case '8': case '9'
+
+#define CASE_SEPARATORS  case ' ': case ',': case '/': case '\n': case '\t': \
+                         case '\r': case ';'
+
+/* This macro assumes that we're operating on a variable.  */
+
+#define is_separator(c) (c == '/' ||  c == ',' || c == '\n' || c == ' ' \
+                         || c == '\t' || c == '\r' || c == ';')
+
+/* Maximum repeat count.  Less than ten times the maximum signed int32.  */
+
+#define MAX_REPEAT 200000000
+
+
+#define MSGLEN 100
+
+/* Save a character to a string buffer, enlarging it as necessary.  */
+
+static void
+push_char (st_parameter_dt *dtp, char c)
+{
+  char *new;
+
+  if (dtp->u.p.saved_string == NULL)
+    {
+      dtp->u.p.saved_string = get_mem (SCRATCH_SIZE);
+      // memset below should be commented out.
+      memset (dtp->u.p.saved_string, 0, SCRATCH_SIZE);
+      dtp->u.p.saved_length = SCRATCH_SIZE;
+      dtp->u.p.saved_used = 0;
+    }
+
+  if (dtp->u.p.saved_used >= dtp->u.p.saved_length)
+    {
+      dtp->u.p.saved_length = 2 * dtp->u.p.saved_length;
+      new = realloc (dtp->u.p.saved_string, dtp->u.p.saved_length);
+      if (new == NULL)
+       generate_error (&dtp->common, LIBERROR_OS, NULL);
+      dtp->u.p.saved_string = new;
+      
+      // Also this should not be necessary.
+      memset (new + dtp->u.p.saved_used, 0, 
+             dtp->u.p.saved_length - dtp->u.p.saved_used);
+
+    }
+
+  dtp->u.p.saved_string[dtp->u.p.saved_used++] = c;
+}
+
+
+/* Free the input buffer if necessary.  */
+
+static void
+free_saved (st_parameter_dt *dtp)
+{
+  if (dtp->u.p.saved_string == NULL)
+    return;
+
+  free (dtp->u.p.saved_string);
+
+  dtp->u.p.saved_string = NULL;
+  dtp->u.p.saved_used = 0;
+}
+
+
+/* Free the line buffer if necessary.  */
+
+static void
+free_line (st_parameter_dt *dtp)
+{
+  dtp->u.p.item_count = 0;
+  dtp->u.p.line_buffer_enabled = 0;
+
+  if (dtp->u.p.line_buffer == NULL)
+    return;
+
+  free (dtp->u.p.line_buffer);
+  dtp->u.p.line_buffer = NULL;
+}
+
+
+static int
+next_char (st_parameter_dt *dtp)
+{
+  ssize_t length;
+  gfc_offset record;
+  int c;
+
+  if (dtp->u.p.last_char != EOF - 1)
+    {
+      dtp->u.p.at_eol = 0;
+      c = dtp->u.p.last_char;
+      dtp->u.p.last_char = EOF - 1;
+      goto done;
+    }
+
+  /* Read from line_buffer if enabled.  */
+
+  if (dtp->u.p.line_buffer_enabled)
+    {
+      dtp->u.p.at_eol = 0;
+
+      c = dtp->u.p.line_buffer[dtp->u.p.item_count];
+      if (c != '\0' && dtp->u.p.item_count < 64)
+       {
+         dtp->u.p.line_buffer[dtp->u.p.item_count] = '\0';
+         dtp->u.p.item_count++;
+         goto done;
+       }
+
+      dtp->u.p.item_count = 0;
+      dtp->u.p.line_buffer_enabled = 0;
+    }    
+
+  /* Handle the end-of-record and end-of-file conditions for
+     internal array unit.  */
+  if (is_array_io (dtp))
+    {
+      if (dtp->u.p.at_eof)
+       return EOF;
+
+      /* Check for "end-of-record" condition.  */
+      if (dtp->u.p.current_unit->bytes_left == 0)
+       {
+         int finished;
+
+         c = '\n';
+         record = next_array_record (dtp, dtp->u.p.current_unit->ls,
+                                     &finished);
+
+         /* Check for "end-of-file" condition.  */      
+         if (finished)
+           {
+             dtp->u.p.at_eof = 1;
+             goto done;
+           }
+
+         record *= dtp->u.p.current_unit->recl;
+         if (sseek (dtp->u.p.current_unit->s, record, SEEK_SET) < 0)
+           return EOF;
+
+         dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+         goto done;
+       }
+    }
+
+  /* Get the next character and handle end-of-record conditions.  */
+
+  if (is_internal_unit (dtp))
+    {
+      char cc;
+      length = sread (dtp->u.p.current_unit->s, &cc, 1);
+      c = cc;
+      if (length < 0)
+       {
+         generate_error (&dtp->common, LIBERROR_OS, NULL);
+         return '\0';
+       }
+  
+      if (is_array_io (dtp))
+       {
+         /* Check whether we hit EOF.  */ 
+         if (length == 0)
+           {
+             generate_error (&dtp->common, LIBERROR_INTERNAL_UNIT, NULL);
+             return '\0';
+           } 
+         dtp->u.p.current_unit->bytes_left--;
+       }
+      else
+       {
+         if (dtp->u.p.at_eof) 
+           return EOF;
+         if (length == 0)
+           {
+             c = '\n';
+             dtp->u.p.at_eof = 1;
+           }
+       }
+    }
+  else
+    {
+      c = fbuf_getc (dtp->u.p.current_unit);
+      if (c != EOF && is_stream_io (dtp))
+       dtp->u.p.current_unit->strm_pos++;
+    }
+done:
+  dtp->u.p.at_eol = (c == '\n' || c == '\r' || c == EOF);
+  return c;
+}
+
+
+/* Push a character back onto the input.  */
+
+static void
+unget_char (st_parameter_dt *dtp, int c)
+{
+  dtp->u.p.last_char = c;
+}
+
+
+/* Skip over spaces in the input.  Returns the nonspace character that
+   terminated the eating and also places it back on the input.  */
+
+static int
+eat_spaces (st_parameter_dt *dtp)
+{
+  int c;
+
+  do
+    c = next_char (dtp);
+  while (c != EOF && (c == ' ' || c == '\t'));
+
+  unget_char (dtp, c);
+  return c;
+}
+
+
+/* This function reads characters through to the end of the current
+   line and just ignores them.  Returns 0 for success and LIBERROR_END
+   if it hit EOF.  */
+
+static int
+eat_line (st_parameter_dt *dtp)
+{
+  int c;
+
+  do
+    c = next_char (dtp);
+  while (c != EOF && c != '\n');
+  if (c == EOF)
+    return LIBERROR_END;
+  return 0;
+}
+
+
+/* Skip over a separator.  Technically, we don't always eat the whole
+   separator.  This is because if we've processed the last input item,
+   then a separator is unnecessary.  Plus the fact that operating
+   systems usually deliver console input on a line basis.
+
+   The upshot is that if we see a newline as part of reading a
+   separator, we stop reading.  If there are more input items, we
+   continue reading the separator with finish_separator() which takes
+   care of the fact that we may or may not have seen a comma as part
+   of the separator. 
+
+   Returns 0 for success, and non-zero error code otherwise.  */
+
+static int
+eat_separator (st_parameter_dt *dtp)
+{
+  int c, n;
+  int err = 0;
+
+  eat_spaces (dtp);
+  dtp->u.p.comma_flag = 0;
+
+  if ((c = next_char (dtp)) == EOF)
+    return LIBERROR_END;
+  switch (c)
+    {
+    case ',':
+      if (dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA)
+       {
+         unget_char (dtp, c);
+         break;
+       }
+      /* Fall through.  */
+    case ';':
+      dtp->u.p.comma_flag = 1;
+      eat_spaces (dtp);
+      break;
+
+    case '/':
+      dtp->u.p.input_complete = 1;
+      break;
+
+    case '\r':
+      dtp->u.p.at_eol = 1;
+      if ((n = next_char(dtp)) == EOF)
+       return LIBERROR_END;
+      if (n != '\n')
+       {
+         unget_char (dtp, n);
+         break;
+       }
+    /* Fall through.  */
+    case '\n':
+      dtp->u.p.at_eol = 1;
+      if (dtp->u.p.namelist_mode)
+       {
+         do
+           {
+             if ((c = next_char (dtp)) == EOF)
+                 return LIBERROR_END;
+             if (c == '!')
+               {
+                 err = eat_line (dtp);
+                 if (err)
+                   return err;
+                 c = '\n';
+               }
+           }
+         while (c == '\n' || c == '\r' || c == ' ' || c == '\t');
+         unget_char (dtp, c);
+       }
+      break;
+
+    case '!':
+      if (dtp->u.p.namelist_mode)
+       {                       /* Eat a namelist comment.  */
+         err = eat_line (dtp);
+         if (err)
+           return err;
+
+         break;
+       }
+
+      /* Fall Through...  */
+
+    default:
+      unget_char (dtp, c);
+      break;
+    }
+  return err;
+}
+
+
+/* Finish processing a separator that was interrupted by a newline.
+   If we're here, then another data item is present, so we finish what
+   we started on the previous line.  Return 0 on success, error code
+   on failure.  */
+
+static int
+finish_separator (st_parameter_dt *dtp)
+{
+  int c;
+  int err;
+
+ restart:
+  eat_spaces (dtp);
+
+  if ((c = next_char (dtp)) == EOF)
+    return LIBERROR_END;
+  switch (c)
+    {
+    case ',':
+      if (dtp->u.p.comma_flag)
+       unget_char (dtp, c);
+      else
+       {
+         if ((c = eat_spaces (dtp)) == EOF)
+           return LIBERROR_END;
+         if (c == '\n' || c == '\r')
+           goto restart;
+       }
+
+      break;
+
+    case '/':
+      dtp->u.p.input_complete = 1;
+      if (!dtp->u.p.namelist_mode)
+       return err;
+      break;
+
+    case '\n':
+    case '\r':
+      goto restart;
+
+    case '!':
+      if (dtp->u.p.namelist_mode)
+       {
+         err = eat_line (dtp);
+         if (err)
+           return err;
+         goto restart;
+       }
+
+    default:
+      unget_char (dtp, c);
+      break;
+    }
+  return err;
+}
+
+
+/* This function is needed to catch bad conversions so that namelist can
+   attempt to see if dtp->u.p.saved_string contains a new object name rather
+   than a bad value.  */
+
+static int
+nml_bad_return (st_parameter_dt *dtp, char c)
+{
+  if (dtp->u.p.namelist_mode)
+    {
+      dtp->u.p.nml_read_error = 1;
+      unget_char (dtp, c);
+      return 1;
+    }
+  return 0;
+}
+
+/* Convert an unsigned string to an integer.  The length value is -1
+   if we are working on a repeat count.  Returns nonzero if we have a
+   range problem.  As a side effect, frees the dtp->u.p.saved_string.  */
+
+static int
+convert_integer (st_parameter_dt *dtp, int length, int negative)
+{
+  char c, *buffer, message[MSGLEN];
+  int m;
+  GFC_INTEGER_LARGEST v, max, max10;
+
+  buffer = dtp->u.p.saved_string;
+  v = 0;
+
+  max = (length == -1) ? MAX_REPEAT : max_value (length, 1);
+  max10 = max / 10;
+
+  for (;;)
+    {
+      c = *buffer++;
+      if (c == '\0')
+       break;
+      c -= '0';
+
+      if (v > max10)
+       goto overflow;
+      v = 10 * v;
+
+      if (v > max - c)
+       goto overflow;
+      v += c;
+    }
+
+  m = 0;
+
+  if (length != -1)
+    {
+      if (negative)
+       v = -v;
+      set_integer (dtp->u.p.value, v, length);
+    }
+  else
+    {
+      dtp->u.p.repeat_count = v;
+
+      if (dtp->u.p.repeat_count == 0)
+       {
+         snprintf (message, MSGLEN, "Zero repeat count in item %d of list input",
+                  dtp->u.p.item_count);
+
+         generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+         m = 1;
+       }
+    }
+
+  free_saved (dtp);
+  return m;
+
+ overflow:
+  if (length == -1)
+    snprintf (message, MSGLEN, "Repeat count overflow in item %d of list input",
+            dtp->u.p.item_count);
+  else
+    snprintf (message, MSGLEN, "Integer overflow while reading item %d",
+            dtp->u.p.item_count);
+
+  free_saved (dtp);
+  generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+
+  return 1;
+}
+
+
+/* Parse a repeat count for logical and complex values which cannot
+   begin with a digit.  Returns nonzero if we are done, zero if we
+   should continue on.  */
+
+static int
+parse_repeat (st_parameter_dt *dtp)
+{
+  char message[MSGLEN];
+  int c, repeat;
+
+  if ((c = next_char (dtp)) == EOF)
+    goto bad_repeat;
+  switch (c)
+    {
+    CASE_DIGITS:
+      repeat = c - '0';
+      break;
+
+    CASE_SEPARATORS:
+      unget_char (dtp, c);
+      eat_separator (dtp);
+      return 1;
+
+    default:
+      unget_char (dtp, c);
+      return 0;
+    }
+
+  for (;;)
+    {
+      c = next_char (dtp);
+      switch (c)
+       {
+       CASE_DIGITS:
+         repeat = 10 * repeat + c - '0';
+
+         if (repeat > MAX_REPEAT)
+           {
+             snprintf (message, MSGLEN,
+                      "Repeat count overflow in item %d of list input",
+                      dtp->u.p.item_count);
+
+             generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+             return 1;
+           }
+
+         break;
+
+       case '*':
+         if (repeat == 0)
+           {
+             snprintf (message, MSGLEN,
+                      "Zero repeat count in item %d of list input",
+                      dtp->u.p.item_count);
+
+             generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+             return 1;
+           }
+
+         goto done;
+
+       default:
+         goto bad_repeat;
+       }
+    }
+
+ done:
+  dtp->u.p.repeat_count = repeat;
+  return 0;
+
+ bad_repeat:
+
+  free_saved (dtp);
+  if (c == EOF)
+    {
+      hit_eof (dtp);
+      return 1;
+    }
+  else
+    eat_line (dtp);
+  snprintf (message, MSGLEN, "Bad repeat count in item %d of list input",
+          dtp->u.p.item_count);
+  generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+  return 1;
+}
+
+
+/* To read a logical we have to look ahead in the input stream to make sure
+    there is not an equal sign indicating a variable name.  To do this we use 
+    line_buffer to point to a temporary buffer, pushing characters there for
+    possible later reading. */
+
+static void
+l_push_char (st_parameter_dt *dtp, char c)
+{
+  if (dtp->u.p.line_buffer == NULL)
+    {
+      dtp->u.p.line_buffer = get_mem (SCRATCH_SIZE);
+      memset (dtp->u.p.line_buffer, 0, SCRATCH_SIZE);
+    }
+
+  dtp->u.p.line_buffer[dtp->u.p.item_count++] = c;
+}
+
+
+/* Read a logical character on the input.  */
+
+static void
+read_logical (st_parameter_dt *dtp, int length)
+{
+  char message[MSGLEN];
+  int c, i, v;
+
+  if (parse_repeat (dtp))
+    return;
+
+  c = tolower (next_char (dtp));
+  l_push_char (dtp, c);
+  switch (c)
+    {
+    case 't':
+      v = 1;
+      c = next_char (dtp);
+      l_push_char (dtp, c);
+
+      if (!is_separator(c) && c != EOF)
+       goto possible_name;
+
+      unget_char (dtp, c);
+      break;
+    case 'f':
+      v = 0;
+      c = next_char (dtp);
+      l_push_char (dtp, c);
+
+      if (!is_separator(c) && c != EOF)
+       goto possible_name;
+
+      unget_char (dtp, c);
+      break;
+
+    case '.':
+      c = tolower (next_char (dtp));
+      switch (c)
+       {
+         case 't':
+           v = 1;
+           break;
+         case 'f':
+           v = 0;
+           break;
+         default:
+           goto bad_logical;
+       }
+
+      break;
+
+    CASE_SEPARATORS:
+      unget_char (dtp, c);
+      eat_separator (dtp);
+      return;                  /* Null value.  */
+
+    default:
+      /* Save the character in case it is the beginning
+        of the next object name. */
+      unget_char (dtp, c);
+      goto bad_logical;
+    }
+
+  dtp->u.p.saved_type = BT_LOGICAL;
+  dtp->u.p.saved_length = length;
+
+  /* Eat trailing garbage.  */
+  do
+    c = next_char (dtp);
+  while (c != EOF && !is_separator (c));
+
+  unget_char (dtp, c);
+  eat_separator (dtp);
+  set_integer ((int *) dtp->u.p.value, v, length);
+  free_line (dtp);
+
+  return;
+
+ possible_name:
+
+  for(i = 0; i < 63; i++)
+    {
+      c = next_char (dtp);
+      if (is_separator(c))
+       {
+         /* All done if this is not a namelist read.  */
+         if (!dtp->u.p.namelist_mode)
+           goto logical_done;
+
+         unget_char (dtp, c);
+         eat_separator (dtp);
+         c = next_char (dtp);
+         if (c != '=')
+           {
+             unget_char (dtp, c);
+             goto logical_done;
+           }
+       }
+      l_push_char (dtp, c);
+      if (c == '=')
+       {
+         dtp->u.p.nml_read_error = 1;
+         dtp->u.p.line_buffer_enabled = 1;
+         dtp->u.p.item_count = 0;
+         return;
+       }
+      
+    }
+
+ bad_logical:
+
+  free_line (dtp);
+
+  if (nml_bad_return (dtp, c))
+    return;
+
+  free_saved (dtp);
+  if (c == EOF)
+    {
+      hit_eof (dtp);
+      return;
+    }
+  else if (c != '\n')
+    eat_line (dtp);
+  snprintf (message, MSGLEN, "Bad logical value while reading item %d",
+             dtp->u.p.item_count);
+  generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+  return;
+
+ logical_done:
+
+  dtp->u.p.saved_type = BT_LOGICAL;
+  dtp->u.p.saved_length = length;
+  set_integer ((int *) dtp->u.p.value, v, length);
+  free_saved (dtp);
+  free_line (dtp);
+}
+
+
+/* Reading integers is tricky because we can actually be reading a
+   repeat count.  We have to store the characters in a buffer because
+   we could be reading an integer that is larger than the default int
+   used for repeat counts.  */
+
+static void
+read_integer (st_parameter_dt *dtp, int length)
+{
+  char message[MSGLEN];
+  int c, negative;
+
+  negative = 0;
+
+  c = next_char (dtp);
+  switch (c)
+    {
+    case '-':
+      negative = 1;
+      /* Fall through...  */
+
+    case '+':
+      if ((c = next_char (dtp)) == EOF)
+       goto bad_integer;
+      goto get_integer;
+
+    CASE_SEPARATORS:           /* Single null.  */
+      unget_char (dtp, c);
+      eat_separator (dtp);
+      return;
+
+    CASE_DIGITS:
+      push_char (dtp, c);
+      break;
+
+    default:
+      goto bad_integer;
+    }
+
+  /* Take care of what may be a repeat count.  */
+
+  for (;;)
+    {
+      c = next_char (dtp);
+      switch (c)
+       {
+       CASE_DIGITS:
+         push_char (dtp, c);
+         break;
+
+       case '*':
+         push_char (dtp, '\0');
+         goto repeat;
+
+       CASE_SEPARATORS:        /* Not a repeat count.  */
+       case EOF:
+         goto done;
+
+       default:
+         goto bad_integer;
+       }
+    }
+
+ repeat:
+  if (convert_integer (dtp, -1, 0))
+    return;
+
+  /* Get the real integer.  */
+
+  if ((c = next_char (dtp)) == EOF)
+    goto bad_integer;
+  switch (c)
+    {
+    CASE_DIGITS:
+      break;
+
+    CASE_SEPARATORS:
+      unget_char (dtp, c);
+      eat_separator (dtp);
+      return;
+
+    case '-':
+      negative = 1;
+      /* Fall through...  */
+
+    case '+':
+      c = next_char (dtp);
+      break;
+    }
+
+ get_integer:
+  if (!isdigit (c))
+    goto bad_integer;
+  push_char (dtp, c);
+
+  for (;;)
+    {
+      c = next_char (dtp);
+      switch (c)
+       {
+       CASE_DIGITS:
+         push_char (dtp, c);
+         break;
+
+       CASE_SEPARATORS:
+       case EOF:
+         goto done;
+
+       default:
+         goto bad_integer;
+       }
+    }
+
+ bad_integer:
+
+  if (nml_bad_return (dtp, c))
+    return;
+
+  free_saved (dtp);  
+  if (c == EOF)
+    {
+      hit_eof (dtp);
+      return;
+    }
+  else if (c != '\n')
+    eat_line (dtp);
+  snprintf (message, MSGLEN, "Bad integer for item %d in list input",
+             dtp->u.p.item_count);
+  generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+
+  return;
+
+ done:
+  unget_char (dtp, c);
+  eat_separator (dtp);
+
+  push_char (dtp, '\0');
+  if (convert_integer (dtp, length, negative))
+    {
+       free_saved (dtp);
+       return;
+    }
+
+  free_saved (dtp);
+  dtp->u.p.saved_type = BT_INTEGER;
+}
+
+
+/* Read a character variable.  */
+
+static void
+read_character (st_parameter_dt *dtp, int length __attribute__ ((unused)))
+{
+  char quote, message[MSGLEN];
+  int c;
+
+  quote = ' ';                 /* Space means no quote character.  */
+
+  if ((c = next_char (dtp)) == EOF)
+    goto eof;
+  switch (c)
+    {
+    CASE_DIGITS:
+      push_char (dtp, c);
+      break;
+
+    CASE_SEPARATORS:
+      unget_char (dtp, c);             /* NULL value.  */
+      eat_separator (dtp);
+      return;
+
+    case '"':
+    case '\'':
+      quote = c;
+      goto get_string;
+
+    default:
+      if (dtp->u.p.namelist_mode)
+       {
+         unget_char (dtp, c);
+         return;
+       }
+
+      push_char (dtp, c);
+      goto get_string;
+    }
+
+  /* Deal with a possible repeat count.  */
+
+  for (;;)
+    {
+      if ((c = next_char (dtp)) == EOF)
+       goto eof;
+      switch (c)
+       {
+       CASE_DIGITS:
+         push_char (dtp, c);
+         break;
+
+       CASE_SEPARATORS:
+         unget_char (dtp, c);
+         goto done;            /* String was only digits!  */
+
+       case '*':
+         push_char (dtp, '\0');
+         goto got_repeat;
+
+       default:
+         push_char (dtp, c);
+         goto get_string;      /* Not a repeat count after all.  */
+       }
+    }
+
+ got_repeat:
+  if (convert_integer (dtp, -1, 0))
+    return;
+
+  /* Now get the real string.  */
+
+  if ((c = next_char (dtp)) == EOF)
+    goto eof;
+  switch (c)
+    {
+    CASE_SEPARATORS:
+      unget_char (dtp, c);             /* Repeated NULL values.  */
+      eat_separator (dtp);
+      return;
+
+    case '"':
+    case '\'':
+      quote = c;
+      break;
+
+    default:
+      push_char (dtp, c);
+      break;
+    }
+
+ get_string:
+  for (;;)
+    {
+      if ((c = next_char (dtp)) == EOF)
+       goto done_eof;
+      switch (c)
+       {
+       case '"':
+       case '\'':
+         if (c != quote)
+           {
+             push_char (dtp, c);
+             break;
+           }
+
+         /* See if we have a doubled quote character or the end of
+            the string.  */
+
+         if ((c = next_char (dtp)) == EOF)
+           goto eof;
+         if (c == quote)
+           {
+             push_char (dtp, quote);
+             break;
+           }
+
+         unget_char (dtp, c);
+         goto done;
+
+       CASE_SEPARATORS:
+         if (quote == ' ')
+           {
+             unget_char (dtp, c);
+             goto done;
+           }
+
+         if (c != '\n' && c != '\r')
+           push_char (dtp, c);
+         break;
+
+       default:
+         push_char (dtp, c);
+         break;
+       }
+    }
+
+  /* At this point, we have to have a separator, or else the string is
+     invalid.  */
+ done:
+  c = next_char (dtp);
+ done_eof:
+  if (is_separator (c) || c == '!' || c == EOF)
+    {
+      unget_char (dtp, c);
+      eat_separator (dtp);
+      dtp->u.p.saved_type = BT_CHARACTER;
+      free_line (dtp);
+    }
+  else 
+    {
+      free_saved (dtp);
+      snprintf (message, MSGLEN, "Invalid string input in item %d",
+                 dtp->u.p.item_count);
+      generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+    }
+  return;
+
+ eof:
+  free_saved (dtp);
+  hit_eof (dtp);
+}
+
+
+/* Parse a component of a complex constant or a real number that we
+   are sure is already there.  This is a straight real number parser.  */
+
+static int
+parse_real (st_parameter_dt *dtp, void *buffer, int length)
+{
+  char message[MSGLEN];
+  int c, m, seen_dp;
+
+  if ((c = next_char (dtp)) == EOF)
+    goto bad;
+    
+  if (c == '-' || c == '+')
+    {
+      push_char (dtp, c);
+      if ((c = next_char (dtp)) == EOF)
+       goto bad;
+    }
+
+  if (c == ',' && dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA)
+    c = '.';
+  
+  if (!isdigit (c) && c != '.')
+    {
+      if (c == 'i' || c == 'I' || c == 'n' || c == 'N')
+       goto inf_nan;
+      else
+       goto bad;
+    }
+
+  push_char (dtp, c);
+
+  seen_dp = (c == '.') ? 1 : 0;
+
+  for (;;)
+    {
+      if ((c = next_char (dtp)) == EOF)
+       goto bad;
+      if (c == ',' && dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA)
+       c = '.';
+      switch (c)
+       {
+       CASE_DIGITS:
+         push_char (dtp, c);
+         break;
+
+       case '.':
+         if (seen_dp)
+           goto bad;
+
+         seen_dp = 1;
+         push_char (dtp, c);
+         break;
+
+       case 'e':
+       case 'E':
+       case 'd':
+       case 'D':
+         push_char (dtp, 'e');
+         goto exp1;
+
+       case '-':
+       case '+':
+         push_char (dtp, 'e');
+         push_char (dtp, c);
+         if ((c = next_char (dtp)) == EOF)
+           goto bad;
+         goto exp2;
+
+       CASE_SEPARATORS:
+         goto done;
+
+       default:
+         goto done;
+       }
+    }
+
+ exp1:
+  if ((c = next_char (dtp)) == EOF)
+    goto bad;
+  if (c != '-' && c != '+')
+    push_char (dtp, '+');
+  else
+    {
+      push_char (dtp, c);
+      c = next_char (dtp);
+    }
+
+ exp2:
+  if (!isdigit (c))
+    goto bad;
+
+  push_char (dtp, c);
+
+  for (;;)
+    {
+      if ((c = next_char (dtp)) == EOF)
+       goto bad;
+      switch (c)
+       {
+       CASE_DIGITS:
+         push_char (dtp, c);
+         break;
+
+       CASE_SEPARATORS:
+         unget_char (dtp, c);
+         goto done;
+
+       default:
+         goto done;
+       }
+    }
+
+ done:
+  unget_char (dtp, c);
+  push_char (dtp, '\0');
+
+  m = convert_real (dtp, buffer, dtp->u.p.saved_string, length);
+  free_saved (dtp);
+
+  return m;
+
+ done_infnan:
+  unget_char (dtp, c);
+  push_char (dtp, '\0');
+
+  m = convert_infnan (dtp, buffer, dtp->u.p.saved_string, length);
+  free_saved (dtp);
+
+  return m;
+
+ inf_nan:
+  /* Match INF and Infinity.  */
+  if ((c == 'i' || c == 'I')
+      && ((c = next_char (dtp)) == 'n' || c == 'N')
+      && ((c = next_char (dtp)) == 'f' || c == 'F'))
+    {
+       c = next_char (dtp);
+       if ((c != 'i' && c != 'I')
+           || ((c == 'i' || c == 'I')
+               && ((c = next_char (dtp)) == 'n' || c == 'N')
+               && ((c = next_char (dtp)) == 'i' || c == 'I')
+               && ((c = next_char (dtp)) == 't' || c == 'T')
+               && ((c = next_char (dtp)) == 'y' || c == 'Y')
+               && (c = next_char (dtp))))
+         {
+            if (is_separator (c))
+              unget_char (dtp, c);
+            push_char (dtp, 'i');
+            push_char (dtp, 'n');
+            push_char (dtp, 'f');
+            goto done_infnan;
+         }
+    } /* Match NaN.  */
+  else if (((c = next_char (dtp)) == 'a' || c == 'A')
+          && ((c = next_char (dtp)) == 'n' || c == 'N')
+          && (c = next_char (dtp)))
+    {
+      if (is_separator (c))
+       unget_char (dtp, c);
+      push_char (dtp, 'n');
+      push_char (dtp, 'a');
+      push_char (dtp, 'n');
+      
+      /* Match "NAN(alphanum)".  */
+      if (c == '(')
+       {
+         for ( ; c != ')'; c = next_char (dtp))
+           if (is_separator (c))
+             goto bad;
+
+         c = next_char (dtp);
+         if (is_separator (c))
+           unget_char (dtp, c);
+       }
+      goto done_infnan;
+    }
+
+ bad:
+
+  if (nml_bad_return (dtp, c))
+    return 0;
+
+  free_saved (dtp);
+  if (c == EOF)
+    {
+      hit_eof (dtp);
+      return 1;
+    }
+  else if (c != '\n')
+    eat_line (dtp);
+  snprintf (message, MSGLEN, "Bad floating point number for item %d",
+             dtp->u.p.item_count);
+  generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+
+  return 1;
+}
+
+
+/* Reading a complex number is straightforward because we can tell
+   what it is right away.  */
+
+static void
+read_complex (st_parameter_dt *dtp, void * dest, int kind, size_t size)
+{
+  char message[MSGLEN];
+  int c;
+
+  if (parse_repeat (dtp))
+    return;
+
+  c = next_char (dtp);
+  switch (c)
+    {
+    case '(':
+      break;
+
+    CASE_SEPARATORS:
+      unget_char (dtp, c);
+      eat_separator (dtp);
+      return;
+
+    default:
+      goto bad_complex;
+    }
+
+eol_1:
+  eat_spaces (dtp);
+  c = next_char (dtp);
+  if (c == '\n' || c== '\r')
+    goto eol_1;
+  else
+    unget_char (dtp, c);
+
+  if (parse_real (dtp, dest, kind))
+    return;
+
+eol_2:
+  eat_spaces (dtp);
+  c = next_char (dtp);
+  if (c == '\n' || c== '\r')
+    goto eol_2;
+  else
+    unget_char (dtp, c);
+
+  if (next_char (dtp)
+      !=  (dtp->u.p.current_unit->decimal_status == DECIMAL_POINT ? ',' : ';'))
+    goto bad_complex;
+
+eol_3:
+  eat_spaces (dtp);
+  c = next_char (dtp);
+  if (c == '\n' || c== '\r')
+    goto eol_3;
+  else
+    unget_char (dtp, c);
+
+  if (parse_real (dtp, dest + size / 2, kind))
+    return;
+    
+eol_4:
+  eat_spaces (dtp);
+  c = next_char (dtp);
+  if (c == '\n' || c== '\r')
+    goto eol_4;
+  else
+    unget_char (dtp, c);
+
+  if (next_char (dtp) != ')')
+    goto bad_complex;
+
+  c = next_char (dtp);
+  if (!is_separator (c))
+    goto bad_complex;
+
+  unget_char (dtp, c);
+  eat_separator (dtp);
+
+  free_saved (dtp);
+  dtp->u.p.saved_type = BT_COMPLEX;
+  return;
+
+ bad_complex:
+
+  if (nml_bad_return (dtp, c))
+    return;
+
+  free_saved (dtp);
+  if (c == EOF)
+    {
+      hit_eof (dtp);
+      return;
+    }
+  else if (c != '\n')   
+    eat_line (dtp);
+  snprintf (message, MSGLEN, "Bad complex value in item %d of list input",
+             dtp->u.p.item_count);
+  generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+}
+
+
+/* Parse a real number with a possible repeat count.  */
+
+static void
+read_real (st_parameter_dt *dtp, void * dest, int length)
+{
+  char message[MSGLEN];
+  int c;
+  int seen_dp;
+  int is_inf;
+
+  seen_dp = 0;
+
+  c = next_char (dtp);
+  if (c == ',' && dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA)
+    c = '.';
+  switch (c)
+    {
+    CASE_DIGITS:
+      push_char (dtp, c);
+      break;
+
+    case '.':
+      push_char (dtp, c);
+      seen_dp = 1;
+      break;
+
+    case '+':
+    case '-':
+      goto got_sign;
+
+    CASE_SEPARATORS:
+      unget_char (dtp, c);             /* Single null.  */
+      eat_separator (dtp);
+      return;
+
+    case 'i':
+    case 'I':
+    case 'n':
+    case 'N':
+      goto inf_nan;
+
+    default:
+      goto bad_real;
+    }
+
+  /* Get the digit string that might be a repeat count.  */
+
+  for (;;)
+    {
+      c = next_char (dtp);
+      if (c == ',' && dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA)
+       c = '.';
+      switch (c)
+       {
+       CASE_DIGITS:
+         push_char (dtp, c);
+         break;
+
+       case '.':
+         if (seen_dp)
+           goto bad_real;
+
+         seen_dp = 1;
+         push_char (dtp, c);
+         goto real_loop;
+
+       case 'E':
+       case 'e':
+       case 'D':
+       case 'd':
+         goto exp1;
+
+       case '+':
+       case '-':
+         push_char (dtp, 'e');
+         push_char (dtp, c);
+         c = next_char (dtp);
+         goto exp2;
+
+       case '*':
+         push_char (dtp, '\0');
+         goto got_repeat;
+
+       CASE_SEPARATORS:
+          if (c != '\n' && c != ',' && c != '\r' && c != ';')
+           unget_char (dtp, c);
+         goto done;
+
+       default:
+         goto bad_real;
+       }
+    }
+
+ got_repeat:
+  if (convert_integer (dtp, -1, 0))
+    return;
+
+  /* Now get the number itself.  */
+
+  if ((c = next_char (dtp)) == EOF)
+    goto bad_real;
+  if (is_separator (c))
+    {                          /* Repeated null value.  */
+      unget_char (dtp, c);
+      eat_separator (dtp);
+      return;
+    }
+
+  if (c != '-' && c != '+')
+    push_char (dtp, '+');
+  else
+    {
+    got_sign:
+      push_char (dtp, c);
+      if ((c = next_char (dtp)) == EOF)
+       goto bad_real;
+    }
+
+  if (c == ',' && dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA)
+    c = '.';
+
+  if (!isdigit (c) && c != '.')
+    {
+      if (c == 'i' || c == 'I' || c == 'n' || c == 'N')
+       goto inf_nan;
+      else
+       goto bad_real;
+    }
+
+  if (c == '.')
+    {
+      if (seen_dp)
+        goto bad_real;
+      else
+        seen_dp = 1;
+    }
+
+  push_char (dtp, c);
+
+ real_loop:
+  for (;;)
+    {
+      c = next_char (dtp);
+      if (c == ',' && dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA)
+       c = '.';
+      switch (c)
+       {
+       CASE_DIGITS:
+         push_char (dtp, c);
+         break;
+
+       CASE_SEPARATORS:
+       case EOF:
+         goto done;
+
+       case '.':
+         if (seen_dp)
+           goto bad_real;
+
+         seen_dp = 1;
+         push_char (dtp, c);
+         break;
+
+       case 'E':
+       case 'e':
+       case 'D':
+       case 'd':
+         goto exp1;
+
+       case '+':
+       case '-':
+         push_char (dtp, 'e');
+         push_char (dtp, c);
+         c = next_char (dtp);
+         goto exp2;
+
+       default:
+         goto bad_real;
+       }
+    }
+
+ exp1:
+  push_char (dtp, 'e');
+
+  if ((c = next_char (dtp)) == EOF)
+    goto bad_real;
+  if (c != '+' && c != '-')
+    push_char (dtp, '+');
+  else
+    {
+      push_char (dtp, c);
+      c = next_char (dtp);
+    }
+
+ exp2:
+  if (!isdigit (c))
+    goto bad_real;
+  push_char (dtp, c);
+
+  for (;;)
+    {
+      c = next_char (dtp);
+
+      switch (c)
+       {
+       CASE_DIGITS:
+         push_char (dtp, c);
+         break;
+
+       CASE_SEPARATORS:
+         goto done;
+
+       default:
+         goto bad_real;
+       }
+    }
+
+ done:
+  unget_char (dtp, c);
+  eat_separator (dtp);
+  push_char (dtp, '\0');
+  if (convert_real (dtp, dest, dtp->u.p.saved_string, length))
+    return;
+
+  free_saved (dtp);
+  dtp->u.p.saved_type = BT_REAL;
+  return;
+
+ inf_nan:
+  l_push_char (dtp, c);
+  is_inf = 0;
+
+  /* Match INF and Infinity.  */
+  if (c == 'i' || c == 'I')
+    {
+      c = next_char (dtp);
+      l_push_char (dtp, c);
+      if (c != 'n' && c != 'N')
+       goto unwind;
+      c = next_char (dtp);
+      l_push_char (dtp, c);
+      if (c != 'f' && c != 'F')
+       goto unwind;
+      c = next_char (dtp);
+      l_push_char (dtp, c);
+      if (!is_separator (c))
+       {
+         if (c != 'i' && c != 'I')
+           goto unwind;
+         c = next_char (dtp);
+         l_push_char (dtp, c);
+         if (c != 'n' && c != 'N')
+           goto unwind;
+         c = next_char (dtp);
+         l_push_char (dtp, c);
+         if (c != 'i' && c != 'I')
+           goto unwind;
+         c = next_char (dtp);
+         l_push_char (dtp, c);
+         if (c != 't' && c != 'T')
+           goto unwind;
+         c = next_char (dtp);
+         l_push_char (dtp, c);
+         if (c != 'y' && c != 'Y')
+           goto unwind;
+         c = next_char (dtp);
+         l_push_char (dtp, c);
+       }
+       is_inf = 1;
+    } /* Match NaN.  */
+  else
+    {
+      c = next_char (dtp);
+      l_push_char (dtp, c);
+      if (c != 'a' && c != 'A')
+       goto unwind;
+      c = next_char (dtp);
+      l_push_char (dtp, c);
+      if (c != 'n' && c != 'N')
+       goto unwind;
+      c = next_char (dtp);
+      l_push_char (dtp, c);
+
+      /* Match NAN(alphanum).  */
+      if (c == '(')
+       {
+         for (c = next_char (dtp); c != ')'; c = next_char (dtp))
+           if (is_separator (c))
+             goto unwind;
+           else
+             l_push_char (dtp, c);
+
+         l_push_char (dtp, ')');
+         c = next_char (dtp);
+         l_push_char (dtp, c);
+       }
+    }
+
+  if (!is_separator (c))
+    goto unwind;
+
+  if (dtp->u.p.namelist_mode)
+    {  
+      if (c == ' ' || c =='\n' || c == '\r')
+       {
+         do
+           {
+             if ((c = next_char (dtp)) == EOF)
+               goto bad_real;
+           }
+         while (c == ' ' || c =='\n' || c == '\r');
+
+         l_push_char (dtp, c);
+
+         if (c == '=')
+           goto unwind;
+       }
+    }
+
+  if (is_inf)
+    {
+      push_char (dtp, 'i');
+      push_char (dtp, 'n');
+      push_char (dtp, 'f');
+    }
+  else
+    {
+      push_char (dtp, 'n');
+      push_char (dtp, 'a');
+      push_char (dtp, 'n');
+    }
+
+  free_line (dtp);
+  unget_char (dtp, c);
+  eat_separator (dtp);
+  push_char (dtp, '\0');
+  if (convert_infnan (dtp, dest, dtp->u.p.saved_string, length))
+    return;
+
+  free_saved (dtp);
+  dtp->u.p.saved_type = BT_REAL;
+  return;
+
+ unwind:
+  if (dtp->u.p.namelist_mode)
+    {
+      dtp->u.p.nml_read_error = 1;
+      dtp->u.p.line_buffer_enabled = 1;
+      dtp->u.p.item_count = 0;
+      return;
+    }
+
+ bad_real:
+
+  if (nml_bad_return (dtp, c))
+    return;
+
+  free_saved (dtp);
+  if (c == EOF)
+    {
+      hit_eof (dtp);
+      return;
+    }
+  else if (c != '\n')
+    eat_line (dtp);
+
+  snprintf (message, MSGLEN, "Bad real number in item %d of list input",
+             dtp->u.p.item_count);
+  generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+}
+
+
+/* Check the current type against the saved type to make sure they are
+   compatible.  Returns nonzero if incompatible.  */
+
+static int
+check_type (st_parameter_dt *dtp, bt type, int len)
+{
+  char message[MSGLEN];
+
+  if (dtp->u.p.saved_type != BT_UNKNOWN && dtp->u.p.saved_type != type)
+    {
+      snprintf (message, MSGLEN, "Read type %s where %s was expected for item %d",
+                 type_name (dtp->u.p.saved_type), type_name (type),
+                 dtp->u.p.item_count);
+
+      generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+      return 1;
+    }
+
+  if (dtp->u.p.saved_type == BT_UNKNOWN || dtp->u.p.saved_type == BT_CHARACTER)
+    return 0;
+
+  if (dtp->u.p.saved_length != len)
+    {
+      snprintf (message, MSGLEN,
+                 "Read kind %d %s where kind %d is required for item %d",
+                 dtp->u.p.saved_length, type_name (dtp->u.p.saved_type), len,
+                 dtp->u.p.item_count);
+      generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+      return 1;
+    }
+
+  return 0;
+}
+
+
+/* Top level data transfer subroutine for list reads.  Because we have
+   to deal with repeat counts, the data item is always saved after
+   reading, usually in the dtp->u.p.value[] array.  If a repeat count is
+   greater than one, we copy the data item multiple times.  */
+
+static int
+list_formatted_read_scalar (st_parameter_dt *dtp, bt type, void *p,
+                           int kind, size_t size)
+{
+  gfc_char4_t *q;
+  int c, i, m;
+  int err = 0;
+
+  dtp->u.p.namelist_mode = 0;
+
+  if (dtp->u.p.first_item)
+    {
+      dtp->u.p.first_item = 0;
+      dtp->u.p.input_complete = 0;
+      dtp->u.p.repeat_count = 1;
+      dtp->u.p.at_eol = 0;
+      
+      if ((c = eat_spaces (dtp)) == EOF)
+       {
+         err = LIBERROR_END;
+         goto cleanup;
+       }
+      if (is_separator (c))
+       {
+         /* Found a null value.  */
+         eat_separator (dtp);
+         dtp->u.p.repeat_count = 0;
+
+         /* eat_separator sets this flag if the separator was a comma.  */
+         if (dtp->u.p.comma_flag)
+           goto cleanup;
+
+         /* eat_separator sets this flag if the separator was a \n or \r.  */
+         if (dtp->u.p.at_eol)
+           finish_separator (dtp);
+         else
+           goto cleanup;
+       }
+
+    }
+  else
+    {
+      if (dtp->u.p.repeat_count > 0)
+       {
+         if (check_type (dtp, type, kind))
+           return err;
+         goto set_value;
+       }
+       
+      if (dtp->u.p.input_complete)
+       goto cleanup;
+
+      if (dtp->u.p.at_eol)
+       finish_separator (dtp);
+      else
+        {
+         eat_spaces (dtp);
+          /* Trailing spaces prior to end of line.  */
+         if (dtp->u.p.at_eol)
+           finish_separator (dtp);
+        }
+
+      dtp->u.p.saved_type = BT_UNKNOWN;
+      dtp->u.p.repeat_count = 1;
+    }
+
+  switch (type)
+    {
+    case BT_INTEGER:
+      read_integer (dtp, kind);
+      break;
+    case BT_LOGICAL:
+      read_logical (dtp, kind);
+      break;
+    case BT_CHARACTER:
+      read_character (dtp, kind);
+      break;
+    case BT_REAL:
+      read_real (dtp, p, kind);
+      /* Copy value back to temporary if needed.  */
+      if (dtp->u.p.repeat_count > 0)
+       memcpy (dtp->u.p.value, p, kind);
+      break;
+    case BT_COMPLEX:
+      read_complex (dtp, p, kind, size);
+      /* Copy value back to temporary if needed.  */
+      if (dtp->u.p.repeat_count > 0)
+       memcpy (dtp->u.p.value, p, size);
+      break;
+    default:
+      internal_error (&dtp->common, "Bad type for list read");
+    }
+
+  if (dtp->u.p.saved_type != BT_CHARACTER && dtp->u.p.saved_type != BT_UNKNOWN)
+    dtp->u.p.saved_length = size;
+
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    goto cleanup;
+
+ set_value:
+  switch (dtp->u.p.saved_type)
+    {
+    case BT_COMPLEX:
+    case BT_REAL:
+      if (dtp->u.p.repeat_count > 0)
+       memcpy (p, dtp->u.p.value, size);
+      break;
+
+    case BT_INTEGER:
+    case BT_LOGICAL:
+      memcpy (p, dtp->u.p.value, size);
+      break;
+
+    case BT_CHARACTER:
+      if (dtp->u.p.saved_string)
+       {
+         m = ((int) size < dtp->u.p.saved_used)
+             ? (int) size : dtp->u.p.saved_used;
+         if (kind == 1)
+           memcpy (p, dtp->u.p.saved_string, m);
+         else
+           {
+             q = (gfc_char4_t *) p;
+             for (i = 0; i < m; i++)
+               q[i] = (unsigned char) dtp->u.p.saved_string[i];
+           }
+       }
+      else
+       /* Just delimiters encountered, nothing to copy but SPACE.  */
+        m = 0;
+
+      if (m < (int) size)
+       {
+         if (kind == 1)
+           memset (((char *) p) + m, ' ', size - m);
+         else
+           {
+             q = (gfc_char4_t *) p;
+             for (i = m; i < (int) size; i++)
+               q[i] = (unsigned char) ' ';
+           }
+       }
+      break;
+
+    case BT_UNKNOWN:
+      break;
+
+    default:
+      internal_error (&dtp->common, "Bad type for list read");
+    }
+
+  if (--dtp->u.p.repeat_count <= 0)
+    free_saved (dtp);
+
+cleanup:
+  if (err == LIBERROR_END)
+    hit_eof (dtp);
+  return err;
+}
+
+
+void
+list_formatted_read (st_parameter_dt *dtp, bt type, void *p, int kind,
+                    size_t size, size_t nelems)
+{
+  size_t elem;
+  char *tmp;
+  size_t stride = type == BT_CHARACTER ?
+                 size * GFC_SIZE_OF_CHAR_KIND(kind) : size;
+  int err;
+
+  tmp = (char *) p;
+
+  /* Big loop over all the elements.  */
+  for (elem = 0; elem < nelems; elem++)
+    {
+      dtp->u.p.item_count++;
+      err = list_formatted_read_scalar (dtp, type, tmp + stride*elem, 
+                                       kind, size);
+      if (err)
+       break;
+    }
+}
+
+
+/* Finish a list read.  */
+
+void
+finish_list_read (st_parameter_dt *dtp)
+{
+  int err;
+
+  free_saved (dtp);
+
+  fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode);
+
+  if (dtp->u.p.at_eol)
+    {
+      dtp->u.p.at_eol = 0;
+      return;
+    }
+
+  err = eat_line (dtp);
+  if (err == LIBERROR_END)
+    hit_eof (dtp);
+}
+
+/*                     NAMELIST INPUT
+
+void namelist_read (st_parameter_dt *dtp)
+calls:
+   static void nml_match_name (char *name, int len)
+   static int nml_query (st_parameter_dt *dtp)
+   static int nml_get_obj_data (st_parameter_dt *dtp,
+                               namelist_info **prev_nl, char *, size_t)
+calls:
+      static void nml_untouch_nodes (st_parameter_dt *dtp)
+      static namelist_info * find_nml_node (st_parameter_dt *dtp,
+                                           char * var_name)
+      static int nml_parse_qualifier(descriptor_dimension * ad,
+                                    array_loop_spec * ls, int rank, char *)
+      static void nml_touch_nodes (namelist_info * nl)
+      static int nml_read_obj (namelist_info *nl, index_type offset,
+                              namelist_info **prev_nl, char *, size_t,
+                              index_type clow, index_type chigh)
+calls:
+      -itself-  */
+
+/* Inputs a rank-dimensional qualifier, which can contain
+   singlets, doublets, triplets or ':' with the standard meanings.  */
+
+static try
+nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
+                    array_loop_spec *ls, int rank, char *parse_err_msg,
+                    size_t parse_err_msg_size,
+                    int *parsed_rank)
+{
+  int dim;
+  int indx;
+  int neg;
+  int null_flag;
+  int is_array_section, is_char;
+  int c;
+
+  is_char = 0;
+  is_array_section = 0;
+  dtp->u.p.expanded_read = 0;
+
+  /* See if this is a character substring qualifier we are looking for.  */
+  if (rank == -1)
+    {
+      rank = 1;
+      is_char = 1;
+    }
+
+  /* The next character in the stream should be the '('.  */
+
+  if ((c = next_char (dtp)) == EOF)
+    return FAILURE;
+
+  /* Process the qualifier, by dimension and triplet.  */
+
+  for (dim=0; dim < rank; dim++ )
+    {
+      for (indx=0; indx<3; indx++)
+       {
+         free_saved (dtp);
+         eat_spaces (dtp);
+         neg = 0;
+
+         /* Process a potential sign.  */
+         if ((c = next_char (dtp)) == EOF)
+           return FAILURE;
+         switch (c)
+           {
+           case '-':
+             neg = 1;
+             break;
+
+           case '+':
+             break;
+
+           default:
+             unget_char (dtp, c);
+             break;
+           }
+
+         /* Process characters up to the next ':' , ',' or ')'.  */
+         for (;;)
+           {
+             if ((c = next_char (dtp)) == EOF)
+               return FAILURE;
+
+             switch (c)
+               {
+               case ':':
+                  is_array_section = 1;
+                 break;
+
+               case ',': case ')':
+                 if ((c==',' && dim == rank -1)
+                     || (c==')' && dim < rank -1))
+                   {
+                     if (is_char)
+                       snprintf (parse_err_msg, parse_err_msg_size, 
+                                 "Bad substring qualifier");
+                     else
+                       snprintf (parse_err_msg, parse_err_msg_size, 
+                                "Bad number of index fields");
+                     goto err_ret;
+                   }
+                 break;
+
+               CASE_DIGITS:
+                 push_char (dtp, c);
+                 continue;
+
+               case ' ': case '\t':
+                 eat_spaces (dtp);
+                 if ((c = next_char (dtp) == EOF))
+                   return FAILURE;
+                 break;
+
+               default:
+                 if (is_char)
+                   snprintf (parse_err_msg, parse_err_msg_size,
+                            "Bad character in substring qualifier");
+                 else
+                   snprintf (parse_err_msg, parse_err_msg_size, 
+                             "Bad character in index");
+                 goto err_ret;
+               }
+
+             if ((c == ',' || c == ')') && indx == 0
+                 && dtp->u.p.saved_string == 0)
+               {
+                 if (is_char)
+                   snprintf (parse_err_msg, parse_err_msg_size, 
+                             "Null substring qualifier");
+                 else
+                   snprintf (parse_err_msg, parse_err_msg_size, 
+                             "Null index field");
+                 goto err_ret;
+               }
+
+             if ((c == ':' && indx == 1 && dtp->u.p.saved_string == 0)
+                 || (indx == 2 && dtp->u.p.saved_string == 0))
+               {
+                 if (is_char)
+                   snprintf (parse_err_msg, parse_err_msg_size, 
+                             "Bad substring qualifier");
+                 else
+                   snprintf (parse_err_msg, parse_err_msg_size,
+                             "Bad index triplet");
+                 goto err_ret;
+               }
+
+             if (is_char && !is_array_section)
+               {
+                 snprintf (parse_err_msg, parse_err_msg_size,
+                          "Missing colon in substring qualifier");
+                 goto err_ret;
+               }
+
+             /* If '( : ? )' or '( ? : )' break and flag read failure.  */
+             null_flag = 0;
+             if ((c == ':' && indx == 0 && dtp->u.p.saved_string == 0)
+                 || (indx==1 && dtp->u.p.saved_string == 0))
+               {
+                 null_flag = 1;
+                 break;
+               }
+
+             /* Now read the index.  */
+             if (convert_integer (dtp, sizeof(index_type), neg))
+               {
+                 if (is_char)
+                   snprintf (parse_err_msg, parse_err_msg_size,
+                             "Bad integer substring qualifier");
+                 else
+                   snprintf (parse_err_msg, parse_err_msg_size,
+                             "Bad integer in index");
+                 goto err_ret;
+               }
+             break;
+           }
+
+         /* Feed the index values to the triplet arrays.  */
+         if (!null_flag)
+           {
+             if (indx == 0)
+               memcpy (&ls[dim].start, dtp->u.p.value, sizeof(index_type));
+             if (indx == 1)
+               memcpy (&ls[dim].end, dtp->u.p.value, sizeof(index_type));
+             if (indx == 2)
+               memcpy (&ls[dim].step, dtp->u.p.value, sizeof(index_type));
+           }
+
+         /* Singlet or doublet indices.  */
+         if (c==',' || c==')')
+           {
+             if (indx == 0)
+               {
+                 memcpy (&ls[dim].start, dtp->u.p.value, sizeof(index_type));
+
+                 /*  If -std=f95/2003 or an array section is specified,
+                     do not allow excess data to be processed.  */
+                 if (is_array_section == 1
+                     || !(compile_options.allow_std & GFC_STD_GNU)
+                     || dtp->u.p.ionml->type == BT_DERIVED)
+                   ls[dim].end = ls[dim].start;
+                 else
+                   dtp->u.p.expanded_read = 1;
+               }
+
+             /* Check for non-zero rank.  */
+             if (is_array_section == 1 && ls[dim].start != ls[dim].end)
+               *parsed_rank = 1;
+
+             break;
+           }
+       }
+
+      if (is_array_section == 1 && dtp->u.p.expanded_read == 1)
+       {
+         int i;
+         dtp->u.p.expanded_read = 0;
+         for (i = 0; i < dim; i++)
+           ls[i].end = ls[i].start;
+       }
+
+      /* Check the values of the triplet indices.  */
+      if ((ls[dim].start > GFC_DIMENSION_UBOUND(ad[dim]))
+          || (ls[dim].start < GFC_DIMENSION_LBOUND(ad[dim]))
+          || (ls[dim].end > GFC_DIMENSION_UBOUND(ad[dim]))
+          || (ls[dim].end < GFC_DIMENSION_LBOUND(ad[dim])))
+       {
+         if (is_char)
+           snprintf (parse_err_msg, parse_err_msg_size, 
+                     "Substring out of range");
+         else
+           snprintf (parse_err_msg, parse_err_msg_size, 
+                     "Index %d out of range", dim + 1);
+         goto err_ret;
+       }
+
+      if (((ls[dim].end - ls[dim].start ) * ls[dim].step < 0)
+         || (ls[dim].step == 0))
+       {
+         snprintf (parse_err_msg, parse_err_msg_size, 
+                  "Bad range in index %d", dim + 1);
+         goto err_ret;
+       }
+
+      /* Initialise the loop index counter.  */
+      ls[dim].idx = ls[dim].start;
+    }
+  eat_spaces (dtp);
+  return SUCCESS;
+
+err_ret:
+
+  return FAILURE;
+}
+
+static namelist_info *
+find_nml_node (st_parameter_dt *dtp, char * var_name)
+{
+  namelist_info * t = dtp->u.p.ionml;
+  while (t != NULL)
+    {
+      if (strcmp (var_name, t->var_name) == 0)
+       {
+         t->touched = 1;
+         return t;
+       }
+      t = t->next;
+    }
+  return NULL;
+}
+
+/* Visits all the components of a derived type that have
+   not explicitly been identified in the namelist input.
+   touched is set and the loop specification initialised
+   to default values  */
+
+static void
+nml_touch_nodes (namelist_info * nl)
+{
+  index_type len = strlen (nl->var_name) + 1;
+  int dim;
+  char * ext_name = (char*)get_mem (len + 1);
+  memcpy (ext_name, nl->var_name, len-1);
+  memcpy (ext_name + len - 1, "%", 2);
+  for (nl = nl->next; nl; nl = nl->next)
+    {
+      if (strncmp (nl->var_name, ext_name, len) == 0)
+       {
+         nl->touched = 1;
+         for (dim=0; dim < nl->var_rank; dim++)
+           {
+             nl->ls[dim].step = 1;
+             nl->ls[dim].end = GFC_DESCRIPTOR_UBOUND(nl,dim);
+             nl->ls[dim].start = GFC_DESCRIPTOR_LBOUND(nl,dim);
+             nl->ls[dim].idx = nl->ls[dim].start;
+           }
+       }
+      else
+       break;
+    }
+  free (ext_name);
+  return;
+}
+
+/* Resets touched for the entire list of nml_nodes, ready for a
+   new object.  */
+
+static void
+nml_untouch_nodes (st_parameter_dt *dtp)
+{
+  namelist_info * t;
+  for (t = dtp->u.p.ionml; t; t = t->next)
+    t->touched = 0;
+  return;
+}
+
+/* Attempts to input name to namelist name.  Returns
+   dtp->u.p.nml_read_error = 1 on no match.  */
+
+static void
+nml_match_name (st_parameter_dt *dtp, const char *name, index_type len)
+{
+  index_type i;
+  int c;
+
+  dtp->u.p.nml_read_error = 0;
+  for (i = 0; i < len; i++)
+    {
+      c = next_char (dtp);
+      if (c == EOF || (tolower (c) != tolower (name[i])))
+       {
+         dtp->u.p.nml_read_error = 1;
+         break;
+       }
+    }
+}
+
+/* If the namelist read is from stdin, output the current state of the
+   namelist to stdout.  This is used to implement the non-standard query
+   features, ? and =?. If c == '=' the full namelist is printed. Otherwise
+   the names alone are printed.  */
+
+static void
+nml_query (st_parameter_dt *dtp, char c)
+{
+  gfc_unit * temp_unit;
+  namelist_info * nl;
+  index_type len;
+  char * p;
+#ifdef HAVE_CRLF
+  static const index_type endlen = 3;
+  static const char endl[] = "\r\n";
+  static const char nmlend[] = "&end\r\n";
+#else
+  static const index_type endlen = 2;
+  static const char endl[] = "\n";
+  static const char nmlend[] = "&end\n";
+#endif
+
+  if (dtp->u.p.current_unit->unit_number != options.stdin_unit)
+    return;
+
+  /* Store the current unit and transfer to stdout.  */
+
+  temp_unit = dtp->u.p.current_unit;
+  dtp->u.p.current_unit = find_unit (options.stdout_unit);
+
+  if (dtp->u.p.current_unit)
+    {
+      dtp->u.p.mode = WRITING;
+      next_record (dtp, 0);
+
+      /* Write the namelist in its entirety.  */
+
+      if (c == '=')
+       namelist_write (dtp);
+
+      /* Or write the list of names.  */
+
+      else
+       {
+         /* "&namelist_name\n"  */
+
+         len = dtp->namelist_name_len;
+         p = write_block (dtp, len + endlen);
+          if (!p)
+            goto query_return;
+         memcpy (p, "&", 1);
+         memcpy ((char*)(p + 1), dtp->namelist_name, len);
+         memcpy ((char*)(p + len + 1), &endl, endlen - 1);
+         for (nl = dtp->u.p.ionml; nl; nl = nl->next)
+           {
+             /* " var_name\n"  */
+
+             len = strlen (nl->var_name);
+              p = write_block (dtp, len + endlen);
+             if (!p)
+               goto query_return;
+             memcpy (p, " ", 1);
+             memcpy ((char*)(p + 1), nl->var_name, len);
+             memcpy ((char*)(p + len + 1), &endl, endlen - 1);
+           }
+
+         /* "&end\n"  */
+
+          p = write_block (dtp, endlen + 3);
+           goto query_return;
+          memcpy (p, &nmlend, endlen + 3);
+       }
+
+      /* Flush the stream to force immediate output.  */
+
+      fbuf_flush (dtp->u.p.current_unit, WRITING);
+      sflush (dtp->u.p.current_unit->s);
+      unlock_unit (dtp->u.p.current_unit);
+    }
+
+query_return:
+
+  /* Restore the current unit.  */
+
+  dtp->u.p.current_unit = temp_unit;
+  dtp->u.p.mode = READING;
+  return;
+}
+
+/* Reads and stores the input for the namelist object nl.  For an array,
+   the function loops over the ranges defined by the loop specification.
+   This default to all the data or to the specification from a qualifier.
+   nml_read_obj recursively calls itself to read derived types. It visits
+   all its own components but only reads data for those that were touched
+   when the name was parsed.  If a read error is encountered, an attempt is
+   made to return to read a new object name because the standard allows too
+   little data to be available.  On the other hand, too much data is an
+   error.  */
+
+static try
+nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset,
+             namelist_info **pprev_nl, char *nml_err_msg,
+             size_t nml_err_msg_size, index_type clow, index_type chigh)
+{
+  namelist_info * cmp;
+  char * obj_name;
+  int nml_carry;
+  int len;
+  int dim;
+  index_type dlen;
+  index_type m;
+  size_t obj_name_len;
+  void * pdata;
+
+  /* This object not touched in name parsing.  */
+
+  if (!nl->touched)
+    return SUCCESS;
+
+  dtp->u.p.repeat_count = 0;
+  eat_spaces (dtp);
+
+  len = nl->len;
+  switch (nl->type)
+  {
+    case BT_INTEGER:
+    case BT_LOGICAL:
+      dlen = len;
+      break;
+
+    case BT_REAL:
+      dlen = size_from_real_kind (len);
+      break;
+
+    case BT_COMPLEX:
+      dlen = size_from_complex_kind (len);
+      break;
+
+    case BT_CHARACTER:
+      dlen = chigh ? (chigh - clow + 1) : nl->string_length;
+      break;
+
+    default:
+      dlen = 0;
+    }
+
+  do
+    {
+      /* Update the pointer to the data, using the current index vector  */
+
+      pdata = (void*)(nl->mem_pos + offset);
+      for (dim = 0; dim < nl->var_rank; dim++)
+       pdata = (void*)(pdata + (nl->ls[dim].idx
+                                - GFC_DESCRIPTOR_LBOUND(nl,dim))
+                       * GFC_DESCRIPTOR_STRIDE(nl,dim) * nl->size);
+
+      /* Reset the error flag and try to read next value, if
+        dtp->u.p.repeat_count=0  */
+
+      dtp->u.p.nml_read_error = 0;
+      nml_carry = 0;
+      if (--dtp->u.p.repeat_count <= 0)
+       {
+         if (dtp->u.p.input_complete)
+           return SUCCESS;
+         if (dtp->u.p.at_eol)
+           finish_separator (dtp);
+         if (dtp->u.p.input_complete)
+           return SUCCESS;
+
+         dtp->u.p.saved_type = BT_UNKNOWN;
+         free_saved (dtp);
+
+          switch (nl->type)
+         {
+         case BT_INTEGER:
+             read_integer (dtp, len);
+              break;
+
+         case BT_LOGICAL:
+             read_logical (dtp, len);
+              break;
+
+         case BT_CHARACTER:
+             read_character (dtp, len);
+              break;
+
+         case BT_REAL:
+           /* Need to copy data back from the real location to the temp in order
+              to handle nml reads into arrays.  */
+           read_real (dtp, pdata, len);
+           memcpy (dtp->u.p.value, pdata, dlen);
+           break;
+
+         case BT_COMPLEX:
+           /* Same as for REAL, copy back to temp.  */
+           read_complex (dtp, pdata, len, dlen);
+           memcpy (dtp->u.p.value, pdata, dlen);
+           break;
+
+         case BT_DERIVED:
+           obj_name_len = strlen (nl->var_name) + 1;
+           obj_name = get_mem (obj_name_len+1);
+           memcpy (obj_name, nl->var_name, obj_name_len-1);
+           memcpy (obj_name + obj_name_len - 1, "%", 2);
+
+           /* If reading a derived type, disable the expanded read warning
+              since a single object can have multiple reads.  */
+           dtp->u.p.expanded_read = 0;
+
+           /* Now loop over the components. Update the component pointer
+              with the return value from nml_write_obj.  This loop jumps
+              past nested derived types by testing if the potential
+              component name contains '%'.  */
+
+           for (cmp = nl->next;
+                cmp &&
+                  !strncmp (cmp->var_name, obj_name, obj_name_len) &&
+                  !strchr (cmp->var_name + obj_name_len, '%');
+                cmp = cmp->next)
+             {
+
+               if (nml_read_obj (dtp, cmp, (index_type)(pdata - nl->mem_pos),
+                                 pprev_nl, nml_err_msg, nml_err_msg_size,
+                                 clow, chigh) == FAILURE)
+                 {
+                   free (obj_name);
+                   return FAILURE;
+                 }
+
+               if (dtp->u.p.input_complete)
+                 {
+                   free (obj_name);
+                   return SUCCESS;
+                 }
+             }
+
+           free (obj_name);
+           goto incr_idx;
+
+          default:
+           snprintf (nml_err_msg, nml_err_msg_size,
+                     "Bad type for namelist object %s", nl->var_name);
+           internal_error (&dtp->common, nml_err_msg);
+           goto nml_err_ret;
+          }
+        }
+
+      /* The standard permits array data to stop short of the number of
+        elements specified in the loop specification.  In this case, we
+        should be here with dtp->u.p.nml_read_error != 0.  Control returns to
+        nml_get_obj_data and an attempt is made to read object name.  */
+
+      *pprev_nl = nl;
+      if (dtp->u.p.nml_read_error)
+       {
+         dtp->u.p.expanded_read = 0;
+         return SUCCESS;
+       }
+
+      if (dtp->u.p.saved_type == BT_UNKNOWN)
+       {
+         dtp->u.p.expanded_read = 0;
+         goto incr_idx;
+       }
+
+      switch (dtp->u.p.saved_type)
+      {
+
+       case BT_COMPLEX:
+       case BT_REAL:
+       case BT_INTEGER:
+       case BT_LOGICAL:
+         memcpy (pdata, dtp->u.p.value, dlen);
+         break;
+
+       case BT_CHARACTER:
+         if (dlen < dtp->u.p.saved_used)
+           {
+             if (compile_options.bounds_check)
+               {
+                 snprintf (nml_err_msg, nml_err_msg_size,
+                           "Namelist object '%s' truncated on read.",
+                           nl->var_name);
+                 generate_warning (&dtp->common, nml_err_msg);
+               }
+             m = dlen;
+           }
+         else
+           m = dtp->u.p.saved_used;
+         pdata = (void*)( pdata + clow - 1 );
+         memcpy (pdata, dtp->u.p.saved_string, m);
+         if (m < dlen)
+           memset ((void*)( pdata + m ), ' ', dlen - m);
+         break;
+
+       default:
+         break;
+      }
+
+      /* Warn if a non-standard expanded read occurs. A single read of a
+        single object is acceptable.  If a second read occurs, issue a warning
+        and set the flag to zero to prevent further warnings.  */
+      if (dtp->u.p.expanded_read == 2)
+       {
+         notify_std (&dtp->common, GFC_STD_GNU, "Non-standard expanded namelist read.");
+         dtp->u.p.expanded_read = 0;
+       }
+
+      /* If the expanded read warning flag is set, increment it,
+        indicating that a single read has occurred.  */
+      if (dtp->u.p.expanded_read >= 1)
+       dtp->u.p.expanded_read++;
+
+      /* Break out of loop if scalar.  */
+      if (!nl->var_rank)
+       break;
+
+      /* Now increment the index vector.  */
+
+incr_idx:
+
+      nml_carry = 1;
+      for (dim = 0; dim < nl->var_rank; dim++)
+       {
+         nl->ls[dim].idx += nml_carry * nl->ls[dim].step;
+         nml_carry = 0;
+         if (((nl->ls[dim].step > 0) && (nl->ls[dim].idx > nl->ls[dim].end))
+             ||
+             ((nl->ls[dim].step < 0) && (nl->ls[dim].idx < nl->ls[dim].end)))
+           {
+             nl->ls[dim].idx = nl->ls[dim].start;
+             nml_carry = 1;
+           }
+        }
+    } while (!nml_carry);
+
+  if (dtp->u.p.repeat_count > 1)
+    {
+      snprintf (nml_err_msg, nml_err_msg_size,
+               "Repeat count too large for namelist object %s", nl->var_name);
+      goto nml_err_ret;
+    }
+  return SUCCESS;
+
+nml_err_ret:
+
+  return FAILURE;
+}
+
+/* Parses the object name, including array and substring qualifiers.  It
+   iterates over derived type components, touching those components and
+   setting their loop specifications, if there is a qualifier.  If the
+   object is itself a derived type, its components and subcomponents are
+   touched.  nml_read_obj is called at the end and this reads the data in
+   the manner specified by the object name.  */
+
+static try
+nml_get_obj_data (st_parameter_dt *dtp, namelist_info **pprev_nl,
+                 char *nml_err_msg, size_t nml_err_msg_size)
+{
+  int c;
+  namelist_info * nl;
+  namelist_info * first_nl = NULL;
+  namelist_info * root_nl = NULL;
+  int dim, parsed_rank;
+  int component_flag, qualifier_flag;
+  index_type clow, chigh;
+  int non_zero_rank_count;
+
+  /* Look for end of input or object name.  If '?' or '=?' are encountered
+     in stdin, print the node names or the namelist to stdout.  */
+
+  eat_separator (dtp);
+  if (dtp->u.p.input_complete)
+    return SUCCESS;
+
+  if (dtp->u.p.at_eol)
+    finish_separator (dtp);
+  if (dtp->u.p.input_complete)
+    return SUCCESS;
+
+  if ((c = next_char (dtp)) == EOF)
+    return FAILURE;
+  switch (c)
+    {
+    case '=':
+      if ((c = next_char (dtp)) == EOF)
+       return FAILURE;
+      if (c != '?')
+       {
+         snprintf (nml_err_msg, nml_err_msg_size, 
+                   "namelist read: misplaced = sign");
+         goto nml_err_ret;
+       }
+      nml_query (dtp, '=');
+      return SUCCESS;
+
+    case '?':
+      nml_query (dtp, '?');
+      return SUCCESS;
+
+    case '$':
+    case '&':
+      nml_match_name (dtp, "end", 3);
+      if (dtp->u.p.nml_read_error)
+       {
+         snprintf (nml_err_msg, nml_err_msg_size, 
+                   "namelist not terminated with / or &end");
+         goto nml_err_ret;
+       }
+    case '/':
+      dtp->u.p.input_complete = 1;
+      return SUCCESS;
+
+    default :
+      break;
+    }
+
+  /* Untouch all nodes of the namelist and reset the flags that are set for
+     derived type components.  */
+
+  nml_untouch_nodes (dtp);
+  component_flag = 0;
+  qualifier_flag = 0;
+  non_zero_rank_count = 0;
+
+  /* Get the object name - should '!' and '\n' be permitted separators?  */
+
+get_name:
+
+  free_saved (dtp);
+
+  do
+    {
+      if (!is_separator (c))
+       push_char (dtp, tolower(c));
+      if ((c = next_char (dtp)) == EOF)
+       return FAILURE;
+    } while (!( c=='=' || c==' ' || c=='\t' || c =='(' || c =='%' ));
+
+  unget_char (dtp, c);
+
+  /* Check that the name is in the namelist and get pointer to object.
+     Three error conditions exist: (i) An attempt is being made to
+     identify a non-existent object, following a failed data read or
+     (ii) The object name does not exist or (iii) Too many data items
+     are present for an object.  (iii) gives the same error message
+     as (i)  */
+
+  push_char (dtp, '\0');
+
+  if (component_flag)
+    {
+      size_t var_len = strlen (root_nl->var_name);
+      size_t saved_len
+       = dtp->u.p.saved_string ? strlen (dtp->u.p.saved_string) : 0;
+      char ext_name[var_len + saved_len + 1];
+
+      memcpy (ext_name, root_nl->var_name, var_len);
+      if (dtp->u.p.saved_string)
+       memcpy (ext_name + var_len, dtp->u.p.saved_string, saved_len);
+      ext_name[var_len + saved_len] = '\0';
+      nl = find_nml_node (dtp, ext_name);
+    }
+  else
+    nl = find_nml_node (dtp, dtp->u.p.saved_string);
+
+  if (nl == NULL)
+    {
+      if (dtp->u.p.nml_read_error && *pprev_nl)
+       snprintf (nml_err_msg, nml_err_msg_size,
+                 "Bad data for namelist object %s", (*pprev_nl)->var_name);
+
+      else
+       snprintf (nml_err_msg, nml_err_msg_size,
+                 "Cannot match namelist object name %s",
+                 dtp->u.p.saved_string);
+
+      goto nml_err_ret;
+    }
+
+  /* Get the length, data length, base pointer and rank of the variable.
+     Set the default loop specification first.  */
+
+  for (dim=0; dim < nl->var_rank; dim++)
+    {
+      nl->ls[dim].step = 1;
+      nl->ls[dim].end = GFC_DESCRIPTOR_UBOUND(nl,dim);
+      nl->ls[dim].start = GFC_DESCRIPTOR_LBOUND(nl,dim);
+      nl->ls[dim].idx = nl->ls[dim].start;
+    }
+
+/* Check to see if there is a qualifier: if so, parse it.*/
+
+  if (c == '(' && nl->var_rank)
+    {
+      parsed_rank = 0;
+      if (nml_parse_qualifier (dtp, nl->dim, nl->ls, nl->var_rank,
+                              nml_err_msg, nml_err_msg_size, 
+                              &parsed_rank) == FAILURE)
+       {
+         char *nml_err_msg_end = strchr (nml_err_msg, '\0');
+         snprintf (nml_err_msg_end,
+                   nml_err_msg_size - (nml_err_msg_end - nml_err_msg),
+                   " for namelist variable %s", nl->var_name);
+         goto nml_err_ret;
+       }
+      if (parsed_rank > 0)
+       non_zero_rank_count++;
+
+      qualifier_flag = 1;
+
+      if ((c = next_char (dtp)) == EOF)
+       return FAILURE;
+      unget_char (dtp, c);
+    }
+  else if (nl->var_rank > 0)
+    non_zero_rank_count++;
+
+  /* Now parse a derived type component. The root namelist_info address
+     is backed up, as is the previous component level.  The  component flag
+     is set and the iteration is made by jumping back to get_name.  */
+
+  if (c == '%')
+    {
+      if (nl->type != BT_DERIVED)
+       {
+         snprintf (nml_err_msg, nml_err_msg_size,
+                   "Attempt to get derived component for %s", nl->var_name);
+         goto nml_err_ret;
+       }
+
+      if (*pprev_nl == NULL || !component_flag)
+       first_nl = nl;
+
+      root_nl = nl;
+
+      component_flag = 1;
+      if ((c = next_char (dtp)) == EOF)
+       return FAILURE;
+      goto get_name;
+    }
+
+  /* Parse a character qualifier, if present.  chigh = 0 is a default
+     that signals that the string length = string_length.  */
+
+  clow = 1;
+  chigh = 0;
+
+  if (c == '(' && nl->type == BT_CHARACTER)
+    {
+      descriptor_dimension chd[1] = { {1, clow, nl->string_length} };
+      array_loop_spec ind[1] = { {1, clow, nl->string_length, 1} };
+
+      if (nml_parse_qualifier (dtp, chd, ind, -1, nml_err_msg, 
+                              nml_err_msg_size, &parsed_rank)
+         == FAILURE)
+       {
+         char *nml_err_msg_end = strchr (nml_err_msg, '\0');
+         snprintf (nml_err_msg_end,
+                   nml_err_msg_size - (nml_err_msg_end - nml_err_msg),
+                   " for namelist variable %s", nl->var_name);
+         goto nml_err_ret;
+       }
+
+      clow = ind[0].start;
+      chigh = ind[0].end;
+
+      if (ind[0].step != 1)
+       {
+         snprintf (nml_err_msg, nml_err_msg_size,
+                   "Step not allowed in substring qualifier"
+                   " for namelist object %s", nl->var_name);
+         goto nml_err_ret;
+       }
+
+      if ((c = next_char (dtp)) == EOF)
+       return FAILURE;
+      unget_char (dtp, c);
+    }
+
+  /* Make sure no extraneous qualifiers are there.  */
+
+  if (c == '(')
+    {
+      snprintf (nml_err_msg, nml_err_msg_size,
+               "Qualifier for a scalar or non-character namelist object %s",
+               nl->var_name);
+      goto nml_err_ret;
+    }
+
+  /* Make sure there is no more than one non-zero rank object.  */
+  if (non_zero_rank_count > 1)
+    {
+      snprintf (nml_err_msg, nml_err_msg_size,
+               "Multiple sub-objects with non-zero rank in namelist object %s",
+               nl->var_name);
+      non_zero_rank_count = 0;
+      goto nml_err_ret;
+    }
+
+/* According to the standard, an equal sign MUST follow an object name. The
+   following is possibly lax - it allows comments, blank lines and so on to
+   intervene.  eat_spaces (dtp); c = next_char (dtp); would be compliant*/
+
+  free_saved (dtp);
+
+  eat_separator (dtp);
+  if (dtp->u.p.input_complete)
+    return SUCCESS;
+
+  if (dtp->u.p.at_eol)
+    finish_separator (dtp);
+  if (dtp->u.p.input_complete)
+    return SUCCESS;
+
+  if ((c = next_char (dtp)) == EOF)
+    return FAILURE;
+
+  if (c != '=')
+    {
+      snprintf (nml_err_msg, nml_err_msg_size,
+               "Equal sign must follow namelist object name %s",
+               nl->var_name);
+      goto nml_err_ret;
+    }
+  /* If a derived type, touch its components and restore the root
+     namelist_info if we have parsed a qualified derived type
+     component.  */
+
+  if (nl->type == BT_DERIVED)
+    nml_touch_nodes (nl);
+
+  if (first_nl)
+    {
+      if (first_nl->var_rank == 0)
+       {
+         if (component_flag && qualifier_flag)
+           nl = first_nl;
+       }
+      else
+       nl = first_nl;
+    }
+
+  if (nml_read_obj (dtp, nl, 0, pprev_nl, nml_err_msg, nml_err_msg_size,
+                   clow, chigh) == FAILURE)
+    goto nml_err_ret;
+
+  return SUCCESS;
+
+nml_err_ret:
+
+  return FAILURE;
+}
+
+/* Entry point for namelist input.  Goes through input until namelist name
+  is matched.  Then cycles through nml_get_obj_data until the input is
+  completed or there is an error.  */
+
+void
+namelist_read (st_parameter_dt *dtp)
+{
+  int c;
+  char nml_err_msg[200];
+
+  /* Initialize the error string buffer just in case we get an unexpected fail
+     somewhere and end up at nml_err_ret.  */
+  strcpy (nml_err_msg, "Internal namelist read error");
+
+  /* Pointer to the previously read object, in case attempt is made to read
+     new object name.  Should this fail, error message can give previous
+     name.  */
+  namelist_info *prev_nl = NULL;
+
+  dtp->u.p.namelist_mode = 1;
+  dtp->u.p.input_complete = 0;
+  dtp->u.p.expanded_read = 0;
+
+  /* Look for &namelist_name .  Skip all characters, testing for $nmlname.
+     Exit on success or EOF. If '?' or '=?' encountered in stdin, print
+     node names or namelist on stdout.  */
+
+find_nml_name:
+  c = next_char (dtp);
+  switch (c)
+    {
+    case '$':
+    case '&':
+          break;
+
+    case '!':
+      eat_line (dtp);
+      goto find_nml_name;
+
+    case '=':
+      c = next_char (dtp);
+      if (c == '?')
+       nml_query (dtp, '=');
+      else
+       unget_char (dtp, c);
+      goto find_nml_name;
+
+    case '?':
+      nml_query (dtp, '?');
+
+    case EOF:
+      return;
+
+    default:
+      goto find_nml_name;
+    }
+
+  /* Match the name of the namelist.  */
+
+  nml_match_name (dtp, dtp->namelist_name, dtp->namelist_name_len);
+
+  if (dtp->u.p.nml_read_error)
+    goto find_nml_name;
+
+  /* A trailing space is required, we give a little lattitude here, 10.9.1.  */ 
+  c = next_char (dtp);
+  if (!is_separator(c) && c != '!')
+    {
+      unget_char (dtp, c);
+      goto find_nml_name;
+    }
+
+  unget_char (dtp, c);
+  eat_separator (dtp);
+
+  /* Ready to read namelist objects.  If there is an error in input
+     from stdin, output the error message and continue.  */
+
+  while (!dtp->u.p.input_complete)
+    {
+      if (nml_get_obj_data (dtp, &prev_nl, nml_err_msg, sizeof nml_err_msg)
+                           == FAILURE)
+       {
+         if (dtp->u.p.current_unit->unit_number != options.stdin_unit)
+           goto nml_err_ret;
+         generate_error (&dtp->common, LIBERROR_READ_VALUE, nml_err_msg);
+        }
+
+      /* Reset the previous namelist pointer if we know we are not going
+        to be doing multiple reads within a single namelist object.  */
+      if (prev_nl && prev_nl->var_rank == 0)
+       prev_nl = NULL;
+    }
+
+  free_saved (dtp);
+  free_line (dtp);
+  return;
+
+
+nml_err_ret:
+
+  /* All namelist error calls return from here */
+  free_saved (dtp);
+  free_line (dtp);
+  generate_error (&dtp->common, LIBERROR_READ_VALUE, nml_err_msg);
+  return;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/lock.c b/l4/pkg/libgfortran/lib/contrib/io/lock.c
new file mode 100644 (file)
index 0000000..9e7e951
--- /dev/null
@@ -0,0 +1,67 @@
+/* Thread/recursion locking
+   Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010 
+   Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org> and Andy Vaught
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "io.h"
+#include <string.h>
+#include <stdlib.h>
+
+/* library_start()-- Called with a library call is entered.  */
+
+void
+library_start (st_parameter_common *cmp)
+{
+  if ((cmp->flags & IOPARM_LIBRETURN_ERROR) != 0)
+    return;
+
+  cmp->flags &= ~IOPARM_LIBRETURN_MASK;
+}
+
+
+void
+free_ionml (st_parameter_dt *dtp)
+{
+  namelist_info * t1, *t2;
+
+  /* Delete the namelist, if it exists.  */
+
+  if (dtp->u.p.ionml != NULL)
+    {
+      t1 = dtp->u.p.ionml;
+      while (t1 != NULL)
+       {
+         t2 = t1;
+         t1 = t1->next;
+         free (t2->var_name);
+         if (t2->var_rank)
+           {
+            free (t2->dim);
+            free (t2->ls);
+           }
+         free (t2);
+       }
+    }
+  dtp->u.p.ionml = NULL;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/open.c b/l4/pkg/libgfortran/lib/contrib/io/open.c
new file mode 100644 (file)
index 0000000..8f969ed
--- /dev/null
@@ -0,0 +1,864 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+
+static const st_option access_opt[] = {
+  {"sequential", ACCESS_SEQUENTIAL},
+  {"direct", ACCESS_DIRECT},
+  {"append", ACCESS_APPEND},
+  {"stream", ACCESS_STREAM},
+  {NULL, 0}
+};
+
+static const st_option action_opt[] =
+{
+  { "read", ACTION_READ},
+  { "write", ACTION_WRITE},
+  { "readwrite", ACTION_READWRITE},
+  { NULL, 0}
+};
+
+static const st_option blank_opt[] =
+{
+  { "null", BLANK_NULL},
+  { "zero", BLANK_ZERO},
+  { NULL, 0}
+};
+
+static const st_option delim_opt[] =
+{
+  { "none", DELIM_NONE},
+  { "apostrophe", DELIM_APOSTROPHE},
+  { "quote", DELIM_QUOTE},
+  { NULL, 0}
+};
+
+static const st_option form_opt[] =
+{
+  { "formatted", FORM_FORMATTED},
+  { "unformatted", FORM_UNFORMATTED},
+  { NULL, 0}
+};
+
+static const st_option position_opt[] =
+{
+  { "asis", POSITION_ASIS},
+  { "rewind", POSITION_REWIND},
+  { "append", POSITION_APPEND},
+  { NULL, 0}
+};
+
+static const st_option status_opt[] =
+{
+  { "unknown", STATUS_UNKNOWN},
+  { "old", STATUS_OLD},
+  { "new", STATUS_NEW},
+  { "replace", STATUS_REPLACE},
+  { "scratch", STATUS_SCRATCH},
+  { NULL, 0}
+};
+
+static const st_option pad_opt[] =
+{
+  { "yes", PAD_YES},
+  { "no", PAD_NO},
+  { NULL, 0}
+};
+
+static const st_option decimal_opt[] =
+{
+  { "point", DECIMAL_POINT},
+  { "comma", DECIMAL_COMMA},
+  { NULL, 0}
+};
+
+static const st_option encoding_opt[] =
+{
+  { "utf-8", ENCODING_UTF8},
+  { "default", ENCODING_DEFAULT},
+  { NULL, 0}
+};
+
+static const st_option round_opt[] =
+{
+  { "up", ROUND_UP},
+  { "down", ROUND_DOWN},
+  { "zero", ROUND_ZERO},
+  { "nearest", ROUND_NEAREST},
+  { "compatible", ROUND_COMPATIBLE},
+  { "processor_defined", ROUND_PROCDEFINED},
+  { NULL, 0}
+};
+
+static const st_option sign_opt[] =
+{
+  { "plus", SIGN_PLUS},
+  { "suppress", SIGN_SUPPRESS},
+  { "processor_defined", SIGN_PROCDEFINED},
+  { NULL, 0}
+};
+
+static const st_option convert_opt[] =
+{
+  { "native", GFC_CONVERT_NATIVE},
+  { "swap", GFC_CONVERT_SWAP},
+  { "big_endian", GFC_CONVERT_BIG},
+  { "little_endian", GFC_CONVERT_LITTLE},
+  { NULL, 0}
+};
+
+static const st_option async_opt[] =
+{
+  { "yes", ASYNC_YES},
+  { "no", ASYNC_NO},
+  { NULL, 0}
+};
+
+/* Given a unit, test to see if the file is positioned at the terminal
+   point, and if so, change state from NO_ENDFILE flag to AT_ENDFILE.
+   This prevents us from changing the state from AFTER_ENDFILE to
+   AT_ENDFILE.  */
+
+static void
+test_endfile (gfc_unit * u)
+{
+  if (u->endfile == NO_ENDFILE && ssize (u->s) == stell (u->s))
+    u->endfile = AT_ENDFILE;
+}
+
+
+/* Change the modes of a file, those that are allowed * to be
+   changed.  */
+
+static void
+edit_modes (st_parameter_open *opp, gfc_unit * u, unit_flags * flags)
+{
+  /* Complain about attempts to change the unchangeable.  */
+
+  if (flags->status != STATUS_UNSPECIFIED && flags->status != STATUS_OLD && 
+      u->flags.status != flags->status)
+    generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                   "Cannot change STATUS parameter in OPEN statement");
+
+  if (flags->access != ACCESS_UNSPECIFIED && u->flags.access != flags->access)
+    generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                   "Cannot change ACCESS parameter in OPEN statement");
+
+  if (flags->form != FORM_UNSPECIFIED && u->flags.form != flags->form)
+    generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                   "Cannot change FORM parameter in OPEN statement");
+
+  if ((opp->common.flags & IOPARM_OPEN_HAS_RECL_IN)
+      && opp->recl_in != u->recl)
+    generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                   "Cannot change RECL parameter in OPEN statement");
+
+  if (flags->action != ACTION_UNSPECIFIED && u->flags.action != flags->action)
+    generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                   "Cannot change ACTION parameter in OPEN statement");
+
+  /* Status must be OLD if present.  */
+
+  if (flags->status != STATUS_UNSPECIFIED && flags->status != STATUS_OLD &&
+      flags->status != STATUS_UNKNOWN)
+    {
+      if (flags->status == STATUS_SCRATCH)
+       notify_std (&opp->common, GFC_STD_GNU,
+                   "OPEN statement must have a STATUS of OLD or UNKNOWN");
+      else
+       generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                   "OPEN statement must have a STATUS of OLD or UNKNOWN");
+    }
+
+  if (u->flags.form == FORM_UNFORMATTED)
+    {
+      if (flags->delim != DELIM_UNSPECIFIED)
+       generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                       "DELIM parameter conflicts with UNFORMATTED form in "
+                       "OPEN statement");
+
+      if (flags->blank != BLANK_UNSPECIFIED)
+       generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                       "BLANK parameter conflicts with UNFORMATTED form in "
+                       "OPEN statement");
+
+      if (flags->pad != PAD_UNSPECIFIED)
+       generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                       "PAD parameter conflicts with UNFORMATTED form in "
+                       "OPEN statement");
+
+      if (flags->decimal != DECIMAL_UNSPECIFIED)
+       generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                       "DECIMAL parameter conflicts with UNFORMATTED form in "
+                       "OPEN statement");
+
+      if (flags->encoding != ENCODING_UNSPECIFIED)
+       generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                       "ENCODING parameter conflicts with UNFORMATTED form in "
+                       "OPEN statement");
+
+      if (flags->round != ROUND_UNSPECIFIED)
+       generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                       "ROUND parameter conflicts with UNFORMATTED form in "
+                       "OPEN statement");
+
+      if (flags->sign != SIGN_UNSPECIFIED)
+       generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                       "SIGN parameter conflicts with UNFORMATTED form in "
+                       "OPEN statement");
+    }
+
+  if ((opp->common.flags & IOPARM_LIBRETURN_MASK) == IOPARM_LIBRETURN_OK)
+    {
+      /* Change the changeable:  */
+      if (flags->blank != BLANK_UNSPECIFIED)
+       u->flags.blank = flags->blank;
+      if (flags->delim != DELIM_UNSPECIFIED)
+       u->flags.delim = flags->delim;
+      if (flags->pad != PAD_UNSPECIFIED)
+       u->flags.pad = flags->pad;
+      if (flags->decimal != DECIMAL_UNSPECIFIED)
+       u->flags.decimal = flags->decimal;
+      if (flags->encoding != ENCODING_UNSPECIFIED)
+       u->flags.encoding = flags->encoding;
+      if (flags->async != ASYNC_UNSPECIFIED)
+       u->flags.async = flags->async;
+      if (flags->round != ROUND_UNSPECIFIED)
+       u->flags.round = flags->round;
+      if (flags->sign != SIGN_UNSPECIFIED)
+       u->flags.sign = flags->sign;
+    }
+
+  /* Reposition the file if necessary.  */
+
+  switch (flags->position)
+    {
+    case POSITION_UNSPECIFIED:
+    case POSITION_ASIS:
+      break;
+
+    case POSITION_REWIND:
+      if (sseek (u->s, 0, SEEK_SET) != 0)
+       goto seek_error;
+
+      u->current_record = 0;
+      u->last_record = 0;
+
+      test_endfile (u);
+      break;
+
+    case POSITION_APPEND:
+      if (sseek (u->s, 0, SEEK_END) < 0)
+       goto seek_error;
+
+      if (flags->access != ACCESS_STREAM)
+       u->current_record = 0;
+
+      u->endfile = AT_ENDFILE; /* We are at the end.  */
+      break;
+
+    seek_error:
+      generate_error (&opp->common, LIBERROR_OS, NULL);
+      break;
+    }
+
+  unlock_unit (u);
+}
+
+
+/* Open an unused unit.  */
+
+gfc_unit *
+new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags)
+{
+  gfc_unit *u2;
+  stream *s;
+  char tmpname[5 /* fort. */ + 10 /* digits of unit number */ + 1 /* 0 */];
+
+  /* Change unspecifieds to defaults.  Leave (flags->action ==
+     ACTION_UNSPECIFIED) alone so open_external() can set it based on
+     what type of open actually works.  */
+
+  if (flags->access == ACCESS_UNSPECIFIED)
+    flags->access = ACCESS_SEQUENTIAL;
+
+  if (flags->form == FORM_UNSPECIFIED)
+    flags->form = (flags->access == ACCESS_SEQUENTIAL)
+      ? FORM_FORMATTED : FORM_UNFORMATTED;
+
+  if (flags->async == ASYNC_UNSPECIFIED)
+    flags->async = ASYNC_NO;
+
+  if (flags->status == STATUS_UNSPECIFIED)
+    flags->status = STATUS_UNKNOWN;
+
+  /* Checks.  */
+
+  if (flags->delim == DELIM_UNSPECIFIED)
+    flags->delim = DELIM_NONE;
+  else
+    {
+      if (flags->form == FORM_UNFORMATTED)
+       {
+         generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                         "DELIM parameter conflicts with UNFORMATTED form in "
+                         "OPEN statement");
+         goto fail;
+       }
+    }
+
+  if (flags->blank == BLANK_UNSPECIFIED)
+    flags->blank = BLANK_NULL;
+  else
+    {
+      if (flags->form == FORM_UNFORMATTED)
+       {
+         generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                         "BLANK parameter conflicts with UNFORMATTED form in "
+                         "OPEN statement");
+         goto fail;
+       }
+    }
+
+  if (flags->pad == PAD_UNSPECIFIED)
+    flags->pad = PAD_YES;
+  else
+    {
+      if (flags->form == FORM_UNFORMATTED)
+       {
+         generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                         "PAD parameter conflicts with UNFORMATTED form in "
+                         "OPEN statement");
+         goto fail;
+       }
+    }
+
+  if (flags->decimal == DECIMAL_UNSPECIFIED)
+    flags->decimal = DECIMAL_POINT;
+  else
+    {
+      if (flags->form == FORM_UNFORMATTED)
+       {
+         generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                         "DECIMAL parameter conflicts with UNFORMATTED form "
+                         "in OPEN statement");
+         goto fail;
+       }
+    }
+
+  if (flags->encoding == ENCODING_UNSPECIFIED)
+    flags->encoding = ENCODING_DEFAULT;
+  else
+    {
+      if (flags->form == FORM_UNFORMATTED)
+       {
+         generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                         "ENCODING parameter conflicts with UNFORMATTED form in "
+                         "OPEN statement");
+         goto fail;
+       }
+    }
+
+  /* NB: the value for ROUND when it's not specified by the user does not
+         have to be PROCESSOR_DEFINED; the standard says that it is
+        processor dependent, and requires that it is one of the
+        possible value (see F2003, 9.4.5.13).  */
+  if (flags->round == ROUND_UNSPECIFIED)
+    flags->round = ROUND_PROCDEFINED;
+  else
+    {
+      if (flags->form == FORM_UNFORMATTED)
+       {
+         generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                         "ROUND parameter conflicts with UNFORMATTED form in "
+                         "OPEN statement");
+         goto fail;
+       }
+    }
+
+  if (flags->sign == SIGN_UNSPECIFIED)
+    flags->sign = SIGN_PROCDEFINED;
+  else
+    {
+      if (flags->form == FORM_UNFORMATTED)
+       {
+         generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                         "SIGN parameter conflicts with UNFORMATTED form in "
+                         "OPEN statement");
+         goto fail;
+       }
+    }
+
+  if (flags->position != POSITION_ASIS && flags->access == ACCESS_DIRECT)
+   {
+     generate_error (&opp->common, LIBERROR_OPTION_CONFLICT,
+                     "ACCESS parameter conflicts with SEQUENTIAL access in "
+                     "OPEN statement");
+     goto fail;
+   }
+  else
+   if (flags->position == POSITION_UNSPECIFIED)
+     flags->position = POSITION_ASIS;
+
+  if (flags->access == ACCESS_DIRECT
+      && (opp->common.flags & IOPARM_OPEN_HAS_RECL_IN) == 0)
+    {
+      generate_error (&opp->common, LIBERROR_MISSING_OPTION,
+                     "Missing RECL parameter in OPEN statement");
+      goto fail;
+    }
+
+  if ((opp->common.flags & IOPARM_OPEN_HAS_RECL_IN) && opp->recl_in <= 0)
+    {
+      generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                     "RECL parameter is non-positive in OPEN statement");
+      goto fail;
+    }
+
+  switch (flags->status)
+    {
+    case STATUS_SCRATCH:
+      if ((opp->common.flags & IOPARM_OPEN_HAS_FILE) == 0)
+       {
+         opp->file = NULL;
+         break;
+       }
+
+      generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                     "FILE parameter must not be present in OPEN statement");
+      goto fail;
+
+    case STATUS_OLD:
+    case STATUS_NEW:
+    case STATUS_REPLACE:
+    case STATUS_UNKNOWN:
+      if ((opp->common.flags & IOPARM_OPEN_HAS_FILE))
+       break;
+
+      opp->file = tmpname;
+      opp->file_len = snprintf(opp->file, sizeof (tmpname), "fort.%d", 
+                              (int) opp->common.unit);
+      break;
+
+    default:
+      internal_error (&opp->common, "new_unit(): Bad status");
+    }
+
+  /* Make sure the file isn't already open someplace else.
+     Do not error if opening file preconnected to stdin, stdout, stderr.  */
+
+  u2 = NULL;
+  if ((opp->common.flags & IOPARM_OPEN_HAS_FILE) != 0)
+    u2 = find_file (opp->file, opp->file_len);
+  if (u2 != NULL
+      && (options.stdin_unit < 0 || u2->unit_number != options.stdin_unit)
+      && (options.stdout_unit < 0 || u2->unit_number != options.stdout_unit)
+      && (options.stderr_unit < 0 || u2->unit_number != options.stderr_unit))
+    {
+      unlock_unit (u2);
+      generate_error (&opp->common, LIBERROR_ALREADY_OPEN, NULL);
+      goto cleanup;
+    }
+
+  if (u2 != NULL)
+    unlock_unit (u2);
+
+  /* Open file.  */
+
+  s = open_external (opp, flags);
+  if (s == NULL)
+    {
+      char *path, *msg;
+      size_t msglen;
+      path = (char *) gfc_alloca (opp->file_len + 1);
+      msglen = opp->file_len + 51;
+      msg = (char *) gfc_alloca (msglen);
+      unpack_filename (path, opp->file, opp->file_len);
+
+      switch (errno)
+       {
+       case ENOENT: 
+         snprintf (msg, msglen, "File '%s' does not exist", path);
+         break;
+
+       case EEXIST:
+         snprintf (msg, msglen, "File '%s' already exists", path);
+         break;
+
+       case EACCES:
+         snprintf (msg, msglen, 
+                   "Permission denied trying to open file '%s'", path);
+         break;
+
+       case EISDIR:
+         snprintf (msg, msglen, "'%s' is a directory", path);
+         break;
+
+       default:
+         msg = NULL;
+       }
+
+      generate_error (&opp->common, LIBERROR_OS, msg);
+      goto cleanup;
+    }
+
+  if (flags->status == STATUS_NEW || flags->status == STATUS_REPLACE)
+    flags->status = STATUS_OLD;
+
+  /* Create the unit structure.  */
+
+  u->file = get_mem (opp->file_len);
+  if (u->unit_number != opp->common.unit)
+    internal_error (&opp->common, "Unit number changed");
+  u->s = s;
+  u->flags = *flags;
+  u->read_bad = 0;
+  u->endfile = NO_ENDFILE;
+  u->last_record = 0;
+  u->current_record = 0;
+  u->mode = READING;
+  u->maxrec = 0;
+  u->bytes_left = 0;
+  u->saved_pos = 0;
+
+  if (flags->position == POSITION_APPEND)
+    {
+      if (sseek (u->s, 0, SEEK_END) < 0)
+       generate_error (&opp->common, LIBERROR_OS, NULL);
+      u->endfile = AT_ENDFILE;
+    }
+
+  /* Unspecified recl ends up with a processor dependent value.  */
+
+  if ((opp->common.flags & IOPARM_OPEN_HAS_RECL_IN))
+    {
+      u->flags.has_recl = 1;
+      u->recl = opp->recl_in;
+      u->recl_subrecord = u->recl;
+      u->bytes_left = u->recl;
+    }
+  else
+    {
+      u->flags.has_recl = 0;
+      u->recl = max_offset;
+      if (compile_options.max_subrecord_length)
+       {
+         u->recl_subrecord = compile_options.max_subrecord_length;
+       }
+      else
+       {
+         switch (compile_options.record_marker)
+           {
+           case 0:
+             /* Fall through */
+           case sizeof (GFC_INTEGER_4):
+             u->recl_subrecord = GFC_MAX_SUBRECORD_LENGTH;
+             break;
+
+           case sizeof (GFC_INTEGER_8):
+             u->recl_subrecord = max_offset - 16;
+             break;
+
+           default:
+             runtime_error ("Illegal value for record marker");
+             break;
+           }
+       }
+    }
+
+  /* If the file is direct access, calculate the maximum record number
+     via a division now instead of letting the multiplication overflow
+     later.  */
+
+  if (flags->access == ACCESS_DIRECT)
+    u->maxrec = max_offset / u->recl;
+  
+  if (flags->access == ACCESS_STREAM)
+    {
+      u->maxrec = max_offset;
+      u->recl = 1;
+      u->bytes_left = 1;
+      u->strm_pos = stell (u->s) + 1;
+    }
+
+  memmove (u->file, opp->file, opp->file_len);
+  u->file_len = opp->file_len;
+
+  /* Curiously, the standard requires that the
+     position specifier be ignored for new files so a newly connected
+     file starts out at the initial point.  We still need to figure
+     out if the file is at the end or not.  */
+
+  test_endfile (u);
+
+  if (flags->status == STATUS_SCRATCH && opp->file != NULL)
+    free (opp->file);
+    
+  if (flags->form == FORM_FORMATTED)
+    {
+      if ((opp->common.flags & IOPARM_OPEN_HAS_RECL_IN))
+        fbuf_init (u, u->recl);
+      else
+        fbuf_init (u, 0);
+    }
+  else
+    u->fbuf = NULL;
+
+    
+    
+  return u;
+
+ cleanup:
+
+  /* Free memory associated with a temporary filename.  */
+
+  if (flags->status == STATUS_SCRATCH && opp->file != NULL)
+    free (opp->file);
+
+ fail:
+
+  close_unit (u);
+  return NULL;
+}
+
+
+/* Open a unit which is already open.  This involves changing the
+   modes or closing what is there now and opening the new file.  */
+
+static void
+already_open (st_parameter_open *opp, gfc_unit * u, unit_flags * flags)
+{
+  if ((opp->common.flags & IOPARM_OPEN_HAS_FILE) == 0)
+    {
+      edit_modes (opp, u, flags);
+      return;
+    }
+
+  /* If the file is connected to something else, close it and open a
+     new unit.  */
+
+  if (!compare_file_filename (u, opp->file, opp->file_len))
+    {
+#if !HAVE_UNLINK_OPEN_FILE
+      char *path = NULL;
+      if (u->file && u->flags.status == STATUS_SCRATCH)
+       {
+         path = (char *) gfc_alloca (u->file_len + 1);
+         unpack_filename (path, u->file, u->file_len);
+       }
+#endif
+
+      if (sclose (u->s) == -1)
+       {
+         unlock_unit (u);
+         generate_error (&opp->common, LIBERROR_OS,
+                         "Error closing file in OPEN statement");
+         return;
+       }
+
+      u->s = NULL;
+      free (u->file);
+      u->file = NULL;
+      u->file_len = 0;
+
+#if !HAVE_UNLINK_OPEN_FILE
+      if (path != NULL)
+       unlink (path);
+#endif
+
+      u = new_unit (opp, u, flags);
+      if (u != NULL)
+       unlock_unit (u);
+      return;
+    }
+
+  edit_modes (opp, u, flags);
+}
+
+
+/* Open file.  */
+
+extern void st_open (st_parameter_open *opp);
+export_proto(st_open);
+
+void
+st_open (st_parameter_open *opp)
+{
+  unit_flags flags;
+  gfc_unit *u = NULL;
+  GFC_INTEGER_4 cf = opp->common.flags;
+  unit_convert conv;
+  library_start (&opp->common);
+
+  /* Decode options.  */
+
+  flags.access = !(cf & IOPARM_OPEN_HAS_ACCESS) ? ACCESS_UNSPECIFIED :
+    find_option (&opp->common, opp->access, opp->access_len,
+                access_opt, "Bad ACCESS parameter in OPEN statement");
+
+  flags.action = !(cf & IOPARM_OPEN_HAS_ACTION) ? ACTION_UNSPECIFIED :
+    find_option (&opp->common, opp->action, opp->action_len,
+                action_opt, "Bad ACTION parameter in OPEN statement");
+
+  flags.blank = !(cf & IOPARM_OPEN_HAS_BLANK) ? BLANK_UNSPECIFIED :
+    find_option (&opp->common, opp->blank, opp->blank_len,
+                blank_opt, "Bad BLANK parameter in OPEN statement");
+
+  flags.delim = !(cf & IOPARM_OPEN_HAS_DELIM) ? DELIM_UNSPECIFIED :
+    find_option (&opp->common, opp->delim, opp->delim_len,
+                delim_opt, "Bad DELIM parameter in OPEN statement");
+
+  flags.pad = !(cf & IOPARM_OPEN_HAS_PAD) ? PAD_UNSPECIFIED :
+    find_option (&opp->common, opp->pad, opp->pad_len,
+                pad_opt, "Bad PAD parameter in OPEN statement");
+
+  flags.decimal = !(cf & IOPARM_OPEN_HAS_DECIMAL) ? DECIMAL_UNSPECIFIED :
+    find_option (&opp->common, opp->decimal, opp->decimal_len,
+                decimal_opt, "Bad DECIMAL parameter in OPEN statement");
+
+  flags.encoding = !(cf & IOPARM_OPEN_HAS_ENCODING) ? ENCODING_UNSPECIFIED :
+    find_option (&opp->common, opp->encoding, opp->encoding_len,
+                encoding_opt, "Bad ENCODING parameter in OPEN statement");
+
+  flags.async = !(cf & IOPARM_OPEN_HAS_ASYNCHRONOUS) ? ASYNC_UNSPECIFIED :
+    find_option (&opp->common, opp->asynchronous, opp->asynchronous_len,
+                async_opt, "Bad ASYNCHRONOUS parameter in OPEN statement");
+
+  flags.round = !(cf & IOPARM_OPEN_HAS_ROUND) ? ROUND_UNSPECIFIED :
+    find_option (&opp->common, opp->round, opp->round_len,
+                round_opt, "Bad ROUND parameter in OPEN statement");
+
+  flags.sign = !(cf & IOPARM_OPEN_HAS_SIGN) ? SIGN_UNSPECIFIED :
+    find_option (&opp->common, opp->sign, opp->sign_len,
+                sign_opt, "Bad SIGN parameter in OPEN statement");
+
+  flags.form = !(cf & IOPARM_OPEN_HAS_FORM) ? FORM_UNSPECIFIED :
+    find_option (&opp->common, opp->form, opp->form_len,
+                form_opt, "Bad FORM parameter in OPEN statement");
+
+  flags.position = !(cf & IOPARM_OPEN_HAS_POSITION) ? POSITION_UNSPECIFIED :
+    find_option (&opp->common, opp->position, opp->position_len,
+                position_opt, "Bad POSITION parameter in OPEN statement");
+
+  flags.status = !(cf & IOPARM_OPEN_HAS_STATUS) ? STATUS_UNSPECIFIED :
+    find_option (&opp->common, opp->status, opp->status_len,
+                status_opt, "Bad STATUS parameter in OPEN statement");
+
+  /* First, we check wether the convert flag has been set via environment
+     variable.  This overrides the convert tag in the open statement.  */
+
+  conv = get_unformatted_convert (opp->common.unit);
+
+  if (conv == GFC_CONVERT_NONE)
+    {
+      /* Nothing has been set by environment variable, check the convert tag.  */
+      if (cf & IOPARM_OPEN_HAS_CONVERT)
+       conv = find_option (&opp->common, opp->convert, opp->convert_len,
+                           convert_opt,
+                           "Bad CONVERT parameter in OPEN statement");
+      else
+       conv = compile_options.convert;
+    }
+  
+  /* We use big_endian, which is 0 on little-endian machines
+     and 1 on big-endian machines.  */
+  switch (conv)
+    {
+    case GFC_CONVERT_NATIVE:
+    case GFC_CONVERT_SWAP:
+      break;
+      
+    case GFC_CONVERT_BIG:
+      conv = big_endian ? GFC_CONVERT_NATIVE : GFC_CONVERT_SWAP;
+      break;
+      
+    case GFC_CONVERT_LITTLE:
+      conv = big_endian ? GFC_CONVERT_SWAP : GFC_CONVERT_NATIVE;
+      break;
+      
+    default:
+      internal_error (&opp->common, "Illegal value for CONVERT");
+      break;
+    }
+
+  flags.convert = conv;
+
+  if (!(opp->common.flags & IOPARM_OPEN_HAS_NEWUNIT) && opp->common.unit < 0)
+    generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                   "Bad unit number in OPEN statement");
+
+  if (flags.position != POSITION_UNSPECIFIED
+      && flags.access == ACCESS_DIRECT)
+    generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                   "Cannot use POSITION with direct access files");
+
+  if (flags.access == ACCESS_APPEND)
+    {
+      if (flags.position != POSITION_UNSPECIFIED
+         && flags.position != POSITION_APPEND)
+       generate_error (&opp->common, LIBERROR_BAD_OPTION,
+                       "Conflicting ACCESS and POSITION flags in"
+                       " OPEN statement");
+
+      notify_std (&opp->common, GFC_STD_GNU,
+                 "Extension: APPEND as a value for ACCESS in OPEN statement");
+      flags.access = ACCESS_SEQUENTIAL;
+      flags.position = POSITION_APPEND;
+    }
+
+  if (flags.position == POSITION_UNSPECIFIED)
+    flags.position = POSITION_ASIS;
+
+  if ((opp->common.flags & IOPARM_LIBRETURN_MASK) == IOPARM_LIBRETURN_OK)
+    {
+      if ((opp->common.flags & IOPARM_OPEN_HAS_NEWUNIT))
+       {
+         *opp->newunit = get_unique_unit_number(opp);
+         opp->common.unit = *opp->newunit;
+       }
+
+      u = find_or_create_unit (opp->common.unit);
+      if (u->s == NULL)
+       {
+         u = new_unit (opp, u, &flags);
+         if (u != NULL)
+           unlock_unit (u);
+       }
+      else
+       already_open (opp, u, &flags);
+    }
+
+  library_end ();
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/read.c b/l4/pkg/libgfortran/lib/contrib/io/read.c
new file mode 100644 (file)
index 0000000..aa41bc7
--- /dev/null
@@ -0,0 +1,1256 @@
+/* Copyright (C) 2002, 2003, 2005, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "io.h"
+#include "fbuf.h"
+#include "format.h"
+#include "unix.h"
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <assert.h>
+
+typedef unsigned char uchar;
+
+/* read.c -- Deal with formatted reads */
+
+
+/* set_integer()-- All of the integer assignments come here to
+   actually place the value into memory.  */
+
+void
+set_integer (void *dest, GFC_INTEGER_LARGEST value, int length)
+{
+  switch (length)
+    {
+#ifdef HAVE_GFC_INTEGER_16
+/* length=10 comes about for kind=10 real/complex BOZ, cf. PR41711. */
+    case 10:
+    case 16:
+      {
+       GFC_INTEGER_16 tmp = value;
+       memcpy (dest, (void *) &tmp, length);
+      }
+      break;
+#endif
+    case 8:
+      {
+       GFC_INTEGER_8 tmp = value;
+       memcpy (dest, (void *) &tmp, length);
+      }
+      break;
+    case 4:
+      {
+       GFC_INTEGER_4 tmp = value;
+       memcpy (dest, (void *) &tmp, length);
+      }
+      break;
+    case 2:
+      {
+       GFC_INTEGER_2 tmp = value;
+       memcpy (dest, (void *) &tmp, length);
+      }
+      break;
+    case 1:
+      {
+       GFC_INTEGER_1 tmp = value;
+       memcpy (dest, (void *) &tmp, length);
+      }
+      break;
+    default:
+      internal_error (NULL, "Bad integer kind");
+    }
+}
+
+
+/* max_value()-- Given a length (kind), return the maximum signed or
+ * unsigned value */
+
+GFC_UINTEGER_LARGEST
+max_value (int length, int signed_flag)
+{
+  GFC_UINTEGER_LARGEST value;
+#if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10
+  int n;
+#endif
+
+  switch (length)
+    {
+#if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10
+    case 16:
+    case 10:
+      value = 1;
+      for (n = 1; n < 4 * length; n++)
+        value = (value << 2) + 3;
+      if (! signed_flag)
+        value = 2*value+1;
+      break;
+#endif
+    case 8:
+      value = signed_flag ? 0x7fffffffffffffff : 0xffffffffffffffff;
+      break;
+    case 4:
+      value = signed_flag ? 0x7fffffff : 0xffffffff;
+      break;
+    case 2:
+      value = signed_flag ? 0x7fff : 0xffff;
+      break;
+    case 1:
+      value = signed_flag ? 0x7f : 0xff;
+      break;
+    default:
+      internal_error (NULL, "Bad integer kind");
+    }
+
+  return value;
+}
+
+
+/* convert_real()-- Convert a character representation of a floating
+   point number to the machine number.  Returns nonzero if there is an
+   invalid input.  Note: many architectures (e.g. IA-64, HP-PA)
+   require that the storage pointed to by the dest argument is
+   properly aligned for the type in question.  */
+
+int
+convert_real (st_parameter_dt *dtp, void *dest, const char *buffer, int length)
+{
+  char *endptr = NULL;
+
+  switch (length)
+    {
+    case 4:
+      *((GFC_REAL_4*) dest) =
+#if defined(HAVE_STRTOF)
+       gfc_strtof (buffer, &endptr);
+#else
+       (GFC_REAL_4) gfc_strtod (buffer, &endptr);
+#endif
+      break;
+
+    case 8:
+      *((GFC_REAL_8*) dest) = gfc_strtod (buffer, &endptr);
+      break;
+
+#if defined(HAVE_GFC_REAL_10) && defined (HAVE_STRTOLD)
+    case 10:
+      *((GFC_REAL_10*) dest) = gfc_strtold (buffer, &endptr);
+      break;
+#endif
+
+#if defined(HAVE_GFC_REAL_16)
+# if defined(GFC_REAL_16_IS_FLOAT128)
+    case 16:
+      *((GFC_REAL_16*) dest) = __qmath_(strtoflt128) (buffer, &endptr);
+      break;
+# elif defined(HAVE_STRTOLD)
+    case 16:
+      *((GFC_REAL_16*) dest) = gfc_strtold (buffer, &endptr);
+      break;
+# endif
+#endif
+
+    default:
+      internal_error (&dtp->common, "Unsupported real kind during IO");
+    }
+
+  if (buffer == endptr)
+    {
+      generate_error (&dtp->common, LIBERROR_READ_VALUE,
+                     "Error during floating point read");
+      next_record (dtp, 1);
+      return 1;
+    }
+
+  return 0;
+}
+
+/* convert_infnan()-- Convert character INF/NAN representation to the
+   machine number.  Note: many architectures (e.g. IA-64, HP-PA) require
+   that the storage pointed to by the dest argument is properly aligned
+   for the type in question.  */
+
+int
+convert_infnan (st_parameter_dt *dtp, void *dest, const char *buffer,
+               int length)
+{
+  const char *s = buffer;
+  int is_inf, plus = 1;
+
+  if (*s == '+')
+    s++;
+  else if (*s == '-')
+    {
+      s++;
+      plus = 0;
+    }
+
+  is_inf = *s == 'i';
+
+  switch (length)
+    {
+    case 4:
+      if (is_inf)
+       *((GFC_REAL_4*) dest) = plus ? __builtin_inff () : -__builtin_inff ();
+      else
+       *((GFC_REAL_4*) dest) = plus ? __builtin_nanf ("") : -__builtin_nanf ("");
+      break;
+
+    case 8:
+      if (is_inf)
+       *((GFC_REAL_8*) dest) = plus ? __builtin_inf () : -__builtin_inf ();
+      else
+       *((GFC_REAL_8*) dest) = plus ? __builtin_nan ("") : -__builtin_nan ("");
+      break;
+
+#if defined(HAVE_GFC_REAL_10)
+    case 10:
+      if (is_inf)
+       *((GFC_REAL_10*) dest) = plus ? __builtin_infl () : -__builtin_infl ();
+      else
+       *((GFC_REAL_10*) dest) = plus ? __builtin_nanl ("") : -__builtin_nanl ("");
+      break;
+#endif
+
+#if defined(HAVE_GFC_REAL_16)
+# if defined(GFC_REAL_16_IS_FLOAT128)
+    case 16:
+      *((GFC_REAL_16*) dest) = __qmath_(strtoflt128) (buffer, NULL);
+      break;
+# else
+    case 16:
+      if (is_inf)
+       *((GFC_REAL_16*) dest) = plus ? __builtin_infl () : -__builtin_infl ();
+      else
+       *((GFC_REAL_16*) dest) = plus ? __builtin_nanl ("") : -__builtin_nanl ("");
+      break;
+# endif
+#endif
+
+    default:
+      internal_error (&dtp->common, "Unsupported real kind during IO");
+    }
+
+  return 0;
+}
+
+
+/* read_l()-- Read a logical value */
+
+void
+read_l (st_parameter_dt *dtp, const fnode *f, char *dest, int length)
+{
+  char *p;
+  int w;
+
+  w = f->u.w;
+
+  p = read_block_form (dtp, &w);
+
+  if (p == NULL)
+    return;
+
+  while (*p == ' ')
+    {
+      if (--w == 0)
+       goto bad;
+      p++;
+    }
+
+  if (*p == '.')
+    {
+      if (--w == 0)
+       goto bad;
+      p++;
+    }
+
+  switch (*p)
+    {
+    case 't':
+    case 'T':
+      set_integer (dest, (GFC_INTEGER_LARGEST) 1, length);
+      break;
+    case 'f':
+    case 'F':
+      set_integer (dest, (GFC_INTEGER_LARGEST) 0, length);
+      break;
+    default:
+    bad:
+      generate_error (&dtp->common, LIBERROR_READ_VALUE,
+                     "Bad value on logical read");
+      next_record (dtp, 1);
+      break;
+    }
+}
+
+
+static gfc_char4_t
+read_utf8 (st_parameter_dt *dtp, int *nbytes) 
+{
+  static const uchar masks[6] = { 0x7F, 0x1F, 0x0F, 0x07, 0x02, 0x01 };
+  static const uchar patns[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+  int i, nb, nread;
+  gfc_char4_t c;
+  char *s;
+
+  *nbytes = 1;
+
+  s = read_block_form (dtp, nbytes);
+  if (s == NULL)
+    return 0;
+
+  /* If this is a short read, just return.  */
+  if (*nbytes == 0)
+    return 0;
+
+  c = (uchar) s[0];
+  if (c < 0x80)
+    return c;
+
+  /* The number of leading 1-bits in the first byte indicates how many
+     bytes follow.  */
+  for (nb = 2; nb < 7; nb++)
+    if ((c & ~masks[nb-1]) == patns[nb-1])
+      goto found;
+  goto invalid;
+       
+ found:
+  c = (c & masks[nb-1]);
+  nread = nb - 1;
+
+  s = read_block_form (dtp, &nread);
+  if (s == NULL)
+    return 0;
+  /* Decode the bytes read.  */
+  for (i = 1; i < nb; i++)
+    {
+      gfc_char4_t n = *s++;
+
+      if ((n & 0xC0) != 0x80)
+       goto invalid;
+
+      c = ((c << 6) + (n & 0x3F));
+    }
+
+  /* Make sure the shortest possible encoding was used.  */
+  if (c <=      0x7F && nb > 1) goto invalid;
+  if (c <=     0x7FF && nb > 2) goto invalid;
+  if (c <=    0xFFFF && nb > 3) goto invalid;
+  if (c <=  0x1FFFFF && nb > 4) goto invalid;
+  if (c <= 0x3FFFFFF && nb > 5) goto invalid;
+
+  /* Make sure the character is valid.  */
+  if (c > 0x7FFFFFFF || (c >= 0xD800 && c <= 0xDFFF))
+    goto invalid;
+
+  return c;
+      
+ invalid:
+  generate_error (&dtp->common, LIBERROR_READ_VALUE, "Invalid UTF-8 encoding");
+  return (gfc_char4_t) '?';
+}
+
+
+static void
+read_utf8_char1 (st_parameter_dt *dtp, char *p, int len, int width)
+{
+  gfc_char4_t c;
+  char *dest;
+  int nbytes;
+  int i, j;
+
+  len = (width < len) ? len : width;
+
+  dest = (char *) p;
+
+  /* Proceed with decoding one character at a time.  */
+  for (j = 0; j < len; j++, dest++)
+    {
+      c = read_utf8 (dtp, &nbytes);
+
+      /* Check for a short read and if so, break out.  */
+      if (nbytes == 0)
+       break;
+
+      *dest = c > 255 ? '?' : (uchar) c;
+    }
+
+  /* If there was a short read, pad the remaining characters.  */
+  for (i = j; i < len; i++)
+    *dest++ = ' ';
+  return;
+}
+
+static void
+read_default_char1 (st_parameter_dt *dtp, char *p, int len, int width)
+{
+  char *s;
+  int m, n;
+
+  s = read_block_form (dtp, &width);
+  
+  if (s == NULL)
+    return;
+  if (width > len)
+     s += (width - len);
+
+  m = (width > len) ? len : width;
+  memcpy (p, s, m);
+
+  n = len - width;
+  if (n > 0)
+    memset (p + m, ' ', n);
+}
+
+
+static void
+read_utf8_char4 (st_parameter_dt *dtp, void *p, int len, int width)
+{
+  gfc_char4_t *dest;
+  int nbytes;
+  int i, j;
+
+  len = (width < len) ? len : width;
+
+  dest = (gfc_char4_t *) p;
+
+  /* Proceed with decoding one character at a time.  */
+  for (j = 0; j < len; j++, dest++)
+    {
+      *dest = read_utf8 (dtp, &nbytes);
+
+      /* Check for a short read and if so, break out.  */
+      if (nbytes == 0)
+       break;
+    }
+
+  /* If there was a short read, pad the remaining characters.  */
+  for (i = j; i < len; i++)
+    *dest++ = (gfc_char4_t) ' ';
+  return;
+}
+
+
+static void
+read_default_char4 (st_parameter_dt *dtp, char *p, int len, int width)
+{
+  int m, n;
+  gfc_char4_t *dest;
+
+  if (is_char4_unit(dtp))
+    {
+      gfc_char4_t *s4;
+
+      s4 = (gfc_char4_t *) read_block_form4 (dtp, &width);
+
+      if (s4 == NULL)
+       return;
+      if (width > len)
+        s4 += (width - len);
+
+      m = ((int) width > len) ? len : (int) width;
+
+      dest = (gfc_char4_t *) p;
+
+      for (n = 0; n < m; n++)
+       *dest++ = *s4++;
+
+      for (n = 0; n < len - (int) width; n++)
+       *dest++ = (gfc_char4_t) ' ';
+    }
+  else
+    {
+      char *s;
+
+      s = read_block_form (dtp, &width);
+
+      if (s == NULL)
+       return;
+      if (width > len)
+        s += (width - len);
+
+      m = ((int) width > len) ? len : (int) width;
+
+      dest = (gfc_char4_t *) p;
+
+      for (n = 0; n < m; n++, dest++, s++)
+       *dest = (unsigned char ) *s;
+
+      for (n = 0; n < len - (int) width; n++, dest++)
+       *dest = (unsigned char) ' ';
+    }
+}
+
+
+/* read_a()-- Read a character record into a KIND=1 character destination,
+   processing UTF-8 encoding if necessary.  */
+
+void
+read_a (st_parameter_dt *dtp, const fnode *f, char *p, int length)
+{
+  int wi;
+  int w;
+
+  wi = f->u.w;
+  if (wi == -1) /* '(A)' edit descriptor  */
+    wi = length;
+  w = wi;
+
+  /* Read in w characters, treating comma as not a separator.  */
+  dtp->u.p.sf_read_comma = 0;
+
+  if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+    read_utf8_char1 (dtp, p, length, w);
+  else
+    read_default_char1 (dtp, p, length, w);
+
+  dtp->u.p.sf_read_comma =
+    dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA ? 0 : 1;
+}
+
+
+/* read_a_char4()-- Read a character record into a KIND=4 character destination,
+   processing UTF-8 encoding if necessary.  */
+
+void
+read_a_char4 (st_parameter_dt *dtp, const fnode *f, char *p, int length)
+{
+  int w;
+
+  w = f->u.w;
+  if (w == -1) /* '(A)' edit descriptor  */
+    w = length;
+
+  /* Read in w characters, treating comma as not a separator.  */
+  dtp->u.p.sf_read_comma = 0;
+
+  if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+    read_utf8_char4 (dtp, p, length, w);
+  else
+    read_default_char4 (dtp, p, length, w);
+  
+  dtp->u.p.sf_read_comma =
+    dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA ? 0 : 1;
+}
+
+/* eat_leading_spaces()-- Given a character pointer and a width,
+ * ignore the leading spaces.  */
+
+static char *
+eat_leading_spaces (int *width, char *p)
+{
+  for (;;)
+    {
+      if (*width == 0 || *p != ' ')
+       break;
+
+      (*width)--;
+      p++;
+    }
+
+  return p;
+}
+
+
+static char
+next_char (st_parameter_dt *dtp, char **p, int *w)
+{
+  char c, *q;
+
+  if (*w == 0)
+    return '\0';
+
+  q = *p;
+  c = *q++;
+  *p = q;
+
+  (*w)--;
+
+  if (c != ' ')
+    return c;
+  if (dtp->u.p.blank_status != BLANK_UNSPECIFIED)
+    return ' ';  /* return a blank to signal a null */ 
+
+  /* At this point, the rest of the field has to be trailing blanks */
+
+  while (*w > 0)
+    {
+      if (*q++ != ' ')
+       return '?';
+      (*w)--;
+    }
+
+  *p = q;
+  return '\0';
+}
+
+
+/* read_decimal()-- Read a decimal integer value.  The values here are
+ * signed values. */
+
+void
+read_decimal (st_parameter_dt *dtp, const fnode *f, char *dest, int length)
+{
+  GFC_UINTEGER_LARGEST value, maxv, maxv_10;
+  GFC_INTEGER_LARGEST v;
+  int w, negative; 
+  char c, *p;
+
+  w = f->u.w;
+
+  p = read_block_form (dtp, &w);
+
+  if (p == NULL)
+    return;
+
+  p = eat_leading_spaces (&w, p);
+  if (w == 0)
+    {
+      set_integer (dest, (GFC_INTEGER_LARGEST) 0, length);
+      return;
+    }
+
+  maxv = max_value (length, 1);
+  maxv_10 = maxv / 10;
+
+  negative = 0;
+  value = 0;
+
+  switch (*p)
+    {
+    case '-':
+      negative = 1;
+      /* Fall through */
+
+    case '+':
+      p++;
+      if (--w == 0)
+       goto bad;
+      /* Fall through */
+
+    default:
+      break;
+    }
+
+  /* At this point we have a digit-string */
+  value = 0;
+
+  for (;;)
+    {
+      c = next_char (dtp, &p, &w);
+      if (c == '\0')
+       break;
+       
+      if (c == ' ')
+        {
+         if (dtp->u.p.blank_status == BLANK_NULL) continue;
+         if (dtp->u.p.blank_status == BLANK_ZERO) c = '0';
+        }
+        
+      if (c < '0' || c > '9')
+       goto bad;
+
+      if (value > maxv_10 && compile_options.range_check == 1)
+       goto overflow;
+
+      c -= '0';
+      value = 10 * value;
+
+      if (value > maxv - c && compile_options.range_check == 1)
+       goto overflow;
+      value += c;
+    }
+
+  v = value;
+  if (negative)
+    v = -v;
+
+  set_integer (dest, v, length);
+  return;
+
+ bad:
+  generate_error (&dtp->common, LIBERROR_READ_VALUE,
+                 "Bad value during integer read");
+  next_record (dtp, 1);
+  return;
+
+ overflow:
+  generate_error (&dtp->common, LIBERROR_READ_OVERFLOW,
+                 "Value overflowed during integer read");
+  next_record (dtp, 1);
+
+}
+
+
+/* read_radix()-- This function reads values for non-decimal radixes.
+ * The difference here is that we treat the values here as unsigned
+ * values for the purposes of overflow.  If minus sign is present and
+ * the top bit is set, the value will be incorrect. */
+
+void
+read_radix (st_parameter_dt *dtp, const fnode *f, char *dest, int length,
+           int radix)
+{
+  GFC_UINTEGER_LARGEST value, maxv, maxv_r;
+  GFC_INTEGER_LARGEST v;
+  int w, negative;
+  char c, *p;
+
+  w = f->u.w;
+
+  p = read_block_form (dtp, &w);
+
+  if (p == NULL)
+    return;
+
+  p = eat_leading_spaces (&w, p);
+  if (w == 0)
+    {
+      set_integer (dest, (GFC_INTEGER_LARGEST) 0, length);
+      return;
+    }
+
+  maxv = max_value (length, 0);
+  maxv_r = maxv / radix;
+
+  negative = 0;
+  value = 0;
+
+  switch (*p)
+    {
+    case '-':
+      negative = 1;
+      /* Fall through */
+
+    case '+':
+      p++;
+      if (--w == 0)
+       goto bad;
+      /* Fall through */
+
+    default:
+      break;
+    }
+
+  /* At this point we have a digit-string */
+  value = 0;
+
+  for (;;)
+    {
+      c = next_char (dtp, &p, &w);
+      if (c == '\0')
+       break;
+      if (c == ' ')
+        {
+         if (dtp->u.p.blank_status == BLANK_NULL) continue;
+         if (dtp->u.p.blank_status == BLANK_ZERO) c = '0';
+        }
+
+      switch (radix)
+       {
+       case 2:
+         if (c < '0' || c > '1')
+           goto bad;
+         break;
+
+       case 8:
+         if (c < '0' || c > '7')
+           goto bad;
+         break;
+
+       case 16:
+         switch (c)
+           {
+           case '0':
+           case '1':
+           case '2':
+           case '3':
+           case '4':
+           case '5':
+           case '6':
+           case '7':
+           case '8':
+           case '9':
+             break;
+
+           case 'a':
+           case 'b':
+           case 'c':
+           case 'd':
+           case 'e':
+           case 'f':
+             c = c - 'a' + '9' + 1;
+             break;
+
+           case 'A':
+           case 'B':
+           case 'C':
+           case 'D':
+           case 'E':
+           case 'F':
+             c = c - 'A' + '9' + 1;
+             break;
+
+           default:
+             goto bad;
+           }
+
+         break;
+       }
+
+      if (value > maxv_r)
+       goto overflow;
+
+      c -= '0';
+      value = radix * value;
+
+      if (maxv - c < value)
+       goto overflow;
+      value += c;
+    }
+
+  v = value;
+  if (negative)
+    v = -v;
+
+  set_integer (dest, v, length);
+  return;
+
+ bad:
+  generate_error (&dtp->common, LIBERROR_READ_VALUE,
+                 "Bad value during integer read");
+  next_record (dtp, 1);
+  return;
+
+ overflow:
+  generate_error (&dtp->common, LIBERROR_READ_OVERFLOW,
+                 "Value overflowed during integer read");
+  next_record (dtp, 1);
+
+}
+
+
+/* read_f()-- Read a floating point number with F-style editing, which
+   is what all of the other floating point descriptors behave as.  The
+   tricky part is that optional spaces are allowed after an E or D,
+   and the implicit decimal point if a decimal point is not present in
+   the input.  */
+
+void
+read_f (st_parameter_dt *dtp, const fnode *f, char *dest, int length)
+{
+  int w, seen_dp, exponent;
+  int exponent_sign;
+  const char *p;
+  char *buffer;
+  char *out;
+  int seen_int_digit; /* Seen a digit before the decimal point?  */
+  int seen_dec_digit; /* Seen a digit after the decimal point?  */
+
+  seen_dp = 0;
+  seen_int_digit = 0;
+  seen_dec_digit = 0;
+  exponent_sign = 1;
+  exponent = 0;
+  w = f->u.w;
+
+  /* Read in the next block.  */
+  p = read_block_form (dtp, &w);
+  if (p == NULL)
+    return;
+  p = eat_leading_spaces (&w, (char*) p);
+  if (w == 0)
+    goto zero;
+
+  /* In this buffer we're going to re-format the number cleanly to be parsed
+     by convert_real in the end; this assures we're using strtod from the
+     C library for parsing and thus probably get the best accuracy possible.
+     This process may add a '+0.0' in front of the number as well as change the
+     exponent because of an implicit decimal point or the like.  Thus allocating
+     strlen ("+0.0e-1000") == 10 characters plus one for NUL more than the
+     original buffer had should be enough.  */
+  buffer = gfc_alloca (w + 11);
+  out = buffer;
+
+  /* Optional sign */
+  if (*p == '-' || *p == '+')
+    {
+      if (*p == '-')
+       *(out++) = '-';
+      ++p;
+      --w;
+    }
+
+  p = eat_leading_spaces (&w, (char*) p);
+  if (w == 0)
+    goto zero;
+
+  /* Check for Infinity or NaN.  */    
+  if (unlikely ((w >= 3 && (*p == 'i' || *p == 'I' || *p == 'n' || *p == 'N'))))
+    {
+      int seen_paren = 0;
+      char *save = out;
+
+      /* Scan through the buffer keeping track of spaces and parenthesis. We
+        null terminate the string as soon as we see a left paren or if we are
+        BLANK_NULL mode.  Leading spaces have already been skipped above,
+        trailing spaces are ignored by converting to '\0'. A space
+        between "NaN" and the optional perenthesis is not permitted.  */
+      while (w > 0)
+       {
+         *out = tolower (*p);
+         switch (*p)
+           {
+           case ' ':
+             if (dtp->u.p.blank_status == BLANK_ZERO)
+               {
+                 *out = '0';
+                 break;
+               }
+             *out = '\0';
+             if (seen_paren == 1)
+               goto bad_float;
+             break;
+           case '(':
+             seen_paren++;
+             *out = '\0';
+             break;
+           case ')':
+             if (seen_paren++ != 1)
+               goto bad_float;
+             break;
+           default:
+             if (!isalnum (*out))
+               goto bad_float;
+           }
+         --w;
+         ++p;
+         ++out;
+       }
+        
+      *out = '\0';
+      
+      if (seen_paren != 0 && seen_paren != 2)
+       goto bad_float;
+
+      if ((strcmp (save, "inf") == 0) || (strcmp (save, "infinity") == 0))
+       {
+          if (seen_paren)
+            goto bad_float;
+       }
+      else if (strcmp (save, "nan") != 0)
+       goto bad_float;
+
+      convert_infnan (dtp, dest, buffer, length);
+      return;
+    }
+
+  /* Process the mantissa string.  */
+  while (w > 0)
+    {
+      switch (*p)
+       {
+       case ',':
+         if (dtp->u.p.current_unit->decimal_status != DECIMAL_COMMA)
+           goto bad_float;
+         /* Fall through.  */
+       case '.':
+         if (seen_dp)
+           goto bad_float;
+         if (!seen_int_digit)
+           *(out++) = '0';
+         *(out++) = '.';
+         seen_dp = 1;
+         break;
+
+       case ' ':
+         if (dtp->u.p.blank_status == BLANK_ZERO)
+           {
+             *(out++) = '0';
+             goto found_digit;
+           }
+         else if (dtp->u.p.blank_status == BLANK_NULL)
+           break;
+         else
+           /* TODO: Should we check instead that there are only trailing
+              blanks here, as is done below for exponents?  */
+           goto done;
+         /* Fall through.  */
+       case '0':
+       case '1':
+       case '2':
+       case '3':
+       case '4':
+       case '5':
+       case '6':
+       case '7':
+       case '8':
+       case '9':
+         *(out++) = *p;
+found_digit:
+         if (!seen_dp)
+           seen_int_digit = 1;
+         else
+           seen_dec_digit = 1;
+         break;
+
+       case '-':
+       case '+':
+         goto exponent;
+
+       case 'e':
+       case 'E':
+       case 'd':
+       case 'D':
+         ++p;
+         --w;
+         goto exponent;
+
+       default:
+         goto bad_float;
+       }
+
+      ++p;
+      --w;
+    }
+  
+  /* No exponent has been seen, so we use the current scale factor.  */
+  exponent = - dtp->u.p.scale_factor;
+  goto done;
+
+  /* At this point the start of an exponent has been found.  */
+exponent:
+  p = eat_leading_spaces (&w, (char*) p);
+  if (*p == '-' || *p == '+')
+    {
+      if (*p == '-')
+       exponent_sign = -1;
+      ++p;
+      --w;
+    }
+
+  /* At this point a digit string is required.  We calculate the value
+     of the exponent in order to take account of the scale factor and
+     the d parameter before explict conversion takes place.  */
+
+  if (w == 0)
+    goto bad_float;
+
+  if (dtp->u.p.blank_status == BLANK_UNSPECIFIED)
+    {
+      while (w > 0 && isdigit (*p))
+       {
+         exponent *= 10;
+         exponent += *p - '0';
+         ++p;
+         --w;
+       }
+       
+      /* Only allow trailing blanks.  */
+      while (w > 0)
+       {
+         if (*p != ' ')
+           goto bad_float;
+         ++p;
+         --w;
+       }
+    }    
+  else  /* BZ or BN status is enabled.  */
+    {
+      while (w > 0)
+       {
+         if (*p == ' ')
+           {
+             if (dtp->u.p.blank_status == BLANK_ZERO)
+               exponent *= 10;
+             else
+               assert (dtp->u.p.blank_status == BLANK_NULL);
+           }
+         else if (!isdigit (*p))
+           goto bad_float;
+         else
+           {
+             exponent *= 10;
+             exponent += *p - '0';
+           }
+
+         ++p;
+         --w;
+       }
+    }
+
+  exponent *= exponent_sign;
+
+done:
+  /* Use the precision specified in the format if no decimal point has been
+     seen.  */
+  if (!seen_dp)
+    exponent -= f->u.real.d;
+
+  /* Output a trailing '0' after decimal point if not yet found.  */
+  if (seen_dp && !seen_dec_digit)
+    *(out++) = '0';
+  /* Handle input of style "E+NN" by inserting a 0 for the
+     significand.  */
+  else if (!seen_int_digit && !seen_dec_digit)
+    {
+      notify_std (&dtp->common, GFC_STD_LEGACY, 
+                 "REAL input of style 'E+NN'");
+      *(out++) = '0';
+    }
+
+  /* Print out the exponent to finish the reformatted number.  Maximum 4
+     digits for the exponent.  */
+  if (exponent != 0)
+    {
+      int dig;
+
+      *(out++) = 'e';
+      if (exponent < 0)
+       {
+         *(out++) = '-';
+         exponent = - exponent;
+       }
+
+      assert (exponent < 10000);
+      for (dig = 3; dig >= 0; --dig)
+       {
+         out[dig] = (char) ('0' + exponent % 10);
+         exponent /= 10;
+       }
+      out += 4;
+    }
+  *(out++) = '\0';
+
+  /* Do the actual conversion.  */
+  convert_real (dtp, dest, buffer, length);
+
+  return;
+
+  /* The value read is zero.  */
+zero:
+  switch (length)
+    {
+      case 4:
+       *((GFC_REAL_4 *) dest) = 0.0;
+       break;
+
+      case 8:
+       *((GFC_REAL_8 *) dest) = 0.0;
+       break;
+
+#ifdef HAVE_GFC_REAL_10
+      case 10:
+       *((GFC_REAL_10 *) dest) = 0.0;
+       break;
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+      case 16:
+       *((GFC_REAL_16 *) dest) = 0.0;
+       break;
+#endif
+
+      default:
+       internal_error (&dtp->common, "Unsupported real kind during IO");
+    }
+  return;
+
+bad_float:
+  generate_error (&dtp->common, LIBERROR_READ_VALUE,
+                 "Bad value during floating point read");
+  next_record (dtp, 1);
+  return;
+}
+
+
+/* read_x()-- Deal with the X/TR descriptor.  We just read some data
+ * and never look at it. */
+
+void
+read_x (st_parameter_dt *dtp, int n)
+{
+  int length, q, q2;
+
+  if ((dtp->u.p.current_unit->pad_status == PAD_NO || is_internal_unit (dtp))
+       && dtp->u.p.current_unit->bytes_left < n)
+    n = dtp->u.p.current_unit->bytes_left;
+    
+  if (n == 0)
+    return;
+
+  length = n;
+
+  if (is_internal_unit (dtp))
+    {
+      mem_alloc_r (dtp->u.p.current_unit->s, &length);
+      if (unlikely (length < n))
+       n = length;
+      goto done;
+    }
+
+  if (dtp->u.p.sf_seen_eor)
+    return;
+
+  n = 0;
+  while (n < length)
+    {
+      q = fbuf_getc (dtp->u.p.current_unit);
+      if (q == EOF)
+       break;
+      else if (q == '\n' || q == '\r')
+       {
+         /* Unexpected end of line. Set the position.  */
+         dtp->u.p.sf_seen_eor = 1;
+
+         /* If we see an EOR during non-advancing I/O, we need to skip
+            the rest of the I/O statement.  Set the corresponding flag.  */
+         if (dtp->u.p.advance_status == ADVANCE_NO || dtp->u.p.seen_dollar)
+           dtp->u.p.eor_condition = 1;
+           
+         /* If we encounter a CR, it might be a CRLF.  */
+         if (q == '\r') /* Probably a CRLF */
+           {
+             /* See if there is an LF.  */
+             q2 = fbuf_getc (dtp->u.p.current_unit);
+             if (q2 == '\n')
+               dtp->u.p.sf_seen_eor = 2;
+             else if (q2 != EOF) /* Oops, seek back.  */
+               fbuf_seek (dtp->u.p.current_unit, -1, SEEK_CUR);
+           }
+         goto done;
+       }
+      n++;
+    } 
+
+ done:
+  if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
+    dtp->u.p.size_used += (GFC_IO_INT) n;
+  dtp->u.p.current_unit->bytes_left -= n;
+  dtp->u.p.current_unit->strm_pos += (gfc_offset) n;
+}
+
diff --git a/l4/pkg/libgfortran/lib/contrib/io/size_from_kind.c b/l4/pkg/libgfortran/lib/contrib/io/size_from_kind.c
new file mode 100644 (file)
index 0000000..d467df0
--- /dev/null
@@ -0,0 +1,83 @@
+/* Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Janne Blomqvist
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* This file contains utility functions for determining the size of a
+   variable given its kind. */
+
+#include "io.h"
+
+size_t
+size_from_real_kind (int kind)
+{
+  switch (kind)
+    {
+#ifdef HAVE_GFC_REAL_4
+    case 4:
+      return sizeof (GFC_REAL_4);
+#endif
+#ifdef HAVE_GFC_REAL_8
+    case 8:
+      return sizeof (GFC_REAL_8);
+#endif
+#ifdef HAVE_GFC_REAL_10
+    case 10:
+      return sizeof (GFC_REAL_10);
+#endif
+#ifdef HAVE_GFC_REAL_16
+    case 16:
+      return sizeof (GFC_REAL_16);
+#endif
+    default:
+      return kind;
+    }
+}
+
+
+size_t
+size_from_complex_kind (int kind)
+{
+  switch (kind)
+    {
+#ifdef HAVE_GFC_COMPLEX_4
+    case 4:
+      return sizeof (GFC_COMPLEX_4);
+#endif
+#ifdef HAVE_GFC_COMPLEX_8
+    case 8:
+      return sizeof (GFC_COMPLEX_8);
+#endif
+#ifdef HAVE_GFC_COMPLEX_10
+    case 10:
+      return sizeof (GFC_COMPLEX_10);
+#endif
+#ifdef HAVE_GFC_COMPLEX_16
+    case 16:
+      return sizeof (GFC_COMPLEX_16);
+#endif
+    default:
+      return 2 * kind;
+    }
+}
+
diff --git a/l4/pkg/libgfortran/lib/contrib/io/transfer.c b/l4/pkg/libgfortran/lib/contrib/io/transfer.c
new file mode 100644 (file)
index 0000000..f71e96f
--- /dev/null
@@ -0,0 +1,3773 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   Namelist transfer functions contributed by Paul Thomas
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* transfer.c -- Top level handling of data transfer statements.  */
+
+#include "io.h"
+#include "fbuf.h"
+#include "format.h"
+#include "unix.h"
+#include <string.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <errno.h>
+
+
+/* Calling conventions:  Data transfer statements are unlike other
+   library calls in that they extend over several calls.
+
+   The first call is always a call to st_read() or st_write().  These
+   subroutines return no status unless a namelist read or write is
+   being done, in which case there is the usual status.  No further
+   calls are necessary in this case.
+
+   For other sorts of data transfer, there are zero or more data
+   transfer statement that depend on the format of the data transfer
+   statement. For READ (and for backwards compatibily: for WRITE), one has
+
+      transfer_integer
+      transfer_logical
+      transfer_character
+      transfer_character_wide
+      transfer_real
+      transfer_complex
+      transfer_real128
+      transfer_complex128
+   
+    and for WRITE
+
+      transfer_integer_write
+      transfer_logical_write
+      transfer_character_write
+      transfer_character_wide_write
+      transfer_real_write
+      transfer_complex_write
+      transfer_real128_write
+      transfer_complex128_write
+
+    These subroutines do not return status. The *128 functions
+    are in the file transfer128.c.
+
+    The last call is a call to st_[read|write]_done().  While
+    something can easily go wrong with the initial st_read() or
+    st_write(), an error inhibits any data from actually being
+    transferred.  */
+
+extern void transfer_integer (st_parameter_dt *, void *, int);
+export_proto(transfer_integer);
+
+extern void transfer_integer_write (st_parameter_dt *, void *, int);
+export_proto(transfer_integer_write);
+
+extern void transfer_real (st_parameter_dt *, void *, int);
+export_proto(transfer_real);
+
+extern void transfer_real_write (st_parameter_dt *, void *, int);
+export_proto(transfer_real_write);
+
+extern void transfer_logical (st_parameter_dt *, void *, int);
+export_proto(transfer_logical);
+
+extern void transfer_logical_write (st_parameter_dt *, void *, int);
+export_proto(transfer_logical_write);
+
+extern void transfer_character (st_parameter_dt *, void *, int);
+export_proto(transfer_character);
+
+extern void transfer_character_write (st_parameter_dt *, void *, int);
+export_proto(transfer_character_write);
+
+extern void transfer_character_wide (st_parameter_dt *, void *, int, int);
+export_proto(transfer_character_wide);
+
+extern void transfer_character_wide_write (st_parameter_dt *,
+                                          void *, int, int);
+export_proto(transfer_character_wide_write);
+
+extern void transfer_complex (st_parameter_dt *, void *, int);
+export_proto(transfer_complex);
+
+extern void transfer_complex_write (st_parameter_dt *, void *, int);
+export_proto(transfer_complex_write);
+
+extern void transfer_array (st_parameter_dt *, gfc_array_char *, int,
+                           gfc_charlen_type);
+export_proto(transfer_array);
+
+extern void transfer_array_write (st_parameter_dt *, gfc_array_char *, int,
+                           gfc_charlen_type);
+export_proto(transfer_array_write);
+
+static void us_read (st_parameter_dt *, int);
+static void us_write (st_parameter_dt *, int);
+static void next_record_r_unf (st_parameter_dt *, int);
+static void next_record_w_unf (st_parameter_dt *, int);
+
+static const st_option advance_opt[] = {
+  {"yes", ADVANCE_YES},
+  {"no", ADVANCE_NO},
+  {NULL, 0}
+};
+
+
+static const st_option decimal_opt[] = {
+  {"point", DECIMAL_POINT},
+  {"comma", DECIMAL_COMMA},
+  {NULL, 0}
+};
+
+static const st_option round_opt[] = {
+  {"up", ROUND_UP},
+  {"down", ROUND_DOWN},
+  {"zero", ROUND_ZERO},
+  {"nearest", ROUND_NEAREST},
+  {"compatible", ROUND_COMPATIBLE},
+  {"processor_defined", ROUND_PROCDEFINED},
+  {NULL, 0}
+};
+
+
+static const st_option sign_opt[] = {
+  {"plus", SIGN_SP},
+  {"suppress", SIGN_SS},
+  {"processor_defined", SIGN_S},
+  {NULL, 0}
+};
+
+static const st_option blank_opt[] = {
+  {"null", BLANK_NULL},
+  {"zero", BLANK_ZERO},
+  {NULL, 0}
+};
+
+static const st_option delim_opt[] = {
+  {"apostrophe", DELIM_APOSTROPHE},
+  {"quote", DELIM_QUOTE},
+  {"none", DELIM_NONE},
+  {NULL, 0}
+};
+
+static const st_option pad_opt[] = {
+  {"yes", PAD_YES},
+  {"no", PAD_NO},
+  {NULL, 0}
+};
+
+typedef enum
+{ FORMATTED_SEQUENTIAL, UNFORMATTED_SEQUENTIAL,
+  FORMATTED_DIRECT, UNFORMATTED_DIRECT, FORMATTED_STREAM, UNFORMATTED_STREAM
+}
+file_mode;
+
+
+static file_mode
+current_mode (st_parameter_dt *dtp)
+{
+  file_mode m;
+
+  m = FORM_UNSPECIFIED;
+
+  if (dtp->u.p.current_unit->flags.access == ACCESS_DIRECT)
+    {
+      m = dtp->u.p.current_unit->flags.form == FORM_FORMATTED ?
+       FORMATTED_DIRECT : UNFORMATTED_DIRECT;
+    }
+  else if (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL)
+    {
+      m = dtp->u.p.current_unit->flags.form == FORM_FORMATTED ?
+       FORMATTED_SEQUENTIAL : UNFORMATTED_SEQUENTIAL;
+    }
+  else if (dtp->u.p.current_unit->flags.access == ACCESS_STREAM)
+    {
+      m = dtp->u.p.current_unit->flags.form == FORM_FORMATTED ?
+       FORMATTED_STREAM : UNFORMATTED_STREAM;
+    }
+
+  return m;
+}
+
+
+/* Mid level data transfer statements.  */
+
+/* Read sequential file - internal unit  */
+
+static char *
+read_sf_internal (st_parameter_dt *dtp, int * length)
+{
+  static char *empty_string[0];
+  char *base;
+  int lorig;
+
+  /* Zero size array gives internal unit len of 0.  Nothing to read. */
+  if (dtp->internal_unit_len == 0
+      && dtp->u.p.current_unit->pad_status == PAD_NO)
+    hit_eof (dtp);
+
+  /* If we have seen an eor previously, return a length of 0.  The
+     caller is responsible for correctly padding the input field.  */
+  if (dtp->u.p.sf_seen_eor)
+    {
+      *length = 0;
+      /* Just return something that isn't a NULL pointer, otherwise the
+         caller thinks an error occured.  */
+      return (char*) empty_string;
+    }
+
+  lorig = *length;
+  if (is_char4_unit(dtp))
+    {
+      int i;
+      gfc_char4_t *p = (gfc_char4_t *) mem_alloc_r4 (dtp->u.p.current_unit->s,
+                       length);
+      base = fbuf_alloc (dtp->u.p.current_unit, lorig);
+      for (i = 0; i < *length; i++, p++)
+       base[i] = *p > 255 ? '?' : (unsigned char) *p;
+    }
+  else
+    base = mem_alloc_r (dtp->u.p.current_unit->s, length);
+
+  if (unlikely (lorig > *length))
+    {
+      hit_eof (dtp);
+      return NULL;
+    }
+
+  dtp->u.p.current_unit->bytes_left -= *length;
+
+  if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
+    dtp->u.p.size_used += (GFC_IO_INT) *length;
+
+  return base;
+
+}
+
+/* When reading sequential formatted records we have a problem.  We
+   don't know how long the line is until we read the trailing newline,
+   and we don't want to read too much.  If we read too much, we might
+   have to do a physical seek backwards depending on how much data is
+   present, and devices like terminals aren't seekable and would cause
+   an I/O error.
+
+   Given this, the solution is to read a byte at a time, stopping if
+   we hit the newline.  For small allocations, we use a static buffer.
+   For larger allocations, we are forced to allocate memory on the
+   heap.  Hopefully this won't happen very often.  */
+
+/* Read sequential file - external unit */
+
+static char *
+read_sf (st_parameter_dt *dtp, int * length)
+{
+  static char *empty_string[0];
+  int q, q2;
+  int n, lorig, seen_comma;
+
+  /* If we have seen an eor previously, return a length of 0.  The
+     caller is responsible for correctly padding the input field.  */
+  if (dtp->u.p.sf_seen_eor)
+    {
+      *length = 0;
+      /* Just return something that isn't a NULL pointer, otherwise the
+         caller thinks an error occured.  */
+      return (char*) empty_string;
+    }
+
+  n = seen_comma = 0;
+
+  /* Read data into format buffer and scan through it.  */
+  lorig = *length;
+
+  while (n < *length)
+    {
+      q = fbuf_getc (dtp->u.p.current_unit);
+      if (q == EOF)
+       break;
+      else if (q == '\n' || q == '\r')
+       {
+         /* Unexpected end of line. Set the position.  */
+         dtp->u.p.sf_seen_eor = 1;
+
+         /* If we see an EOR during non-advancing I/O, we need to skip
+            the rest of the I/O statement.  Set the corresponding flag.  */
+         if (dtp->u.p.advance_status == ADVANCE_NO || dtp->u.p.seen_dollar)
+           dtp->u.p.eor_condition = 1;
+           
+         /* If we encounter a CR, it might be a CRLF.  */
+         if (q == '\r') /* Probably a CRLF */
+           {
+             /* See if there is an LF.  */
+             q2 = fbuf_getc (dtp->u.p.current_unit);
+             if (q2 == '\n')
+               dtp->u.p.sf_seen_eor = 2;
+             else if (q2 != EOF) /* Oops, seek back.  */
+               fbuf_seek (dtp->u.p.current_unit, -1, SEEK_CUR);
+           }
+
+         /* Without padding, terminate the I/O statement without assigning
+            the value.  With padding, the value still needs to be assigned,
+            so we can just continue with a short read.  */
+         if (dtp->u.p.current_unit->pad_status == PAD_NO)
+           {
+             generate_error (&dtp->common, LIBERROR_EOR, NULL);
+             return NULL;
+           }
+
+         *length = n;
+         goto done;
+       }
+      /*  Short circuit the read if a comma is found during numeric input.
+         The flag is set to zero during character reads so that commas in
+         strings are not ignored  */
+      else if (q == ',')
+       if (dtp->u.p.sf_read_comma == 1)
+         {
+            seen_comma = 1;
+           notify_std (&dtp->common, GFC_STD_GNU,
+                       "Comma in formatted numeric read.");
+           break;
+         }
+      n++;
+    }
+
+  *length = n;
+
+  /* A short read implies we hit EOF, unless we hit EOR, a comma, or
+     some other stuff. Set the relevant flags.  */
+  if (lorig > *length && !dtp->u.p.sf_seen_eor && !seen_comma)
+    {
+      if (n > 0)
+        {
+         if (dtp->u.p.advance_status == ADVANCE_NO)
+           {
+             if (dtp->u.p.current_unit->pad_status == PAD_NO)
+               {
+                 hit_eof (dtp);
+                 return NULL;
+               }
+             else
+               dtp->u.p.eor_condition = 1;
+           }
+         else
+           dtp->u.p.at_eof = 1;
+       }
+      else if (dtp->u.p.advance_status == ADVANCE_NO
+              || dtp->u.p.current_unit->pad_status == PAD_NO
+              || dtp->u.p.current_unit->bytes_left
+                   == dtp->u.p.current_unit->recl)
+       {
+         hit_eof (dtp);
+         return NULL;
+       }
+    }
+
+ done:
+
+  dtp->u.p.current_unit->bytes_left -= n;
+
+  if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
+    dtp->u.p.size_used += (GFC_IO_INT) n;
+
+  /* We can't call fbuf_getptr before the loop doing fbuf_getc, because
+     fbuf_getc might reallocate the buffer.  So return current pointer
+     minus all the advances, which is n plus up to two characters
+     of newline or comma.  */
+  return fbuf_getptr (dtp->u.p.current_unit)
+        - n - dtp->u.p.sf_seen_eor - seen_comma;
+}
+
+
+/* Function for reading the next couple of bytes from the current
+   file, advancing the current position. We return FAILURE on end of record or
+   end of file. This function is only for formatted I/O, unformatted uses
+   read_block_direct.
+
+   If the read is short, then it is because the current record does not
+   have enough data to satisfy the read request and the file was
+   opened with PAD=YES.  The caller must assume tailing spaces for
+   short reads.  */
+
+void *
+read_block_form (st_parameter_dt *dtp, int * nbytes)
+{
+  char *source;
+  int norig;
+
+  if (!is_stream_io (dtp))
+    {
+      if (dtp->u.p.current_unit->bytes_left < (gfc_offset) *nbytes)
+       {
+         /* For preconnected units with default record length, set bytes left
+          to unit record length and proceed, otherwise error.  */
+         if (dtp->u.p.current_unit->unit_number == options.stdin_unit
+             && dtp->u.p.current_unit->recl == DEFAULT_RECL)
+            dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+         else
+           {
+             if (unlikely (dtp->u.p.current_unit->pad_status == PAD_NO)
+                 && !is_internal_unit (dtp))
+               {
+                 /* Not enough data left.  */
+                 generate_error (&dtp->common, LIBERROR_EOR, NULL);
+                 return NULL;
+               }
+           }
+
+         if (unlikely (dtp->u.p.current_unit->bytes_left == 0
+             && !is_internal_unit(dtp)))
+           {
+             hit_eof (dtp);
+             return NULL;
+           }
+
+         *nbytes = dtp->u.p.current_unit->bytes_left;
+       }
+    }
+
+  if (dtp->u.p.current_unit->flags.form == FORM_FORMATTED &&
+      (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL ||
+       dtp->u.p.current_unit->flags.access == ACCESS_STREAM))
+    {
+      if (is_internal_unit (dtp))
+       source = read_sf_internal (dtp, nbytes);
+      else
+       source = read_sf (dtp, nbytes);
+
+      dtp->u.p.current_unit->strm_pos +=
+       (gfc_offset) (*nbytes + dtp->u.p.sf_seen_eor);
+      return source;
+    }
+
+  /* If we reach here, we can assume it's direct access.  */
+
+  dtp->u.p.current_unit->bytes_left -= (gfc_offset) *nbytes;
+
+  norig = *nbytes;
+  source = fbuf_read (dtp->u.p.current_unit, nbytes);
+  fbuf_seek (dtp->u.p.current_unit, *nbytes, SEEK_CUR);
+
+  if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
+    dtp->u.p.size_used += (GFC_IO_INT) *nbytes;
+
+  if (norig != *nbytes)
+    {
+      /* Short read, this shouldn't happen.  */
+      if (!dtp->u.p.current_unit->pad_status == PAD_YES)
+       {
+         generate_error (&dtp->common, LIBERROR_EOR, NULL);
+         source = NULL;
+       }
+    }
+
+  dtp->u.p.current_unit->strm_pos += (gfc_offset) *nbytes;
+
+  return source;
+}
+
+
+/* Read a block from a character(kind=4) internal unit, to be transferred into
+   a character(kind=4) variable.  Note: Portions of this code borrowed from
+   read_sf_internal.  */
+void *
+read_block_form4 (st_parameter_dt *dtp, int * nbytes)
+{
+  static gfc_char4_t *empty_string[0];
+  gfc_char4_t *source;
+  int lorig;
+
+  if (dtp->u.p.current_unit->bytes_left < (gfc_offset) *nbytes)
+    *nbytes = dtp->u.p.current_unit->bytes_left;
+
+  /* Zero size array gives internal unit len of 0.  Nothing to read. */
+  if (dtp->internal_unit_len == 0
+      && dtp->u.p.current_unit->pad_status == PAD_NO)
+    hit_eof (dtp);
+
+  /* If we have seen an eor previously, return a length of 0.  The
+     caller is responsible for correctly padding the input field.  */
+  if (dtp->u.p.sf_seen_eor)
+    {
+      *nbytes = 0;
+      /* Just return something that isn't a NULL pointer, otherwise the
+         caller thinks an error occured.  */
+      return empty_string;
+    }
+
+  lorig = *nbytes;
+  source = (gfc_char4_t *) mem_alloc_r4 (dtp->u.p.current_unit->s, nbytes);
+
+  if (unlikely (lorig > *nbytes))
+    {
+      hit_eof (dtp);
+      return NULL;
+    }
+
+  dtp->u.p.current_unit->bytes_left -= *nbytes;
+
+  if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
+    dtp->u.p.size_used += (GFC_IO_INT) *nbytes;
+
+  return source;
+}
+
+
+/* Reads a block directly into application data space.  This is for
+   unformatted files.  */
+
+static void
+read_block_direct (st_parameter_dt *dtp, void *buf, size_t nbytes)
+{
+  ssize_t to_read_record;
+  ssize_t have_read_record;
+  ssize_t to_read_subrecord;
+  ssize_t have_read_subrecord;
+  int short_record;
+
+  if (is_stream_io (dtp))
+    {
+      have_read_record = sread (dtp->u.p.current_unit->s, buf, 
+                               nbytes);
+      if (unlikely (have_read_record < 0))
+       {
+         generate_error (&dtp->common, LIBERROR_OS, NULL);
+         return;
+       }
+
+      dtp->u.p.current_unit->strm_pos += (gfc_offset) have_read_record; 
+
+      if (unlikely ((ssize_t) nbytes != have_read_record))
+       {
+         /* Short read,  e.g. if we hit EOF.  For stream files,
+          we have to set the end-of-file condition.  */
+          hit_eof (dtp);
+       }
+      return;
+    }
+
+  if (dtp->u.p.current_unit->flags.access == ACCESS_DIRECT)
+    {
+      if (dtp->u.p.current_unit->bytes_left < (gfc_offset) nbytes)
+       {
+         short_record = 1;
+         to_read_record = dtp->u.p.current_unit->bytes_left;
+         nbytes = to_read_record;
+       }
+      else
+       {
+         short_record = 0;
+         to_read_record = nbytes;
+       }
+
+      dtp->u.p.current_unit->bytes_left -= to_read_record;
+
+      to_read_record = sread (dtp->u.p.current_unit->s, buf, to_read_record);
+      if (unlikely (to_read_record < 0))
+       {
+         generate_error (&dtp->common, LIBERROR_OS, NULL);
+         return;
+       }
+
+      if (to_read_record != (ssize_t) nbytes)  
+       {
+         /* Short read, e.g. if we hit EOF.  Apparently, we read
+          more than was written to the last record.  */
+         return;
+       }
+
+      if (unlikely (short_record))
+       {
+         generate_error (&dtp->common, LIBERROR_SHORT_RECORD, NULL);
+       }
+      return;
+    }
+
+  /* Unformatted sequential.  We loop over the subrecords, reading
+     until the request has been fulfilled or the record has run out
+     of continuation subrecords.  */
+
+  /* Check whether we exceed the total record length.  */
+
+  if (dtp->u.p.current_unit->flags.has_recl
+      && ((gfc_offset) nbytes > dtp->u.p.current_unit->bytes_left))
+    {
+      to_read_record = dtp->u.p.current_unit->bytes_left;
+      short_record = 1;
+    }
+  else
+    {
+      to_read_record = nbytes;
+      short_record = 0;
+    }
+  have_read_record = 0;
+
+  while(1)
+    {
+      if (dtp->u.p.current_unit->bytes_left_subrecord
+         < (gfc_offset) to_read_record)
+       {
+         to_read_subrecord = dtp->u.p.current_unit->bytes_left_subrecord;
+         to_read_record -= to_read_subrecord;
+       }
+      else
+       {
+         to_read_subrecord = to_read_record;
+         to_read_record = 0;
+       }
+
+      dtp->u.p.current_unit->bytes_left_subrecord -= to_read_subrecord;
+
+      have_read_subrecord = sread (dtp->u.p.current_unit->s, 
+                                  buf + have_read_record, to_read_subrecord);
+      if (unlikely (have_read_subrecord) < 0)
+       {
+         generate_error (&dtp->common, LIBERROR_OS, NULL);
+         return;
+       }
+
+      have_read_record += have_read_subrecord;
+
+      if (unlikely (to_read_subrecord != have_read_subrecord))
+       {
+         /* Short read, e.g. if we hit EOF.  This means the record
+            structure has been corrupted, or the trailing record
+            marker would still be present.  */
+
+         generate_error (&dtp->common, LIBERROR_CORRUPT_FILE, NULL);
+         return;
+       }
+
+      if (to_read_record > 0)
+       {
+         if (likely (dtp->u.p.current_unit->continued))
+           {
+             next_record_r_unf (dtp, 0);
+             us_read (dtp, 1);
+           }
+         else
+           {
+             /* Let's make sure the file position is correctly pre-positioned
+                for the next read statement.  */
+
+             dtp->u.p.current_unit->current_record = 0;
+             next_record_r_unf (dtp, 0);
+             generate_error (&dtp->common, LIBERROR_SHORT_RECORD, NULL);
+             return;
+           }
+       }
+      else
+       {
+         /* Normal exit, the read request has been fulfilled.  */
+         break;
+       }
+    }
+
+  dtp->u.p.current_unit->bytes_left -= have_read_record;
+  if (unlikely (short_record))
+    {
+      generate_error (&dtp->common, LIBERROR_SHORT_RECORD, NULL);
+      return;
+    }
+  return;
+}
+
+
+/* Function for writing a block of bytes to the current file at the
+   current position, advancing the file pointer. We are given a length
+   and return a pointer to a buffer that the caller must (completely)
+   fill in.  Returns NULL on error.  */
+
+void *
+write_block (st_parameter_dt *dtp, int length)
+{
+  char *dest;
+
+  if (!is_stream_io (dtp))
+    {
+      if (dtp->u.p.current_unit->bytes_left < (gfc_offset) length)
+       {
+         /* For preconnected units with default record length, set bytes left
+            to unit record length and proceed, otherwise error.  */
+         if (likely ((dtp->u.p.current_unit->unit_number
+                      == options.stdout_unit
+                      || dtp->u.p.current_unit->unit_number
+                      == options.stderr_unit)
+                     && dtp->u.p.current_unit->recl == DEFAULT_RECL))
+           dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+         else
+           {
+             generate_error (&dtp->common, LIBERROR_EOR, NULL);
+             return NULL;
+           }
+       }
+
+      dtp->u.p.current_unit->bytes_left -= (gfc_offset) length;
+    }
+
+  if (is_internal_unit (dtp))
+    {
+      if (dtp->common.unit) /* char4 internel unit.  */
+       {
+         gfc_char4_t *dest4;
+         dest4 = mem_alloc_w4 (dtp->u.p.current_unit->s, &length);
+         if (dest4 == NULL)
+         {
+            generate_error (&dtp->common, LIBERROR_END, NULL);
+            return NULL;
+         }
+         return dest4;
+       }
+      else
+       dest = mem_alloc_w (dtp->u.p.current_unit->s, &length);
+
+      if (dest == NULL)
+       {
+          generate_error (&dtp->common, LIBERROR_END, NULL);
+          return NULL;
+       }
+
+      if (unlikely (dtp->u.p.current_unit->endfile == AT_ENDFILE))
+       generate_error (&dtp->common, LIBERROR_END, NULL);
+    }
+  else
+    {
+      dest = fbuf_alloc (dtp->u.p.current_unit, length);
+      if (dest == NULL)
+       {
+         generate_error (&dtp->common, LIBERROR_OS, NULL);
+         return NULL;
+       }
+    }
+    
+  if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
+    dtp->u.p.size_used += (GFC_IO_INT) length;
+
+  dtp->u.p.current_unit->strm_pos += (gfc_offset) length;
+
+  return dest;
+}
+
+
+/* High level interface to swrite(), taking care of errors.  This is only
+   called for unformatted files.  There are three cases to consider:
+   Stream I/O, unformatted direct, unformatted sequential.  */
+
+static try
+write_buf (st_parameter_dt *dtp, void *buf, size_t nbytes)
+{
+
+  ssize_t have_written;
+  ssize_t to_write_subrecord;
+  int short_record;
+
+  /* Stream I/O.  */
+
+  if (is_stream_io (dtp))
+    {
+      have_written = swrite (dtp->u.p.current_unit->s, buf, nbytes);
+      if (unlikely (have_written < 0))
+       {
+         generate_error (&dtp->common, LIBERROR_OS, NULL);
+         return FAILURE;
+       }
+
+      dtp->u.p.current_unit->strm_pos += (gfc_offset) have_written; 
+
+      return SUCCESS;
+    }
+
+  /* Unformatted direct access.  */
+
+  if (dtp->u.p.current_unit->flags.access == ACCESS_DIRECT)
+    {
+      if (unlikely (dtp->u.p.current_unit->bytes_left < (gfc_offset) nbytes))
+       {
+         generate_error (&dtp->common, LIBERROR_DIRECT_EOR, NULL);
+         return FAILURE;
+       }
+
+      if (buf == NULL && nbytes == 0)
+       return SUCCESS;
+
+      have_written = swrite (dtp->u.p.current_unit->s, buf, nbytes); 
+      if (unlikely (have_written < 0))
+       {
+         generate_error (&dtp->common, LIBERROR_OS, NULL);
+         return FAILURE;
+       }
+
+      dtp->u.p.current_unit->strm_pos += (gfc_offset) have_written;
+      dtp->u.p.current_unit->bytes_left -= (gfc_offset) have_written;
+
+      return SUCCESS;
+    }
+
+  /* Unformatted sequential.  */
+
+  have_written = 0;
+
+  if (dtp->u.p.current_unit->flags.has_recl
+      && (gfc_offset) nbytes > dtp->u.p.current_unit->bytes_left)
+    {
+      nbytes = dtp->u.p.current_unit->bytes_left;
+      short_record = 1;
+    }
+  else
+    {
+      short_record = 0;
+    }
+
+  while (1)
+    {
+
+      to_write_subrecord =
+       (size_t) dtp->u.p.current_unit->bytes_left_subrecord < nbytes ?
+       (size_t) dtp->u.p.current_unit->bytes_left_subrecord : nbytes;
+
+      dtp->u.p.current_unit->bytes_left_subrecord -=
+       (gfc_offset) to_write_subrecord;
+
+      to_write_subrecord = swrite (dtp->u.p.current_unit->s, 
+                                  buf + have_written, to_write_subrecord);
+      if (unlikely (to_write_subrecord < 0))
+       {
+         generate_error (&dtp->common, LIBERROR_OS, NULL);
+         return FAILURE;
+       }
+
+      dtp->u.p.current_unit->strm_pos += (gfc_offset) to_write_subrecord; 
+      nbytes -= to_write_subrecord;
+      have_written += to_write_subrecord;
+
+      if (nbytes == 0)
+       break;
+
+      next_record_w_unf (dtp, 1);
+      us_write (dtp, 1);
+    }
+  dtp->u.p.current_unit->bytes_left -= have_written;
+  if (unlikely (short_record))
+    {
+      generate_error (&dtp->common, LIBERROR_SHORT_RECORD, NULL);
+      return FAILURE;
+    }
+  return SUCCESS;
+}
+
+
+/* Master function for unformatted reads.  */
+
+static void
+unformatted_read (st_parameter_dt *dtp, bt type,
+                 void *dest, int kind, size_t size, size_t nelems)
+{
+  if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE)
+      || kind == 1)
+    {
+      if (type == BT_CHARACTER)
+       size *= GFC_SIZE_OF_CHAR_KIND(kind);
+      read_block_direct (dtp, dest, size * nelems);
+    }
+  else
+    {
+      char buffer[16];
+      char *p;
+      size_t i;
+
+      p = dest;
+
+      /* Handle wide chracters.  */
+      if (type == BT_CHARACTER && kind != 1)
+       {
+         nelems *= size;
+         size = kind;
+       }
+
+      /* Break up complex into its constituent reals.  */
+      if (type == BT_COMPLEX)
+       {
+         nelems *= 2;
+         size /= 2;
+       }
+      
+      /* By now, all complex variables have been split into their
+        constituent reals.  */
+      
+      for (i = 0; i < nelems; i++)
+       {
+         read_block_direct (dtp, buffer, size);
+         reverse_memcpy (p, buffer, size);
+         p += size;
+       }
+    }
+}
+
+
+/* Master function for unformatted writes.  NOTE: For kind=10 the size is 16
+   bytes on 64 bit machines.  The unused bytes are not initialized and never
+   used, which can show an error with memory checking analyzers like
+   valgrind.  */
+
+static void
+unformatted_write (st_parameter_dt *dtp, bt type,
+                  void *source, int kind, size_t size, size_t nelems)
+{
+  if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE) 
+      || kind == 1)
+    {
+      size_t stride = type == BT_CHARACTER ?
+                 size * GFC_SIZE_OF_CHAR_KIND(kind) : size;
+
+      write_buf (dtp, source, stride * nelems);
+    }
+  else
+    {
+      char buffer[16];
+      char *p;
+      size_t i;
+
+      p = source;
+
+      /* Handle wide chracters.  */
+      if (type == BT_CHARACTER && kind != 1)
+       {
+         nelems *= size;
+         size = kind;
+       }
+  
+      /* Break up complex into its constituent reals.  */
+      if (type == BT_COMPLEX)
+       {
+         nelems *= 2;
+         size /= 2;
+       }      
+
+      /* By now, all complex variables have been split into their
+        constituent reals.  */
+
+      for (i = 0; i < nelems; i++)
+       {
+         reverse_memcpy(buffer, p, size);
+         p += size;
+         write_buf (dtp, buffer, size);
+       }
+    }
+}
+
+
+/* Return a pointer to the name of a type.  */
+
+const char *
+type_name (bt type)
+{
+  const char *p;
+
+  switch (type)
+    {
+    case BT_INTEGER:
+      p = "INTEGER";
+      break;
+    case BT_LOGICAL:
+      p = "LOGICAL";
+      break;
+    case BT_CHARACTER:
+      p = "CHARACTER";
+      break;
+    case BT_REAL:
+      p = "REAL";
+      break;
+    case BT_COMPLEX:
+      p = "COMPLEX";
+      break;
+    default:
+      internal_error (NULL, "type_name(): Bad type");
+    }
+
+  return p;
+}
+
+
+/* Write a constant string to the output.
+   This is complicated because the string can have doubled delimiters
+   in it.  The length in the format node is the true length.  */
+
+static void
+write_constant_string (st_parameter_dt *dtp, const fnode *f)
+{
+  char c, delimiter, *p, *q;
+  int length; 
+
+  length = f->u.string.length;
+  if (length == 0)
+    return;
+
+  p = write_block (dtp, length);
+  if (p == NULL)
+    return;
+    
+  q = f->u.string.p;
+  delimiter = q[-1];
+
+  for (; length > 0; length--)
+    {
+      c = *p++ = *q++;
+      if (c == delimiter && c != 'H' && c != 'h')
+       q++;                    /* Skip the doubled delimiter.  */
+    }
+}
+
+
+/* Given actual and expected types in a formatted data transfer, make
+   sure they agree.  If not, an error message is generated.  Returns
+   nonzero if something went wrong.  */
+
+static int
+require_type (st_parameter_dt *dtp, bt expected, bt actual, const fnode *f)
+{
+#define BUFLEN 100
+  char buffer[BUFLEN];
+
+  if (actual == expected)
+    return 0;
+
+  /* Adjust item_count before emitting error message.  */
+  snprintf (buffer, BUFLEN, 
+           "Expected %s for item %d in formatted transfer, got %s",
+          type_name (expected), dtp->u.p.item_count - 1, type_name (actual));
+
+  format_error (dtp, f, buffer);
+  return 1;
+}
+
+
+static int
+require_numeric_type (st_parameter_dt *dtp, bt actual, const fnode *f)
+{
+#define BUFLEN 100
+  char buffer[BUFLEN];
+
+  if (actual == BT_INTEGER || actual == BT_REAL || actual == BT_COMPLEX)
+    return 0;
+
+  /* Adjust item_count before emitting error message.  */
+  snprintf (buffer, BUFLEN, 
+           "Expected numeric type for item %d in formatted transfer, got %s",
+           dtp->u.p.item_count - 1, type_name (actual));
+
+  format_error (dtp, f, buffer);
+  return 1;
+}
+
+
+/* This function is in the main loop for a formatted data transfer
+   statement.  It would be natural to implement this as a coroutine
+   with the user program, but C makes that awkward.  We loop,
+   processing format elements.  When we actually have to transfer
+   data instead of just setting flags, we return control to the user
+   program which calls a function that supplies the address and type
+   of the next element, then comes back here to process it.  */
+
+static void
+formatted_transfer_scalar_read (st_parameter_dt *dtp, bt type, void *p, int kind,
+                               size_t size)
+{
+  int pos, bytes_used;
+  const fnode *f;
+  format_token t;
+  int n;
+  int consume_data_flag;
+
+  /* Change a complex data item into a pair of reals.  */
+
+  n = (p == NULL) ? 0 : ((type != BT_COMPLEX) ? 1 : 2);
+  if (type == BT_COMPLEX)
+    {
+      type = BT_REAL;
+      size /= 2;
+    }
+
+  /* If there's an EOR condition, we simulate finalizing the transfer
+     by doing nothing.  */
+  if (dtp->u.p.eor_condition)
+    return;
+
+  /* Set this flag so that commas in reads cause the read to complete before
+     the entire field has been read.  The next read field will start right after
+     the comma in the stream.  (Set to 0 for character reads).  */
+  dtp->u.p.sf_read_comma =
+    dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA ? 0 : 1;
+
+  for (;;)
+    {
+      /* If reversion has occurred and there is another real data item,
+        then we have to move to the next record.  */
+      if (dtp->u.p.reversion_flag && n > 0)
+       {
+         dtp->u.p.reversion_flag = 0;
+         next_record (dtp, 0);
+       }
+
+      consume_data_flag = 1;
+      if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+       break;
+
+      f = next_format (dtp);
+      if (f == NULL)
+       {
+         /* No data descriptors left.  */
+         if (unlikely (n > 0))
+           generate_error (&dtp->common, LIBERROR_FORMAT,
+               "Insufficient data descriptors in format after reversion");
+         return;
+       }
+
+      t = f->format;
+
+      bytes_used = (int)(dtp->u.p.current_unit->recl
+                  - dtp->u.p.current_unit->bytes_left);
+
+      if (is_stream_io(dtp))
+       bytes_used = 0;
+
+      switch (t)
+       {
+       case FMT_I:
+         if (n == 0)
+           goto need_read_data;
+         if (require_type (dtp, BT_INTEGER, type, f))
+           return;
+         read_decimal (dtp, f, p, kind);
+         break;
+
+       case FMT_B:
+         if (n == 0)
+           goto need_read_data;
+         if (!(compile_options.allow_std & GFC_STD_GNU)
+             && require_numeric_type (dtp, type, f))
+           return;
+         if (!(compile_options.allow_std & GFC_STD_F2008)
+              && require_type (dtp, BT_INTEGER, type, f))
+           return;
+         read_radix (dtp, f, p, kind, 2);
+         break;
+
+       case FMT_O:
+         if (n == 0)
+           goto need_read_data; 
+         if (!(compile_options.allow_std & GFC_STD_GNU)
+             && require_numeric_type (dtp, type, f))
+           return;
+         if (!(compile_options.allow_std & GFC_STD_F2008)
+              && require_type (dtp, BT_INTEGER, type, f))
+           return;
+         read_radix (dtp, f, p, kind, 8);
+         break;
+
+       case FMT_Z:
+         if (n == 0)
+           goto need_read_data;
+         if (!(compile_options.allow_std & GFC_STD_GNU)
+             && require_numeric_type (dtp, type, f))
+           return;
+         if (!(compile_options.allow_std & GFC_STD_F2008)
+              && require_type (dtp, BT_INTEGER, type, f))
+           return;
+         read_radix (dtp, f, p, kind, 16);
+         break;
+
+       case FMT_A:
+         if (n == 0)
+           goto need_read_data;
+
+         /* It is possible to have FMT_A with something not BT_CHARACTER such
+            as when writing out hollerith strings, so check both type
+            and kind before calling wide character routines.  */
+         if (type == BT_CHARACTER && kind == 4)
+           read_a_char4 (dtp, f, p, size);
+         else
+           read_a (dtp, f, p, size);
+         break;
+
+       case FMT_L:
+         if (n == 0)
+           goto need_read_data;
+         read_l (dtp, f, p, kind);
+         break;
+
+       case FMT_D:
+         if (n == 0)
+           goto need_read_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         read_f (dtp, f, p, kind);
+         break;
+
+       case FMT_E:
+         if (n == 0)
+           goto need_read_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         read_f (dtp, f, p, kind);
+         break;
+
+       case FMT_EN:
+         if (n == 0)
+           goto need_read_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         read_f (dtp, f, p, kind);
+         break;
+
+       case FMT_ES:
+         if (n == 0)
+           goto need_read_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         read_f (dtp, f, p, kind);
+         break;
+
+       case FMT_F:
+         if (n == 0)
+           goto need_read_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         read_f (dtp, f, p, kind);
+         break;
+
+       case FMT_G:
+         if (n == 0)
+           goto need_read_data;
+         switch (type)
+           {
+             case BT_INTEGER:
+               read_decimal (dtp, f, p, kind);
+               break;
+             case BT_LOGICAL:
+               read_l (dtp, f, p, kind);
+               break;
+             case BT_CHARACTER:
+               if (kind == 4)
+                 read_a_char4 (dtp, f, p, size);
+               else
+                 read_a (dtp, f, p, size);
+               break;
+             case BT_REAL:
+               read_f (dtp, f, p, kind);
+               break;
+             default:
+               internal_error (&dtp->common, "formatted_transfer(): Bad type");
+           }
+         break;
+
+       case FMT_STRING:
+         consume_data_flag = 0;
+         format_error (dtp, f, "Constant string in input format");
+         return;
+
+       /* Format codes that don't transfer data.  */
+       case FMT_X:
+       case FMT_TR:
+         consume_data_flag = 0;
+         dtp->u.p.skips += f->u.n;
+         pos = bytes_used + dtp->u.p.skips - 1;
+         dtp->u.p.pending_spaces = pos - dtp->u.p.max_pos + 1;
+         read_x (dtp, f->u.n);
+         break;
+
+       case FMT_TL:
+       case FMT_T:
+         consume_data_flag = 0;
+
+         if (f->format == FMT_TL)
+           {
+             /* Handle the special case when no bytes have been used yet.
+                Cannot go below zero. */
+             if (bytes_used == 0)
+               {
+                 dtp->u.p.pending_spaces -= f->u.n;
+                 dtp->u.p.skips -= f->u.n;
+                 dtp->u.p.skips = dtp->u.p.skips < 0 ? 0 : dtp->u.p.skips;
+               }
+
+             pos = bytes_used - f->u.n;
+           }
+         else /* FMT_T */
+           pos = f->u.n - 1;
+
+         /* Standard 10.6.1.1: excessive left tabbing is reset to the
+            left tab limit.  We do not check if the position has gone
+            beyond the end of record because a subsequent tab could
+            bring us back again.  */
+         pos = pos < 0 ? 0 : pos;
+
+         dtp->u.p.skips = dtp->u.p.skips + pos - bytes_used;
+         dtp->u.p.pending_spaces = dtp->u.p.pending_spaces
+                                   + pos - dtp->u.p.max_pos;
+         dtp->u.p.pending_spaces = dtp->u.p.pending_spaces < 0
+                                   ? 0 : dtp->u.p.pending_spaces;
+         if (dtp->u.p.skips == 0)
+           break;
+
+         /* Adjust everything for end-of-record condition */
+         if (dtp->u.p.sf_seen_eor && !is_internal_unit (dtp))
+           {
+              dtp->u.p.current_unit->bytes_left -= dtp->u.p.sf_seen_eor;
+              dtp->u.p.skips -= dtp->u.p.sf_seen_eor;
+             bytes_used = pos;
+             dtp->u.p.sf_seen_eor = 0;
+           }
+         if (dtp->u.p.skips < 0)
+           {
+              if (is_internal_unit (dtp))  
+                sseek (dtp->u.p.current_unit->s, dtp->u.p.skips, SEEK_CUR);
+              else
+                fbuf_seek (dtp->u.p.current_unit, dtp->u.p.skips, SEEK_CUR);
+             dtp->u.p.current_unit->bytes_left -= (gfc_offset) dtp->u.p.skips;
+             dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
+           }
+         else
+           read_x (dtp, dtp->u.p.skips);
+         break;
+
+       case FMT_S:
+         consume_data_flag = 0;
+         dtp->u.p.sign_status = SIGN_S;
+         break;
+
+       case FMT_SS:
+         consume_data_flag = 0;
+         dtp->u.p.sign_status = SIGN_SS;
+         break;
+
+       case FMT_SP:
+         consume_data_flag = 0;
+         dtp->u.p.sign_status = SIGN_SP;
+         break;
+
+       case FMT_BN:
+         consume_data_flag = 0 ;
+         dtp->u.p.blank_status = BLANK_NULL;
+         break;
+
+       case FMT_BZ:
+         consume_data_flag = 0;
+         dtp->u.p.blank_status = BLANK_ZERO;
+         break;
+
+       case FMT_DC:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->decimal_status = DECIMAL_COMMA;
+         break;
+
+       case FMT_DP:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->decimal_status = DECIMAL_POINT;
+         break;
+
+       case FMT_RC:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_COMPATIBLE;
+         break;
+
+       case FMT_RD:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_DOWN;
+         break;
+
+       case FMT_RN:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_NEAREST;
+         break;
+
+       case FMT_RP:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_PROCDEFINED;
+         break;
+
+       case FMT_RU:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_UP;
+         break;
+
+       case FMT_RZ:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_ZERO;
+         break;
+
+       case FMT_P:
+         consume_data_flag = 0;
+         dtp->u.p.scale_factor = f->u.k;
+         break;
+
+       case FMT_DOLLAR:
+         consume_data_flag = 0;
+         dtp->u.p.seen_dollar = 1;
+         break;
+
+       case FMT_SLASH:
+         consume_data_flag = 0;
+         dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
+         next_record (dtp, 0);
+         break;
+
+       case FMT_COLON:
+         /* A colon descriptor causes us to exit this loop (in
+            particular preventing another / descriptor from being
+            processed) unless there is another data item to be
+            transferred.  */
+         consume_data_flag = 0;
+         if (n == 0)
+           return;
+         break;
+
+       default:
+         internal_error (&dtp->common, "Bad format node");
+       }
+
+      /* Adjust the item count and data pointer.  */
+
+      if ((consume_data_flag > 0) && (n > 0))
+       {
+         n--;
+         p = ((char *) p) + size;
+       }
+
+      dtp->u.p.skips = 0;
+
+      pos = (int)(dtp->u.p.current_unit->recl - dtp->u.p.current_unit->bytes_left);
+      dtp->u.p.max_pos = (dtp->u.p.max_pos > pos) ? dtp->u.p.max_pos : pos;
+    }
+
+  return;
+
+  /* Come here when we need a data descriptor but don't have one.  We
+     push the current format node back onto the input, then return and
+     let the user program call us back with the data.  */
+ need_read_data:
+  unget_format (dtp, f);
+}
+
+
+static void
+formatted_transfer_scalar_write (st_parameter_dt *dtp, bt type, void *p, int kind,
+                                size_t size)
+{
+  int pos, bytes_used;
+  const fnode *f;
+  format_token t;
+  int n;
+  int consume_data_flag;
+
+  /* Change a complex data item into a pair of reals.  */
+
+  n = (p == NULL) ? 0 : ((type != BT_COMPLEX) ? 1 : 2);
+  if (type == BT_COMPLEX)
+    {
+      type = BT_REAL;
+      size /= 2;
+    }
+
+  /* If there's an EOR condition, we simulate finalizing the transfer
+     by doing nothing.  */
+  if (dtp->u.p.eor_condition)
+    return;
+
+  /* Set this flag so that commas in reads cause the read to complete before
+     the entire field has been read.  The next read field will start right after
+     the comma in the stream.  (Set to 0 for character reads).  */
+  dtp->u.p.sf_read_comma =
+    dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA ? 0 : 1;
+
+  for (;;)
+    {
+      /* If reversion has occurred and there is another real data item,
+        then we have to move to the next record.  */
+      if (dtp->u.p.reversion_flag && n > 0)
+       {
+         dtp->u.p.reversion_flag = 0;
+         next_record (dtp, 0);
+       }
+
+      consume_data_flag = 1;
+      if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+       break;
+
+      f = next_format (dtp);
+      if (f == NULL)
+       {
+         /* No data descriptors left.  */
+         if (unlikely (n > 0))
+           generate_error (&dtp->common, LIBERROR_FORMAT,
+               "Insufficient data descriptors in format after reversion");
+         return;
+       }
+
+      /* Now discharge T, TR and X movements to the right.  This is delayed
+        until a data producing format to suppress trailing spaces.  */
+        
+      t = f->format;
+      if (dtp->u.p.mode == WRITING && dtp->u.p.skips != 0
+       && ((n>0 && (  t == FMT_I  || t == FMT_B  || t == FMT_O
+                   || t == FMT_Z  || t == FMT_F  || t == FMT_E
+                   || t == FMT_EN || t == FMT_ES || t == FMT_G
+                   || t == FMT_L  || t == FMT_A  || t == FMT_D))
+           || t == FMT_STRING))
+       {
+         if (dtp->u.p.skips > 0)
+           {
+             int tmp;
+             write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces);
+             tmp = (int)(dtp->u.p.current_unit->recl
+                         - dtp->u.p.current_unit->bytes_left);
+             dtp->u.p.max_pos = 
+               dtp->u.p.max_pos > tmp ? dtp->u.p.max_pos : tmp;
+           }
+         if (dtp->u.p.skips < 0)
+           {
+              if (is_internal_unit (dtp))  
+               sseek (dtp->u.p.current_unit->s, dtp->u.p.skips, SEEK_CUR);
+              else
+                fbuf_seek (dtp->u.p.current_unit, dtp->u.p.skips, SEEK_CUR);
+             dtp->u.p.current_unit->bytes_left -= (gfc_offset) dtp->u.p.skips;
+           }
+         dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
+       }
+
+      bytes_used = (int)(dtp->u.p.current_unit->recl
+                  - dtp->u.p.current_unit->bytes_left);
+
+      if (is_stream_io(dtp))
+       bytes_used = 0;
+
+      switch (t)
+       {
+       case FMT_I:
+         if (n == 0)
+           goto need_data;
+         if (require_type (dtp, BT_INTEGER, type, f))
+           return;
+         write_i (dtp, f, p, kind);
+         break;
+
+       case FMT_B:
+         if (n == 0)
+           goto need_data;
+         if (!(compile_options.allow_std & GFC_STD_GNU)
+             && require_numeric_type (dtp, type, f))
+           return;
+         if (!(compile_options.allow_std & GFC_STD_F2008)
+              && require_type (dtp, BT_INTEGER, type, f))
+           return;
+         write_b (dtp, f, p, kind);
+         break;
+
+       case FMT_O:
+         if (n == 0)
+           goto need_data; 
+         if (!(compile_options.allow_std & GFC_STD_GNU)
+             && require_numeric_type (dtp, type, f))
+           return;
+         if (!(compile_options.allow_std & GFC_STD_F2008)
+              && require_type (dtp, BT_INTEGER, type, f))
+           return;
+         write_o (dtp, f, p, kind);
+         break;
+
+       case FMT_Z:
+         if (n == 0)
+           goto need_data;
+         if (!(compile_options.allow_std & GFC_STD_GNU)
+             && require_numeric_type (dtp, type, f))
+           return;
+         if (!(compile_options.allow_std & GFC_STD_F2008)
+              && require_type (dtp, BT_INTEGER, type, f))
+           return;
+         write_z (dtp, f, p, kind);
+         break;
+
+       case FMT_A:
+         if (n == 0)
+           goto need_data;
+
+         /* It is possible to have FMT_A with something not BT_CHARACTER such
+            as when writing out hollerith strings, so check both type
+            and kind before calling wide character routines.  */
+         if (type == BT_CHARACTER && kind == 4)
+           write_a_char4 (dtp, f, p, size);
+         else
+           write_a (dtp, f, p, size);
+         break;
+
+       case FMT_L:
+         if (n == 0)
+           goto need_data;
+         write_l (dtp, f, p, kind);
+         break;
+
+       case FMT_D:
+         if (n == 0)
+           goto need_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         write_d (dtp, f, p, kind);
+         break;
+
+       case FMT_E:
+         if (n == 0)
+           goto need_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         write_e (dtp, f, p, kind);
+         break;
+
+       case FMT_EN:
+         if (n == 0)
+           goto need_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         write_en (dtp, f, p, kind);
+         break;
+
+       case FMT_ES:
+         if (n == 0)
+           goto need_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         write_es (dtp, f, p, kind);
+         break;
+
+       case FMT_F:
+         if (n == 0)
+           goto need_data;
+         if (require_type (dtp, BT_REAL, type, f))
+           return;
+         write_f (dtp, f, p, kind);
+         break;
+
+       case FMT_G:
+         if (n == 0)
+           goto need_data;
+         switch (type)
+           {
+             case BT_INTEGER:
+               write_i (dtp, f, p, kind);
+               break;
+             case BT_LOGICAL:
+               write_l (dtp, f, p, kind);
+               break;
+             case BT_CHARACTER:
+               if (kind == 4)
+                 write_a_char4 (dtp, f, p, size);
+               else
+                 write_a (dtp, f, p, size);
+               break;
+             case BT_REAL:
+               if (f->u.real.w == 0)
+                  write_real_g0 (dtp, p, kind, f->u.real.d);
+               else
+                 write_d (dtp, f, p, kind);
+               break;
+             default:
+               internal_error (&dtp->common,
+                               "formatted_transfer(): Bad type");
+           }
+         break;
+
+       case FMT_STRING:
+         consume_data_flag = 0;
+         write_constant_string (dtp, f);
+         break;
+
+       /* Format codes that don't transfer data.  */
+       case FMT_X:
+       case FMT_TR:
+         consume_data_flag = 0;
+
+         dtp->u.p.skips += f->u.n;
+         pos = bytes_used + dtp->u.p.skips - 1;
+         dtp->u.p.pending_spaces = pos - dtp->u.p.max_pos + 1;
+         /* Writes occur just before the switch on f->format, above, so
+            that trailing blanks are suppressed, unless we are doing a
+            non-advancing write in which case we want to output the blanks
+            now.  */
+         if (dtp->u.p.advance_status == ADVANCE_NO)
+           {
+             write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces);
+             dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
+           }
+         break;
+
+       case FMT_TL:
+       case FMT_T:
+         consume_data_flag = 0;
+
+         if (f->format == FMT_TL)
+           {
+
+             /* Handle the special case when no bytes have been used yet.
+                Cannot go below zero. */
+             if (bytes_used == 0)
+               {
+                 dtp->u.p.pending_spaces -= f->u.n;
+                 dtp->u.p.skips -= f->u.n;
+                 dtp->u.p.skips = dtp->u.p.skips < 0 ? 0 : dtp->u.p.skips;
+               }
+
+             pos = bytes_used - f->u.n;
+           }
+         else /* FMT_T */
+           pos = f->u.n - dtp->u.p.pending_spaces - 1;
+
+         /* Standard 10.6.1.1: excessive left tabbing is reset to the
+            left tab limit.  We do not check if the position has gone
+            beyond the end of record because a subsequent tab could
+            bring us back again.  */
+         pos = pos < 0 ? 0 : pos;
+
+         dtp->u.p.skips = dtp->u.p.skips + pos - bytes_used;
+         dtp->u.p.pending_spaces = dtp->u.p.pending_spaces
+                                   + pos - dtp->u.p.max_pos;
+         dtp->u.p.pending_spaces = dtp->u.p.pending_spaces < 0
+                                   ? 0 : dtp->u.p.pending_spaces;
+         break;
+
+       case FMT_S:
+         consume_data_flag = 0;
+         dtp->u.p.sign_status = SIGN_S;
+         break;
+
+       case FMT_SS:
+         consume_data_flag = 0;
+         dtp->u.p.sign_status = SIGN_SS;
+         break;
+
+       case FMT_SP:
+         consume_data_flag = 0;
+         dtp->u.p.sign_status = SIGN_SP;
+         break;
+
+       case FMT_BN:
+         consume_data_flag = 0 ;
+         dtp->u.p.blank_status = BLANK_NULL;
+         break;
+
+       case FMT_BZ:
+         consume_data_flag = 0;
+         dtp->u.p.blank_status = BLANK_ZERO;
+         break;
+
+       case FMT_DC:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->decimal_status = DECIMAL_COMMA;
+         break;
+
+       case FMT_DP:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->decimal_status = DECIMAL_POINT;
+         break;
+
+       case FMT_RC:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_COMPATIBLE;
+         break;
+
+       case FMT_RD:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_DOWN;
+         break;
+
+       case FMT_RN:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_NEAREST;
+         break;
+
+       case FMT_RP:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_PROCDEFINED;
+         break;
+
+       case FMT_RU:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_UP;
+         break;
+
+       case FMT_RZ:
+         consume_data_flag = 0;
+         dtp->u.p.current_unit->round_status = ROUND_ZERO;
+         break;
+
+       case FMT_P:
+         consume_data_flag = 0;
+         dtp->u.p.scale_factor = f->u.k;
+         break;
+
+       case FMT_DOLLAR:
+         consume_data_flag = 0;
+         dtp->u.p.seen_dollar = 1;
+         break;
+
+       case FMT_SLASH:
+         consume_data_flag = 0;
+         dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
+         next_record (dtp, 0);
+         break;
+
+       case FMT_COLON:
+         /* A colon descriptor causes us to exit this loop (in
+            particular preventing another / descriptor from being
+            processed) unless there is another data item to be
+            transferred.  */
+         consume_data_flag = 0;
+         if (n == 0)
+           return;
+         break;
+
+       default:
+         internal_error (&dtp->common, "Bad format node");
+       }
+
+      /* Adjust the item count and data pointer.  */
+
+      if ((consume_data_flag > 0) && (n > 0))
+       {
+         n--;
+         p = ((char *) p) + size;
+       }
+
+      pos = (int)(dtp->u.p.current_unit->recl - dtp->u.p.current_unit->bytes_left);
+      dtp->u.p.max_pos = (dtp->u.p.max_pos > pos) ? dtp->u.p.max_pos : pos;
+    }
+
+  return;
+
+  /* Come here when we need a data descriptor but don't have one.  We
+     push the current format node back onto the input, then return and
+     let the user program call us back with the data.  */
+ need_data:
+  unget_format (dtp, f);
+}
+
+  /* This function is first called from data_init_transfer to initiate the loop
+     over each item in the format, transferring data as required.  Subsequent
+     calls to this function occur for each data item foound in the READ/WRITE
+     statement.  The item_count is incremented for each call.  Since the first
+     call is from data_transfer_init, the item_count is always one greater than
+     the actual count number of the item being transferred.  */
+
+static void
+formatted_transfer (st_parameter_dt *dtp, bt type, void *p, int kind,
+                   size_t size, size_t nelems)
+{
+  size_t elem;
+  char *tmp;
+
+  tmp = (char *) p;
+  size_t stride = type == BT_CHARACTER ?
+                 size * GFC_SIZE_OF_CHAR_KIND(kind) : size;
+  if (dtp->u.p.mode == READING)
+    {
+      /* Big loop over all the elements.  */
+      for (elem = 0; elem < nelems; elem++)
+       {
+         dtp->u.p.item_count++;
+         formatted_transfer_scalar_read (dtp, type, tmp + stride*elem, kind, size);
+       }
+    }
+  else
+    {
+      /* Big loop over all the elements.  */
+      for (elem = 0; elem < nelems; elem++)
+       {
+         dtp->u.p.item_count++;
+         formatted_transfer_scalar_write (dtp, type, tmp + stride*elem, kind, size);
+       }
+    }
+}
+
+
+/* Data transfer entry points.  The type of the data entity is
+   implicit in the subroutine call.  This prevents us from having to
+   share a common enum with the compiler.  */
+
+void
+transfer_integer (st_parameter_dt *dtp, void *p, int kind)
+{
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    return;
+  dtp->u.p.transfer (dtp, BT_INTEGER, p, kind, kind, 1);
+}
+
+void
+transfer_integer_write (st_parameter_dt *dtp, void *p, int kind)
+{
+  transfer_integer (dtp, p, kind);
+}
+
+void
+transfer_real (st_parameter_dt *dtp, void *p, int kind)
+{
+  size_t size;
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    return;
+  size = size_from_real_kind (kind);
+  dtp->u.p.transfer (dtp, BT_REAL, p, kind, size, 1);
+}
+
+void
+transfer_real_write (st_parameter_dt *dtp, void *p, int kind)
+{
+  transfer_real (dtp, p, kind);
+}
+
+void
+transfer_logical (st_parameter_dt *dtp, void *p, int kind)
+{
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    return;
+  dtp->u.p.transfer (dtp, BT_LOGICAL, p, kind, kind, 1);
+}
+
+void
+transfer_logical_write (st_parameter_dt *dtp, void *p, int kind)
+{
+  transfer_logical (dtp, p, kind);
+}
+
+void
+transfer_character (st_parameter_dt *dtp, void *p, int len)
+{
+  static char *empty_string[0];
+
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    return;
+
+  /* Strings of zero length can have p == NULL, which confuses the
+     transfer routines into thinking we need more data elements.  To avoid
+     this, we give them a nice pointer.  */
+  if (len == 0 && p == NULL)
+    p = empty_string;
+
+  /* Set kind here to 1.  */
+  dtp->u.p.transfer (dtp, BT_CHARACTER, p, 1, len, 1);
+}
+
+void
+transfer_character_write (st_parameter_dt *dtp, void *p, int len)
+{
+  transfer_character (dtp, p, len);
+}
+
+void
+transfer_character_wide (st_parameter_dt *dtp, void *p, int len, int kind)
+{
+  static char *empty_string[0];
+
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    return;
+
+  /* Strings of zero length can have p == NULL, which confuses the
+     transfer routines into thinking we need more data elements.  To avoid
+     this, we give them a nice pointer.  */
+  if (len == 0 && p == NULL)
+    p = empty_string;
+
+  /* Here we pass the actual kind value.  */
+  dtp->u.p.transfer (dtp, BT_CHARACTER, p, kind, len, 1);
+}
+
+void
+transfer_character_wide_write (st_parameter_dt *dtp, void *p, int len, int kind)
+{
+  transfer_character_wide (dtp, p, len, kind);
+}
+
+void
+transfer_complex (st_parameter_dt *dtp, void *p, int kind)
+{
+  size_t size;
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    return;
+  size = size_from_complex_kind (kind);
+  dtp->u.p.transfer (dtp, BT_COMPLEX, p, kind, size, 1);
+}
+
+void
+transfer_complex_write (st_parameter_dt *dtp, void *p, int kind)
+{
+  transfer_complex (dtp, p, kind);
+}
+
+void
+transfer_array (st_parameter_dt *dtp, gfc_array_char *desc, int kind,
+               gfc_charlen_type charlen)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0, rank, size, n;
+  size_t tsize;
+  char *data;
+  bt iotype;
+
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    return;
+
+  iotype = (bt) GFC_DESCRIPTOR_TYPE (desc);
+  size = iotype == BT_CHARACTER ? charlen : GFC_DESCRIPTOR_SIZE (desc);
+
+  rank = GFC_DESCRIPTOR_RANK (desc);
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(desc,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(desc,n);
+
+      /* If the extent of even one dimension is zero, then the entire
+        array section contains zero elements, so we return after writing
+        a zero array record.  */
+      if (extent[n] <= 0)
+       {
+         data = NULL;
+         tsize = 0;
+         dtp->u.p.transfer (dtp, iotype, data, kind, size, tsize);
+         return;
+       }
+    }
+
+  stride0 = stride[0];
+
+  /* If the innermost dimension has a stride of 1, we can do the transfer
+     in contiguous chunks.  */
+  if (stride0 == size)
+    tsize = extent[0];
+  else
+    tsize = 1;
+
+  data = GFC_DESCRIPTOR_DATA (desc);
+
+  while (data)
+    {
+      dtp->u.p.transfer (dtp, iotype, data, kind, size, tsize);
+      data += stride0 * tsize;
+      count[0] += tsize;
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         count[n] = 0;
+         data -= stride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             data = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             data += stride[n];
+           }
+       }
+    }
+}
+
+void
+transfer_array_write (st_parameter_dt *dtp, gfc_array_char *desc, int kind,
+                     gfc_charlen_type charlen)
+{
+  transfer_array (dtp, desc, kind, charlen);
+}
+
+/* Preposition a sequential unformatted file while reading.  */
+
+static void
+us_read (st_parameter_dt *dtp, int continued)
+{
+  ssize_t n, nr;
+  GFC_INTEGER_4 i4;
+  GFC_INTEGER_8 i8;
+  gfc_offset i;
+
+  if (compile_options.record_marker == 0)
+    n = sizeof (GFC_INTEGER_4);
+  else
+    n = compile_options.record_marker;
+
+  nr = sread (dtp->u.p.current_unit->s, &i, n);
+  if (unlikely (nr < 0))
+    {
+      generate_error (&dtp->common, LIBERROR_BAD_US, NULL);
+      return;
+    }
+  else if (nr == 0)
+    {
+      hit_eof (dtp);
+      return;  /* end of file */
+    }
+  else if (unlikely (n != nr))
+    {
+      generate_error (&dtp->common, LIBERROR_BAD_US, NULL);
+      return;
+    }
+
+  /* Only GFC_CONVERT_NATIVE and GFC_CONVERT_SWAP are valid here.  */
+  if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE))
+    {
+      switch (nr)
+       {
+       case sizeof(GFC_INTEGER_4):
+         memcpy (&i4, &i, sizeof (i4));
+         i = i4;
+         break;
+
+       case sizeof(GFC_INTEGER_8):
+         memcpy (&i8, &i, sizeof (i8));
+         i = i8;
+         break;
+
+       default:
+         runtime_error ("Illegal value for record marker");
+         break;
+       }
+    }
+  else
+      switch (nr)
+       {
+       case sizeof(GFC_INTEGER_4):
+         reverse_memcpy (&i4, &i, sizeof (i4));
+         i = i4;
+         break;
+
+       case sizeof(GFC_INTEGER_8):
+         reverse_memcpy (&i8, &i, sizeof (i8));
+         i = i8;
+         break;
+
+       default:
+         runtime_error ("Illegal value for record marker");
+         break;
+       }
+
+  if (i >= 0)
+    {
+      dtp->u.p.current_unit->bytes_left_subrecord = i;
+      dtp->u.p.current_unit->continued = 0;
+    }
+  else
+    {
+      dtp->u.p.current_unit->bytes_left_subrecord = -i;
+      dtp->u.p.current_unit->continued = 1;
+    }
+
+  if (! continued)
+    dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+}
+
+
+/* Preposition a sequential unformatted file while writing.  This
+   amount to writing a bogus length that will be filled in later.  */
+
+static void
+us_write (st_parameter_dt *dtp, int continued)
+{
+  ssize_t nbytes;
+  gfc_offset dummy;
+
+  dummy = 0;
+
+  if (compile_options.record_marker == 0)
+    nbytes = sizeof (GFC_INTEGER_4);
+  else
+    nbytes = compile_options.record_marker ;
+
+  if (swrite (dtp->u.p.current_unit->s, &dummy, nbytes) != nbytes)
+    generate_error (&dtp->common, LIBERROR_OS, NULL);
+
+  /* For sequential unformatted, if RECL= was not specified in the OPEN
+     we write until we have more bytes than can fit in the subrecord
+     markers, then we write a new subrecord.  */
+
+  dtp->u.p.current_unit->bytes_left_subrecord =
+    dtp->u.p.current_unit->recl_subrecord;
+  dtp->u.p.current_unit->continued = continued;
+}
+
+
+/* Position to the next record prior to transfer.  We are assumed to
+   be before the next record.  We also calculate the bytes in the next
+   record.  */
+
+static void
+pre_position (st_parameter_dt *dtp)
+{
+  if (dtp->u.p.current_unit->current_record)
+    return;                    /* Already positioned.  */
+
+  switch (current_mode (dtp))
+    {
+    case FORMATTED_STREAM:
+    case UNFORMATTED_STREAM:
+      /* There are no records with stream I/O.  If the position was specified
+        data_transfer_init has already positioned the file. If no position
+        was specified, we continue from where we last left off.  I.e.
+        there is nothing to do here.  */
+      break;
+    
+    case UNFORMATTED_SEQUENTIAL:
+      if (dtp->u.p.mode == READING)
+       us_read (dtp, 0);
+      else
+       us_write (dtp, 0);
+
+      break;
+
+    case FORMATTED_SEQUENTIAL:
+    case FORMATTED_DIRECT:
+    case UNFORMATTED_DIRECT:
+      dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+      break;
+    }
+
+  dtp->u.p.current_unit->current_record = 1;
+}
+
+
+/* Initialize things for a data transfer.  This code is common for
+   both reading and writing.  */
+
+static void
+data_transfer_init (st_parameter_dt *dtp, int read_flag)
+{
+  unit_flags u_flags;  /* Used for creating a unit if needed.  */
+  GFC_INTEGER_4 cf = dtp->common.flags;
+  namelist_info *ionml;
+
+  ionml = ((cf & IOPARM_DT_IONML_SET) != 0) ? dtp->u.p.ionml : NULL;
+
+  memset (&dtp->u.p, 0, sizeof (dtp->u.p));
+
+  dtp->u.p.ionml = ionml;
+  dtp->u.p.mode = read_flag ? READING : WRITING;
+
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    return;
+
+  if ((cf & IOPARM_DT_HAS_SIZE) != 0)
+    dtp->u.p.size_used = 0;  /* Initialize the count.  */
+
+  dtp->u.p.current_unit = get_unit (dtp, 1);
+  if (dtp->u.p.current_unit->s == NULL)
+    {  /* Open the unit with some default flags.  */
+       st_parameter_open opp;
+       unit_convert conv;
+
+      if (dtp->common.unit < 0)
+       {
+         close_unit (dtp->u.p.current_unit);
+         dtp->u.p.current_unit = NULL;
+         generate_error (&dtp->common, LIBERROR_BAD_OPTION,
+                         "Bad unit number in statement");
+         return;
+       }
+      memset (&u_flags, '\0', sizeof (u_flags));
+      u_flags.access = ACCESS_SEQUENTIAL;
+      u_flags.action = ACTION_READWRITE;
+
+      /* Is it unformatted?  */
+      if (!(cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT
+                 | IOPARM_DT_IONML_SET)))
+       u_flags.form = FORM_UNFORMATTED;
+      else
+       u_flags.form = FORM_UNSPECIFIED;
+
+      u_flags.delim = DELIM_UNSPECIFIED;
+      u_flags.blank = BLANK_UNSPECIFIED;
+      u_flags.pad = PAD_UNSPECIFIED;
+      u_flags.decimal = DECIMAL_UNSPECIFIED;
+      u_flags.encoding = ENCODING_UNSPECIFIED;
+      u_flags.async = ASYNC_UNSPECIFIED;
+      u_flags.round = ROUND_UNSPECIFIED;
+      u_flags.sign = SIGN_UNSPECIFIED;
+
+      u_flags.status = STATUS_UNKNOWN;
+
+      conv = get_unformatted_convert (dtp->common.unit);
+
+      if (conv == GFC_CONVERT_NONE)
+       conv = compile_options.convert;
+
+      /* We use big_endian, which is 0 on little-endian machines
+        and 1 on big-endian machines.  */
+      switch (conv)
+       {
+       case GFC_CONVERT_NATIVE:
+       case GFC_CONVERT_SWAP:
+         break;
+        
+       case GFC_CONVERT_BIG:
+         conv = big_endian ? GFC_CONVERT_NATIVE : GFC_CONVERT_SWAP;
+         break;
+      
+       case GFC_CONVERT_LITTLE:
+         conv = big_endian ? GFC_CONVERT_SWAP : GFC_CONVERT_NATIVE;
+         break;
+        
+       default:
+         internal_error (&opp.common, "Illegal value for CONVERT");
+         break;
+       }
+
+      u_flags.convert = conv;
+
+      opp.common = dtp->common;
+      opp.common.flags &= IOPARM_COMMON_MASK;
+      dtp->u.p.current_unit = new_unit (&opp, dtp->u.p.current_unit, &u_flags);
+      dtp->common.flags &= ~IOPARM_COMMON_MASK;
+      dtp->common.flags |= (opp.common.flags & IOPARM_COMMON_MASK);
+      if (dtp->u.p.current_unit == NULL)
+       return;
+    }
+
+  /* Check the action.  */
+
+  if (read_flag && dtp->u.p.current_unit->flags.action == ACTION_WRITE)
+    {
+      generate_error (&dtp->common, LIBERROR_BAD_ACTION,
+                     "Cannot read from file opened for WRITE");
+      return;
+    }
+
+  if (!read_flag && dtp->u.p.current_unit->flags.action == ACTION_READ)
+    {
+      generate_error (&dtp->common, LIBERROR_BAD_ACTION,
+                     "Cannot write to file opened for READ");
+      return;
+    }
+
+  dtp->u.p.first_item = 1;
+
+  /* Check the format.  */
+
+  if ((cf & IOPARM_DT_HAS_FORMAT) != 0)
+    parse_format (dtp);
+
+  if (dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED
+      && (cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT))
+        != 0)
+    {
+      generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                     "Format present for UNFORMATTED data transfer");
+      return;
+    }
+
+  if ((cf & IOPARM_DT_HAS_NAMELIST_NAME) != 0 && dtp->u.p.ionml != NULL)
+     {
+       if ((cf & IOPARM_DT_HAS_FORMAT) != 0)
+          generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                   "A format cannot be specified with a namelist");
+     }
+  else if (dtp->u.p.current_unit->flags.form == FORM_FORMATTED &&
+          !(cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT)))
+    {
+      generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                     "Missing format for FORMATTED data transfer");
+    }
+
+  if (is_internal_unit (dtp)
+      && dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED)
+    {
+      generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                     "Internal file cannot be accessed by UNFORMATTED "
+                     "data transfer");
+      return;
+    }
+
+  /* Check the record or position number.  */
+
+  if (dtp->u.p.current_unit->flags.access == ACCESS_DIRECT
+      && (cf & IOPARM_DT_HAS_REC) == 0)
+    {
+      generate_error (&dtp->common, LIBERROR_MISSING_OPTION,
+                     "Direct access data transfer requires record number");
+      return;
+    }
+
+  if (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL)
+    {
+      if ((cf & IOPARM_DT_HAS_REC) != 0)
+       {
+         generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                       "Record number not allowed for sequential access "
+                       "data transfer");
+         return;
+       }
+
+      if (dtp->u.p.current_unit->endfile == AFTER_ENDFILE)
+       {
+         generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                       "Sequential READ or WRITE not allowed after "
+                       "EOF marker, possibly use REWIND or BACKSPACE");
+         return;
+       }
+
+    }
+  /* Process the ADVANCE option.  */
+
+  dtp->u.p.advance_status
+    = !(cf & IOPARM_DT_HAS_ADVANCE) ? ADVANCE_UNSPECIFIED :
+      find_option (&dtp->common, dtp->advance, dtp->advance_len, advance_opt,
+                  "Bad ADVANCE parameter in data transfer statement");
+
+  if (dtp->u.p.advance_status != ADVANCE_UNSPECIFIED)
+    {
+      if (dtp->u.p.current_unit->flags.access == ACCESS_DIRECT)
+       {
+         generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                         "ADVANCE specification conflicts with sequential "
+                         "access");
+         return;
+       }
+
+      if (is_internal_unit (dtp))
+       {
+         generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                         "ADVANCE specification conflicts with internal file");
+         return;
+       }
+
+      if ((cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT))
+         != IOPARM_DT_HAS_FORMAT)
+       {
+         generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                         "ADVANCE specification requires an explicit format");
+         return;
+       }
+    }
+
+  if (read_flag)
+    {
+      dtp->u.p.current_unit->previous_nonadvancing_write = 0;
+
+      if ((cf & IOPARM_EOR) != 0 && dtp->u.p.advance_status != ADVANCE_NO)
+       {
+         generate_error (&dtp->common, LIBERROR_MISSING_OPTION,
+                         "EOR specification requires an ADVANCE specification "
+                         "of NO");
+         return;
+       }
+
+      if ((cf & IOPARM_DT_HAS_SIZE) != 0 
+         && dtp->u.p.advance_status != ADVANCE_NO)
+       {
+         generate_error (&dtp->common, LIBERROR_MISSING_OPTION,
+                         "SIZE specification requires an ADVANCE "
+                         "specification of NO");
+         return;
+       }
+    }
+  else
+    {                          /* Write constraints.  */
+      if ((cf & IOPARM_END) != 0)
+       {
+         generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                         "END specification cannot appear in a write "
+                         "statement");
+         return;
+       }
+
+      if ((cf & IOPARM_EOR) != 0)
+       {
+         generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                         "EOR specification cannot appear in a write "
+                         "statement");
+         return;
+       }
+
+      if ((cf & IOPARM_DT_HAS_SIZE) != 0)
+       {
+         generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                         "SIZE specification cannot appear in a write "
+                         "statement");
+         return;
+       }
+    }
+
+  if (dtp->u.p.advance_status == ADVANCE_UNSPECIFIED)
+    dtp->u.p.advance_status = ADVANCE_YES;
+
+  /* Check the decimal mode.  */
+  dtp->u.p.current_unit->decimal_status
+       = !(cf & IOPARM_DT_HAS_DECIMAL) ? DECIMAL_UNSPECIFIED :
+         find_option (&dtp->common, dtp->decimal, dtp->decimal_len,
+                       decimal_opt, "Bad DECIMAL parameter in data transfer "
+                       "statement");
+
+  if (dtp->u.p.current_unit->decimal_status == DECIMAL_UNSPECIFIED)
+       dtp->u.p.current_unit->decimal_status = dtp->u.p.current_unit->flags.decimal;
+
+  /* Check the round mode.  */
+  dtp->u.p.current_unit->round_status
+       = !(cf & IOPARM_DT_HAS_ROUND) ? ROUND_UNSPECIFIED :
+         find_option (&dtp->common, dtp->round, dtp->round_len,
+                       round_opt, "Bad ROUND parameter in data transfer "
+                       "statement");
+
+  if (dtp->u.p.current_unit->round_status == ROUND_UNSPECIFIED)
+       dtp->u.p.current_unit->round_status = dtp->u.p.current_unit->flags.round;
+
+  /* Check the sign mode. */
+  dtp->u.p.sign_status
+       = !(cf & IOPARM_DT_HAS_SIGN) ? SIGN_UNSPECIFIED :
+         find_option (&dtp->common, dtp->sign, dtp->sign_len, sign_opt,
+                       "Bad SIGN parameter in data transfer statement");
+  
+  if (dtp->u.p.sign_status == SIGN_UNSPECIFIED)
+       dtp->u.p.sign_status = dtp->u.p.current_unit->flags.sign;
+
+  /* Check the blank mode.  */
+  dtp->u.p.blank_status
+       = !(cf & IOPARM_DT_HAS_BLANK) ? BLANK_UNSPECIFIED :
+         find_option (&dtp->common, dtp->blank, dtp->blank_len,
+                       blank_opt,
+                       "Bad BLANK parameter in data transfer statement");
+  
+  if (dtp->u.p.blank_status == BLANK_UNSPECIFIED)
+       dtp->u.p.blank_status = dtp->u.p.current_unit->flags.blank;
+
+  /* Check the delim mode.  */
+  dtp->u.p.current_unit->delim_status
+       = !(cf & IOPARM_DT_HAS_DELIM) ? DELIM_UNSPECIFIED :
+         find_option (&dtp->common, dtp->delim, dtp->delim_len,
+         delim_opt, "Bad DELIM parameter in data transfer statement");
+  
+  if (dtp->u.p.current_unit->delim_status == DELIM_UNSPECIFIED)
+    dtp->u.p.current_unit->delim_status = dtp->u.p.current_unit->flags.delim;
+
+  /* Check the pad mode.  */
+  dtp->u.p.current_unit->pad_status
+       = !(cf & IOPARM_DT_HAS_PAD) ? PAD_UNSPECIFIED :
+         find_option (&dtp->common, dtp->pad, dtp->pad_len, pad_opt,
+                       "Bad PAD parameter in data transfer statement");
+  
+  if (dtp->u.p.current_unit->pad_status == PAD_UNSPECIFIED)
+       dtp->u.p.current_unit->pad_status = dtp->u.p.current_unit->flags.pad;
+
+  /* Check to see if we might be reading what we wrote before  */
+
+  if (dtp->u.p.mode != dtp->u.p.current_unit->mode
+      && !is_internal_unit (dtp))
+    {
+      int pos = fbuf_reset (dtp->u.p.current_unit);
+      if (pos != 0)
+        sseek (dtp->u.p.current_unit->s, pos, SEEK_CUR);
+      sflush(dtp->u.p.current_unit->s);
+    }
+
+  /* Check the POS= specifier: that it is in range and that it is used with a
+     unit that has been connected for STREAM access. F2003 9.5.1.10.  */
+  
+  if (((cf & IOPARM_DT_HAS_POS) != 0))
+    {
+      if (is_stream_io (dtp))
+        {
+          
+          if (dtp->pos <= 0)
+            {
+              generate_error (&dtp->common, LIBERROR_BAD_OPTION,
+                              "POS=specifier must be positive");
+              return;
+            }
+          
+          if (dtp->pos >= dtp->u.p.current_unit->maxrec)
+            {
+              generate_error (&dtp->common, LIBERROR_BAD_OPTION,
+                              "POS=specifier too large");
+              return;
+            }
+          
+          dtp->rec = dtp->pos;
+          
+          if (dtp->u.p.mode == READING)
+            {
+              /* Reset the endfile flag; if we hit EOF during reading
+                 we'll set the flag and generate an error at that point
+                 rather than worrying about it here.  */
+              dtp->u.p.current_unit->endfile = NO_ENDFILE;
+            }
+         
+          if (dtp->pos != dtp->u.p.current_unit->strm_pos)
+            {
+              fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode);
+              if (sseek (dtp->u.p.current_unit->s, dtp->pos - 1, SEEK_SET) < 0)
+                {
+                  generate_error (&dtp->common, LIBERROR_OS, NULL);
+                  return;
+                }
+              dtp->u.p.current_unit->strm_pos = dtp->pos;
+            }
+        }
+      else
+        {
+          generate_error (&dtp->common, LIBERROR_BAD_OPTION,
+                          "POS=specifier not allowed, "
+                          "Try OPEN with ACCESS='stream'");
+          return;
+        }
+    }
+  
+
+  /* Sanity checks on the record number.  */
+  if ((cf & IOPARM_DT_HAS_REC) != 0)
+    {
+      if (dtp->rec <= 0)
+       {
+         generate_error (&dtp->common, LIBERROR_BAD_OPTION,
+                         "Record number must be positive");
+         return;
+       }
+
+      if (dtp->rec >= dtp->u.p.current_unit->maxrec)
+       {
+         generate_error (&dtp->common, LIBERROR_BAD_OPTION,
+                         "Record number too large");
+         return;
+       }
+
+      /* Make sure format buffer is reset.  */
+      if (dtp->u.p.current_unit->flags.form == FORM_FORMATTED)
+        fbuf_reset (dtp->u.p.current_unit);
+
+
+      /* Check whether the record exists to be read.  Only
+        a partial record needs to exist.  */
+
+      if (dtp->u.p.mode == READING && (dtp->rec - 1)
+         * dtp->u.p.current_unit->recl >= ssize (dtp->u.p.current_unit->s))
+       {
+         generate_error (&dtp->common, LIBERROR_BAD_OPTION,
+                         "Non-existing record number");
+         return;
+       }
+
+      /* Position the file.  */
+      if (sseek (dtp->u.p.current_unit->s, (gfc_offset) (dtp->rec - 1)
+                 * dtp->u.p.current_unit->recl, SEEK_SET) < 0)
+        {
+          generate_error (&dtp->common, LIBERROR_OS, NULL);
+          return;
+        }
+
+      /* TODO: This is required to maintain compatibility between
+         4.3 and 4.4 runtime. Remove when ABI changes from 4.3 */
+
+      if (is_stream_io (dtp))
+        dtp->u.p.current_unit->strm_pos = dtp->rec;
+
+      /* TODO: Un-comment this code when ABI changes from 4.3.
+      if (dtp->u.p.current_unit->flags.access == ACCESS_STREAM)
+       {
+         generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+                     "Record number not allowed for stream access "
+                     "data transfer");
+         return;
+       }  */
+    }
+
+  /* Bugware for badly written mixed C-Fortran I/O.  */
+  if (!is_internal_unit (dtp))
+    flush_if_preconnected(dtp->u.p.current_unit->s);
+
+  dtp->u.p.current_unit->mode = dtp->u.p.mode;
+
+  /* Set the maximum position reached from the previous I/O operation.  This
+     could be greater than zero from a previous non-advancing write.  */
+  dtp->u.p.max_pos = dtp->u.p.current_unit->saved_pos;
+
+  pre_position (dtp);
+  
+
+  /* Set up the subroutine that will handle the transfers.  */
+
+  if (read_flag)
+    {
+      if (dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED)
+       dtp->u.p.transfer = unformatted_read;
+      else
+       {
+         if ((cf & IOPARM_DT_LIST_FORMAT) != 0)
+           {
+               dtp->u.p.last_char = EOF - 1;
+               dtp->u.p.transfer = list_formatted_read;
+           }
+         else
+           dtp->u.p.transfer = formatted_transfer;
+       }
+    }
+  else
+    {
+      if (dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED)
+       dtp->u.p.transfer = unformatted_write;
+      else
+       {
+         if ((cf & IOPARM_DT_LIST_FORMAT) != 0)
+           dtp->u.p.transfer = list_formatted_write;
+         else
+           dtp->u.p.transfer = formatted_transfer;
+       }
+    }
+
+  /* Make sure that we don't do a read after a nonadvancing write.  */
+
+  if (read_flag)
+    {
+      if (dtp->u.p.current_unit->read_bad && !is_stream_io (dtp))
+       {
+         generate_error (&dtp->common, LIBERROR_BAD_OPTION,
+                         "Cannot READ after a nonadvancing WRITE");
+         return;
+       }
+    }
+  else
+    {
+      if (dtp->u.p.advance_status == ADVANCE_YES && !dtp->u.p.seen_dollar)
+       dtp->u.p.current_unit->read_bad = 1;
+    }
+
+  /* Start the data transfer if we are doing a formatted transfer.  */
+  if (dtp->u.p.current_unit->flags.form == FORM_FORMATTED
+      && ((cf & (IOPARM_DT_LIST_FORMAT | IOPARM_DT_HAS_NAMELIST_NAME)) == 0)
+      && dtp->u.p.ionml == NULL)
+    formatted_transfer (dtp, 0, NULL, 0, 0, 1);
+}
+
+/* Initialize an array_loop_spec given the array descriptor.  The function
+   returns the index of the last element of the array, and also returns
+   starting record, where the first I/O goes to (necessary in case of
+   negative strides).  */
+   
+gfc_offset
+init_loop_spec (gfc_array_char *desc, array_loop_spec *ls,
+               gfc_offset *start_record)
+{
+  int rank = GFC_DESCRIPTOR_RANK(desc);
+  int i;
+  gfc_offset index; 
+  int empty;
+
+  empty = 0;
+  index = 1;
+  *start_record = 0;
+
+  for (i=0; i<rank; i++)
+    {
+      ls[i].idx = GFC_DESCRIPTOR_LBOUND(desc,i);
+      ls[i].start = GFC_DESCRIPTOR_LBOUND(desc,i);
+      ls[i].end = GFC_DESCRIPTOR_UBOUND(desc,i);
+      ls[i].step = GFC_DESCRIPTOR_STRIDE(desc,i);
+      empty = empty || (GFC_DESCRIPTOR_UBOUND(desc,i) 
+                       < GFC_DESCRIPTOR_LBOUND(desc,i));
+
+      if (GFC_DESCRIPTOR_STRIDE(desc,i) > 0)
+       {
+         index += (GFC_DESCRIPTOR_EXTENT(desc,i) - 1)
+           * GFC_DESCRIPTOR_STRIDE(desc,i);
+       }
+      else
+       {
+         index -= (GFC_DESCRIPTOR_EXTENT(desc,i) - 1)
+           * GFC_DESCRIPTOR_STRIDE(desc,i);
+         *start_record -= (GFC_DESCRIPTOR_EXTENT(desc,i) - 1)
+           * GFC_DESCRIPTOR_STRIDE(desc,i);
+       }
+    }
+
+  if (empty)
+    return 0;
+  else
+    return index;
+}
+
+/* Determine the index to the next record in an internal unit array by
+   by incrementing through the array_loop_spec.  */
+   
+gfc_offset
+next_array_record (st_parameter_dt *dtp, array_loop_spec *ls, int *finished)
+{
+  int i, carry;
+  gfc_offset index;
+  
+  carry = 1;
+  index = 0;
+
+  for (i = 0; i < dtp->u.p.current_unit->rank; i++)
+    {
+      if (carry)
+        {
+          ls[i].idx++;
+          if (ls[i].idx > ls[i].end)
+            {
+              ls[i].idx = ls[i].start;
+              carry = 1;
+            }
+          else
+            carry = 0;
+        }
+      index = index + (ls[i].idx - ls[i].start) * ls[i].step;
+    }
+
+  *finished = carry;
+
+  return index;
+}
+
+
+
+/* Skip to the end of the current record, taking care of an optional
+   record marker of size bytes.  If the file is not seekable, we
+   read chunks of size MAX_READ until we get to the right
+   position.  */
+
+static void
+skip_record (st_parameter_dt *dtp, ssize_t bytes)
+{
+  ssize_t rlength, readb;
+  static const ssize_t MAX_READ = 4096;
+  char p[MAX_READ];
+
+  dtp->u.p.current_unit->bytes_left_subrecord += bytes;
+  if (dtp->u.p.current_unit->bytes_left_subrecord == 0)
+    return;
+
+  /* Direct access files do not generate END conditions,
+     only I/O errors.  */
+  if (sseek (dtp->u.p.current_unit->s, 
+            dtp->u.p.current_unit->bytes_left_subrecord, SEEK_CUR) < 0)
+    {
+      /* Seeking failed, fall back to seeking by reading data.  */
+      while (dtp->u.p.current_unit->bytes_left_subrecord > 0)
+       {
+         rlength = 
+           (MAX_READ < dtp->u.p.current_unit->bytes_left_subrecord) ?
+           MAX_READ : dtp->u.p.current_unit->bytes_left_subrecord;
+
+         readb = sread (dtp->u.p.current_unit->s, p, rlength);
+         if (readb < 0)
+           {
+             generate_error (&dtp->common, LIBERROR_OS, NULL);
+             return;
+           }
+
+         dtp->u.p.current_unit->bytes_left_subrecord -= readb;
+       }
+      return;
+    }
+  dtp->u.p.current_unit->bytes_left_subrecord = 0;
+}
+
+
+/* Advance to the next record reading unformatted files, taking
+   care of subrecords.  If complete_record is nonzero, we loop
+   until all subrecords are cleared.  */
+
+static void
+next_record_r_unf (st_parameter_dt *dtp, int complete_record)
+{
+  size_t bytes;
+
+  bytes =  compile_options.record_marker == 0 ?
+    sizeof (GFC_INTEGER_4) : compile_options.record_marker;
+
+  while(1)
+    {
+
+      /* Skip over tail */
+
+      skip_record (dtp, bytes);
+
+      if ( ! (complete_record && dtp->u.p.current_unit->continued))
+       return;
+
+      us_read (dtp, 1);
+    }
+}
+
+
+static gfc_offset
+min_off (gfc_offset a, gfc_offset b)
+{
+  return (a < b ? a : b);
+}
+
+
+/* Space to the next record for read mode.  */
+
+static void
+next_record_r (st_parameter_dt *dtp, int done)
+{
+  gfc_offset record;
+  int bytes_left;
+  char p;
+  int cc;
+
+  switch (current_mode (dtp))
+    {
+    /* No records in unformatted STREAM I/O.  */
+    case UNFORMATTED_STREAM:
+      return;
+    
+    case UNFORMATTED_SEQUENTIAL:
+      next_record_r_unf (dtp, 1);
+      dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+      break;
+
+    case FORMATTED_DIRECT:
+    case UNFORMATTED_DIRECT:
+      skip_record (dtp, dtp->u.p.current_unit->bytes_left);
+      break;
+
+    case FORMATTED_STREAM:
+    case FORMATTED_SEQUENTIAL:
+      /* read_sf has already terminated input because of an '\n', or
+         we have hit EOF.  */
+      if (dtp->u.p.sf_seen_eor)
+       {
+         dtp->u.p.sf_seen_eor = 0;
+         break;
+       }
+
+      if (is_internal_unit (dtp))
+       {
+         if (is_array_io (dtp))
+           {
+             int finished;
+
+             record = next_array_record (dtp, dtp->u.p.current_unit->ls,
+                                         &finished);
+             if (!done && finished)
+               hit_eof (dtp);
+
+             /* Now seek to this record.  */
+             record = record * dtp->u.p.current_unit->recl;
+             if (sseek (dtp->u.p.current_unit->s, record, SEEK_SET) < 0)
+               {
+                 generate_error (&dtp->common, LIBERROR_INTERNAL_UNIT, NULL);
+                 break;
+               }
+             dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+           }
+         else  
+           {
+             bytes_left = (int) dtp->u.p.current_unit->bytes_left;
+             bytes_left = min_off (bytes_left, 
+                     ssize (dtp->u.p.current_unit->s)
+                     - stell (dtp->u.p.current_unit->s));
+             if (sseek (dtp->u.p.current_unit->s, 
+                        bytes_left, SEEK_CUR) < 0)
+               {
+                 generate_error (&dtp->common, LIBERROR_INTERNAL_UNIT, NULL);
+                 break;
+               }
+             dtp->u.p.current_unit->bytes_left
+               = dtp->u.p.current_unit->recl;
+           } 
+         break;
+       }
+      else 
+       {
+         do
+           {
+              errno = 0;
+              cc = fbuf_getc (dtp->u.p.current_unit);
+             if (cc == EOF) 
+               {
+                  if (errno != 0)
+                    generate_error (&dtp->common, LIBERROR_OS, NULL);
+                 else
+                   {
+                     if (is_stream_io (dtp)
+                         || dtp->u.p.current_unit->pad_status == PAD_NO
+                         || dtp->u.p.current_unit->bytes_left
+                            == dtp->u.p.current_unit->recl)
+                       hit_eof (dtp);
+                   }
+                 break;
+                }
+             
+             if (is_stream_io (dtp))
+               dtp->u.p.current_unit->strm_pos++;
+              
+              p = (char) cc;
+           }
+         while (p != '\n');
+       }
+      break;
+    }
+}
+
+
+/* Small utility function to write a record marker, taking care of
+   byte swapping and of choosing the correct size.  */
+
+static int
+write_us_marker (st_parameter_dt *dtp, const gfc_offset buf)
+{
+  size_t len;
+  GFC_INTEGER_4 buf4;
+  GFC_INTEGER_8 buf8;
+  char p[sizeof (GFC_INTEGER_8)];
+
+  if (compile_options.record_marker == 0)
+    len = sizeof (GFC_INTEGER_4);
+  else
+    len = compile_options.record_marker;
+
+  /* Only GFC_CONVERT_NATIVE and GFC_CONVERT_SWAP are valid here.  */
+  if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE))
+    {
+      switch (len)
+       {
+       case sizeof (GFC_INTEGER_4):
+         buf4 = buf;
+         return swrite (dtp->u.p.current_unit->s, &buf4, len);
+         break;
+
+       case sizeof (GFC_INTEGER_8):
+         buf8 = buf;
+         return swrite (dtp->u.p.current_unit->s, &buf8, len);
+         break;
+
+       default:
+         runtime_error ("Illegal value for record marker");
+         break;
+       }
+    }
+  else
+    {
+      switch (len)
+       {
+       case sizeof (GFC_INTEGER_4):
+         buf4 = buf;
+         reverse_memcpy (p, &buf4, sizeof (GFC_INTEGER_4));
+         return swrite (dtp->u.p.current_unit->s, p, len);
+         break;
+
+       case sizeof (GFC_INTEGER_8):
+         buf8 = buf;
+         reverse_memcpy (p, &buf8, sizeof (GFC_INTEGER_8));
+         return swrite (dtp->u.p.current_unit->s, p, len);
+         break;
+
+       default:
+         runtime_error ("Illegal value for record marker");
+         break;
+       }
+    }
+
+}
+
+/* Position to the next (sub)record in write mode for
+   unformatted sequential files.  */
+
+static void
+next_record_w_unf (st_parameter_dt *dtp, int next_subrecord)
+{
+  gfc_offset m, m_write, record_marker;
+
+  /* Bytes written.  */
+  m = dtp->u.p.current_unit->recl_subrecord
+    - dtp->u.p.current_unit->bytes_left_subrecord;
+
+  /* Write the length tail.  If we finish a record containing
+     subrecords, we write out the negative length.  */
+
+  if (dtp->u.p.current_unit->continued)
+    m_write = -m;
+  else
+    m_write = m;
+
+  if (unlikely (write_us_marker (dtp, m_write) < 0))
+    goto io_error;
+
+  if (compile_options.record_marker == 0)
+    record_marker = sizeof (GFC_INTEGER_4);
+  else
+    record_marker = compile_options.record_marker;
+
+  /* Seek to the head and overwrite the bogus length with the real
+     length.  */
+
+  if (unlikely (sseek (dtp->u.p.current_unit->s, - m - 2 * record_marker, 
+                      SEEK_CUR) < 0))
+    goto io_error;
+
+  if (next_subrecord)
+    m_write = -m;
+  else
+    m_write = m;
+
+  if (unlikely (write_us_marker (dtp, m_write) < 0))
+    goto io_error;
+
+  /* Seek past the end of the current record.  */
+
+  if (unlikely (sseek (dtp->u.p.current_unit->s, m + record_marker, 
+                      SEEK_CUR) < 0))
+    goto io_error;
+
+  return;
+
+ io_error:
+  generate_error (&dtp->common, LIBERROR_OS, NULL);
+  return;
+
+}
+
+
+/* Utility function like memset() but operating on streams. Return
+   value is same as for POSIX write().  */
+
+static ssize_t
+sset (stream * s, int c, ssize_t nbyte)
+{
+  static const int WRITE_CHUNK = 256;
+  char p[WRITE_CHUNK];
+  ssize_t bytes_left, trans;
+
+  if (nbyte < WRITE_CHUNK)
+    memset (p, c, nbyte);
+  else
+    memset (p, c, WRITE_CHUNK);
+
+  bytes_left = nbyte;
+  while (bytes_left > 0)
+    {
+      trans = (bytes_left < WRITE_CHUNK) ? bytes_left : WRITE_CHUNK;
+      trans = swrite (s, p, trans);
+      if (trans <= 0)
+       return trans;
+      bytes_left -= trans;
+    }
+              
+  return nbyte - bytes_left;
+}
+
+
+/* Position to the next record in write mode.  */
+
+static void
+next_record_w (st_parameter_dt *dtp, int done)
+{
+  gfc_offset m, record, max_pos;
+  int length;
+
+  /* Zero counters for X- and T-editing.  */
+  max_pos = dtp->u.p.max_pos;
+  dtp->u.p.max_pos = dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
+
+  switch (current_mode (dtp))
+    {
+    /* No records in unformatted STREAM I/O.  */
+    case UNFORMATTED_STREAM:
+      return;
+
+    case FORMATTED_DIRECT:
+      if (dtp->u.p.current_unit->bytes_left == 0)
+       break;
+
+      fbuf_seek (dtp->u.p.current_unit, 0, SEEK_END);
+      fbuf_flush (dtp->u.p.current_unit, WRITING);
+      if (sset (dtp->u.p.current_unit->s, ' ', 
+               dtp->u.p.current_unit->bytes_left) 
+         != dtp->u.p.current_unit->bytes_left)
+       goto io_error;
+
+      break;
+
+    case UNFORMATTED_DIRECT:
+      if (dtp->u.p.current_unit->bytes_left > 0)
+       {
+         length = (int) dtp->u.p.current_unit->bytes_left;
+         if (sset (dtp->u.p.current_unit->s, 0, length) != length)
+           goto io_error;
+       }
+      break;
+
+    case UNFORMATTED_SEQUENTIAL:
+      next_record_w_unf (dtp, 0);
+      dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+      break;
+
+    case FORMATTED_STREAM:
+    case FORMATTED_SEQUENTIAL:
+
+      if (is_internal_unit (dtp))
+       {
+         char *p;
+         if (is_array_io (dtp))
+           {
+             int finished;
+
+             length = (int) dtp->u.p.current_unit->bytes_left;
+             
+             /* If the farthest position reached is greater than current
+             position, adjust the position and set length to pad out
+             whats left.  Otherwise just pad whats left.
+             (for character array unit) */
+             m = dtp->u.p.current_unit->recl
+                       - dtp->u.p.current_unit->bytes_left;
+             if (max_pos > m)
+               {
+                 length = (int) (max_pos - m);
+                 if (sseek (dtp->u.p.current_unit->s, 
+                            length, SEEK_CUR) < 0)
+                   {
+                     generate_error (&dtp->common, LIBERROR_INTERNAL_UNIT, NULL);
+                     return;
+                   }
+                 length = (int) (dtp->u.p.current_unit->recl - max_pos);
+               }
+
+             p = write_block (dtp, length);
+             if (p == NULL)
+               return;
+
+             if (unlikely (is_char4_unit (dtp)))
+               {
+                 gfc_char4_t *p4 = (gfc_char4_t *) p;
+                 memset4 (p4, ' ', length);
+               }
+             else
+               memset (p, ' ', length);
+
+             /* Now that the current record has been padded out,
+                determine where the next record in the array is. */
+             record = next_array_record (dtp, dtp->u.p.current_unit->ls,
+                                         &finished);
+             if (finished)
+               dtp->u.p.current_unit->endfile = AT_ENDFILE;
+             
+             /* Now seek to this record */
+             record = record * dtp->u.p.current_unit->recl;
+
+             if (sseek (dtp->u.p.current_unit->s, record, SEEK_SET) < 0)
+               {
+                 generate_error (&dtp->common, LIBERROR_INTERNAL_UNIT, NULL);
+                 return;
+               }
+
+             dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+           }
+         else
+           {
+             length = 1;
+
+             /* If this is the last call to next_record move to the farthest
+                position reached and set length to pad out the remainder
+                of the record. (for character scaler unit) */
+             if (done)
+               {
+                 m = dtp->u.p.current_unit->recl
+                       - dtp->u.p.current_unit->bytes_left;
+                 if (max_pos > m)
+                   {
+                     length = (int) (max_pos - m);
+                     if (sseek (dtp->u.p.current_unit->s, 
+                                length, SEEK_CUR) < 0)
+                       {
+                         generate_error (&dtp->common, LIBERROR_INTERNAL_UNIT, NULL);
+                         return;
+                       }
+                     length = (int) (dtp->u.p.current_unit->recl - max_pos);
+                   }
+                 else
+                   length = (int) dtp->u.p.current_unit->bytes_left;
+               }
+             if (length > 0)
+               {
+                 p = write_block (dtp, length);
+                 if (p == NULL)
+                   return;
+
+                 if (unlikely (is_char4_unit (dtp)))
+                   {
+                     gfc_char4_t *p4 = (gfc_char4_t *) p;
+                     memset4 (p4, (gfc_char4_t) ' ', length);
+                   }
+                 else
+                   memset (p, ' ', length);
+               }
+           }
+       }
+      else
+       {
+#ifdef HAVE_CRLF
+         const int len = 2;
+#else
+         const int len = 1;
+#endif
+          fbuf_seek (dtp->u.p.current_unit, 0, SEEK_END);
+          char * p = fbuf_alloc (dtp->u.p.current_unit, len);
+          if (!p)
+            goto io_error;
+#ifdef HAVE_CRLF
+          *(p++) = '\r';
+#endif
+          *p = '\n';
+         if (is_stream_io (dtp))
+           {
+             dtp->u.p.current_unit->strm_pos += len;
+             if (dtp->u.p.current_unit->strm_pos
+                 < ssize (dtp->u.p.current_unit->s))
+               unit_truncate (dtp->u.p.current_unit,
+                               dtp->u.p.current_unit->strm_pos - 1,
+                               &dtp->common);
+           }
+       }
+
+      break;
+
+    io_error:
+      generate_error (&dtp->common, LIBERROR_OS, NULL);
+      break;
+    }
+}
+
+/* Position to the next record, which means moving to the end of the
+   current record.  This can happen under several different
+   conditions.  If the done flag is not set, we get ready to process
+   the next record.  */
+
+void
+next_record (st_parameter_dt *dtp, int done)
+{
+  gfc_offset fp; /* File position.  */
+
+  dtp->u.p.current_unit->read_bad = 0;
+
+  if (dtp->u.p.mode == READING)
+    next_record_r (dtp, done);
+  else
+    next_record_w (dtp, done);
+
+  if (!is_stream_io (dtp))
+    {
+      /* Since we have changed the position, set it to unspecified so
+        that INQUIRE(POSITION=) knows it needs to look into it.  */
+      if (done)
+       dtp->u.p.current_unit->flags.position = POSITION_UNSPECIFIED;
+
+      dtp->u.p.current_unit->current_record = 0;
+      if (dtp->u.p.current_unit->flags.access == ACCESS_DIRECT)
+       {
+         fp = stell (dtp->u.p.current_unit->s);
+         /* Calculate next record, rounding up partial records.  */
+         dtp->u.p.current_unit->last_record =
+           (fp + dtp->u.p.current_unit->recl - 1) /
+             dtp->u.p.current_unit->recl;
+       }
+      else
+       dtp->u.p.current_unit->last_record++;
+    }
+
+  if (!done)
+    pre_position (dtp);
+
+  fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode);
+}
+
+
+/* Finalize the current data transfer.  For a nonadvancing transfer,
+   this means advancing to the next record.  For internal units close the
+   stream associated with the unit.  */
+
+static void
+finalize_transfer (st_parameter_dt *dtp)
+{
+  GFC_INTEGER_4 cf = dtp->common.flags;
+
+  if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
+    *dtp->size = dtp->u.p.size_used;
+
+  if (dtp->u.p.eor_condition)
+    {
+      generate_error (&dtp->common, LIBERROR_EOR, NULL);
+      return;
+    }
+
+  if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+    {
+      if (dtp->u.p.current_unit && current_mode (dtp) == UNFORMATTED_SEQUENTIAL)
+       dtp->u.p.current_unit->current_record = 0;
+      return;
+    }
+
+  if ((dtp->u.p.ionml != NULL)
+      && (cf & IOPARM_DT_HAS_NAMELIST_NAME) != 0)
+    {
+       if ((cf & IOPARM_DT_NAMELIST_READ_MODE) != 0)
+        namelist_read (dtp);
+       else
+        namelist_write (dtp);
+    }
+
+  dtp->u.p.transfer = NULL;
+  if (dtp->u.p.current_unit == NULL)
+    return;
+
+  if ((cf & IOPARM_DT_LIST_FORMAT) != 0 && dtp->u.p.mode == READING)
+    {
+      finish_list_read (dtp);
+      return;
+    }
+
+  if (dtp->u.p.mode == WRITING)
+    dtp->u.p.current_unit->previous_nonadvancing_write
+      = dtp->u.p.advance_status == ADVANCE_NO;
+
+  if (is_stream_io (dtp))
+    {
+      if (dtp->u.p.current_unit->flags.form == FORM_FORMATTED
+         && dtp->u.p.advance_status != ADVANCE_NO)
+       next_record (dtp, 1);
+
+      return;
+    }
+
+  dtp->u.p.current_unit->current_record = 0;
+
+  if (!is_internal_unit (dtp) && dtp->u.p.seen_dollar)
+    {
+      fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode);
+      dtp->u.p.seen_dollar = 0;
+      return;
+    }
+
+  /* For non-advancing I/O, save the current maximum position for use in the
+     next I/O operation if needed.  */
+  if (dtp->u.p.advance_status == ADVANCE_NO)
+    {
+      int bytes_written = (int) (dtp->u.p.current_unit->recl
+       - dtp->u.p.current_unit->bytes_left);
+      dtp->u.p.current_unit->saved_pos =
+       dtp->u.p.max_pos > 0 ? dtp->u.p.max_pos - bytes_written : 0;
+      fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode);
+      return;
+    }
+  else if (dtp->u.p.current_unit->flags.form == FORM_FORMATTED 
+           && dtp->u.p.mode == WRITING && !is_internal_unit (dtp))
+      fbuf_seek (dtp->u.p.current_unit, 0, SEEK_END);    
+
+  dtp->u.p.current_unit->saved_pos = 0;
+
+  next_record (dtp, 1);
+}
+
+/* Transfer function for IOLENGTH. It doesn't actually do any
+   data transfer, it just updates the length counter.  */
+
+static void
+iolength_transfer (st_parameter_dt *dtp, bt type __attribute__((unused)), 
+                  void *dest __attribute__ ((unused)),
+                  int kind __attribute__((unused)), 
+                  size_t size, size_t nelems)
+{
+  if ((dtp->common.flags & IOPARM_DT_HAS_IOLENGTH) != 0)
+    *dtp->iolength += (GFC_IO_INT) (size * nelems);
+}
+
+
+/* Initialize the IOLENGTH data transfer. This function is in essence
+   a very much simplified version of data_transfer_init(), because it
+   doesn't have to deal with units at all.  */
+
+static void
+iolength_transfer_init (st_parameter_dt *dtp)
+{
+  if ((dtp->common.flags & IOPARM_DT_HAS_IOLENGTH) != 0)
+    *dtp->iolength = 0;
+
+  memset (&dtp->u.p, 0, sizeof (dtp->u.p));
+
+  /* Set up the subroutine that will handle the transfers.  */
+
+  dtp->u.p.transfer = iolength_transfer;
+}
+
+
+/* Library entry point for the IOLENGTH form of the INQUIRE
+   statement. The IOLENGTH form requires no I/O to be performed, but
+   it must still be a runtime library call so that we can determine
+   the iolength for dynamic arrays and such.  */
+
+extern void st_iolength (st_parameter_dt *);
+export_proto(st_iolength);
+
+void
+st_iolength (st_parameter_dt *dtp)
+{
+  library_start (&dtp->common);
+  iolength_transfer_init (dtp);
+}
+
+extern void st_iolength_done (st_parameter_dt *);
+export_proto(st_iolength_done);
+
+void
+st_iolength_done (st_parameter_dt *dtp __attribute__((unused)))
+{
+  free_ionml (dtp);
+  library_end ();
+}
+
+
+/* The READ statement.  */
+
+extern void st_read (st_parameter_dt *);
+export_proto(st_read);
+
+void
+st_read (st_parameter_dt *dtp)
+{
+  library_start (&dtp->common);
+
+  data_transfer_init (dtp, 1);
+}
+
+extern void st_read_done (st_parameter_dt *);
+export_proto(st_read_done);
+
+void
+st_read_done (st_parameter_dt *dtp)
+{
+  finalize_transfer (dtp);
+  if (is_internal_unit (dtp) || dtp->u.p.format_not_saved)
+    free_format_data (dtp->u.p.fmt);
+  free_ionml (dtp);
+  if (dtp->u.p.current_unit != NULL)
+    unlock_unit (dtp->u.p.current_unit);
+
+  free_internal_unit (dtp);
+  
+  library_end ();
+}
+
+extern void st_write (st_parameter_dt *);
+export_proto(st_write);
+
+void
+st_write (st_parameter_dt *dtp)
+{
+  library_start (&dtp->common);
+  data_transfer_init (dtp, 0);
+}
+
+extern void st_write_done (st_parameter_dt *);
+export_proto(st_write_done);
+
+void
+st_write_done (st_parameter_dt *dtp)
+{
+  finalize_transfer (dtp);
+
+  /* Deal with endfile conditions associated with sequential files.  */
+
+  if (dtp->u.p.current_unit != NULL 
+      && dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL)
+    switch (dtp->u.p.current_unit->endfile)
+      {
+      case AT_ENDFILE:         /* Remain at the endfile record.  */
+       break;
+
+      case AFTER_ENDFILE:
+       dtp->u.p.current_unit->endfile = AT_ENDFILE;    /* Just at it now.  */
+       break;
+
+      case NO_ENDFILE:
+       /* Get rid of whatever is after this record.  */
+        if (!is_internal_unit (dtp))
+          unit_truncate (dtp->u.p.current_unit, 
+                         stell (dtp->u.p.current_unit->s),
+                         &dtp->common);
+       dtp->u.p.current_unit->endfile = AT_ENDFILE;
+       break;
+      }
+
+  if (is_internal_unit (dtp) || dtp->u.p.format_not_saved)
+    free_format_data (dtp->u.p.fmt);
+  free_ionml (dtp);
+  if (dtp->u.p.current_unit != NULL)
+    unlock_unit (dtp->u.p.current_unit);
+  
+  free_internal_unit (dtp);
+
+  library_end ();
+}
+
+
+/* F2003: This is a stub for the runtime portion of the WAIT statement.  */
+void
+st_wait (st_parameter_wait *wtp __attribute__((unused)))
+{
+}
+
+
+/* Receives the scalar information for namelist objects and stores it
+   in a linked list of namelist_info types.  */
+
+extern void st_set_nml_var (st_parameter_dt *dtp, void *, char *,
+                           GFC_INTEGER_4, gfc_charlen_type, GFC_INTEGER_4);
+export_proto(st_set_nml_var);
+
+
+void
+st_set_nml_var (st_parameter_dt *dtp, void * var_addr, char * var_name,
+               GFC_INTEGER_4 len, gfc_charlen_type string_length,
+               GFC_INTEGER_4 dtype)
+{
+  namelist_info *t1 = NULL;
+  namelist_info *nml;
+  size_t var_name_len = strlen (var_name);
+
+  nml = (namelist_info*) get_mem (sizeof (namelist_info));
+
+  nml->mem_pos = var_addr;
+
+  nml->var_name = (char*) get_mem (var_name_len + 1);
+  memcpy (nml->var_name, var_name, var_name_len);
+  nml->var_name[var_name_len] = '\0';
+
+  nml->len = (int) len;
+  nml->string_length = (index_type) string_length;
+
+  nml->var_rank = (int) (dtype & GFC_DTYPE_RANK_MASK);
+  nml->size = (index_type) (dtype >> GFC_DTYPE_SIZE_SHIFT);
+  nml->type = (bt) ((dtype & GFC_DTYPE_TYPE_MASK) >> GFC_DTYPE_TYPE_SHIFT);
+
+  if (nml->var_rank > 0)
+    {
+      nml->dim = (descriptor_dimension*)
+                  get_mem (nml->var_rank * sizeof (descriptor_dimension));
+      nml->ls = (array_loop_spec*)
+                 get_mem (nml->var_rank * sizeof (array_loop_spec));
+    }
+  else
+    {
+      nml->dim = NULL;
+      nml->ls = NULL;
+    }
+
+  nml->next = NULL;
+
+  if ((dtp->common.flags & IOPARM_DT_IONML_SET) == 0)
+    {
+      dtp->common.flags |= IOPARM_DT_IONML_SET;
+      dtp->u.p.ionml = nml;
+    }
+  else
+    {
+      for (t1 = dtp->u.p.ionml; t1->next; t1 = t1->next);
+      t1->next = nml;
+    }
+}
+
+/* Store the dimensional information for the namelist object.  */
+extern void st_set_nml_var_dim (st_parameter_dt *, GFC_INTEGER_4,
+                               index_type, index_type,
+                               index_type);
+export_proto(st_set_nml_var_dim);
+
+void
+st_set_nml_var_dim (st_parameter_dt *dtp, GFC_INTEGER_4 n_dim,
+                   index_type stride, index_type lbound,
+                   index_type ubound)
+{
+  namelist_info * nml;
+  int n;
+
+  n = (int)n_dim;
+
+  for (nml = dtp->u.p.ionml; nml->next; nml = nml->next);
+
+  GFC_DIMENSION_SET(nml->dim[n],lbound,ubound,stride);
+}
+
+/* Reverse memcpy - used for byte swapping.  */
+
+void reverse_memcpy (void *dest, const void *src, size_t n)
+{
+  char *d, *s;
+  size_t i;
+
+  d = (char *) dest;
+  s = (char *) src + n - 1;
+
+  /* Write with ascending order - this is likely faster
+     on modern architectures because of write combining.  */
+  for (i=0; i<n; i++)
+      *(d++) = *(s--);
+}
+
+
+/* Once upon a time, a poor innocent Fortran program was reading a
+   file, when suddenly it hit the end-of-file (EOF).  Unfortunately
+   the OS doesn't tell whether we're at the EOF or whether we already
+   went past it.  Luckily our hero, libgfortran, keeps track of this.
+   Call this function when you detect an EOF condition.  See Section
+   9.10.2 in F2003.  */
+
+void
+hit_eof (st_parameter_dt * dtp)
+{
+  dtp->u.p.current_unit->flags.position = POSITION_APPEND;
+
+  if (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL)
+    switch (dtp->u.p.current_unit->endfile)
+      {
+      case NO_ENDFILE:
+      case AT_ENDFILE:
+        generate_error (&dtp->common, LIBERROR_END, NULL);
+       if (!is_internal_unit (dtp))
+         {
+           dtp->u.p.current_unit->endfile = AFTER_ENDFILE;
+           dtp->u.p.current_unit->current_record = 0;
+         }
+        else
+          dtp->u.p.current_unit->endfile = AT_ENDFILE;
+       break;
+        
+      case AFTER_ENDFILE:
+       generate_error (&dtp->common, LIBERROR_ENDFILE, NULL);
+       dtp->u.p.current_unit->current_record = 0;
+       break;
+      }
+  else
+    {
+      /* Non-sequential files don't have an ENDFILE record, so we
+         can't be at AFTER_ENDFILE.  */
+      dtp->u.p.current_unit->endfile = AT_ENDFILE;
+      generate_error (&dtp->common, LIBERROR_END, NULL);
+      dtp->u.p.current_unit->current_record = 0;
+    }
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/transfer128.c b/l4/pkg/libgfortran/lib/contrib/io/transfer128.c
new file mode 100644 (file)
index 0000000..d94ccac
--- /dev/null
@@ -0,0 +1,98 @@
+/* Copyright (C) 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* Note: This file needs to be a separate translation unit (.o file)
+   to make sure that for static linkage, the libquad dependence only
+   occurs if needed.  */
+
+#include "io.h"
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+
+/* The prototypes for the called procedures in transfer.c.  */
+
+extern void transfer_real (st_parameter_dt *, void *, int);
+export_proto(transfer_real);
+
+extern void transfer_real_write (st_parameter_dt *, void *, int);
+export_proto(transfer_real_write);
+
+extern void transfer_complex (st_parameter_dt *, void *, int);
+export_proto(transfer_complex);
+
+extern void transfer_complex_write (st_parameter_dt *, void *, int);
+export_proto(transfer_complex_write);
+
+
+/* The prototypes for the procedures in this file.  */
+
+extern void transfer_real128 (st_parameter_dt *, void *, int);
+export_proto(transfer_real128);
+
+extern void transfer_real128_write (st_parameter_dt *, void *, int);
+export_proto(transfer_real128_write);
+
+extern void transfer_complex128 (st_parameter_dt *, void *, int);
+export_proto(transfer_complex128);
+
+extern void transfer_complex128_write (st_parameter_dt *, void *, int);
+export_proto(transfer_complex128_write);
+
+
+/* Make sure that libquadmath is pulled in. The functions strtoflt128
+   and quadmath_snprintf are weakly referrenced in convert_real and
+   write_float; the pointer assignment with USED attribute make sure
+   that there is a non-weakref dependence if the quadmath functions
+   are used. That avoids segfault when libquadmath is statically linked.  */
+static void __attribute__((used)) *tmp1 = strtoflt128;
+static void __attribute__((used)) *tmp2 = quadmath_snprintf;
+
+void
+transfer_real128 (st_parameter_dt *dtp, void *p, int kind)
+{
+  transfer_real (dtp, p, kind);
+}
+
+
+void
+transfer_real128_write (st_parameter_dt *dtp, void *p, int kind)
+{
+  transfer_real (dtp, p, kind);
+}
+
+
+void
+transfer_complex128 (st_parameter_dt *dtp, void *p, int kind)
+{
+  transfer_complex (dtp, p, kind);
+}
+
+
+void
+transfer_complex128_write (st_parameter_dt *dtp, void *p, int kind)
+{
+  transfer_complex_write (dtp, p, kind);
+}
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/io/unit.c b/l4/pkg/libgfortran/lib/contrib/io/unit.c
new file mode 100644 (file)
index 0000000..7c71b09
--- /dev/null
@@ -0,0 +1,825 @@
+/* Copyright (C) 2002, 2003, 2005, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "io.h"
+#include "fbuf.h"
+#include "format.h"
+#include "unix.h"
+#include <stdlib.h>
+#include <string.h>
+
+
+/* IO locking rules:
+   UNIT_LOCK is a master lock, protecting UNIT_ROOT tree and UNIT_CACHE.
+   Concurrent use of different units should be supported, so
+   each unit has its own lock, LOCK.
+   Open should be atomic with its reopening of units and list_read.c
+   in several places needs find_unit another unit while holding stdin
+   unit's lock, so it must be possible to acquire UNIT_LOCK while holding
+   some unit's lock.  Therefore to avoid deadlocks, it is forbidden
+   to acquire unit's private locks while holding UNIT_LOCK, except
+   for freshly created units (where no other thread can get at their
+   address yet) or when using just trylock rather than lock operation.
+   In addition to unit's private lock each unit has a WAITERS counter
+   and CLOSED flag.  WAITERS counter must be either only
+   atomically incremented/decremented in all places (if atomic builtins
+   are supported), or protected by UNIT_LOCK in all places (otherwise).
+   CLOSED flag must be always protected by unit's LOCK.
+   After finding a unit in UNIT_CACHE or UNIT_ROOT with UNIT_LOCK held,
+   WAITERS must be incremented to avoid concurrent close from freeing
+   the unit between unlocking UNIT_LOCK and acquiring unit's LOCK.
+   Unit freeing is always done under UNIT_LOCK.  If close_unit sees any
+   WAITERS, it doesn't free the unit but instead sets the CLOSED flag
+   and the thread that decrements WAITERS to zero while CLOSED flag is
+   set is responsible for freeing it (while holding UNIT_LOCK).
+   flush_all_units operation is iterating over the unit tree with
+   increasing UNIT_NUMBER while holding UNIT_LOCK and attempting to
+   flush each unit (and therefore needs the unit's LOCK held as well).
+   To avoid deadlocks, it just trylocks the LOCK and if unsuccessful,
+   remembers the current unit's UNIT_NUMBER, unlocks UNIT_LOCK, acquires
+   unit's LOCK and after flushing reacquires UNIT_LOCK and restarts with
+   the smallest UNIT_NUMBER above the last one flushed.
+
+   If find_unit/find_or_create_unit/find_file/get_unit routines return
+   non-NULL, the returned unit has its private lock locked and when the
+   caller is done with it, it must call either unlock_unit or close_unit
+   on it.  unlock_unit or close_unit must be always called only with the
+   private lock held.  */
+
+/* Subroutines related to units */
+
+/* Unit number to be assigned when NEWUNIT is used in an OPEN statement.  */
+#define GFC_FIRST_NEWUNIT -10
+static GFC_INTEGER_4 next_available_newunit = GFC_FIRST_NEWUNIT;
+
+#define CACHE_SIZE 3
+static gfc_unit *unit_cache[CACHE_SIZE];
+gfc_offset max_offset;
+gfc_unit *unit_root;
+#ifdef __GTHREAD_MUTEX_INIT
+__gthread_mutex_t unit_lock = __GTHREAD_MUTEX_INIT;
+#else
+__gthread_mutex_t unit_lock;
+#endif
+
+/* We use these filenames for error reporting.  */
+
+static char stdin_name[] = "stdin";
+static char stdout_name[] = "stdout";
+static char stderr_name[] = "stderr";
+
+/* This implementation is based on Stefan Nilsson's article in the
+ * July 1997 Doctor Dobb's Journal, "Treaps in Java". */
+
+/* pseudo_random()-- Simple linear congruential pseudorandom number
+ * generator.  The period of this generator is 44071, which is plenty
+ * for our purposes.  */
+
+static int
+pseudo_random (void)
+{
+  static int x0 = 5341;
+
+  x0 = (22611 * x0 + 10) % 44071;
+  return x0;
+}
+
+
+/* rotate_left()-- Rotate the treap left */
+
+static gfc_unit *
+rotate_left (gfc_unit * t)
+{
+  gfc_unit *temp;
+
+  temp = t->right;
+  t->right = t->right->left;
+  temp->left = t;
+
+  return temp;
+}
+
+
+/* rotate_right()-- Rotate the treap right */
+
+static gfc_unit *
+rotate_right (gfc_unit * t)
+{
+  gfc_unit *temp;
+
+  temp = t->left;
+  t->left = t->left->right;
+  temp->right = t;
+
+  return temp;
+}
+
+
+static int
+compare (int a, int b)
+{
+  if (a < b)
+    return -1;
+  if (a > b)
+    return 1;
+
+  return 0;
+}
+
+
+/* insert()-- Recursive insertion function.  Returns the updated treap. */
+
+static gfc_unit *
+insert (gfc_unit *new, gfc_unit *t)
+{
+  int c;
+
+  if (t == NULL)
+    return new;
+
+  c = compare (new->unit_number, t->unit_number);
+
+  if (c < 0)
+    {
+      t->left = insert (new, t->left);
+      if (t->priority < t->left->priority)
+       t = rotate_right (t);
+    }
+
+  if (c > 0)
+    {
+      t->right = insert (new, t->right);
+      if (t->priority < t->right->priority)
+       t = rotate_left (t);
+    }
+
+  if (c == 0)
+    internal_error (NULL, "insert(): Duplicate key found!");
+
+  return t;
+}
+
+
+/* insert_unit()-- Create a new node, insert it into the treap.  */
+
+static gfc_unit *
+insert_unit (int n)
+{
+  gfc_unit *u = get_mem (sizeof (gfc_unit));
+  memset (u, '\0', sizeof (gfc_unit));
+  u->unit_number = n;
+#ifdef __GTHREAD_MUTEX_INIT
+  {
+    __gthread_mutex_t tmp = __GTHREAD_MUTEX_INIT;
+    u->lock = tmp;
+  }
+#else
+  __GTHREAD_MUTEX_INIT_FUNCTION (&u->lock);
+#endif
+  __gthread_mutex_lock (&u->lock);
+  u->priority = pseudo_random ();
+  unit_root = insert (u, unit_root);
+  return u;
+}
+
+
+/* destroy_unit_mutex()-- Destroy the mutex and free memory of unit.  */
+
+static void
+destroy_unit_mutex (gfc_unit * u)
+{
+  __gthread_mutex_destroy (&u->lock);
+  free (u);
+}
+
+
+static gfc_unit *
+delete_root (gfc_unit * t)
+{
+  gfc_unit *temp;
+
+  if (t->left == NULL)
+    return t->right;
+  if (t->right == NULL)
+    return t->left;
+
+  if (t->left->priority > t->right->priority)
+    {
+      temp = rotate_right (t);
+      temp->right = delete_root (t);
+    }
+  else
+    {
+      temp = rotate_left (t);
+      temp->left = delete_root (t);
+    }
+
+  return temp;
+}
+
+
+/* delete_treap()-- Delete an element from a tree.  The 'old' value
+ * does not necessarily have to point to the element to be deleted, it
+ * must just point to a treap structure with the key to be deleted.
+ * Returns the new root node of the tree. */
+
+static gfc_unit *
+delete_treap (gfc_unit * old, gfc_unit * t)
+{
+  int c;
+
+  if (t == NULL)
+    return NULL;
+
+  c = compare (old->unit_number, t->unit_number);
+
+  if (c < 0)
+    t->left = delete_treap (old, t->left);
+  if (c > 0)
+    t->right = delete_treap (old, t->right);
+  if (c == 0)
+    t = delete_root (t);
+
+  return t;
+}
+
+
+/* delete_unit()-- Delete a unit from a tree */
+
+static void
+delete_unit (gfc_unit * old)
+{
+  unit_root = delete_treap (old, unit_root);
+}
+
+
+/* get_external_unit()-- Given an integer, return a pointer to the unit
+ * structure.  Returns NULL if the unit does not exist,
+ * otherwise returns a locked unit. */
+
+static gfc_unit *
+get_external_unit (int n, int do_create)
+{
+  gfc_unit *p;
+  int c, created = 0;
+
+  __gthread_mutex_lock (&unit_lock);
+retry:
+  for (c = 0; c < CACHE_SIZE; c++)
+    if (unit_cache[c] != NULL && unit_cache[c]->unit_number == n)
+      {
+       p = unit_cache[c];
+       goto found;
+      }
+
+  p = unit_root;
+  while (p != NULL)
+    {
+      c = compare (n, p->unit_number);
+      if (c < 0)
+       p = p->left;
+      if (c > 0)
+       p = p->right;
+      if (c == 0)
+       break;
+    }
+
+  if (p == NULL && do_create)
+    {
+      p = insert_unit (n);
+      created = 1;
+    }
+
+  if (p != NULL)
+    {
+      for (c = 0; c < CACHE_SIZE - 1; c++)
+       unit_cache[c] = unit_cache[c + 1];
+
+      unit_cache[CACHE_SIZE - 1] = p;
+    }
+
+  if (created)
+    {
+      /* Newly created units have their lock held already
+        from insert_unit.  Just unlock UNIT_LOCK and return.  */
+      __gthread_mutex_unlock (&unit_lock);
+      return p;
+    }
+
+found:
+  if (p != NULL)
+    {
+      /* Fast path.  */
+      if (! __gthread_mutex_trylock (&p->lock))
+       {
+         /* assert (p->closed == 0); */
+         __gthread_mutex_unlock (&unit_lock);
+         return p;
+       }
+
+      inc_waiting_locked (p);
+    }
+
+  __gthread_mutex_unlock (&unit_lock);
+
+  if (p != NULL)
+    {
+      __gthread_mutex_lock (&p->lock);
+      if (p->closed)
+       {
+         __gthread_mutex_lock (&unit_lock);
+         __gthread_mutex_unlock (&p->lock);
+         if (predec_waiting_locked (p) == 0)
+           destroy_unit_mutex (p);
+         goto retry;
+       }
+
+      dec_waiting_unlocked (p);
+    }
+  return p;
+}
+
+
+gfc_unit *
+find_unit (int n)
+{
+  return get_external_unit (n, 0);
+}
+
+
+gfc_unit *
+find_or_create_unit (int n)
+{
+  return get_external_unit (n, 1);
+}
+
+
+gfc_unit *
+get_internal_unit (st_parameter_dt *dtp)
+{
+  gfc_unit * iunit;
+  gfc_offset start_record = 0;
+
+  /* Allocate memory for a unit structure.  */
+
+  iunit = get_mem (sizeof (gfc_unit));
+  if (iunit == NULL)
+    {
+      generate_error (&dtp->common, LIBERROR_INTERNAL_UNIT, NULL);
+      return NULL;
+    }
+
+  memset (iunit, '\0', sizeof (gfc_unit));
+#ifdef __GTHREAD_MUTEX_INIT
+  {
+    __gthread_mutex_t tmp = __GTHREAD_MUTEX_INIT;
+    iunit->lock = tmp;
+  }
+#else
+  __GTHREAD_MUTEX_INIT_FUNCTION (&iunit->lock);
+#endif
+  __gthread_mutex_lock (&iunit->lock);
+
+  iunit->recl = dtp->internal_unit_len;
+  
+  /* For internal units we set the unit number to -1.
+     Otherwise internal units can be mistaken for a pre-connected unit or
+     some other file I/O unit.  */
+  iunit->unit_number = -1;
+
+  /* Set up the looping specification from the array descriptor, if any.  */
+
+  if (is_array_io (dtp))
+    {
+      iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc);
+      iunit->ls = (array_loop_spec *)
+       get_mem (iunit->rank * sizeof (array_loop_spec));
+      dtp->internal_unit_len *=
+       init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record);
+
+      start_record *= iunit->recl;
+    }
+
+  /* Set initial values for unit parameters.  */
+  if (dtp->common.unit)
+    {
+      iunit->s = open_internal4 (dtp->internal_unit - start_record,
+                                dtp->internal_unit_len, -start_record);
+      fbuf_init (iunit, 256);
+    }
+  else
+    iunit->s = open_internal (dtp->internal_unit - start_record,
+                             dtp->internal_unit_len, -start_record);
+
+  iunit->bytes_left = iunit->recl;
+  iunit->last_record=0;
+  iunit->maxrec=0;
+  iunit->current_record=0;
+  iunit->read_bad = 0;
+  iunit->endfile = NO_ENDFILE;
+
+  /* Set flags for the internal unit.  */
+
+  iunit->flags.access = ACCESS_SEQUENTIAL;
+  iunit->flags.action = ACTION_READWRITE;
+  iunit->flags.blank = BLANK_NULL;
+  iunit->flags.form = FORM_FORMATTED;
+  iunit->flags.pad = PAD_YES;
+  iunit->flags.status = STATUS_UNSPECIFIED;
+  iunit->flags.sign = SIGN_SUPPRESS;
+  iunit->flags.decimal = DECIMAL_POINT;
+  iunit->flags.encoding = ENCODING_DEFAULT;
+  iunit->flags.async = ASYNC_NO;
+  iunit->flags.round = ROUND_COMPATIBLE;
+
+  /* Initialize the data transfer parameters.  */
+
+  dtp->u.p.advance_status = ADVANCE_YES;
+  dtp->u.p.seen_dollar = 0;
+  dtp->u.p.skips = 0;
+  dtp->u.p.pending_spaces = 0;
+  dtp->u.p.max_pos = 0;
+  dtp->u.p.at_eof = 0;
+
+  /* This flag tells us the unit is assigned to internal I/O.  */
+  
+  dtp->u.p.unit_is_internal = 1;
+
+  return iunit;
+}
+
+
+/* free_internal_unit()-- Free memory allocated for internal units if any.  */
+void
+free_internal_unit (st_parameter_dt *dtp)
+{
+  if (!is_internal_unit (dtp))
+    return;
+
+  if (unlikely (is_char4_unit (dtp)))
+    fbuf_destroy (dtp->u.p.current_unit);
+
+  if (dtp->u.p.current_unit != NULL)
+    {
+      free (dtp->u.p.current_unit->ls);
+  
+      free (dtp->u.p.current_unit->s);
+  
+      destroy_unit_mutex (dtp->u.p.current_unit);
+    }
+}
+      
+
+
+/* get_unit()-- Returns the unit structure associated with the integer
+   unit or the internal file.  */
+
+gfc_unit *
+get_unit (st_parameter_dt *dtp, int do_create)
+{
+
+  if ((dtp->common.flags & IOPARM_DT_HAS_INTERNAL_UNIT) != 0)
+    return get_internal_unit (dtp);
+
+  /* Has to be an external unit.  */
+
+  dtp->u.p.unit_is_internal = 0;
+  dtp->internal_unit_desc = NULL;
+
+  return get_external_unit (dtp->common.unit, do_create);
+}
+
+
+/*************************/
+/* Initialize everything.  */
+
+void
+init_units (void)
+{
+  gfc_unit *u;
+  unsigned int i;
+
+#ifndef __GTHREAD_MUTEX_INIT
+  __GTHREAD_MUTEX_INIT_FUNCTION (&unit_lock);
+#endif
+
+  if (options.stdin_unit >= 0)
+    {                          /* STDIN */
+      u = insert_unit (options.stdin_unit);
+      u->s = input_stream ();
+
+      u->flags.action = ACTION_READ;
+
+      u->flags.access = ACCESS_SEQUENTIAL;
+      u->flags.form = FORM_FORMATTED;
+      u->flags.status = STATUS_OLD;
+      u->flags.blank = BLANK_NULL;
+      u->flags.pad = PAD_YES;
+      u->flags.position = POSITION_ASIS;
+      u->flags.sign = SIGN_SUPPRESS;
+      u->flags.decimal = DECIMAL_POINT;
+      u->flags.encoding = ENCODING_DEFAULT;
+      u->flags.async = ASYNC_NO;
+      u->flags.round = ROUND_COMPATIBLE;
+     
+      u->recl = options.default_recl;
+      u->endfile = NO_ENDFILE;
+
+      u->file_len = strlen (stdin_name);
+      u->file = get_mem (u->file_len);
+      memmove (u->file, stdin_name, u->file_len);
+
+      fbuf_init (u, 0);
+    
+      __gthread_mutex_unlock (&u->lock);
+    }
+
+  if (options.stdout_unit >= 0)
+    {                          /* STDOUT */
+      u = insert_unit (options.stdout_unit);
+      u->s = output_stream ();
+
+      u->flags.action = ACTION_WRITE;
+
+      u->flags.access = ACCESS_SEQUENTIAL;
+      u->flags.form = FORM_FORMATTED;
+      u->flags.status = STATUS_OLD;
+      u->flags.blank = BLANK_NULL;
+      u->flags.position = POSITION_ASIS;
+      u->flags.sign = SIGN_SUPPRESS;
+      u->flags.decimal = DECIMAL_POINT;
+      u->flags.encoding = ENCODING_DEFAULT;
+      u->flags.async = ASYNC_NO;
+      u->flags.round = ROUND_COMPATIBLE;
+
+      u->recl = options.default_recl;
+      u->endfile = AT_ENDFILE;
+    
+      u->file_len = strlen (stdout_name);
+      u->file = get_mem (u->file_len);
+      memmove (u->file, stdout_name, u->file_len);
+      
+      fbuf_init (u, 0);
+
+      __gthread_mutex_unlock (&u->lock);
+    }
+
+  if (options.stderr_unit >= 0)
+    {                          /* STDERR */
+      u = insert_unit (options.stderr_unit);
+      u->s = error_stream ();
+
+      u->flags.action = ACTION_WRITE;
+
+      u->flags.access = ACCESS_SEQUENTIAL;
+      u->flags.form = FORM_FORMATTED;
+      u->flags.status = STATUS_OLD;
+      u->flags.blank = BLANK_NULL;
+      u->flags.position = POSITION_ASIS;
+      u->flags.sign = SIGN_SUPPRESS;
+      u->flags.decimal = DECIMAL_POINT;
+      u->flags.encoding = ENCODING_DEFAULT;
+      u->flags.async = ASYNC_NO;
+      u->flags.round = ROUND_COMPATIBLE;
+
+      u->recl = options.default_recl;
+      u->endfile = AT_ENDFILE;
+
+      u->file_len = strlen (stderr_name);
+      u->file = get_mem (u->file_len);
+      memmove (u->file, stderr_name, u->file_len);
+      
+      fbuf_init (u, 256);  /* 256 bytes should be enough, probably not doing
+                              any kind of exotic formatting to stderr.  */
+
+      __gthread_mutex_unlock (&u->lock);
+    }
+
+  /* Calculate the maximum file offset in a portable manner.
+     max will be the largest signed number for the type gfc_offset.
+     set a 1 in the LSB and keep a running sum, stopping at MSB-1 bit.  */
+  max_offset = 0;
+  for (i = 0; i < sizeof (max_offset) * 8 - 1; i++)
+    max_offset = max_offset + ((gfc_offset) 1 << i);
+}
+
+
+static int
+close_unit_1 (gfc_unit *u, int locked)
+{
+  int i, rc;
+  
+  /* If there are previously written bytes from a write with ADVANCE="no"
+     Reposition the buffer before closing.  */
+  if (u->previous_nonadvancing_write)
+    finish_last_advance_record (u);
+
+  rc = (u->s == NULL) ? 0 : sclose (u->s) == -1;
+
+  u->closed = 1;
+  if (!locked)
+    __gthread_mutex_lock (&unit_lock);
+
+  for (i = 0; i < CACHE_SIZE; i++)
+    if (unit_cache[i] == u)
+      unit_cache[i] = NULL;
+
+  delete_unit (u);
+
+  free (u->file);
+  u->file = NULL;
+  u->file_len = 0;
+
+  free_format_hash_table (u);  
+  fbuf_destroy (u);
+
+  if (!locked)
+    __gthread_mutex_unlock (&u->lock);
+
+  /* If there are any threads waiting in find_unit for this unit,
+     avoid freeing the memory, the last such thread will free it
+     instead.  */
+  if (u->waiting == 0)
+    destroy_unit_mutex (u);
+
+  if (!locked)
+    __gthread_mutex_unlock (&unit_lock);
+
+  return rc;
+}
+
+void
+unlock_unit (gfc_unit *u)
+{
+  __gthread_mutex_unlock (&u->lock);
+}
+
+/* close_unit()-- Close a unit.  The stream is closed, and any memory
+   associated with the stream is freed.  Returns nonzero on I/O error.
+   Should be called with the u->lock locked. */
+
+int
+close_unit (gfc_unit *u)
+{
+  return close_unit_1 (u, 0);
+}
+
+
+/* close_units()-- Delete units on completion.  We just keep deleting
+   the root of the treap until there is nothing left.
+   Not sure what to do with locking here.  Some other thread might be
+   holding some unit's lock and perhaps hold it indefinitely
+   (e.g. waiting for input from some pipe) and close_units shouldn't
+   delay the program too much.  */
+
+void
+close_units (void)
+{
+  __gthread_mutex_lock (&unit_lock);
+  while (unit_root != NULL)
+    close_unit_1 (unit_root, 1);
+  __gthread_mutex_unlock (&unit_lock);
+}
+
+
+/* High level interface to truncate a file, i.e. flush format buffers,
+   and generate an error or set some flags.  Just like POSIX
+   ftruncate, returns 0 on success, -1 on failure.  */
+
+int
+unit_truncate (gfc_unit * u, gfc_offset pos, st_parameter_common * common)
+{
+  int ret;
+
+  /* Make sure format buffer is flushed.  */
+  if (u->flags.form == FORM_FORMATTED)
+    {
+      if (u->mode == READING)
+       pos += fbuf_reset (u);
+      else
+       fbuf_flush (u, u->mode);
+    }
+  
+  /* struncate() should flush the stream buffer if necessary, so don't
+     bother calling sflush() here.  */
+  ret = struncate (u->s, pos);
+
+  if (ret != 0)
+    generate_error (common, LIBERROR_OS, NULL);
+  else
+    {
+      u->endfile = AT_ENDFILE;
+      u->flags.position = POSITION_APPEND;
+    }
+
+  return ret;
+}
+
+
+/* filename_from_unit()-- If the unit_number exists, return a pointer to the
+   name of the associated file, otherwise return the empty string.  The caller
+   must free memory allocated for the filename string.  */
+
+char *
+filename_from_unit (int n)
+{
+  char *filename;
+  gfc_unit *u;
+  int c;
+
+  /* Find the unit.  */
+  u = unit_root;
+  while (u != NULL)
+    {
+      c = compare (n, u->unit_number);
+      if (c < 0)
+       u = u->left;
+      if (c > 0)
+       u = u->right;
+      if (c == 0)
+       break;
+    }
+
+  /* Get the filename.  */
+  if (u != NULL)
+    {
+      filename = (char *) get_mem (u->file_len + 1);
+      unpack_filename (filename, u->file, u->file_len);
+      return filename;
+    }
+  else
+    return (char *) NULL;
+}
+
+void
+finish_last_advance_record (gfc_unit *u)
+{
+  
+  if (u->saved_pos > 0)
+    fbuf_seek (u, u->saved_pos, SEEK_CUR);
+
+  if (!(u->unit_number == options.stdout_unit
+       || u->unit_number == options.stderr_unit))
+    {
+#ifdef HAVE_CRLF
+      const int len = 2;
+#else
+      const int len = 1;
+#endif
+      char *p = fbuf_alloc (u, len);
+      if (!p)
+       os_error ("Completing record after ADVANCE_NO failed");
+#ifdef HAVE_CRLF
+      *(p++) = '\r';
+#endif
+      *p = '\n';
+    }
+
+  fbuf_flush (u, u->mode);
+}
+
+/* Assign a negative number for NEWUNIT in OPEN statements.  */
+GFC_INTEGER_4
+get_unique_unit_number (st_parameter_open *opp)
+{
+  GFC_INTEGER_4 num;
+
+#ifdef HAVE_SYNC_FETCH_AND_ADD
+  num = __sync_fetch_and_add (&next_available_newunit, -1);
+#else
+  __gthread_mutex_lock (&unit_lock);
+  num = next_available_newunit--;
+  __gthread_mutex_unlock (&unit_lock);
+#endif
+
+  /* Do not allow NEWUNIT numbers to wrap.  */
+  if (num > GFC_FIRST_NEWUNIT)
+    {
+      generate_error (&opp->common, LIBERROR_INTERNAL, "NEWUNIT exhausted");
+      return 0;
+    }
+  return num;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/io/unix.c b/l4/pkg/libgfortran/lib/contrib/io/unix.c
new file mode 100644 (file)
index 0000000..6eef3f9
--- /dev/null
@@ -0,0 +1,1829 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* Unix stream I/O module */
+
+#include "io.h"
+#include "unix.h"
+#include <stdlib.h>
+#include <limits.h>
+
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <assert.h>
+
+#include <string.h>
+#include <errno.h>
+
+
+/* min macro that evaluates its arguments only once.  */
+#define min(a,b)               \
+  ({ typeof (a) _a = (a);      \
+    typeof (b) _b = (b);       \
+    _a < _b ? _a : _b; })
+
+
+/* For mingw, we don't identify files by their inode number, but by a
+   64-bit identifier created from a BY_HANDLE_FILE_INFORMATION. */
+#ifdef __MINGW32__
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#if !defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64
+#undef lseek
+#define lseek _lseeki64
+#undef fstat
+#define fstat _fstati64
+#undef stat
+#define stat _stati64
+#endif
+
+#ifndef HAVE_WORKING_STAT
+static uint64_t
+id_from_handle (HANDLE hFile)
+{
+  BY_HANDLE_FILE_INFORMATION FileInformation;
+
+  if (hFile == INVALID_HANDLE_VALUE)
+      return 0;
+
+  memset (&FileInformation, 0, sizeof(FileInformation));
+  if (!GetFileInformationByHandle (hFile, &FileInformation))
+    return 0;
+
+  return ((uint64_t) FileInformation.nFileIndexLow)
+        | (((uint64_t) FileInformation.nFileIndexHigh) << 32);
+}
+
+
+static uint64_t
+id_from_path (const char *path)
+{
+  HANDLE hFile;
+  uint64_t res;
+
+  if (!path || !*path || access (path, F_OK))
+    return (uint64_t) -1;
+
+  hFile = CreateFile (path, 0, 0, NULL, OPEN_EXISTING,
+                     FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_READONLY,
+                     NULL);
+  res = id_from_handle (hFile);
+  CloseHandle (hFile);
+  return res;
+}
+
+
+static uint64_t
+id_from_fd (const int fd)
+{
+  return id_from_handle ((HANDLE) _get_osfhandle (fd));
+}
+
+#endif
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+/* These flags aren't defined on all targets (mingw32), so provide them
+   here.  */
+#ifndef S_IRGRP
+#define S_IRGRP 0
+#endif
+
+#ifndef S_IWGRP
+#define S_IWGRP 0
+#endif
+
+#ifndef S_IROTH
+#define S_IROTH 0
+#endif
+
+#ifndef S_IWOTH
+#define S_IWOTH 0
+#endif
+
+
+#ifndef HAVE_ACCESS
+
+#ifndef W_OK
+#define W_OK 2
+#endif
+
+#ifndef R_OK
+#define R_OK 4
+#endif
+
+#ifndef F_OK
+#define F_OK 0
+#endif
+
+/* Fallback implementation of access() on systems that don't have it.
+   Only modes R_OK, W_OK and F_OK are used in this file.  */
+
+static int
+fallback_access (const char *path, int mode)
+{
+  int fd;
+
+  if ((mode & R_OK) && (fd = open (path, O_RDONLY)) < 0)
+    return -1;
+  close (fd);
+
+  if ((mode & W_OK) && (fd = open (path, O_WRONLY)) < 0)
+    return -1;
+  close (fd);
+
+  if (mode == F_OK)
+    {
+      struct stat st;
+      return stat (path, &st);
+    }
+
+  return 0;
+}
+
+#undef access
+#define access fallback_access
+#endif
+
+
+/* Unix and internal stream I/O module */
+
+static const int BUFFER_SIZE = 8192;
+
+typedef struct
+{
+  stream st;
+
+  gfc_offset buffer_offset;    /* File offset of the start of the buffer */
+  gfc_offset physical_offset;  /* Current physical file offset */
+  gfc_offset logical_offset;   /* Current logical file offset */
+  gfc_offset file_length;      /* Length of the file. */
+
+  char *buffer;                 /* Pointer to the buffer.  */
+  int fd;                       /* The POSIX file descriptor.  */
+
+  int active;                  /* Length of valid bytes in the buffer */
+
+  int ndirty;                  /* Dirty bytes starting at buffer_offset */
+
+  /* Cached stat(2) values.  */
+  dev_t st_dev;
+  ino_t st_ino;
+}
+unix_stream;
+
+
+/* fix_fd()-- Given a file descriptor, make sure it is not one of the
+ * standard descriptors, returning a non-standard descriptor.  If the
+ * user specifies that system errors should go to standard output,
+ * then closes standard output, we don't want the system errors to a
+ * file that has been given file descriptor 1 or 0.  We want to send
+ * the error to the invalid descriptor. */
+
+static int
+fix_fd (int fd)
+{
+#ifdef HAVE_DUP
+  int input, output, error;
+
+  input = output = error = 0;
+
+  /* Unix allocates the lowest descriptors first, so a loop is not
+     required, but this order is. */
+  if (fd == STDIN_FILENO)
+    {
+      fd = dup (fd);
+      input = 1;
+    }
+  if (fd == STDOUT_FILENO)
+    {
+      fd = dup (fd);
+      output = 1;
+    }
+  if (fd == STDERR_FILENO)
+    {
+      fd = dup (fd);
+      error = 1;
+    }
+
+  if (input)
+    close (STDIN_FILENO);
+  if (output)
+    close (STDOUT_FILENO);
+  if (error)
+    close (STDERR_FILENO);
+#endif
+
+  return fd;
+}
+
+
+/* If the stream corresponds to a preconnected unit, we flush the
+   corresponding C stream.  This is bugware for mixed C-Fortran codes
+   where the C code doesn't flush I/O before returning.  */
+void
+flush_if_preconnected (stream * s)
+{
+  int fd;
+
+  fd = ((unix_stream *) s)->fd;
+  if (fd == STDIN_FILENO)
+    fflush (stdin);
+  else if (fd == STDOUT_FILENO)
+    fflush (stdout);
+  else if (fd == STDERR_FILENO)
+    fflush (stderr);
+}
+
+
+/********************************************************************
+Raw I/O functions (read, write, seek, tell, truncate, close).
+
+These functions wrap the basic POSIX I/O syscalls. Any deviation in
+semantics is a bug, except the following: write restarts in case
+of being interrupted by a signal, and as the first argument the
+functions take the unix_stream struct rather than an integer file
+descriptor. Also, for POSIX read() and write() a nbyte argument larger
+than SSIZE_MAX is undefined; here the type of nbyte is ssize_t rather
+than size_t as for POSIX read/write.
+*********************************************************************/
+
+static int
+raw_flush (unix_stream * s  __attribute__ ((unused)))
+{
+  return 0;
+}
+
+static ssize_t
+raw_read (unix_stream * s, void * buf, ssize_t nbyte)
+{
+  /* For read we can't do I/O in a loop like raw_write does, because
+     that will break applications that wait for interactive I/O.  */
+  return read (s->fd, buf, nbyte);
+}
+
+static ssize_t
+raw_write (unix_stream * s, const void * buf, ssize_t nbyte)
+{
+  ssize_t trans, bytes_left;
+  char *buf_st;
+
+  bytes_left = nbyte;
+  buf_st = (char *) buf;
+
+  /* We must write in a loop since some systems don't restart system
+     calls in case of a signal.  */
+  while (bytes_left > 0)
+    {
+      trans = write (s->fd, buf_st, bytes_left);
+      if (trans < 0)
+       {
+         if (errno == EINTR)
+           continue;
+         else
+           return trans;
+       }
+      buf_st += trans;
+      bytes_left -= trans;
+    }
+
+  return nbyte - bytes_left;
+}
+
+static gfc_offset
+raw_seek (unix_stream * s, gfc_offset offset, int whence)
+{
+  return lseek (s->fd, offset, whence);
+}
+
+static gfc_offset
+raw_tell (unix_stream * s)
+{
+  return lseek (s->fd, 0, SEEK_CUR);
+}
+
+static gfc_offset
+raw_size (unix_stream * s)
+{
+  struct stat statbuf;
+  int ret = fstat (s->fd, &statbuf);
+  if (ret == -1)
+    return ret;
+  return statbuf.st_size;
+}
+
+static int
+raw_truncate (unix_stream * s, gfc_offset length)
+{
+#ifdef __MINGW32__
+  HANDLE h;
+  gfc_offset cur;
+
+  if (isatty (s->fd))
+    {
+      errno = EBADF;
+      return -1;
+    }
+  h = (HANDLE) _get_osfhandle (s->fd);
+  if (h == INVALID_HANDLE_VALUE)
+    {
+      errno = EBADF;
+      return -1;
+    }
+  cur = lseek (s->fd, 0, SEEK_CUR);
+  if (cur == -1)
+    return -1;
+  if (lseek (s->fd, length, SEEK_SET) == -1)
+    goto error;
+  if (!SetEndOfFile (h))
+    {
+      errno = EBADF;
+      goto error;
+    }
+  if (lseek (s->fd, cur, SEEK_SET) == -1)
+    return -1;
+  return 0;
+ error:
+  lseek (s->fd, cur, SEEK_SET);
+  return -1;
+#elif defined HAVE_FTRUNCATE
+  return ftruncate (s->fd, length);
+#elif defined HAVE_CHSIZE
+  return chsize (s->fd, length);
+#else
+  runtime_error ("required ftruncate or chsize support not present");
+  return -1;
+#endif
+}
+
+static int
+raw_close (unix_stream * s)
+{
+  int retval;
+  
+  if (s->fd != STDOUT_FILENO
+      && s->fd != STDERR_FILENO
+      && s->fd != STDIN_FILENO)
+    retval = close (s->fd);
+  else
+    retval = 0;
+  free (s);
+  return retval;
+}
+
+static int
+raw_init (unix_stream * s)
+{
+  s->st.read = (void *) raw_read;
+  s->st.write = (void *) raw_write;
+  s->st.seek = (void *) raw_seek;
+  s->st.tell = (void *) raw_tell;
+  s->st.size = (void *) raw_size;
+  s->st.trunc = (void *) raw_truncate;
+  s->st.close = (void *) raw_close;
+  s->st.flush = (void *) raw_flush;
+
+  s->buffer = NULL;
+  return 0;
+}
+
+
+/*********************************************************************
+Buffered I/O functions. These functions have the same semantics as the
+raw I/O functions above, except that they are buffered in order to
+improve performance. The buffer must be flushed when switching from
+reading to writing and vice versa. Only supported for regular files.
+*********************************************************************/
+
+static int
+buf_flush (unix_stream * s)
+{
+  int writelen;
+
+  /* Flushing in read mode means discarding read bytes.  */
+  s->active = 0;
+
+  if (s->ndirty == 0)
+    return 0;
+  
+  if (s->physical_offset != s->buffer_offset
+      && lseek (s->fd, s->buffer_offset, SEEK_SET) < 0)
+    return -1;
+
+  writelen = raw_write (s, s->buffer, s->ndirty);
+
+  s->physical_offset = s->buffer_offset + writelen;
+
+  if (s->physical_offset > s->file_length)
+      s->file_length = s->physical_offset;
+
+  s->ndirty -= writelen;
+  if (s->ndirty != 0)
+    return -1;
+
+  return 0;
+}
+
+static ssize_t
+buf_read (unix_stream * s, void * buf, ssize_t nbyte)
+{
+  if (s->active == 0)
+    s->buffer_offset = s->logical_offset;
+
+  /* Is the data we want in the buffer?  */
+  if (s->logical_offset + nbyte <= s->buffer_offset + s->active
+      && s->buffer_offset <= s->logical_offset)
+    memcpy (buf, s->buffer + (s->logical_offset - s->buffer_offset), nbyte);
+  else
+    {
+      /* First copy the active bytes if applicable, then read the rest
+         either directly or filling the buffer.  */
+      char *p;
+      int nread = 0;
+      ssize_t to_read, did_read;
+      gfc_offset new_logical;
+      
+      p = (char *) buf;
+      if (s->logical_offset >= s->buffer_offset 
+          && s->buffer_offset + s->active >= s->logical_offset)
+        {
+          nread = s->active - (s->logical_offset - s->buffer_offset);
+          memcpy (buf, s->buffer + (s->logical_offset - s->buffer_offset), 
+                  nread);
+          p += nread;
+        }
+      /* At this point we consider all bytes in the buffer discarded.  */
+      to_read = nbyte - nread;
+      new_logical = s->logical_offset + nread;
+      if (s->physical_offset != new_logical
+          && lseek (s->fd, new_logical, SEEK_SET) < 0)
+        return -1;
+      s->buffer_offset = s->physical_offset = new_logical;
+      if (to_read <= BUFFER_SIZE/2)
+        {
+          did_read = raw_read (s, s->buffer, BUFFER_SIZE);
+          s->physical_offset += did_read;
+          s->active = did_read;
+          did_read = (did_read > to_read) ? to_read : did_read;
+          memcpy (p, s->buffer, did_read);
+        }
+      else
+        {
+          did_read = raw_read (s, p, to_read);
+          s->physical_offset += did_read;
+          s->active = 0;
+        }
+      nbyte = did_read + nread;
+    }
+  s->logical_offset += nbyte;
+  return nbyte;
+}
+
+static ssize_t
+buf_write (unix_stream * s, const void * buf, ssize_t nbyte)
+{
+  if (s->ndirty == 0)
+    s->buffer_offset = s->logical_offset;
+
+  /* Does the data fit into the buffer?  As a special case, if the
+     buffer is empty and the request is bigger than BUFFER_SIZE/2,
+     write directly. This avoids the case where the buffer would have
+     to be flushed at every write.  */
+  if (!(s->ndirty == 0 && nbyte > BUFFER_SIZE/2)
+      && s->logical_offset + nbyte <= s->buffer_offset + BUFFER_SIZE
+      && s->buffer_offset <= s->logical_offset
+      && s->buffer_offset + s->ndirty >= s->logical_offset)
+    {
+      memcpy (s->buffer + (s->logical_offset - s->buffer_offset), buf, nbyte);
+      int nd = (s->logical_offset - s->buffer_offset) + nbyte;
+      if (nd > s->ndirty)
+        s->ndirty = nd;
+    }
+  else
+    {
+      /* Flush, and either fill the buffer with the new data, or if
+         the request is bigger than the buffer size, write directly
+         bypassing the buffer.  */
+      buf_flush (s);
+      if (nbyte <= BUFFER_SIZE/2)
+        {
+          memcpy (s->buffer, buf, nbyte);
+          s->buffer_offset = s->logical_offset;
+          s->ndirty += nbyte;
+        }
+      else
+       {
+         if (s->physical_offset != s->logical_offset)
+           {
+             if (lseek (s->fd, s->logical_offset, SEEK_SET) < 0)
+               return -1;
+             s->physical_offset = s->logical_offset;
+           }
+
+         nbyte = raw_write (s, buf, nbyte);
+         s->physical_offset += nbyte;
+       }
+    }
+  s->logical_offset += nbyte;
+  if (s->logical_offset > s->file_length)
+    s->file_length = s->logical_offset;
+  return nbyte;
+}
+
+static gfc_offset
+buf_seek (unix_stream * s, gfc_offset offset, int whence)
+{
+  switch (whence)
+    {
+    case SEEK_SET:
+      break;
+    case SEEK_CUR:
+      offset += s->logical_offset;
+      break;
+    case SEEK_END:
+      offset += s->file_length;
+      break;
+    default:
+      return -1;
+    }
+  if (offset < 0)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+  s->logical_offset = offset;
+  return offset;
+}
+
+static gfc_offset
+buf_tell (unix_stream * s)
+{
+  return buf_seek (s, 0, SEEK_CUR);
+}
+
+static gfc_offset
+buf_size (unix_stream * s)
+{
+  return s->file_length;
+}
+
+static int
+buf_truncate (unix_stream * s, gfc_offset length)
+{
+  int r;
+
+  if (buf_flush (s) != 0)
+    return -1;
+  r = raw_truncate (s, length);
+  if (r == 0)
+    s->file_length = length;
+  return r;
+}
+
+static int
+buf_close (unix_stream * s)
+{
+  if (buf_flush (s) != 0)
+    return -1;
+  free (s->buffer);
+  return raw_close (s);
+}
+
+static int
+buf_init (unix_stream * s)
+{
+  s->st.read = (void *) buf_read;
+  s->st.write = (void *) buf_write;
+  s->st.seek = (void *) buf_seek;
+  s->st.tell = (void *) buf_tell;
+  s->st.size = (void *) buf_size;
+  s->st.trunc = (void *) buf_truncate;
+  s->st.close = (void *) buf_close;
+  s->st.flush = (void *) buf_flush;
+
+  s->buffer = get_mem (BUFFER_SIZE);
+  return 0;
+}
+
+
+/*********************************************************************
+  memory stream functions - These are used for internal files
+
+  The idea here is that a single stream structure is created and all
+  requests must be satisfied from it.  The location and size of the
+  buffer is the character variable supplied to the READ or WRITE
+  statement.
+
+*********************************************************************/
+
+char *
+mem_alloc_r (stream * strm, int * len)
+{
+  unix_stream * s = (unix_stream *) strm;
+  gfc_offset n;
+  gfc_offset where = s->logical_offset;
+
+  if (where < s->buffer_offset || where > s->buffer_offset + s->active)
+    return NULL;
+
+  n = s->buffer_offset + s->active - where;
+  if (*len > n)
+    *len = n;
+
+  s->logical_offset = where + *len;
+
+  return s->buffer + (where - s->buffer_offset);
+}
+
+
+char *
+mem_alloc_r4 (stream * strm, int * len)
+{
+  unix_stream * s = (unix_stream *) strm;
+  gfc_offset n;
+  gfc_offset where = s->logical_offset;
+
+  if (where < s->buffer_offset || where > s->buffer_offset + s->active)
+    return NULL;
+
+  n = s->buffer_offset + s->active - where;
+  if (*len > n)
+    *len = n;
+
+  s->logical_offset = where + *len;
+
+  return s->buffer + (where - s->buffer_offset) * 4;
+}
+
+
+char *
+mem_alloc_w (stream * strm, int * len)
+{
+  unix_stream * s = (unix_stream *) strm;
+  gfc_offset m;
+  gfc_offset where = s->logical_offset;
+
+  m = where + *len;
+
+  if (where < s->buffer_offset)
+    return NULL;
+
+  if (m > s->file_length)
+    return NULL;
+
+  s->logical_offset = m;
+
+  return s->buffer + (where - s->buffer_offset);
+}
+
+
+gfc_char4_t *
+mem_alloc_w4 (stream * strm, int * len)
+{
+  unix_stream * s = (unix_stream *) strm;
+  gfc_offset m;
+  gfc_offset where = s->logical_offset;
+  gfc_char4_t *result = (gfc_char4_t *) s->buffer;
+
+  m = where + *len;
+
+  if (where < s->buffer_offset)
+    return NULL;
+
+  if (m > s->file_length)
+    return NULL;
+
+  s->logical_offset = m;
+  return &result[where - s->buffer_offset];
+}
+
+
+/* Stream read function for character(kine=1) internal units.  */
+
+static ssize_t
+mem_read (stream * s, void * buf, ssize_t nbytes)
+{
+  void *p;
+  int nb = nbytes;
+
+  p = mem_alloc_r (s, &nb);
+  if (p)
+    {
+      memcpy (buf, p, nb);
+      return (ssize_t) nb;
+    }
+  else
+    return 0;
+}
+
+
+/* Stream read function for chracter(kind=4) internal units.  */
+
+static ssize_t
+mem_read4 (stream * s, void * buf, ssize_t nbytes)
+{
+  void *p;
+  int nb = nbytes;
+
+  p = mem_alloc_r (s, &nb);
+  if (p)
+    {
+      memcpy (buf, p, nb);
+      return (ssize_t) nb;
+    }
+  else
+    return 0;
+}
+
+
+/* Stream write function for character(kind=1) internal units.  */
+
+static ssize_t
+mem_write (stream * s, const void * buf, ssize_t nbytes)
+{
+  void *p;
+  int nb = nbytes;
+
+  p = mem_alloc_w (s, &nb);
+  if (p)
+    {
+      memcpy (p, buf, nb);
+      return (ssize_t) nb;
+    }
+  else
+    return 0;
+}
+
+
+/* Stream write function for character(kind=4) internal units.  */
+
+static ssize_t
+mem_write4 (stream * s, const void * buf, ssize_t nwords)
+{
+  gfc_char4_t *p;
+  int nw = nwords;
+
+  p = mem_alloc_w4 (s, &nw);
+  if (p)
+    {
+      while (nw--)
+       *p++ = (gfc_char4_t) *((char *) buf);
+      return nwords;
+    }
+  else
+    return 0;
+}
+
+
+static gfc_offset
+mem_seek (stream * strm, gfc_offset offset, int whence)
+{
+  unix_stream * s = (unix_stream *) strm;
+  switch (whence)
+    {
+    case SEEK_SET:
+      break;
+    case SEEK_CUR:
+      offset += s->logical_offset;
+      break;
+    case SEEK_END:
+      offset += s->file_length;
+      break;
+    default:
+      return -1;
+    }
+
+  /* Note that for internal array I/O it's actually possible to have a
+     negative offset, so don't check for that.  */
+  if (offset > s->file_length)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
+  s->logical_offset = offset;
+
+  /* Returning < 0 is the error indicator for sseek(), so return 0 if
+     offset is negative.  Thus if the return value is 0, the caller
+     has to use stell() to get the real value of logical_offset.  */
+  if (offset >= 0)
+    return offset;
+  return 0;
+}
+
+
+static gfc_offset
+mem_tell (stream * s)
+{
+  return ((unix_stream *)s)->logical_offset;
+}
+
+
+static int
+mem_truncate (unix_stream * s __attribute__ ((unused)), 
+             gfc_offset length __attribute__ ((unused)))
+{
+  return 0;
+}
+
+
+static int
+mem_flush (unix_stream * s __attribute__ ((unused)))
+{
+  return 0;
+}
+
+
+static int
+mem_close (unix_stream * s)
+{
+  free (s);
+
+  return 0;
+}
+
+
+/*********************************************************************
+  Public functions -- A reimplementation of this module needs to
+  define functional equivalents of the following.
+*********************************************************************/
+
+/* open_internal()-- Returns a stream structure from a character(kind=1)
+   internal file */
+
+stream *
+open_internal (char *base, int length, gfc_offset offset)
+{
+  unix_stream *s;
+
+  s = get_mem (sizeof (unix_stream));
+  memset (s, '\0', sizeof (unix_stream));
+
+  s->buffer = base;
+  s->buffer_offset = offset;
+
+  s->logical_offset = 0;
+  s->active = s->file_length = length;
+
+  s->st.close = (void *) mem_close;
+  s->st.seek = (void *) mem_seek;
+  s->st.tell = (void *) mem_tell;
+  /* buf_size is not a typo, we just reuse an identical
+     implementation.  */
+  s->st.size = (void *) buf_size;
+  s->st.trunc = (void *) mem_truncate;
+  s->st.read = (void *) mem_read;
+  s->st.write = (void *) mem_write;
+  s->st.flush = (void *) mem_flush;
+
+  return (stream *) s;
+}
+
+/* open_internal4()-- Returns a stream structure from a character(kind=4)
+   internal file */
+
+stream *
+open_internal4 (char *base, int length, gfc_offset offset)
+{
+  unix_stream *s;
+
+  s = get_mem (sizeof (unix_stream));
+  memset (s, '\0', sizeof (unix_stream));
+
+  s->buffer = base;
+  s->buffer_offset = offset;
+
+  s->logical_offset = 0;
+  s->active = s->file_length = length;
+
+  s->st.close = (void *) mem_close;
+  s->st.seek = (void *) mem_seek;
+  s->st.tell = (void *) mem_tell;
+  /* buf_size is not a typo, we just reuse an identical
+     implementation.  */
+  s->st.size = (void *) buf_size;
+  s->st.trunc = (void *) mem_truncate;
+  s->st.read = (void *) mem_read4;
+  s->st.write = (void *) mem_write4;
+  s->st.flush = (void *) mem_flush;
+
+  return (stream *) s;
+}
+
+
+/* fd_to_stream()-- Given an open file descriptor, build a stream
+ * around it. */
+
+static stream *
+fd_to_stream (int fd)
+{
+  struct stat statbuf;
+  unix_stream *s;
+
+  s = get_mem (sizeof (unix_stream));
+  memset (s, '\0', sizeof (unix_stream));
+
+  s->fd = fd;
+  s->buffer_offset = 0;
+  s->physical_offset = 0;
+  s->logical_offset = 0;
+
+  /* Get the current length of the file. */
+
+  fstat (fd, &statbuf);
+
+  s->st_dev = statbuf.st_dev;
+  s->st_ino = statbuf.st_ino;
+  s->file_length = statbuf.st_size;
+
+  /* Only use buffered IO for regular files.  */
+  if (S_ISREG (statbuf.st_mode)
+      && !options.all_unbuffered
+      && !(options.unbuffered_preconnected && 
+          (s->fd == STDIN_FILENO 
+           || s->fd == STDOUT_FILENO 
+           || s->fd == STDERR_FILENO)))
+    buf_init (s);
+  else
+    raw_init (s);
+
+  return (stream *) s;
+}
+
+
+/* Given the Fortran unit number, convert it to a C file descriptor.  */
+
+int
+unit_to_fd (int unit)
+{
+  gfc_unit *us;
+  int fd;
+
+  us = find_unit (unit);
+  if (us == NULL)
+    return -1;
+
+  fd = ((unix_stream *) us->s)->fd;
+  unlock_unit (us);
+  return fd;
+}
+
+
+/* unpack_filename()-- Given a fortran string and a pointer to a
+ * buffer that is PATH_MAX characters, convert the fortran string to a
+ * C string in the buffer.  Returns nonzero if this is not possible.  */
+
+int
+unpack_filename (char *cstring, const char *fstring, int len)
+{
+  if (fstring == NULL)
+    return EFAULT;
+  len = fstrlen (fstring, len);
+  if (len >= PATH_MAX)
+    return ENAMETOOLONG;
+
+  memmove (cstring, fstring, len);
+  cstring[len] = '\0';
+
+  return 0;
+}
+
+
+/* tempfile()-- Generate a temporary filename for a scratch file and
+ * open it.  mkstemp() opens the file for reading and writing, but the
+ * library mode prevents anything that is not allowed.  The descriptor
+ * is returned, which is -1 on error.  The template is pointed to by 
+ * opp->file, which is copied into the unit structure
+ * and freed later. */
+
+static int
+tempfile (st_parameter_open *opp)
+{
+  const char *tempdir;
+  char *template;
+  const char *slash = "/";
+  int fd;
+  size_t tempdirlen;
+
+#ifndef HAVE_MKSTEMP
+  int count;
+  size_t slashlen;
+#endif
+
+  tempdir = getenv ("GFORTRAN_TMPDIR");
+#ifdef __MINGW32__
+  if (tempdir == NULL)
+    {
+      char buffer[MAX_PATH + 1];
+      DWORD ret;
+      ret = GetTempPath (MAX_PATH, buffer);
+      /* If we are not able to get a temp-directory, we use
+        current directory.  */
+      if (ret > MAX_PATH || !ret)
+        buffer[0] = 0;
+      else
+        buffer[ret] = 0;
+      tempdir = strdup (buffer);
+    }
+#else
+  if (tempdir == NULL)
+    tempdir = getenv ("TMP");
+  if (tempdir == NULL)
+    tempdir = getenv ("TEMP");
+  if (tempdir == NULL)
+    tempdir = DEFAULT_TEMPDIR;
+#endif
+
+  /* Check for special case that tempdir contains slash
+     or backslash at end.  */
+  tempdirlen = strlen (tempdir);
+  if (*tempdir == 0 || tempdir[tempdirlen - 1] == '/'
+#ifdef __MINGW32__
+      || tempdir[tempdirlen - 1] == '\\'
+#endif
+     )
+    slash = "";
+
+  // Take care that the template is longer in the mktemp() branch.
+  template = get_mem (tempdirlen + 23);
+
+#ifdef HAVE_MKSTEMP
+  snprintf (template, tempdirlen + 23, "%s%sgfortrantmpXXXXXX", 
+           tempdir, slash);
+
+  fd = mkstemp (template);
+
+#else /* HAVE_MKSTEMP */
+  fd = -1;
+  count = 0;
+  slashlen = strlen (slash);
+  do
+    {
+      snprintf (template, tempdirlen + 23, "%s%sgfortrantmpaaaXXXXXX", 
+               tempdir, slash);
+      if (count > 0)
+       {
+         int c = count;
+         template[tempdirlen + slashlen + 13] = 'a' + (c% 26);
+         c /= 26;
+         template[tempdirlen + slashlen + 12] = 'a' + (c % 26);
+         c /= 26;
+         template[tempdirlen + slashlen + 11] = 'a' + (c % 26);
+         if (c >= 26)
+           break;
+       }
+
+      if (!mktemp (template))
+      {
+       errno = EEXIST;
+       count++;
+       continue;
+      }
+
+#if defined(HAVE_CRLF) && defined(O_BINARY)
+      fd = open (template, O_RDWR | O_CREAT | O_EXCL | O_BINARY,
+                S_IRUSR | S_IWUSR);
+#else
+      fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+#endif
+    }
+  while (fd == -1 && errno == EEXIST);
+#endif /* HAVE_MKSTEMP */
+
+  opp->file = template;
+  opp->file_len = strlen (template);   /* Don't include trailing nul */
+
+  return fd;
+}
+
+
+/* regular_file()-- Open a regular file.
+ * Change flags->action if it is ACTION_UNSPECIFIED on entry,
+ * unless an error occurs.
+ * Returns the descriptor, which is less than zero on error. */
+
+static int
+regular_file (st_parameter_open *opp, unit_flags *flags)
+{
+  char path[min(PATH_MAX, opp->file_len + 1)];
+  int mode;
+  int rwflag;
+  int crflag;
+  int fd;
+  int err;
+
+  err = unpack_filename (path, opp->file, opp->file_len);
+  if (err)
+    {
+      errno = err;             /* Fake an OS error */
+      return -1;
+    }
+
+#ifdef __CYGWIN__
+  if (opp->file_len == 7)
+    {
+      if (strncmp (path, "CONOUT$", 7) == 0
+         || strncmp (path, "CONERR$", 7) == 0)
+       {
+         fd = open ("/dev/conout", O_WRONLY);
+         flags->action = ACTION_WRITE;
+         return fd;
+       }
+    }
+
+  if (opp->file_len == 6 && strncmp (path, "CONIN$", 6) == 0)
+    {
+      fd = open ("/dev/conin", O_RDONLY);
+      flags->action = ACTION_READ;
+      return fd;
+    }
+#endif
+
+
+#ifdef __MINGW32__
+  if (opp->file_len == 7)
+    {
+      if (strncmp (path, "CONOUT$", 7) == 0
+         || strncmp (path, "CONERR$", 7) == 0)
+       {
+         fd = open ("CONOUT$", O_WRONLY);
+         flags->action = ACTION_WRITE;
+         return fd;
+       }
+    }
+
+  if (opp->file_len == 6 && strncmp (path, "CONIN$", 6) == 0)
+    {
+      fd = open ("CONIN$", O_RDONLY);
+      flags->action = ACTION_READ;
+      return fd;
+    }
+#endif
+
+  rwflag = 0;
+
+  switch (flags->action)
+    {
+    case ACTION_READ:
+      rwflag = O_RDONLY;
+      break;
+
+    case ACTION_WRITE:
+      rwflag = O_WRONLY;
+      break;
+
+    case ACTION_READWRITE:
+    case ACTION_UNSPECIFIED:
+      rwflag = O_RDWR;
+      break;
+
+    default:
+      internal_error (&opp->common, "regular_file(): Bad action");
+    }
+
+  switch (flags->status)
+    {
+    case STATUS_NEW:
+      crflag = O_CREAT | O_EXCL;
+      break;
+
+    case STATUS_OLD:           /* open will fail if the file does not exist*/
+      crflag = 0;
+      break;
+
+    case STATUS_UNKNOWN:
+    case STATUS_SCRATCH:
+      crflag = O_CREAT;
+      break;
+
+    case STATUS_REPLACE:
+      crflag = O_CREAT | O_TRUNC;
+      break;
+
+    default:
+      internal_error (&opp->common, "regular_file(): Bad status");
+    }
+
+  /* rwflag |= O_LARGEFILE; */
+
+#if defined(HAVE_CRLF) && defined(O_BINARY)
+  crflag |= O_BINARY;
+#endif
+
+  mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+  fd = open (path, rwflag | crflag, mode);
+  if (flags->action != ACTION_UNSPECIFIED)
+    return fd;
+
+  if (fd >= 0)
+    {
+      flags->action = ACTION_READWRITE;
+      return fd;
+    }
+  if (errno != EACCES && errno != EROFS)
+     return fd;
+
+  /* retry for read-only access */
+  rwflag = O_RDONLY;
+  fd = open (path, rwflag | crflag, mode);
+  if (fd >=0)
+    {
+      flags->action = ACTION_READ;
+      return fd;               /* success */
+    }
+  
+  if (errno != EACCES)
+    return fd;                 /* failure */
+
+  /* retry for write-only access */
+  rwflag = O_WRONLY;
+  fd = open (path, rwflag | crflag, mode);
+  if (fd >=0)
+    {
+      flags->action = ACTION_WRITE;
+      return fd;               /* success */
+    }
+  return fd;                   /* failure */
+}
+
+
+/* open_external()-- Open an external file, unix specific version.
+ * Change flags->action if it is ACTION_UNSPECIFIED on entry.
+ * Returns NULL on operating system error. */
+
+stream *
+open_external (st_parameter_open *opp, unit_flags *flags)
+{
+  int fd;
+
+  if (flags->status == STATUS_SCRATCH)
+    {
+      fd = tempfile (opp);
+      if (flags->action == ACTION_UNSPECIFIED)
+       flags->action = ACTION_READWRITE;
+
+#if HAVE_UNLINK_OPEN_FILE
+      /* We can unlink scratch files now and it will go away when closed. */
+      if (fd >= 0)
+       unlink (opp->file);
+#endif
+    }
+  else
+    {
+      /* regular_file resets flags->action if it is ACTION_UNSPECIFIED and
+       * if it succeeds */
+      fd = regular_file (opp, flags);
+    }
+
+  if (fd < 0)
+    return NULL;
+  fd = fix_fd (fd);
+
+  return fd_to_stream (fd);
+}
+
+
+/* input_stream()-- Return a stream pointer to the default input stream.
+ * Called on initialization. */
+
+stream *
+input_stream (void)
+{
+  return fd_to_stream (STDIN_FILENO);
+}
+
+
+/* output_stream()-- Return a stream pointer to the default output stream.
+ * Called on initialization. */
+
+stream *
+output_stream (void)
+{
+  stream * s;
+
+#if defined(HAVE_CRLF) && defined(HAVE_SETMODE)
+  setmode (STDOUT_FILENO, O_BINARY);
+#endif
+
+  s = fd_to_stream (STDOUT_FILENO);
+  return s;
+}
+
+
+/* error_stream()-- Return a stream pointer to the default error stream.
+ * Called on initialization. */
+
+stream *
+error_stream (void)
+{
+  stream * s;
+
+#if defined(HAVE_CRLF) && defined(HAVE_SETMODE)
+  setmode (STDERR_FILENO, O_BINARY);
+#endif
+
+  s = fd_to_stream (STDERR_FILENO);
+  return s;
+}
+
+
+/* compare_file_filename()-- Given an open stream and a fortran string
+ * that is a filename, figure out if the file is the same as the
+ * filename. */
+
+int
+compare_file_filename (gfc_unit *u, const char *name, int len)
+{
+  char path[min(PATH_MAX, len + 1)];
+  struct stat st;
+#ifdef HAVE_WORKING_STAT
+  unix_stream *s;
+#else
+# ifdef __MINGW32__
+  uint64_t id1, id2;
+# endif
+#endif
+
+  if (unpack_filename (path, name, len))
+    return 0;                  /* Can't be the same */
+
+  /* If the filename doesn't exist, then there is no match with the
+   * existing file. */
+
+  if (stat (path, &st) < 0)
+    return 0;
+
+#ifdef HAVE_WORKING_STAT
+  s = (unix_stream *) (u->s);
+  return (st.st_dev == s->st_dev) && (st.st_ino == s->st_ino);
+#else
+
+# ifdef __MINGW32__
+  /* We try to match files by a unique ID.  On some filesystems (network
+     fs and FAT), we can't generate this unique ID, and will simply compare
+     filenames.  */
+  id1 = id_from_path (path);
+  id2 = id_from_fd (((unix_stream *) (u->s))->fd);
+  if (id1 || id2)
+    return (id1 == id2);
+# endif
+
+  if (len != u->file_len)
+    return 0;
+  return (memcmp(path, u->file, len) == 0);
+#endif
+}
+
+
+#ifdef HAVE_WORKING_STAT
+# define FIND_FILE0_DECL struct stat *st
+# define FIND_FILE0_ARGS st
+#else
+# define FIND_FILE0_DECL uint64_t id, const char *file, gfc_charlen_type file_len
+# define FIND_FILE0_ARGS id, file, file_len
+#endif
+
+/* find_file0()-- Recursive work function for find_file() */
+
+static gfc_unit *
+find_file0 (gfc_unit *u, FIND_FILE0_DECL)
+{
+  gfc_unit *v;
+#if defined(__MINGW32__) && !HAVE_WORKING_STAT
+  uint64_t id1;
+#endif
+
+  if (u == NULL)
+    return NULL;
+
+#ifdef HAVE_WORKING_STAT
+  if (u->s != NULL)
+    {
+      unix_stream *s = (unix_stream *) (u->s);
+      if (st[0].st_dev == s->st_dev && st[0].st_ino == s->st_ino)
+       return u;
+    }
+#else
+# ifdef __MINGW32__ 
+  if (u->s && ((id1 = id_from_fd (((unix_stream *) u->s)->fd)) || id1))
+    {
+      if (id == id1)
+       return u;
+    }
+  else
+# endif
+    if (compare_string (u->file_len, u->file, file_len, file) == 0)
+      return u;
+#endif
+
+  v = find_file0 (u->left, FIND_FILE0_ARGS);
+  if (v != NULL)
+    return v;
+
+  v = find_file0 (u->right, FIND_FILE0_ARGS);
+  if (v != NULL)
+    return v;
+
+  return NULL;
+}
+
+
+/* find_file()-- Take the current filename and see if there is a unit
+ * that has the file already open.  Returns a pointer to the unit if so. */
+
+gfc_unit *
+find_file (const char *file, gfc_charlen_type file_len)
+{
+  char path[min(PATH_MAX, file_len + 1)];
+  struct stat st[1];
+  gfc_unit *u;
+#if defined(__MINGW32__) && !HAVE_WORKING_STAT
+  uint64_t id = 0ULL;
+#endif
+
+  if (unpack_filename (path, file, file_len))
+    return NULL;
+
+  if (stat (path, &st[0]) < 0)
+    return NULL;
+
+#if defined(__MINGW32__) && !HAVE_WORKING_STAT
+  id = id_from_path (path);
+#endif
+
+  __gthread_mutex_lock (&unit_lock);
+retry:
+  u = find_file0 (unit_root, FIND_FILE0_ARGS);
+  if (u != NULL)
+    {
+      /* Fast path.  */
+      if (! __gthread_mutex_trylock (&u->lock))
+       {
+         /* assert (u->closed == 0); */
+         __gthread_mutex_unlock (&unit_lock);
+         return u;
+       }
+
+      inc_waiting_locked (u);
+    }
+  __gthread_mutex_unlock (&unit_lock);
+  if (u != NULL)
+    {
+      __gthread_mutex_lock (&u->lock);
+      if (u->closed)
+       {
+         __gthread_mutex_lock (&unit_lock);
+         __gthread_mutex_unlock (&u->lock);
+         if (predec_waiting_locked (u) == 0)
+           free (u);
+         goto retry;
+       }
+
+      dec_waiting_unlocked (u);
+    }
+  return u;
+}
+
+static gfc_unit *
+flush_all_units_1 (gfc_unit *u, int min_unit)
+{
+  while (u != NULL)
+    {
+      if (u->unit_number > min_unit)
+       {
+         gfc_unit *r = flush_all_units_1 (u->left, min_unit);
+         if (r != NULL)
+           return r;
+       }
+      if (u->unit_number >= min_unit)
+       {
+         if (__gthread_mutex_trylock (&u->lock))
+           return u;
+         if (u->s)
+           sflush (u->s);
+         __gthread_mutex_unlock (&u->lock);
+       }
+      u = u->right;
+    }
+  return NULL;
+}
+
+void
+flush_all_units (void)
+{
+  gfc_unit *u;
+  int min_unit = 0;
+
+  __gthread_mutex_lock (&unit_lock);
+  do
+    {
+      u = flush_all_units_1 (unit_root, min_unit);
+      if (u != NULL)
+       inc_waiting_locked (u);
+      __gthread_mutex_unlock (&unit_lock);
+      if (u == NULL)
+       return;
+
+      __gthread_mutex_lock (&u->lock);
+
+      min_unit = u->unit_number + 1;
+
+      if (u->closed == 0)
+       {
+         sflush (u->s);
+         __gthread_mutex_lock (&unit_lock);
+         __gthread_mutex_unlock (&u->lock);
+         (void) predec_waiting_locked (u);
+       }
+      else
+       {
+         __gthread_mutex_lock (&unit_lock);
+         __gthread_mutex_unlock (&u->lock);
+         if (predec_waiting_locked (u) == 0)
+           free (u);
+       }
+    }
+  while (1);
+}
+
+
+/* delete_file()-- Given a unit structure, delete the file associated
+ * with the unit.  Returns nonzero if something went wrong. */
+
+int
+delete_file (gfc_unit * u)
+{
+  char path[min(PATH_MAX, u->file_len + 1)];
+  int err = unpack_filename (path, u->file, u->file_len);
+
+  if (err)
+    {                          /* Shouldn't be possible */
+      errno = err;
+      return 1;
+    }
+
+  return unlink (path);
+}
+
+
+/* file_exists()-- Returns nonzero if the current filename exists on
+ * the system */
+
+int
+file_exists (const char *file, gfc_charlen_type file_len)
+{
+  char path[min(PATH_MAX, file_len + 1)];
+
+  if (unpack_filename (path, file, file_len))
+    return 0;
+
+  return !(access (path, F_OK));
+}
+
+
+/* file_size()-- Returns the size of the file.  */
+
+GFC_IO_INT
+file_size (const char *file, gfc_charlen_type file_len)
+{
+  char path[min(PATH_MAX, file_len + 1)];
+  struct stat statbuf;
+
+  if (unpack_filename (path, file, file_len))
+    return -1;
+
+  if (stat (path, &statbuf) < 0)
+    return -1;
+
+  return (GFC_IO_INT) statbuf.st_size;
+}
+
+static const char yes[] = "YES", no[] = "NO", unknown[] = "UNKNOWN";
+
+/* inquire_sequential()-- Given a fortran string, determine if the
+ * file is suitable for sequential access.  Returns a C-style
+ * string. */
+
+const char *
+inquire_sequential (const char *string, int len)
+{
+  char path[min(PATH_MAX, len + 1)];
+  struct stat statbuf;
+
+  if (string == NULL ||
+      unpack_filename (path, string, len) || stat (path, &statbuf) < 0)
+    return unknown;
+
+  if (S_ISREG (statbuf.st_mode) ||
+      S_ISCHR (statbuf.st_mode) || S_ISFIFO (statbuf.st_mode))
+    return unknown;
+
+  if (S_ISDIR (statbuf.st_mode) || S_ISBLK (statbuf.st_mode))
+    return no;
+
+  return unknown;
+}
+
+
+/* inquire_direct()-- Given a fortran string, determine if the file is
+ * suitable for direct access.  Returns a C-style string. */
+
+const char *
+inquire_direct (const char *string, int len)
+{
+  char path[min(PATH_MAX, len + 1)];
+  struct stat statbuf;
+
+  if (string == NULL ||
+      unpack_filename (path, string, len) || stat (path, &statbuf) < 0)
+    return unknown;
+
+  if (S_ISREG (statbuf.st_mode) || S_ISBLK (statbuf.st_mode))
+    return unknown;
+
+  if (S_ISDIR (statbuf.st_mode) ||
+      S_ISCHR (statbuf.st_mode) || S_ISFIFO (statbuf.st_mode))
+    return no;
+
+  return unknown;
+}
+
+
+/* inquire_formatted()-- Given a fortran string, determine if the file
+ * is suitable for formatted form.  Returns a C-style string. */
+
+const char *
+inquire_formatted (const char *string, int len)
+{
+  char path[min(PATH_MAX, len + 1)];
+  struct stat statbuf;
+
+  if (string == NULL ||
+      unpack_filename (path, string, len) || stat (path, &statbuf) < 0)
+    return unknown;
+
+  if (S_ISREG (statbuf.st_mode) ||
+      S_ISBLK (statbuf.st_mode) ||
+      S_ISCHR (statbuf.st_mode) || S_ISFIFO (statbuf.st_mode))
+    return unknown;
+
+  if (S_ISDIR (statbuf.st_mode))
+    return no;
+
+  return unknown;
+}
+
+
+/* inquire_unformatted()-- Given a fortran string, determine if the file
+ * is suitable for unformatted form.  Returns a C-style string. */
+
+const char *
+inquire_unformatted (const char *string, int len)
+{
+  return inquire_formatted (string, len);
+}
+
+
+/* inquire_access()-- Given a fortran string, determine if the file is
+ * suitable for access. */
+
+static const char *
+inquire_access (const char *string, int len, int mode)
+{
+  char path[min(PATH_MAX, len + 1)];
+
+  if (string == NULL || unpack_filename (path, string, len) ||
+      access (path, mode) < 0)
+    return no;
+
+  return yes;
+}
+
+
+/* inquire_read()-- Given a fortran string, determine if the file is
+ * suitable for READ access. */
+
+const char *
+inquire_read (const char *string, int len)
+{
+  return inquire_access (string, len, R_OK);
+}
+
+
+/* inquire_write()-- Given a fortran string, determine if the file is
+ * suitable for READ access. */
+
+const char *
+inquire_write (const char *string, int len)
+{
+  return inquire_access (string, len, W_OK);
+}
+
+
+/* inquire_readwrite()-- Given a fortran string, determine if the file is
+ * suitable for read and write access. */
+
+const char *
+inquire_readwrite (const char *string, int len)
+{
+  return inquire_access (string, len, R_OK | W_OK);
+}
+
+
+int
+stream_isatty (stream *s)
+{
+  return isatty (((unix_stream *) s)->fd);
+}
+
+int
+stream_ttyname (stream *s  __attribute__ ((unused)),
+               char * buf  __attribute__ ((unused)),
+               size_t buflen  __attribute__ ((unused)))
+{
+#ifdef HAVE_TTYNAME_R
+  return ttyname_r (((unix_stream *) s)->fd, buf, buflen);
+#elif defined HAVE_TTYNAME
+  char *p;
+  size_t plen;
+  p = ttyname (((unix_stream *) s)->fd);
+  if (!p)
+    return errno;
+  plen = strlen (p);
+  if (buflen < plen)
+    plen = buflen;
+  memcpy (buf, p, plen);
+  return 0;
+#else
+  return ENOSYS;
+#endif
+}
+
+
+
+
+/* How files are stored:  This is an operating-system specific issue,
+   and therefore belongs here.  There are three cases to consider.
+
+   Direct Access:
+      Records are written as block of bytes corresponding to the record
+      length of the file.  This goes for both formatted and unformatted
+      records.  Positioning is done explicitly for each data transfer,
+      so positioning is not much of an issue.
+
+   Sequential Formatted:
+      Records are separated by newline characters.  The newline character
+      is prohibited from appearing in a string.  If it does, this will be
+      messed up on the next read.  End of file is also the end of a record.
+
+   Sequential Unformatted:
+      In this case, we are merely copying bytes to and from main storage,
+      yet we need to keep track of varying record lengths.  We adopt
+      the solution used by f2c.  Each record contains a pair of length
+      markers:
+
+       Length of record n in bytes
+       Data of record n
+       Length of record n in bytes
+
+       Length of record n+1 in bytes
+       Data of record n+1
+       Length of record n+1 in bytes
+
+     The length is stored at the end of a record to allow backspacing to the
+     previous record.  Between data transfer statements, the file pointer
+     is left pointing to the first length of the current record.
+
+     ENDFILE records are never explicitly stored.
+
+*/
diff --git a/l4/pkg/libgfortran/lib/contrib/io/unix.h b/l4/pkg/libgfortran/lib/contrib/io/unix.h
new file mode 100644 (file)
index 0000000..52f3e0c
--- /dev/null
@@ -0,0 +1,187 @@
+/* Copyright (C) 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Janne Blomqvist
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GFOR_UNIX_H
+#define GFOR_UNIX_H
+
+#include "io.h"
+
+
+struct stream
+{
+  ssize_t (*read) (struct stream *, void *, ssize_t);
+  ssize_t (*write) (struct stream *, const void *, ssize_t);
+  gfc_offset (*seek) (struct stream *, gfc_offset, int);
+  gfc_offset (*tell) (struct stream *);
+  gfc_offset (*size) (struct stream *);
+  /* Avoid keyword truncate due to AIX namespace collision.  */
+  int (*trunc) (struct stream *, gfc_offset);
+  int (*flush) (struct stream *);
+  int (*close) (struct stream *);
+};
+
+
+/* Inline functions for doing file I/O given a stream.  */
+static inline ssize_t
+sread (stream * s, void * buf, ssize_t nbyte)
+{
+  return s->read (s, buf, nbyte);
+}
+
+static inline ssize_t
+swrite (stream * s, const void * buf, ssize_t nbyte)
+{
+  return s->write (s, buf, nbyte);
+}
+
+static inline gfc_offset
+sseek (stream * s, gfc_offset offset, int whence)
+{
+  return s->seek (s, offset, whence);
+}
+
+static inline gfc_offset
+stell (stream * s)
+{
+  return s->tell (s);
+}
+
+static inline gfc_offset
+ssize (stream * s)
+{
+  return s->size (s);
+}
+
+static inline int
+struncate (stream * s, gfc_offset length)
+{
+  return s->trunc (s, length);
+}
+
+static inline int
+sflush (stream * s)
+{
+  return s->flush (s);
+}
+
+static inline int
+sclose (stream * s)
+{
+  return s->close (s);
+}
+
+
+extern int compare_files (stream *, stream *);
+internal_proto(compare_files);
+
+extern stream *open_external (st_parameter_open *, unit_flags *);
+internal_proto(open_external);
+
+extern stream *open_internal (char *, int, gfc_offset);
+internal_proto(open_internal);
+
+extern stream *open_internal4 (char *, int, gfc_offset);
+internal_proto(open_internal4);
+
+extern char * mem_alloc_w (stream *, int *);
+internal_proto(mem_alloc_w);
+
+extern char * mem_alloc_r (stream *, int *);
+internal_proto(mem_alloc_r);
+
+extern gfc_char4_t * mem_alloc_w4 (stream *, int *);
+internal_proto(mem_alloc_w4);
+
+extern char * mem_alloc_r4 (stream *, int *);
+internal_proto(mem_alloc_r4);
+
+extern stream *input_stream (void);
+internal_proto(input_stream);
+
+extern stream *output_stream (void);
+internal_proto(output_stream);
+
+extern stream *error_stream (void);
+internal_proto(error_stream);
+
+extern int compare_file_filename (gfc_unit *, const char *, int);
+internal_proto(compare_file_filename);
+
+extern gfc_unit *find_file (const char *file, gfc_charlen_type file_len);
+internal_proto(find_file);
+
+extern int delete_file (gfc_unit *);
+internal_proto(delete_file);
+
+extern int file_exists (const char *file, gfc_charlen_type file_len);
+internal_proto(file_exists);
+
+extern GFC_IO_INT file_size (const char *file, gfc_charlen_type file_len);
+internal_proto(file_size);
+
+extern const char *inquire_sequential (const char *, int);
+internal_proto(inquire_sequential);
+
+extern const char *inquire_direct (const char *, int);
+internal_proto(inquire_direct);
+
+extern const char *inquire_formatted (const char *, int);
+internal_proto(inquire_formatted);
+
+extern const char *inquire_unformatted (const char *, int);
+internal_proto(inquire_unformatted);
+
+extern const char *inquire_read (const char *, int);
+internal_proto(inquire_read);
+
+extern const char *inquire_write (const char *, int);
+internal_proto(inquire_write);
+
+extern const char *inquire_readwrite (const char *, int);
+internal_proto(inquire_readwrite);
+
+extern void flush_if_preconnected (stream *);
+internal_proto(flush_if_preconnected);
+
+extern int stream_isatty (stream *);
+internal_proto(stream_isatty);
+
+#ifndef TTY_NAME_MAX
+#ifdef _POSIX_TTY_NAME_MAX
+#define TTY_NAME_MAX _POSIX_TTY_NAME_MAX
+#else
+/* sysconf(_SC_TTY_NAME_MAX) = 32 which should be enough.  */
+#define TTY_NAME_MAX 32
+#endif
+#endif
+
+extern int stream_ttyname (stream *, char *, size_t);
+internal_proto(stream_ttyname);
+
+extern int unpack_filename (char *, const char *, int);
+internal_proto(unpack_filename);
+
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/io/write.c b/l4/pkg/libgfortran/lib/contrib/io/write.c
new file mode 100644 (file)
index 0000000..8be3a5a
--- /dev/null
@@ -0,0 +1,2007 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   Namelist output contributed by Paul Thomas
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "io.h"
+#include "format.h"
+#include "unix.h"
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <errno.h>
+#define star_fill(p, n) memset(p, '*', n)
+
+typedef unsigned char uchar;
+
+/* Helper functions for character(kind=4) internal units.  These are needed
+   by write_float.def.  */
+
+static void
+memcpy4 (gfc_char4_t *dest, const char *source, int k)
+{
+  int j;
+  
+  const char *p = source;
+  for (j = 0; j < k; j++)
+    *dest++ = (gfc_char4_t) *p++;
+}
+
+/* This include contains the heart and soul of formatted floating point.  */
+#include "write_float.def"
+
+/* Write out default char4.  */
+
+static void
+write_default_char4 (st_parameter_dt *dtp, const gfc_char4_t *source,
+                    int src_len, int w_len)
+{
+  char *p;
+  int j, k = 0;
+  gfc_char4_t c;
+  uchar d;
+      
+  /* Take care of preceding blanks.  */
+  if (w_len > src_len)
+    {
+      k = w_len - src_len;
+      p = write_block (dtp, k);
+      if (p == NULL)
+       return;
+      if (is_char4_unit (dtp))
+       {
+         gfc_char4_t *p4 = (gfc_char4_t *) p;
+         memset4 (p4, ' ', k);
+       }
+      else
+       memset (p, ' ', k);
+    }
+
+  /* Get ready to handle delimiters if needed.  */
+  switch (dtp->u.p.current_unit->delim_status)
+    {
+    case DELIM_APOSTROPHE:
+      d = '\'';
+      break;
+    case DELIM_QUOTE:
+      d = '"';
+      break;
+    default:
+      d = ' ';
+      break;
+    }
+
+  /* Now process the remaining characters, one at a time.  */
+  for (j = 0; j < src_len; j++)
+    {
+      c = source[j];
+      if (is_char4_unit (dtp))
+       {
+         gfc_char4_t *q;
+         /* Handle delimiters if any.  */
+         if (c == d && d != ' ')
+           {
+             p = write_block (dtp, 2);
+             if (p == NULL)
+               return;
+             q = (gfc_char4_t *) p;
+             *q++ = c;
+           }
+         else
+           {
+             p = write_block (dtp, 1);
+             if (p == NULL)
+               return;
+             q = (gfc_char4_t *) p;
+           }
+         *q = c;
+       }
+      else
+       {
+         /* Handle delimiters if any.  */
+         if (c == d && d != ' ')
+           {
+             p = write_block (dtp, 2);
+             if (p == NULL)
+               return;
+             *p++ = (uchar) c;
+           }
+          else
+           {
+             p = write_block (dtp, 1);
+             if (p == NULL)
+               return;
+           }
+           *p = c > 255 ? '?' : (uchar) c;
+       }
+    }
+}
+
+
+/* Write out UTF-8 converted from char4.  */
+
+static void
+write_utf8_char4 (st_parameter_dt *dtp, gfc_char4_t *source,
+                    int src_len, int w_len)
+{
+  char *p;
+  int j, k = 0;
+  gfc_char4_t c;
+  static const uchar masks[6] =  { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+  static const uchar limits[6] = { 0x80, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE };
+  int nbytes;
+  uchar buf[6], d, *q; 
+
+  /* Take care of preceding blanks.  */
+  if (w_len > src_len)
+    {
+      k = w_len - src_len;
+      p = write_block (dtp, k);
+      if (p == NULL)
+       return;
+      memset (p, ' ', k);
+    }
+
+  /* Get ready to handle delimiters if needed.  */
+  switch (dtp->u.p.current_unit->delim_status)
+    {
+    case DELIM_APOSTROPHE:
+      d = '\'';
+      break;
+    case DELIM_QUOTE:
+      d = '"';
+      break;
+    default:
+      d = ' ';
+      break;
+    }
+
+  /* Now process the remaining characters, one at a time.  */
+  for (j = k; j < src_len; j++)
+    {
+      c = source[j];
+      if (c < 0x80)
+       {
+         /* Handle the delimiters if any.  */
+         if (c == d && d != ' ')
+           {
+             p = write_block (dtp, 2);
+             if (p == NULL)
+               return;
+             *p++ = (uchar) c;
+           }
+         else
+           {
+             p = write_block (dtp, 1);
+             if (p == NULL)
+               return;
+           }
+         *p = (uchar) c;
+       }
+      else
+       {
+         /* Convert to UTF-8 sequence.  */
+         nbytes = 1;
+         q = &buf[6];
+
+         do
+           {
+             *--q = ((c & 0x3F) | 0x80);
+             c >>= 6;
+             nbytes++;
+           }
+         while (c >= 0x3F || (c & limits[nbytes-1]));
+
+         *--q = (c | masks[nbytes-1]);
+
+         p = write_block (dtp, nbytes);
+         if (p == NULL)
+           return;
+
+         while (q < &buf[6])
+           *p++ = *q++;
+       }
+    }
+}
+
+
+void
+write_a (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
+{
+  int wlen;
+  char *p;
+
+  wlen = f->u.string.length < 0
+        || (f->format == FMT_G && f->u.string.length == 0)
+        ? len : f->u.string.length;
+
+#ifdef HAVE_CRLF
+  /* If this is formatted STREAM IO convert any embedded line feed characters
+     to CR_LF on systems that use that sequence for newlines.  See F2003
+     Standard sections 10.6.3 and 9.9 for further information.  */
+  if (is_stream_io (dtp))
+    {
+      const char crlf[] = "\r\n";
+      int i, q, bytes;
+      q = bytes = 0;
+
+      /* Write out any padding if needed.  */
+      if (len < wlen)
+       {
+         p = write_block (dtp, wlen - len);
+         if (p == NULL)
+           return;
+         memset (p, ' ', wlen - len);
+       }
+
+      /* Scan the source string looking for '\n' and convert it if found.  */
+      for (i = 0; i < wlen; i++)
+       {
+         if (source[i] == '\n')
+           {
+             /* Write out the previously scanned characters in the string.  */
+             if (bytes > 0)
+               {
+                 p = write_block (dtp, bytes);
+                 if (p == NULL)
+                   return;
+                 memcpy (p, &source[q], bytes);
+                 q += bytes;
+                 bytes = 0;
+               }
+
+             /* Write out the CR_LF sequence.  */ 
+             q++;
+             p = write_block (dtp, 2);
+              if (p == NULL)
+                return;
+             memcpy (p, crlf, 2);
+           }
+         else
+           bytes++;
+       }
+
+      /*  Write out any remaining bytes if no LF was found.  */
+      if (bytes > 0)
+       {
+         p = write_block (dtp, bytes);
+         if (p == NULL)
+           return;
+         memcpy (p, &source[q], bytes);
+       }
+    }
+  else
+    {
+#endif
+      p = write_block (dtp, wlen);
+      if (p == NULL)
+       return;
+
+      if (unlikely (is_char4_unit (dtp)))
+       {
+         gfc_char4_t *p4 = (gfc_char4_t *) p;
+         if (wlen < len)
+           memcpy4 (p4, source, wlen);
+         else
+           {
+             memset4 (p4, ' ', wlen - len);
+             memcpy4 (p4 + wlen - len, source, len);
+           }
+         return;
+       }
+
+      if (wlen < len)
+       memcpy (p, source, wlen);
+      else
+       {
+         memset (p, ' ', wlen - len);
+         memcpy (p + wlen - len, source, len);
+       }
+#ifdef HAVE_CRLF
+    }
+#endif
+}
+
+
+/* The primary difference between write_a_char4 and write_a is that we have to
+   deal with writing from the first byte of the 4-byte character and pay
+   attention to the most significant bytes.  For ENCODING="default" write the
+   lowest significant byte. If the 3 most significant bytes contain
+   non-zero values, emit a '?'.  For ENCODING="utf-8", convert the UCS-32 value
+   to the UTF-8 encoded string before writing out.  */
+
+void
+write_a_char4 (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
+{
+  int wlen;
+  gfc_char4_t *q;
+
+  wlen = f->u.string.length < 0
+        || (f->format == FMT_G && f->u.string.length == 0)
+        ? len : f->u.string.length;
+
+  q = (gfc_char4_t *) source;
+#ifdef HAVE_CRLF
+  /* If this is formatted STREAM IO convert any embedded line feed characters
+     to CR_LF on systems that use that sequence for newlines.  See F2003
+     Standard sections 10.6.3 and 9.9 for further information.  */
+  if (is_stream_io (dtp))
+    {
+      const gfc_char4_t crlf[] = {0x000d,0x000a};
+      int i, bytes;
+      gfc_char4_t *qq;
+      bytes = 0;
+
+      /* Write out any padding if needed.  */
+      if (len < wlen)
+       {
+         char *p;
+         p = write_block (dtp, wlen - len);
+         if (p == NULL)
+           return;
+         memset (p, ' ', wlen - len);
+       }
+
+      /* Scan the source string looking for '\n' and convert it if found.  */
+      qq = (gfc_char4_t *) source;
+      for (i = 0; i < wlen; i++)
+       {
+         if (qq[i] == '\n')
+           {
+             /* Write out the previously scanned characters in the string.  */
+             if (bytes > 0)
+               {
+                 if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+                   write_utf8_char4 (dtp, q, bytes, 0);
+                 else
+                   write_default_char4 (dtp, q, bytes, 0);
+                 bytes = 0;
+               }
+
+             /* Write out the CR_LF sequence.  */ 
+             write_default_char4 (dtp, crlf, 2, 0);
+           }
+         else
+           bytes++;
+       }
+
+      /*  Write out any remaining bytes if no LF was found.  */
+      if (bytes > 0)
+       {
+         if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+           write_utf8_char4 (dtp, q, bytes, 0);
+         else
+           write_default_char4 (dtp, q, bytes, 0);
+       }
+    }
+  else
+    {
+#endif
+      if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+       write_utf8_char4 (dtp, q, len, wlen);
+      else
+       write_default_char4 (dtp, q, len, wlen);
+#ifdef HAVE_CRLF
+    }
+#endif
+}
+
+
+static GFC_INTEGER_LARGEST
+extract_int (const void *p, int len)
+{
+  GFC_INTEGER_LARGEST i = 0;
+
+  if (p == NULL)
+    return i;
+
+  switch (len)
+    {
+    case 1:
+      {
+       GFC_INTEGER_1 tmp;
+       memcpy ((void *) &tmp, p, len);
+       i = tmp;
+      }
+      break;
+    case 2:
+      {
+       GFC_INTEGER_2 tmp;
+       memcpy ((void *) &tmp, p, len);
+       i = tmp;
+      }
+      break;
+    case 4:
+      {
+       GFC_INTEGER_4 tmp;
+       memcpy ((void *) &tmp, p, len);
+       i = tmp;
+      }
+      break;
+    case 8:
+      {
+       GFC_INTEGER_8 tmp;
+       memcpy ((void *) &tmp, p, len);
+       i = tmp;
+      }
+      break;
+#ifdef HAVE_GFC_INTEGER_16
+    case 16:
+      {
+       GFC_INTEGER_16 tmp;
+       memcpy ((void *) &tmp, p, len);
+       i = tmp;
+      }
+      break;
+#endif
+    default:
+      internal_error (NULL, "bad integer kind");
+    }
+
+  return i;
+}
+
+static GFC_UINTEGER_LARGEST
+extract_uint (const void *p, int len)
+{
+  GFC_UINTEGER_LARGEST i = 0;
+
+  if (p == NULL)
+    return i;
+
+  switch (len)
+    {
+    case 1:
+      {
+       GFC_INTEGER_1 tmp;
+       memcpy ((void *) &tmp, p, len);
+       i = (GFC_UINTEGER_1) tmp;
+      }
+      break;
+    case 2:
+      {
+       GFC_INTEGER_2 tmp;
+       memcpy ((void *) &tmp, p, len);
+       i = (GFC_UINTEGER_2) tmp;
+      }
+      break;
+    case 4:
+      {
+       GFC_INTEGER_4 tmp;
+       memcpy ((void *) &tmp, p, len);
+       i = (GFC_UINTEGER_4) tmp;
+      }
+      break;
+    case 8:
+      {
+       GFC_INTEGER_8 tmp;
+       memcpy ((void *) &tmp, p, len);
+       i = (GFC_UINTEGER_8) tmp;
+      }
+      break;
+#ifdef HAVE_GFC_INTEGER_16
+    case 10:
+    case 16:
+      {
+       GFC_INTEGER_16 tmp = 0;
+       memcpy ((void *) &tmp, p, len);
+       i = (GFC_UINTEGER_16) tmp;
+      }
+      break;
+#endif
+    default:
+      internal_error (NULL, "bad integer kind");
+    }
+
+  return i;
+}
+
+
+void
+write_l (st_parameter_dt *dtp, const fnode *f, char *source, int len)
+{
+  char *p;
+  int wlen;
+  GFC_INTEGER_LARGEST n;
+
+  wlen = (f->format == FMT_G && f->u.w == 0) ? 1 : f->u.w;
+  
+  p = write_block (dtp, wlen);
+  if (p == NULL)
+    return;
+
+  n = extract_int (source, len);
+
+  if (unlikely (is_char4_unit (dtp)))
+    {
+      gfc_char4_t *p4 = (gfc_char4_t *) p;
+      memset4 (p4, ' ', wlen -1);
+      p4[wlen - 1] = (n) ? 'T' : 'F';
+      return;
+    }
+
+  memset (p, ' ', wlen -1);
+  p[wlen - 1] = (n) ? 'T' : 'F';
+}
+
+
+static void
+write_boz (st_parameter_dt *dtp, const fnode *f, const char *q, int n)
+{
+  int w, m, digits, nzero, nblank;
+  char *p;
+
+  w = f->u.integer.w;
+  m = f->u.integer.m;
+
+  /* Special case:  */
+
+  if (m == 0 && n == 0)
+    {
+      if (w == 0)
+        w = 1;
+
+      p = write_block (dtp, w);
+      if (p == NULL)
+        return;
+      if (unlikely (is_char4_unit (dtp)))
+       {
+         gfc_char4_t *p4 = (gfc_char4_t *) p;
+         memset4 (p4, ' ', w);
+       }
+      else
+       memset (p, ' ', w);
+      goto done;
+    }
+
+  digits = strlen (q);
+
+  /* Select a width if none was specified.  The idea here is to always
+     print something.  */
+
+  if (w == 0)
+    w = ((digits < m) ? m : digits);
+
+  p = write_block (dtp, w);
+  if (p == NULL)
+    return;
+
+  nzero = 0;
+  if (digits < m)
+    nzero = m - digits;
+
+  /* See if things will work.  */
+
+  nblank = w - (nzero + digits);
+
+  if (unlikely (is_char4_unit (dtp)))
+    {
+      gfc_char4_t *p4 = (gfc_char4_t *) p;
+      if (nblank < 0)
+       {
+         memset4 (p4, '*', w);
+         return;
+       }
+
+      if (!dtp->u.p.no_leading_blank)
+       {
+         memset4 (p4, ' ', nblank);
+         q += nblank;
+         memset4 (p4, '0', nzero);
+         q += nzero;
+         memcpy4 (p4, q, digits);
+       }
+      else
+       {
+         memset4 (p4, '0', nzero);
+         q += nzero;
+         memcpy4 (p4, q, digits);
+         q += digits;
+         memset4 (p4, ' ', nblank);
+         dtp->u.p.no_leading_blank = 0;
+       }
+      return;
+    }
+
+  if (nblank < 0)
+    {
+      star_fill (p, w);
+      goto done;
+    }
+
+  if (!dtp->u.p.no_leading_blank)
+    {
+      memset (p, ' ', nblank);
+      p += nblank;
+      memset (p, '0', nzero);
+      p += nzero;
+      memcpy (p, q, digits);
+    }
+  else
+    {
+      memset (p, '0', nzero);
+      p += nzero;
+      memcpy (p, q, digits);
+      p += digits;
+      memset (p, ' ', nblank);
+      dtp->u.p.no_leading_blank = 0;
+    }
+
+ done:
+  return;
+}
+
+static void
+write_decimal (st_parameter_dt *dtp, const fnode *f, const char *source,
+              int len,
+               const char *(*conv) (GFC_INTEGER_LARGEST, char *, size_t))
+{
+  GFC_INTEGER_LARGEST n = 0;
+  int w, m, digits, nsign, nzero, nblank;
+  char *p;
+  const char *q;
+  sign_t sign;
+  char itoa_buf[GFC_BTOA_BUF_SIZE];
+
+  w = f->u.integer.w;
+  m = f->format == FMT_G ? -1 : f->u.integer.m;
+
+  n = extract_int (source, len);
+
+  /* Special case:  */
+  if (m == 0 && n == 0)
+    {
+      if (w == 0)
+        w = 1;
+
+      p = write_block (dtp, w);
+      if (p == NULL)
+        return;
+      if (unlikely (is_char4_unit (dtp)))
+       {
+         gfc_char4_t *p4 = (gfc_char4_t *) p;
+         memset4 (p4, ' ', w);
+       }
+      else
+       memset (p, ' ', w);
+      goto done;
+    }
+
+  sign = calculate_sign (dtp, n < 0);
+  if (n < 0)
+    n = -n;
+  nsign = sign == S_NONE ? 0 : 1;
+  
+  /* conv calls itoa which sets the negative sign needed
+     by write_integer. The sign '+' or '-' is set below based on sign
+     calculated above, so we just point past the sign in the string
+     before proceeding to avoid double signs in corner cases.
+     (see PR38504)  */
+  q = conv (n, itoa_buf, sizeof (itoa_buf));
+  if (*q == '-')
+    q++;
+
+  digits = strlen (q);
+
+  /* Select a width if none was specified.  The idea here is to always
+     print something.  */
+
+  if (w == 0)
+    w = ((digits < m) ? m : digits) + nsign;
+
+  p = write_block (dtp, w);
+  if (p == NULL)
+    return;
+
+  nzero = 0;
+  if (digits < m)
+    nzero = m - digits;
+
+  /* See if things will work.  */
+
+  nblank = w - (nsign + nzero + digits);
+
+  if (unlikely (is_char4_unit (dtp)))
+    {
+      gfc_char4_t * p4 = (gfc_char4_t *) p;
+      if (nblank < 0)
+       {
+         memset4 (p4, '*', w);
+         goto done;
+       }
+
+      memset4 (p4, ' ', nblank);
+      p4 += nblank;
+
+      switch (sign)
+       {
+       case S_PLUS:
+         *p4++ = '+';
+         break;
+       case S_MINUS:
+         *p4++ = '-';
+         break;
+       case S_NONE:
+         break;
+       }
+
+      memset4 (p4, '0', nzero);
+      p4 += nzero;
+
+      memcpy4 (p4, q, digits);
+      return;
+    }
+
+  if (nblank < 0)
+    {
+      star_fill (p, w);
+      goto done;
+    }
+
+  memset (p, ' ', nblank);
+  p += nblank;
+
+  switch (sign)
+    {
+    case S_PLUS:
+      *p++ = '+';
+      break;
+    case S_MINUS:
+      *p++ = '-';
+      break;
+    case S_NONE:
+      break;
+    }
+
+  memset (p, '0', nzero);
+  p += nzero;
+
+  memcpy (p, q, digits);
+
+ done:
+  return;
+}
+
+
+/* Convert unsigned octal to ascii.  */
+
+static const char *
+otoa (GFC_UINTEGER_LARGEST n, char *buffer, size_t len)
+{
+  char *p;
+
+  assert (len >= GFC_OTOA_BUF_SIZE);
+
+  if (n == 0)
+    return "0";
+
+  p = buffer + GFC_OTOA_BUF_SIZE - 1;
+  *p = '\0';
+
+  while (n != 0)
+    {
+      *--p = '0' + (n & 7);
+      n >>= 3;
+    }
+
+  return p;
+}
+
+
+/* Convert unsigned binary to ascii.  */
+
+static const char *
+btoa (GFC_UINTEGER_LARGEST n, char *buffer, size_t len)
+{
+  char *p;
+
+  assert (len >= GFC_BTOA_BUF_SIZE);
+
+  if (n == 0)
+    return "0";
+
+  p = buffer + GFC_BTOA_BUF_SIZE - 1;
+  *p = '\0';
+
+  while (n != 0)
+    {
+      *--p = '0' + (n & 1);
+      n >>= 1;
+    }
+
+  return p;
+}
+
+/* The following three functions, btoa_big, otoa_big, and ztoa_big, are needed
+   to convert large reals with kind sizes that exceed the largest integer type
+   available on certain platforms.  In these cases, byte by byte conversion is
+   performed. Endianess is taken into account.  */
+
+/* Conversion to binary.  */
+
+static const char *
+btoa_big (const char *s, char *buffer, int len, GFC_UINTEGER_LARGEST *n)
+{
+  char *q;
+  int i, j;
+  
+  q = buffer;
+  if (big_endian)
+    {
+      const char *p = s;
+      for (i = 0; i < len; i++)
+       {
+         char c = *p;
+
+         /* Test for zero. Needed by write_boz later.  */
+         if (*p != 0)
+           *n = 1;
+
+         for (j = 0; j < 8; j++)
+           {
+             *q++ = (c & 128) ? '1' : '0';
+             c <<= 1;
+           }
+         p++;
+       }
+    }
+  else
+    {
+      const char *p = s + len - 1;
+      for (i = 0; i < len; i++)
+       {
+         char c = *p;
+
+         /* Test for zero. Needed by write_boz later.  */
+         if (*p != 0)
+           *n = 1;
+
+         for (j = 0; j < 8; j++)
+           {
+             *q++ = (c & 128) ? '1' : '0';
+             c <<= 1;
+           }
+         p--;
+       }
+    }
+
+  *q = '\0';
+
+  if (*n == 0)
+    return "0";
+
+  /* Move past any leading zeros.  */  
+  while (*buffer == '0')
+    buffer++;
+
+  return buffer;
+
+}
+
+/* Conversion to octal.  */
+
+static const char *
+otoa_big (const char *s, char *buffer, int len, GFC_UINTEGER_LARGEST *n)
+{
+  char *q;
+  int i, j, k;
+  uint8_t octet;
+
+  q = buffer + GFC_OTOA_BUF_SIZE - 1;
+  *q = '\0';
+  i = k = octet = 0;
+
+  if (big_endian)
+    {
+      const char *p = s + len - 1;
+      char c = *p;
+      while (i < len)
+       {
+         /* Test for zero. Needed by write_boz later.  */
+         if (*p != 0)
+           *n = 1;
+
+         for (j = 0; j < 3 && i < len; j++)
+           {
+             octet |= (c & 1) << j;
+             c >>= 1;
+             if (++k > 7)
+               {
+                 i++;
+                 k = 0;
+                 c = *--p;
+               }
+           }
+         *--q = '0' + octet;
+         octet = 0;
+       }
+    }
+  else
+    {
+      const char *p = s;
+      char c = *p;
+      while (i < len)
+       {
+         /* Test for zero. Needed by write_boz later.  */
+         if (*p != 0)
+           *n = 1;
+
+         for (j = 0; j < 3 && i < len; j++)
+           {
+             octet |= (c & 1) << j;
+             c >>= 1;
+             if (++k > 7)
+               {
+                 i++;
+                 k = 0;
+                 c = *++p;
+               }
+           }
+         *--q = '0' + octet;
+         octet = 0;
+       }
+    }
+
+  if (*n == 0)
+    return "0";
+
+  /* Move past any leading zeros.  */  
+  while (*q == '0')
+    q++;
+
+  return q;
+}
+
+/* Conversion to hexidecimal.  */
+
+static const char *
+ztoa_big (const char *s, char *buffer, int len, GFC_UINTEGER_LARGEST *n)
+{
+  static char a[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
+    '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+
+  char *q;
+  uint8_t h, l;
+  int i;
+  
+  q = buffer;
+  
+  if (big_endian)
+    {
+      const char *p = s;
+      for (i = 0; i < len; i++)
+       {
+         /* Test for zero. Needed by write_boz later.  */
+         if (*p != 0)
+           *n = 1;
+
+         h = (*p >> 4) & 0x0F;
+         l = *p++ & 0x0F;
+         *q++ = a[h];
+         *q++ = a[l];
+       }
+    }
+  else
+    {
+      const char *p = s + len - 1;
+      for (i = 0; i < len; i++)
+       {
+         /* Test for zero. Needed by write_boz later.  */
+         if (*p != 0)
+           *n = 1;
+
+         h = (*p >> 4) & 0x0F;
+         l = *p-- & 0x0F;
+         *q++ = a[h];
+         *q++ = a[l];
+       }
+    }
+
+  *q = '\0';
+  
+  if (*n == 0)
+    return "0";
+    
+  /* Move past any leading zeros.  */  
+  while (*buffer == '0')
+    buffer++;
+
+  return buffer;
+}
+
+/* gfc_itoa()-- Integer to decimal conversion.
+   The itoa function is a widespread non-standard extension to standard
+   C, often declared in <stdlib.h>.  Even though the itoa defined here
+   is a static function we take care not to conflict with any prior
+   non-static declaration.  Hence the 'gfc_' prefix, which is normally
+   reserved for functions with external linkage.  */
+
+static const char *
+gfc_itoa (GFC_INTEGER_LARGEST n, char *buffer, size_t len)
+{
+  int negative;
+  char *p;
+  GFC_UINTEGER_LARGEST t;
+
+  assert (len >= GFC_ITOA_BUF_SIZE);
+
+  if (n == 0)
+    return "0";
+
+  negative = 0;
+  t = n;
+  if (n < 0)
+    {
+      negative = 1;
+      t = -n; /*must use unsigned to protect from overflow*/
+    }
+
+  p = buffer + GFC_ITOA_BUF_SIZE - 1;
+  *p = '\0';
+
+  while (t != 0)
+    {
+      *--p = '0' + (t % 10);
+      t /= 10;
+    }
+
+  if (negative)
+    *--p = '-';
+  return p;
+}
+
+
+void
+write_i (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
+{
+  write_decimal (dtp, f, p, len, (void *) gfc_itoa);
+}
+
+
+void
+write_b (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
+{
+  const char *p;
+  char itoa_buf[GFC_BTOA_BUF_SIZE];
+  GFC_UINTEGER_LARGEST n = 0;
+
+  if (len > (int) sizeof (GFC_UINTEGER_LARGEST))
+    {
+      p = btoa_big (source, itoa_buf, len, &n);
+      write_boz (dtp, f, p, n);
+    }
+  else
+    {
+      n = extract_uint (source, len);
+      p = btoa (n, itoa_buf, sizeof (itoa_buf));
+      write_boz (dtp, f, p, n);
+    }
+}
+
+
+void
+write_o (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
+{
+  const char *p;
+  char itoa_buf[GFC_OTOA_BUF_SIZE];
+  GFC_UINTEGER_LARGEST n = 0;
+  
+  if (len > (int) sizeof (GFC_UINTEGER_LARGEST))
+    {
+      p = otoa_big (source, itoa_buf, len, &n);
+      write_boz (dtp, f, p, n);
+    }
+  else
+    {
+      n = extract_uint (source, len);
+      p = otoa (n, itoa_buf, sizeof (itoa_buf));
+      write_boz (dtp, f, p, n);
+    }
+}
+
+void
+write_z (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
+{
+  const char *p;
+  char itoa_buf[GFC_XTOA_BUF_SIZE];
+  GFC_UINTEGER_LARGEST n = 0;
+
+  if (len > (int) sizeof (GFC_UINTEGER_LARGEST))
+    {
+      p = ztoa_big (source, itoa_buf, len, &n);
+      write_boz (dtp, f, p, n);
+    }
+  else
+    {
+      n = extract_uint (source, len);
+      p = gfc_xtoa (n, itoa_buf, sizeof (itoa_buf));
+      write_boz (dtp, f, p, n);
+    }
+}
+
+
+void
+write_d (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
+{
+  write_float (dtp, f, p, len, 0);
+}
+
+
+void
+write_e (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
+{
+  write_float (dtp, f, p, len, 0);
+}
+
+
+void
+write_f (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
+{
+  write_float (dtp, f, p, len, 0);
+}
+
+
+void
+write_en (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
+{
+  write_float (dtp, f, p, len, 0);
+}
+
+
+void
+write_es (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
+{
+  write_float (dtp, f, p, len, 0);
+}
+
+
+/* Take care of the X/TR descriptor.  */
+
+void
+write_x (st_parameter_dt *dtp, int len, int nspaces)
+{
+  char *p;
+
+  p = write_block (dtp, len);
+  if (p == NULL)
+    return;
+  if (nspaces > 0 && len - nspaces >= 0)
+    {
+      if (unlikely (is_char4_unit (dtp)))
+       {
+         gfc_char4_t *p4 = (gfc_char4_t *) p;
+         memset4 (&p4[len - nspaces], ' ', nspaces);
+       }
+      else
+       memset (&p[len - nspaces], ' ', nspaces);
+    }
+}
+
+
+/* List-directed writing.  */
+
+
+/* Write a single character to the output.  Returns nonzero if
+   something goes wrong.  */
+
+static int
+write_char (st_parameter_dt *dtp, int c)
+{
+  char *p;
+
+  p = write_block (dtp, 1);
+  if (p == NULL)
+    return 1;
+  if (unlikely (is_char4_unit (dtp)))
+    {
+      gfc_char4_t *p4 = (gfc_char4_t *) p;
+      *p4 = c;
+      return 0;
+    }
+
+  *p = (uchar) c;
+
+  return 0;
+}
+
+
+/* Write a list-directed logical value.  */
+
+static void
+write_logical (st_parameter_dt *dtp, const char *source, int length)
+{
+  write_char (dtp, extract_int (source, length) ? 'T' : 'F');
+}
+
+
+/* Write a list-directed integer value.  */
+
+static void
+write_integer (st_parameter_dt *dtp, const char *source, int length)
+{
+  char *p;
+  const char *q;
+  int digits;
+  int width;
+  char itoa_buf[GFC_ITOA_BUF_SIZE];
+
+  q = gfc_itoa (extract_int (source, length), itoa_buf, sizeof (itoa_buf));
+
+  switch (length)
+    {
+    case 1:
+      width = 4;
+      break;
+
+    case 2:
+      width = 6;
+      break;
+
+    case 4:
+      width = 11;
+      break;
+
+    case 8:
+      width = 20;
+      break;
+
+    default:
+      width = 0;
+      break;
+    }
+
+  digits = strlen (q);
+
+  if (width < digits)
+    width = digits;
+  p = write_block (dtp, width);
+  if (p == NULL)
+    return;
+
+  if (unlikely (is_char4_unit (dtp)))
+    {
+      gfc_char4_t *p4 = (gfc_char4_t *) p;
+      if (dtp->u.p.no_leading_blank)
+       {
+         memcpy4 (p4, q, digits);
+         memset4 (p4 + digits, ' ', width - digits);
+       }
+      else
+       {
+         memset4 (p4, ' ', width - digits);
+         memcpy4 (p4 + width - digits, q, digits);
+       }
+      return;
+    }
+
+  if (dtp->u.p.no_leading_blank)
+    {
+      memcpy (p, q, digits);
+      memset (p + digits, ' ', width - digits);
+    }
+  else
+    {
+      memset (p, ' ', width - digits);
+      memcpy (p + width - digits, q, digits);
+    }
+}
+
+
+/* Write a list-directed string.  We have to worry about delimiting
+   the strings if the file has been opened in that mode.  */
+
+static void
+write_character (st_parameter_dt *dtp, const char *source, int kind, int length)
+{
+  int i, extra;
+  char *p, d;
+
+  switch (dtp->u.p.current_unit->delim_status)
+    {
+    case DELIM_APOSTROPHE:
+      d = '\'';
+      break;
+    case DELIM_QUOTE:
+      d = '"';
+      break;
+    default:
+      d = ' ';
+      break;
+    }
+
+  if (kind == 1)
+    {
+      if (d == ' ')
+       extra = 0;
+      else
+       {
+         extra = 2;
+
+         for (i = 0; i < length; i++)
+           if (source[i] == d)
+             extra++;
+       }
+
+      p = write_block (dtp, length + extra);
+      if (p == NULL)
+       return;
+
+      if (unlikely (is_char4_unit (dtp)))
+       {
+         gfc_char4_t d4 = (gfc_char4_t) d;
+         gfc_char4_t *p4 = (gfc_char4_t *) p;
+
+         if (d4 == ' ')
+           memcpy4 (p4, source, length);
+         else
+           {
+             *p4++ = d4;
+
+             for (i = 0; i < length; i++)
+               {
+                 *p4++ = (gfc_char4_t) source[i];
+                 if (source[i] == d)
+                   *p4++ = d4;
+               }
+
+             *p4 = d4;
+           }
+         return;
+       }
+
+      if (d == ' ')
+       memcpy (p, source, length);
+      else
+       {
+         *p++ = d;
+
+         for (i = 0; i < length; i++)
+            {
+              *p++ = source[i];
+              if (source[i] == d)
+               *p++ = d;
+           }
+
+         *p = d;
+       }
+    }
+  else
+    {
+      if (d == ' ')
+       {
+         if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+           write_utf8_char4 (dtp, (gfc_char4_t *) source, length, 0);
+         else
+           write_default_char4 (dtp, (gfc_char4_t *) source, length, 0);
+       }
+      else
+       {
+         p = write_block (dtp, 1);
+         *p = d;
+
+         if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+           write_utf8_char4 (dtp, (gfc_char4_t *) source, length, 0);
+         else
+           write_default_char4 (dtp, (gfc_char4_t *) source, length, 0);
+
+         p = write_block (dtp, 1);
+         *p = d;
+       }
+    }
+}
+
+
+/* Set an fnode to default format.  */
+
+static void
+set_fnode_default (st_parameter_dt *dtp, fnode *f, int length)
+{
+  f->format = FMT_G;
+  switch (length)
+    {
+    case 4:
+      f->u.real.w = 16;
+      f->u.real.d = 9;
+      f->u.real.e = 2;
+      break;
+    case 8:
+      f->u.real.w = 25;
+      f->u.real.d = 17;
+      f->u.real.e = 3;
+      break;
+    case 10:
+      f->u.real.w = 30;
+      f->u.real.d = 21;
+      f->u.real.e = 4;
+      break;
+    case 16:
+      f->u.real.w = 45;
+      f->u.real.d = 36;
+      f->u.real.e = 4;
+      break;
+    default:
+      internal_error (&dtp->common, "bad real kind");
+      break;
+    }
+}
+
+/* Output a real number with default format.  To guarantee that a
+   binary -> decimal -> binary roundtrip conversion recovers the
+   original value, IEEE 754-2008 requires 9, 17, 21 and 36 significant
+   digits for REAL kinds 4, 8, 10, and 16, respectively. Thus, we use
+   1PG16.9E2 for REAL(4), 1PG25.17E3 for REAL(8), 1PG30.21E4 for
+   REAL(10) and 1PG45.36E4 for REAL(16). The exception is that the
+   Fortran standard requires outputting an extra digit when the scale
+   factor is 1 and when the magnitude of the value is such that E
+   editing is used. However, gfortran compensates for this, and thus
+   for list formatted the same number of significant digits is
+   generated both when using F and E editing.  */
+
+void
+write_real (st_parameter_dt *dtp, const char *source, int length)
+{
+  fnode f ;
+  int org_scale = dtp->u.p.scale_factor;
+  dtp->u.p.scale_factor = 1;
+  set_fnode_default (dtp, &f, length);
+  write_float (dtp, &f, source , length, 1);
+  dtp->u.p.scale_factor = org_scale;
+}
+
+/* Similar to list formatted REAL output, for kPG0 where k > 0 we
+   compensate for the extra digit.  */
+
+void
+write_real_g0 (st_parameter_dt *dtp, const char *source, int length, int d)
+{
+  fnode f;
+  int comp_d; 
+  set_fnode_default (dtp, &f, length);
+  if (d > 0)
+    f.u.real.d = d;
+
+  /* Compensate for extra digits when using scale factor, d is not
+     specified, and the magnitude is such that E editing is used.  */
+  if (dtp->u.p.scale_factor > 0 && d == 0)
+    comp_d = 1;
+  else
+    comp_d = 0;
+  dtp->u.p.g0_no_blanks = 1;
+  write_float (dtp, &f, source , length, comp_d);
+  dtp->u.p.g0_no_blanks = 0;
+}
+
+
+static void
+write_complex (st_parameter_dt *dtp, const char *source, int kind, size_t size)
+{
+  char semi_comma =
+       dtp->u.p.current_unit->decimal_status == DECIMAL_POINT ? ',' : ';';
+
+  if (write_char (dtp, '('))
+    return;
+  write_real (dtp, source, kind);
+
+  if (write_char (dtp, semi_comma))
+    return;
+  write_real (dtp, source + size / 2, kind);
+
+  write_char (dtp, ')');
+}
+
+
+/* Write the separator between items.  */
+
+static void
+write_separator (st_parameter_dt *dtp)
+{
+  char *p;
+
+  p = write_block (dtp, options.separator_len);
+  if (p == NULL)
+    return;
+  if (unlikely (is_char4_unit (dtp)))
+    {
+      gfc_char4_t *p4 = (gfc_char4_t *) p;
+      memcpy4 (p4, options.separator, options.separator_len);
+    }
+  else
+    memcpy (p, options.separator, options.separator_len);
+}
+
+
+/* Write an item with list formatting.
+   TODO: handle skipping to the next record correctly, particularly
+   with strings.  */
+
+static void
+list_formatted_write_scalar (st_parameter_dt *dtp, bt type, void *p, int kind,
+                            size_t size)
+{
+  if (dtp->u.p.current_unit == NULL)
+    return;
+
+  if (dtp->u.p.first_item)
+    {
+      dtp->u.p.first_item = 0;
+      write_char (dtp, ' ');
+    }
+  else
+    {
+      if (type != BT_CHARACTER || !dtp->u.p.char_flag ||
+       dtp->u.p.current_unit->delim_status != DELIM_NONE)
+      write_separator (dtp);
+    }
+
+  switch (type)
+    {
+    case BT_INTEGER:
+      write_integer (dtp, p, kind);
+      break;
+    case BT_LOGICAL:
+      write_logical (dtp, p, kind);
+      break;
+    case BT_CHARACTER:
+      write_character (dtp, p, kind, size);
+      break;
+    case BT_REAL:
+      write_real (dtp, p, kind);
+      break;
+    case BT_COMPLEX:
+      write_complex (dtp, p, kind, size);
+      break;
+    default:
+      internal_error (&dtp->common, "list_formatted_write(): Bad type");
+    }
+
+  dtp->u.p.char_flag = (type == BT_CHARACTER);
+}
+
+
+void
+list_formatted_write (st_parameter_dt *dtp, bt type, void *p, int kind,
+                     size_t size, size_t nelems)
+{
+  size_t elem;
+  char *tmp;
+  size_t stride = type == BT_CHARACTER ?
+                 size * GFC_SIZE_OF_CHAR_KIND(kind) : size;
+
+  tmp = (char *) p;
+
+  /* Big loop over all the elements.  */
+  for (elem = 0; elem < nelems; elem++)
+    {
+      dtp->u.p.item_count++;
+      list_formatted_write_scalar (dtp, type, tmp + elem * stride, kind, size);
+    }
+}
+
+/*                     NAMELIST OUTPUT
+
+   nml_write_obj writes a namelist object to the output stream.  It is called
+   recursively for derived type components:
+       obj    = is the namelist_info for the current object.
+       offset = the offset relative to the address held by the object for
+                derived type arrays.
+       base   = is the namelist_info of the derived type, when obj is a
+                component.
+       base_name = the full name for a derived type, including qualifiers
+                   if any.
+   The returned value is a pointer to the object beyond the last one
+   accessed, including nested derived types.  Notice that the namelist is
+   a linear linked list of objects, including derived types and their
+   components.  A tree, of sorts, is implied by the compound names of
+   the derived type components and this is how this function recurses through
+   the list.  */
+
+/* A generous estimate of the number of characters needed to print
+   repeat counts and indices, including commas, asterices and brackets.  */
+
+#define NML_DIGITS 20
+
+static void
+namelist_write_newline (st_parameter_dt *dtp)
+{
+  if (!is_internal_unit (dtp))
+    {
+#ifdef HAVE_CRLF
+      write_character (dtp, "\r\n", 1, 2);
+#else
+      write_character (dtp, "\n", 1, 1);
+#endif
+      return;
+    }
+
+  if (is_array_io (dtp))
+    {
+      gfc_offset record;
+      int finished;
+      char *p;
+      int length = dtp->u.p.current_unit->bytes_left;
+
+      p = write_block (dtp, length);
+      if (p == NULL)
+       return;
+
+      if (unlikely (is_char4_unit (dtp)))
+       {
+         gfc_char4_t *p4 = (gfc_char4_t *) p;
+         memset4 (p4, ' ', length);
+       }
+      else
+       memset (p, ' ', length);
+
+      /* Now that the current record has been padded out,
+        determine where the next record in the array is. */
+      record = next_array_record (dtp, dtp->u.p.current_unit->ls,
+                                 &finished);
+      if (finished)
+       dtp->u.p.current_unit->endfile = AT_ENDFILE;
+      else
+       {
+         /* Now seek to this record */
+         record = record * dtp->u.p.current_unit->recl;
+
+         if (sseek (dtp->u.p.current_unit->s, record, SEEK_SET) < 0)
+           {
+             generate_error (&dtp->common, LIBERROR_INTERNAL_UNIT, NULL);
+             return;
+           }
+
+         dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
+       }
+    }
+  else
+    write_character (dtp, " ", 1, 1);
+}
+
+
+static namelist_info *
+nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
+              namelist_info * base, char * base_name)
+{
+  int rep_ctr;
+  int num;
+  int nml_carry;
+  int len;
+  index_type obj_size;
+  index_type nelem;
+  size_t dim_i;
+  size_t clen;
+  index_type elem_ctr;
+  size_t obj_name_len;
+  void * p ;
+  char cup;
+  char * obj_name;
+  char * ext_name;
+  size_t ext_name_len;
+  char rep_buff[NML_DIGITS];
+  namelist_info * cmp;
+  namelist_info * retval = obj->next;
+  size_t base_name_len;
+  size_t base_var_name_len;
+  size_t tot_len;
+  unit_delim tmp_delim;
+  
+  /* Set the character to be used to separate values
+     to a comma or semi-colon.  */
+
+  char semi_comma =
+       dtp->u.p.current_unit->decimal_status == DECIMAL_POINT ? ',' : ';';
+
+  /* Write namelist variable names in upper case. If a derived type,
+     nothing is output.  If a component, base and base_name are set.  */
+
+  if (obj->type != BT_DERIVED)
+    {
+      namelist_write_newline (dtp);
+      write_character (dtp, " ", 1, 1);
+
+      len = 0;
+      if (base)
+       {
+         len = strlen (base->var_name);
+         base_name_len = strlen (base_name);
+         for (dim_i = 0; dim_i < base_name_len; dim_i++)
+            {
+             cup = toupper ((int) base_name[dim_i]);
+             write_character (dtp, &cup, 1, 1);
+            }
+       }
+      clen = strlen (obj->var_name);
+      for (dim_i = len; dim_i < clen; dim_i++)
+       {
+         cup = toupper ((int) obj->var_name[dim_i]);
+         write_character (dtp, &cup, 1, 1);
+       }
+      write_character (dtp, "=", 1, 1);
+    }
+
+  /* Counts the number of data output on a line, including names.  */
+
+  num = 1;
+
+  len = obj->len;
+
+  switch (obj->type)
+    {
+
+    case BT_REAL:
+      obj_size = size_from_real_kind (len);
+      break;
+
+    case BT_COMPLEX:
+      obj_size = size_from_complex_kind (len);
+      break;
+
+    case BT_CHARACTER:
+      obj_size = obj->string_length;
+      break;
+
+    default:
+      obj_size = len;      
+    }
+
+  if (obj->var_rank)
+    obj_size = obj->size;
+
+  /* Set the index vector and count the number of elements.  */
+
+  nelem = 1;
+  for (dim_i = 0; dim_i < (size_t) obj->var_rank; dim_i++)
+    {
+      obj->ls[dim_i].idx = GFC_DESCRIPTOR_LBOUND(obj, dim_i);
+      nelem = nelem * GFC_DESCRIPTOR_EXTENT (obj, dim_i);
+    }
+
+  /* Main loop to output the data held in the object.  */
+
+  rep_ctr = 1;
+  for (elem_ctr = 0; elem_ctr < nelem; elem_ctr++)
+    {
+
+      /* Build the pointer to the data value.  The offset is passed by
+        recursive calls to this function for arrays of derived types.
+        Is NULL otherwise.  */
+
+      p = (void *)(obj->mem_pos + elem_ctr * obj_size);
+      p += offset;
+
+      /* Check for repeat counts of intrinsic types.  */
+
+      if ((elem_ctr < (nelem - 1)) &&
+         (obj->type != BT_DERIVED) &&
+         !memcmp (p, (void*)(p + obj_size ), obj_size ))
+       {
+         rep_ctr++;
+       }
+
+      /* Execute a repeated output.  Note the flag no_leading_blank that
+        is used in the functions used to output the intrinsic types.  */
+
+      else
+       {
+         if (rep_ctr > 1)
+           {
+             snprintf(rep_buff, NML_DIGITS, " %d*", rep_ctr);
+             write_character (dtp, rep_buff, 1, strlen (rep_buff));
+             dtp->u.p.no_leading_blank = 1;
+           }
+         num++;
+
+         /* Output the data, if an intrinsic type, or recurse into this
+            routine to treat derived types.  */
+
+         switch (obj->type)
+           {
+
+           case BT_INTEGER:
+             write_integer (dtp, p, len);
+              break;
+
+           case BT_LOGICAL:
+             write_logical (dtp, p, len);
+              break;
+
+           case BT_CHARACTER:
+             tmp_delim = dtp->u.p.current_unit->delim_status;
+             if (dtp->u.p.nml_delim == '"')
+               dtp->u.p.current_unit->delim_status = DELIM_QUOTE;
+             if (dtp->u.p.nml_delim == '\'')
+               dtp->u.p.current_unit->delim_status = DELIM_APOSTROPHE;
+             write_character (dtp, p, 1, obj->string_length);
+               dtp->u.p.current_unit->delim_status = tmp_delim;
+              break;
+
+           case BT_REAL:
+             write_real (dtp, p, len);
+              break;
+
+          case BT_COMPLEX:
+             dtp->u.p.no_leading_blank = 0;
+             num++;
+              write_complex (dtp, p, len, obj_size);
+              break;
+
+           case BT_DERIVED:
+
+             /* To treat a derived type, we need to build two strings:
+                ext_name = the name, including qualifiers that prepends
+                           component names in the output - passed to
+                           nml_write_obj.
+                obj_name = the derived type name with no qualifiers but %
+                           appended.  This is used to identify the
+                           components.  */
+
+             /* First ext_name => get length of all possible components  */
+
+             base_name_len = base_name ? strlen (base_name) : 0;
+             base_var_name_len = base ? strlen (base->var_name) : 0;
+             ext_name_len = base_name_len + base_var_name_len 
+               + strlen (obj->var_name) + obj->var_rank * NML_DIGITS + 1;
+             ext_name = (char*)get_mem (ext_name_len);
+
+             memcpy (ext_name, base_name, base_name_len);
+             clen = strlen (obj->var_name + base_var_name_len);
+             memcpy (ext_name + base_name_len, 
+                     obj->var_name + base_var_name_len, clen);
+             
+             /* Append the qualifier.  */
+
+             tot_len = base_name_len + clen;
+             for (dim_i = 0; dim_i < (size_t) obj->var_rank; dim_i++)
+               {
+                 if (!dim_i)
+                   {
+                     ext_name[tot_len] = '(';
+                     tot_len++;
+                   }
+                 snprintf (ext_name + tot_len, ext_name_len - tot_len, "%d", 
+                           (int) obj->ls[dim_i].idx);
+                 tot_len += strlen (ext_name + tot_len);
+                 ext_name[tot_len] = ((int) dim_i == obj->var_rank - 1) ? ')' : ',';
+                 tot_len++;
+               }
+
+             ext_name[tot_len] = '\0';
+
+             /* Now obj_name.  */
+
+             obj_name_len = strlen (obj->var_name) + 1;
+             obj_name = get_mem (obj_name_len+1);
+             memcpy (obj_name, obj->var_name, obj_name_len-1);
+             memcpy (obj_name + obj_name_len-1, "%", 2);
+
+             /* Now loop over the components. Update the component pointer
+                with the return value from nml_write_obj => this loop jumps
+                past nested derived types.  */
+
+             for (cmp = obj->next;
+                  cmp && !strncmp (cmp->var_name, obj_name, obj_name_len);
+                  cmp = retval)
+               {
+                 retval = nml_write_obj (dtp, cmp,
+                                         (index_type)(p - obj->mem_pos),
+                                         obj, ext_name);
+               }
+
+             free (obj_name);
+             free (ext_name);
+             goto obj_loop;
+
+            default:
+             internal_error (&dtp->common, "Bad type for namelist write");
+            }
+
+         /* Reset the leading blank suppression, write a comma (or semi-colon)
+            and, if 5 values have been output, write a newline and advance
+            to column 2. Reset the repeat counter.  */
+
+         dtp->u.p.no_leading_blank = 0;
+         write_character (dtp, &semi_comma, 1, 1);
+         if (num > 5)
+           {
+             num = 0;
+             namelist_write_newline (dtp);
+             write_character (dtp, " ", 1, 1);
+           }
+         rep_ctr = 1;
+       }
+
+    /* Cycle through and increment the index vector.  */
+
+obj_loop:
+
+    nml_carry = 1;
+    for (dim_i = 0; nml_carry && (dim_i < (size_t) obj->var_rank); dim_i++)
+      {
+       obj->ls[dim_i].idx += nml_carry ;
+       nml_carry = 0;
+       if (obj->ls[dim_i].idx  > GFC_DESCRIPTOR_UBOUND(obj,dim_i))
+         {
+           obj->ls[dim_i].idx = GFC_DESCRIPTOR_LBOUND(obj,dim_i);
+           nml_carry = 1;
+         }
+       }
+    }
+
+  /* Return a pointer beyond the furthest object accessed.  */
+
+  return retval;
+}
+
+
+/* This is the entry function for namelist writes.  It outputs the name
+   of the namelist and iterates through the namelist by calls to
+   nml_write_obj.  The call below has dummys in the arguments used in
+   the treatment of derived types.  */
+
+void
+namelist_write (st_parameter_dt *dtp)
+{
+  namelist_info * t1, *t2, *dummy = NULL;
+  index_type i;
+  index_type dummy_offset = 0;
+  char c;
+  char * dummy_name = NULL;
+  unit_delim tmp_delim = DELIM_UNSPECIFIED;
+
+  /* Set the delimiter for namelist output.  */
+  tmp_delim = dtp->u.p.current_unit->delim_status;
+
+  dtp->u.p.nml_delim = tmp_delim == DELIM_APOSTROPHE ? '\'' : '"';
+
+  /* Temporarily disable namelist delimters.  */
+  dtp->u.p.current_unit->delim_status = DELIM_NONE;
+
+  write_character (dtp, "&", 1, 1);
+
+  /* Write namelist name in upper case - f95 std.  */
+  for (i = 0 ;i < dtp->namelist_name_len ;i++ )
+    {
+      c = toupper ((int) dtp->namelist_name[i]);
+      write_character (dtp, &c, 1 ,1);
+    }
+
+  if (dtp->u.p.ionml != NULL)
+    {
+      t1 = dtp->u.p.ionml;
+      while (t1 != NULL)
+       {
+         t2 = t1;
+         t1 = nml_write_obj (dtp, t2, dummy_offset, dummy, dummy_name);
+       }
+    }
+
+  namelist_write_newline (dtp);
+  write_character (dtp, " /", 1, 2);
+  /* Restore the original delimiter.  */
+  dtp->u.p.current_unit->delim_status = tmp_delim;
+}
+
+#undef NML_DIGITS
diff --git a/l4/pkg/libgfortran/lib/contrib/io/write_float.def b/l4/pkg/libgfortran/lib/contrib/io/write_float.def
new file mode 100644 (file)
index 0000000..78f09b2
--- /dev/null
@@ -0,0 +1,1071 @@
+/* Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+   Write float code factoring to this file by Jerry DeLisle   
+   F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+
+typedef enum
+{ S_NONE, S_MINUS, S_PLUS }
+sign_t;
+
+/* Given a flag that indicates if a value is negative or not, return a
+   sign_t that gives the sign that we need to produce.  */
+
+static sign_t
+calculate_sign (st_parameter_dt *dtp, int negative_flag)
+{
+  sign_t s = S_NONE;
+
+  if (negative_flag)
+    s = S_MINUS;
+  else
+    switch (dtp->u.p.sign_status)
+      {
+      case SIGN_SP:    /* Show sign. */
+       s = S_PLUS;
+       break;
+      case SIGN_SS:    /* Suppress sign. */
+       s = S_NONE;
+       break;
+      case SIGN_S:     /* Processor defined. */
+      case SIGN_UNSPECIFIED:
+       s = options.optional_plus ? S_PLUS : S_NONE;
+       break;
+      }
+
+  return s;
+}
+
+
+/* Output a real number according to its format which is FMT_G free.  */
+
+static try
+output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size, 
+             int sign_bit, bool zero_flag, int ndigits, int edigits)
+{
+  char *out;
+  char *digits;
+  int e, w, d, p, i;
+  char expchar, rchar;
+  format_token ft;
+  /* Number of digits before the decimal point.  */
+  int nbefore;
+  /* Number of zeros after the decimal point.  */
+  int nzero;
+  /* Number of digits after the decimal point.  */
+  int nafter;
+  /* Number of zeros after the decimal point, whatever the precision.  */
+  int nzero_real;
+  int leadzero;
+  int nblanks;
+  sign_t sign;
+
+  ft = f->format;
+  w = f->u.real.w;
+  d = f->u.real.d;
+  p = dtp->u.p.scale_factor;
+
+  rchar = '5';
+  nzero_real = -1;
+
+  /* We should always know the field width and precision.  */
+  if (d < 0)
+    internal_error (&dtp->common, "Unspecified precision");
+
+  sign = calculate_sign (dtp, sign_bit);
+  
+  /* The following code checks the given string has punctuation in the correct
+     places.  Uncomment if needed for debugging.
+     if (d != 0 && ((buffer[2] != '.' && buffer[2] != ',')
+                   || buffer[ndigits + 2] != 'e'))
+       internal_error (&dtp->common, "printf is broken");  */
+
+  /* Read the exponent back in.  */
+  e = atoi (&buffer[ndigits + 3]) + 1;
+
+  /* Make sure zero comes out as 0.0e0.   */
+  if (zero_flag)
+    e = 0;
+
+  /* Normalize the fractional component.  */
+  buffer[2] = buffer[1];
+  digits = &buffer[2];
+
+  /* Figure out where to place the decimal point.  */
+  switch (ft)
+    {
+    case FMT_F:
+      if (d == 0 && e <= 0 && p == 0)
+       {
+         memmove (digits + 1, digits, ndigits - 1);
+         digits[0] = '0';
+         e++;
+       }
+
+      nbefore = e + p;
+      if (nbefore < 0)
+       {
+         nzero = -nbefore;
+          nzero_real = nzero;
+         if (nzero > d)
+           nzero = d;
+         nafter = d - nzero;
+         nbefore = 0;
+       }
+      else
+       {
+         nzero = 0;
+         nafter = d;
+       }
+      expchar = 0;
+      break;
+
+    case FMT_E:
+    case FMT_D:
+      i = dtp->u.p.scale_factor;
+      if (d <= 0 && p == 0)
+       {
+         generate_error (&dtp->common, LIBERROR_FORMAT, "Precision not "
+                         "greater than zero in format specifier 'E' or 'D'");
+         return FAILURE;
+       }
+      if (p <= -d || p >= d + 2)
+       {
+         generate_error (&dtp->common, LIBERROR_FORMAT, "Scale factor "
+                         "out of range in format specifier 'E' or 'D'");
+         return FAILURE;
+       }
+
+      if (!zero_flag)
+       e -= p;
+      if (p < 0)
+       {
+         nbefore = 0;
+         nzero = -p;
+         nafter = d + p;
+       }
+      else if (p > 0)
+       {
+         nbefore = p;
+         nzero = 0;
+         nafter = (d - p) + 1;
+       }
+      else /* p == 0 */
+       {
+         nbefore = 0;
+         nzero = 0;
+         nafter = d;
+       }
+
+      if (ft == FMT_E)
+       expchar = 'E';
+      else
+       expchar = 'D';
+      break;
+
+    case FMT_EN:
+      /* The exponent must be a multiple of three, with 1-3 digits before
+        the decimal point.  */
+      if (!zero_flag)
+        e--;
+      if (e >= 0)
+       nbefore = e % 3;
+      else
+       {
+         nbefore = (-e) % 3;
+         if (nbefore != 0)
+           nbefore = 3 - nbefore;
+       }
+      e -= nbefore;
+      nbefore++;
+      nzero = 0;
+      nafter = d;
+      expchar = 'E';
+      break;
+
+    case FMT_ES:
+      if (!zero_flag)
+        e--;
+      nbefore = 1;
+      nzero = 0;
+      nafter = d;
+      expchar = 'E';
+      break;
+
+    default:
+      /* Should never happen.  */
+      internal_error (&dtp->common, "Unexpected format token");
+    }
+
+  if (zero_flag)
+    goto skip;
+
+  /* Round the value.  The value being rounded is an unsigned magnitude.
+     The ROUND_COMPATIBLE is rounding away from zero when there is a tie.  */
+  switch (dtp->u.p.current_unit->round_status)
+    {
+      case ROUND_ZERO: /* Do nothing and truncation occurs.  */
+       goto skip;
+      case ROUND_UP:
+       if (sign_bit)
+         goto skip;
+       goto updown;
+      case ROUND_DOWN:
+       if (!sign_bit)
+         goto skip;
+       goto updown;
+      case ROUND_NEAREST:
+       /* Round compatible unless there is a tie. A tie is a 5 with
+          all trailing zero's.  */
+       i = nafter + nbefore;
+       if (digits[i] == '5')
+         {
+           for(i++ ; i < ndigits; i++)
+             {
+               if (digits[i] != '0')
+                 goto do_rnd;
+             }
+           /* It is a tie so round to even.  */
+           switch (digits[nafter + nbefore - 1])
+             {
+               case '1':
+               case '3':
+               case '5':
+               case '7':
+               case '9':
+                 /* If odd, round away from zero to even.  */
+                 break;
+               default:
+                 /* If even, skip rounding, truncate to even.  */
+                 goto skip;
+             }
+         }
+        /* Fall through.  */ 
+      case ROUND_PROCDEFINED:
+      case ROUND_UNSPECIFIED:
+      case ROUND_COMPATIBLE:
+       rchar = '5';
+       goto do_rnd;
+    }
+
+  updown:
+
+  rchar = '0';
+  if (w > 0 && d == 0 && p == 0)
+    nbefore = 1;
+  /* Scan for trailing zeros to see if we really need to round it.  */
+  for(i = nbefore + nafter; i < ndigits; i++)
+    {
+      if (digits[i] != '0')
+       goto do_rnd;
+    }
+  goto skip;
+    
+  do_rnd:
+  if (nbefore + nafter == 0)
+    {
+      ndigits = 0;
+      if (nzero_real == d && digits[0] >= rchar)
+       {
+         /* We rounded to zero but shouldn't have */
+         nzero--;
+         nafter = 1;
+         digits[0] = '1';
+         ndigits = 1;
+       }
+    }
+  else if (nbefore + nafter < ndigits)
+    {
+      i = ndigits = nbefore + nafter;
+      if (digits[i] >= rchar)
+       {
+         /* Propagate the carry.  */
+         for (i--; i >= 0; i--)
+           {
+             if (digits[i] != '9')
+               {
+                 digits[i]++;
+                 break;
+               }
+             digits[i] = '0';
+           }
+
+         if (i < 0)
+           {
+             /* The carry overflowed.  Fortunately we have some spare
+                space at the start of the buffer.  We may discard some
+                digits, but this is ok because we already know they are
+                zero.  */
+             digits--;
+             digits[0] = '1';
+             if (ft == FMT_F)
+               {
+                 if (nzero > 0)
+                   {
+                     nzero--;
+                     nafter++;
+                   }
+                 else
+                   nbefore++;
+               }
+             else if (ft == FMT_EN)
+               {
+                 nbefore++;
+                 if (nbefore == 4)
+                   {
+                     nbefore = 1;
+                     e += 3;
+                   }
+               }
+             else
+               e++;
+           }
+       }
+    }
+
+  skip:
+
+  /* Calculate the format of the exponent field.  */
+  if (expchar)
+    {
+      edigits = 1;
+      for (i = abs (e); i >= 10; i /= 10)
+       edigits++;
+
+      if (f->u.real.e < 0)
+       {
+         /* Width not specified.  Must be no more than 3 digits.  */
+         if (e > 999 || e < -999)
+           edigits = -1;
+         else
+           {
+             edigits = 4;
+             if (e > 99 || e < -99)
+               expchar = ' ';
+           }
+       }
+      else
+       {
+         /* Exponent width specified, check it is wide enough.  */
+         if (edigits > f->u.real.e)
+           edigits = -1;
+         else
+           edigits = f->u.real.e + 2;
+       }
+    }
+  else
+    edigits = 0;
+
+  /* Scan the digits string and count the number of zeros.  If we make it
+     all the way through the loop, we know the value is zero after the
+     rounding completed above.  */
+  for (i = 0; i < ndigits; i++)
+    {
+      if (digits[i] != '0')
+       break;
+    }
+
+  /* To format properly, we need to know if the rounded result is zero and if
+     so, we set the zero_flag which may have been already set for
+     actual zero.  */
+  if (i == ndigits)
+    {
+      zero_flag = true;
+      /* The output is zero, so set the sign according to the sign bit unless
+        -fno-sign-zero was specified.  */
+      if (compile_options.sign_zero == 1)
+        sign = calculate_sign (dtp, sign_bit);
+      else
+       sign = calculate_sign (dtp, 0);
+    }
+
+  /* Pick a field size if none was specified, taking into account small
+     values that may have been rounded to zero.  */
+  if (w <= 0)
+    {
+      if (zero_flag)
+       w = d + (sign != S_NONE ? 2 : 1) + (d == 0 ? 1 : 0);
+      else
+       {
+         w = nbefore + nzero + nafter + (sign != S_NONE ? 2 : 1);
+         w = w == 1 ? 2 : w;
+       }
+    }
+  
+  /* Work out how much padding is needed.  */
+  nblanks = w - (nbefore + nzero + nafter + edigits + 1);
+  if (sign != S_NONE)
+    nblanks--;
+
+  if (dtp->u.p.g0_no_blanks)
+    {
+      w -= nblanks;
+      nblanks = 0;
+    }
+
+  /* Create the ouput buffer.  */
+  out = write_block (dtp, w);
+  if (out == NULL)
+    return FAILURE;
+
+  /* Check the value fits in the specified field width.  */
+  if (nblanks < 0 || edigits == -1 || w == 1 || (w == 2 && sign != S_NONE))
+    {
+      if (unlikely (is_char4_unit (dtp)))
+       {
+         gfc_char4_t *out4 = (gfc_char4_t *) out;
+         memset4 (out4, '*', w);
+         return FAILURE;
+       }
+      star_fill (out, w);
+      return FAILURE;
+    }
+
+  /* See if we have space for a zero before the decimal point.  */
+  if (nbefore == 0 && nblanks > 0)
+    {
+      leadzero = 1;
+      nblanks--;
+    }
+  else
+    leadzero = 0;
+
+  /* For internal character(kind=4) units, we duplicate the code used for
+     regular output slightly modified.  This needs to be maintained
+     consistent with the regular code that follows this block.  */
+  if (unlikely (is_char4_unit (dtp)))
+    {
+      gfc_char4_t *out4 = (gfc_char4_t *) out;
+      /* Pad to full field width.  */
+
+      if ( ( nblanks > 0 ) && !dtp->u.p.no_leading_blank)
+       {
+         memset4 (out4, ' ', nblanks);
+         out4 += nblanks;
+       }
+
+      /* Output the initial sign (if any).  */
+      if (sign == S_PLUS)
+       *(out4++) = '+';
+      else if (sign == S_MINUS)
+       *(out4++) = '-';
+
+      /* Output an optional leading zero.  */
+      if (leadzero)
+       *(out4++) = '0';
+
+      /* Output the part before the decimal point, padding with zeros.  */
+      if (nbefore > 0)
+       {
+         if (nbefore > ndigits)
+           {
+             i = ndigits;
+             memcpy4 (out4, digits, i);
+             ndigits = 0;
+             while (i < nbefore)
+               out4[i++] = '0';
+           }
+         else
+           {
+             i = nbefore;
+             memcpy4 (out4, digits, i);
+             ndigits -= i;
+           }
+
+         digits += i;
+         out4 += nbefore;
+       }
+
+      /* Output the decimal point.  */
+      *(out4++) = dtp->u.p.current_unit->decimal_status
+                   == DECIMAL_POINT ? '.' : ',';
+
+      /* Output leading zeros after the decimal point.  */
+      if (nzero > 0)
+       {
+         for (i = 0; i < nzero; i++)
+           *(out4++) = '0';
+       }
+
+      /* Output digits after the decimal point, padding with zeros.  */
+      if (nafter > 0)
+       {
+         if (nafter > ndigits)
+           i = ndigits;
+         else
+           i = nafter;
+
+         memcpy4 (out4, digits, i);
+         while (i < nafter)
+           out4[i++] = '0';
+
+         digits += i;
+         ndigits -= i;
+         out4 += nafter;
+       }
+
+      /* Output the exponent.  */
+      if (expchar)
+       {
+         if (expchar != ' ')
+           {
+             *(out4++) = expchar;
+             edigits--;
+           }
+         snprintf (buffer, size, "%+0*d", edigits, e);
+         memcpy4 (out4, buffer, edigits);
+       }
+
+      if (dtp->u.p.no_leading_blank)
+       {
+         out4 += edigits;
+         memset4 (out4, ' ' , nblanks);
+         dtp->u.p.no_leading_blank = 0;
+       }
+      return SUCCESS;
+    } /* End of character(kind=4) internal unit code.  */
+
+  /* Pad to full field width.  */
+
+  if ( ( nblanks > 0 ) && !dtp->u.p.no_leading_blank)
+    {
+      memset (out, ' ', nblanks);
+      out += nblanks;
+    }
+
+  /* Output the initial sign (if any).  */
+  if (sign == S_PLUS)
+    *(out++) = '+';
+  else if (sign == S_MINUS)
+    *(out++) = '-';
+
+  /* Output an optional leading zero.  */
+  if (leadzero)
+    *(out++) = '0';
+
+  /* Output the part before the decimal point, padding with zeros.  */
+  if (nbefore > 0)
+    {
+      if (nbefore > ndigits)
+       {
+         i = ndigits;
+         memcpy (out, digits, i);
+         ndigits = 0;
+         while (i < nbefore)
+           out[i++] = '0';
+       }
+      else
+       {
+         i = nbefore;
+         memcpy (out, digits, i);
+         ndigits -= i;
+       }
+
+      digits += i;
+      out += nbefore;
+    }
+
+  /* Output the decimal point.  */
+  *(out++) = dtp->u.p.current_unit->decimal_status == DECIMAL_POINT ? '.' : ',';
+
+  /* Output leading zeros after the decimal point.  */
+  if (nzero > 0)
+    {
+      for (i = 0; i < nzero; i++)
+       *(out++) = '0';
+    }
+
+  /* Output digits after the decimal point, padding with zeros.  */
+  if (nafter > 0)
+    {
+      if (nafter > ndigits)
+       i = ndigits;
+      else
+       i = nafter;
+
+      memcpy (out, digits, i);
+      while (i < nafter)
+       out[i++] = '0';
+
+      digits += i;
+      ndigits -= i;
+      out += nafter;
+    }
+
+  /* Output the exponent.  */
+  if (expchar)
+    {
+      if (expchar != ' ')
+       {
+         *(out++) = expchar;
+         edigits--;
+       }
+      snprintf (buffer, size, "%+0*d", edigits, e);
+      memcpy (out, buffer, edigits);
+    }
+
+  if (dtp->u.p.no_leading_blank)
+    {
+      out += edigits;
+      memset( out , ' ' , nblanks );
+      dtp->u.p.no_leading_blank = 0;
+    }
+
+#undef STR
+#undef STR1
+#undef MIN_FIELD_WIDTH
+  return SUCCESS;
+}
+
+
+/* Write "Infinite" or "Nan" as appropriate for the given format.  */
+
+static void
+write_infnan (st_parameter_dt *dtp, const fnode *f, int isnan_flag, int sign_bit)
+{
+  char * p, fin;
+  int nb = 0;
+  sign_t sign;
+  int mark;
+
+  if (f->format != FMT_B && f->format != FMT_O && f->format != FMT_Z)
+    {
+      sign = calculate_sign (dtp, sign_bit);
+      mark = (sign == S_PLUS || sign == S_MINUS) ? 8 : 7;
+
+      nb =  f->u.real.w;
+
+      /* If the field width is zero, the processor must select a width 
+        not zero.  4 is chosen to allow output of '-Inf' or '+Inf' */
+     
+      if ((nb == 0) || dtp->u.p.g0_no_blanks)
+       {
+         if (isnan_flag)
+           nb = 3;
+         else
+           nb = (sign == S_PLUS || sign == S_MINUS) ? 4 : 3;
+       }
+      p = write_block (dtp, nb);
+      if (p == NULL)
+       return;
+      if (nb < 3)
+       {
+         if (unlikely (is_char4_unit (dtp)))
+           {
+             gfc_char4_t *p4 = (gfc_char4_t *) p;
+             memset4 (p4, '*', nb);
+           }
+         else
+           memset (p, '*', nb);
+         return;
+       }
+
+      if (unlikely (is_char4_unit (dtp)))
+       {
+         gfc_char4_t *p4 = (gfc_char4_t *) p;
+         memset4 (p4, ' ', nb);
+       }
+      else
+       memset(p, ' ', nb);
+
+      if (!isnan_flag)
+       {
+         if (sign_bit)
+           {
+             /* If the sign is negative and the width is 3, there is
+                insufficient room to output '-Inf', so output asterisks */
+             if (nb == 3)
+               {
+                 if (unlikely (is_char4_unit (dtp)))
+                   {
+                     gfc_char4_t *p4 = (gfc_char4_t *) p;
+                     memset4 (p4, '*', nb);
+                   }
+                 else
+                   memset (p, '*', nb);
+                 return;
+               }
+             /* The negative sign is mandatory */
+             fin = '-';
+           }    
+         else
+           /* The positive sign is optional, but we output it for
+              consistency */
+           fin = '+';
+           
+         if (unlikely (is_char4_unit (dtp)))
+           {
+             gfc_char4_t *p4 = (gfc_char4_t *) p;
+
+             if (nb > mark)
+               /* We have room, so output 'Infinity' */
+               memcpy4 (p4 + nb - 8, "Infinity", 8);
+             else
+               /* For the case of width equals mark, there is not enough room
+                  for the sign and 'Infinity' so we go with 'Inf' */
+               memcpy4 (p4 + nb - 3, "Inf", 3);
+
+             if (sign == S_PLUS || sign == S_MINUS)
+               {
+                 if (nb < 9 && nb > 3)
+                   /* Put the sign in front of Inf */
+                   p4[nb - 4] = (gfc_char4_t) fin;
+                 else if (nb > 8)
+                   /* Put the sign in front of Infinity */
+                   p4[nb - 9] = (gfc_char4_t) fin;
+               }
+             return;
+           }
+
+         if (nb > mark)
+           /* We have room, so output 'Infinity' */
+           memcpy(p + nb - 8, "Infinity", 8);
+         else
+           /* For the case of width equals 8, there is not enough room
+              for the sign and 'Infinity' so we go with 'Inf' */
+           memcpy(p + nb - 3, "Inf", 3);
+
+         if (sign == S_PLUS || sign == S_MINUS)
+           {
+             if (nb < 9 && nb > 3)
+               p[nb - 4] = fin;  /* Put the sign in front of Inf */
+             else if (nb > 8)
+               p[nb - 9] = fin;  /* Put the sign in front of Infinity */
+           }
+       }
+      else
+        {
+         if (unlikely (is_char4_unit (dtp)))
+           {
+             gfc_char4_t *p4 = (gfc_char4_t *) p;
+             memcpy4 (p4 + nb - 3, "NaN", 3);
+           }
+         else
+           memcpy(p + nb - 3, "NaN", 3);
+       }
+      return;
+    }
+}
+
+
+/* Returns the value of 10**d.  */
+
+#define CALCULATE_EXP(x) \
+static GFC_REAL_ ## x \
+calculate_exp_ ## x  (int d)\
+{\
+  int i;\
+  GFC_REAL_ ## x r = 1.0;\
+  for (i = 0; i< (d >= 0 ? d : -d); i++)\
+    r *= 10;\
+  r = (d >= 0) ? r : 1.0 / r;\
+  return r;\
+}
+
+CALCULATE_EXP(4)
+
+CALCULATE_EXP(8)
+
+#ifdef HAVE_GFC_REAL_10
+CALCULATE_EXP(10)
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+CALCULATE_EXP(16)
+#endif
+#undef CALCULATE_EXP
+
+/* Generate corresponding I/O format for FMT_G and output.
+   The rules to translate FMT_G to FMT_E or FMT_F from DEC fortran
+   LRM (table 11-2, Chapter 11, "I/O Formatting", P11-25) is:
+
+   Data Magnitude                              Equivalent Conversion
+   0< m < 0.1-0.5*10**(-d-1)                   Ew.d[Ee]
+   m = 0                                       F(w-n).(d-1), n' '
+   0.1-0.5*10**(-d-1)<= m < 1-0.5*10**(-d)     F(w-n).d, n' '
+   1-0.5*10**(-d)<= m < 10-0.5*10**(-d+1)      F(w-n).(d-1), n' '
+   10-0.5*10**(-d+1)<= m < 100-0.5*10**(-d+2)  F(w-n).(d-2), n' '
+   ................                           ..........
+   10**(d-1)-0.5*10**(-1)<= m <10**d-0.5       F(w-n).0,n(' ')
+   m >= 10**d-0.5                              Ew.d[Ee]
+
+   notes: for Gw.d ,  n' ' means 4 blanks
+         for Gw.dEe, n' ' means e+2 blanks
+         for rounding modes adjustment, r, See Fortran F2008 10.7.5.2.2
+         the asm volatile is required for 32-bit x86 platforms.  */
+
+#define OUTPUT_FLOAT_FMT_G(x) \
+static void \
+output_float_FMT_G_ ## x (st_parameter_dt *dtp, const fnode *f, \
+                     GFC_REAL_ ## x m, char *buffer, size_t size, \
+                     int sign_bit, bool zero_flag, int ndigits, \
+                      int edigits, int comp_d) \
+{ \
+  int e = f->u.real.e;\
+  int d = f->u.real.d;\
+  int w = f->u.real.w;\
+  fnode *newf;\
+  GFC_REAL_ ## x rexp_d, r = 0.5;\
+  int low, high, mid;\
+  int ubound, lbound;\
+  char *p, pad = ' ';\
+  int save_scale_factor, nb = 0;\
+  try result;\
+\
+  save_scale_factor = dtp->u.p.scale_factor;\
+  newf = (fnode *) get_mem (sizeof (fnode));\
+\
+  switch (dtp->u.p.current_unit->round_status)\
+    {\
+      case ROUND_ZERO:\
+       r = sign_bit ? 1.0 : 0.0;\
+       break;\
+      case ROUND_UP:\
+       r = 1.0;\
+       break;\
+      case ROUND_DOWN:\
+       r = 0.0;\
+       break;\
+      default:\
+       break;\
+    }\
+\
+  rexp_d = calculate_exp_ ## x (-d);\
+  if ((m > 0.0 && ((m < 0.1 - 0.1 * r * rexp_d) || (rexp_d * (m + r) >= 1.0)))\
+      || ((m == 0.0) && !(compile_options.allow_std\
+                         & (GFC_STD_F2003 | GFC_STD_F2008))))\
+    { \
+      newf->format = FMT_E;\
+      newf->u.real.w = w;\
+      newf->u.real.d = d - comp_d;\
+      newf->u.real.e = e;\
+      nb = 0;\
+      goto finish;\
+    }\
+\
+  mid = 0;\
+  low = 0;\
+  high = d + 1;\
+  lbound = 0;\
+  ubound = d + 1;\
+\
+  while (low <= high)\
+    { \
+      volatile GFC_REAL_ ## x temp;\
+      mid = (low + high) / 2;\
+\
+      temp = (calculate_exp_ ## x (mid - 1) * (1 - r * rexp_d));\
+\
+      if (m < temp)\
+        { \
+          ubound = mid;\
+          if (ubound == lbound + 1)\
+            break;\
+          high = mid - 1;\
+        }\
+      else if (m > temp)\
+        { \
+          lbound = mid;\
+          if (ubound == lbound + 1)\
+            { \
+              mid ++;\
+              break;\
+            }\
+          low = mid + 1;\
+        }\
+      else\
+       {\
+         mid++;\
+         break;\
+       }\
+    }\
+\
+  nb = e <= 0 ? 4 : e + 2;\
+  nb = nb >= w ? w - 1 : nb;\
+  newf->format = FMT_F;\
+  newf->u.real.w = w - nb;\
+  newf->u.real.d = m == 0.0 ? d - 1 : -(mid - d - 1) ;\
+  dtp->u.p.scale_factor = 0;\
+\
+ finish:\
+  result = output_float (dtp, newf, buffer, size, sign_bit, zero_flag, \
+                        ndigits, edigits);\
+  dtp->u.p.scale_factor = save_scale_factor;\
+\
+  free (newf);\
+\
+  if (nb > 0 && !dtp->u.p.g0_no_blanks)\
+    {\
+      p = write_block (dtp, nb);\
+      if (p == NULL)\
+       return;\
+      if (result == FAILURE)\
+        pad = '*';\
+      if (unlikely (is_char4_unit (dtp)))\
+       {\
+         gfc_char4_t *p4 = (gfc_char4_t *) p;\
+         memset4 (p4, pad, nb);\
+       }\
+      else \
+       memset (p, pad, nb);\
+    }\
+}\
+
+OUTPUT_FLOAT_FMT_G(4)
+
+OUTPUT_FLOAT_FMT_G(8)
+
+#ifdef HAVE_GFC_REAL_10
+OUTPUT_FLOAT_FMT_G(10)
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+OUTPUT_FLOAT_FMT_G(16)
+#endif
+
+#undef OUTPUT_FLOAT_FMT_G
+
+
+/* Define a macro to build code for write_float.  */
+
+  /* Note: Before output_float is called, snprintf is used to print to buffer the
+     number in the format +D.DDDDe+ddd. For an N digit exponent, this gives us
+     (MIN_FIELD_WIDTH-5)-N digits after the decimal point, plus another one
+     before the decimal point.
+
+     #   The result will always contain a decimal point, even if no
+        digits follow it
+
+     -   The converted value is to be left adjusted on the field boundary
+
+     +   A sign (+ or -) always be placed before a number
+
+     MIN_FIELD_WIDTH  minimum field width
+
+     *   (ndigits-1) is used as the precision
+
+     e format: [-]d.ddde±dd where there is one digit before the
+       decimal-point character and the number of digits after it is
+       equal to the precision. The exponent always contains at least two
+       digits; if the value is zero, the exponent is 00.  */
+
+#define DTOA \
+snprintf (buffer, size, "%+-#" STR(MIN_FIELD_WIDTH) ".*" \
+         "e", ndigits - 1, tmp);
+
+#define DTOAL \
+snprintf (buffer, size, "%+-#" STR(MIN_FIELD_WIDTH) ".*" \
+         "Le", ndigits - 1, tmp);
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define DTOAQ \
+__qmath_(quadmath_snprintf) (buffer, sizeof buffer, \
+                            "%+-#" STR(MIN_FIELD_WIDTH) ".*" \
+                            "Qe", ndigits - 1, tmp);
+#endif
+
+#define WRITE_FLOAT(x,y)\
+{\
+       GFC_REAL_ ## x tmp;\
+       tmp = * (GFC_REAL_ ## x *)source;\
+       sign_bit = signbit (tmp);\
+       if (!isfinite (tmp))\
+         { \
+           write_infnan (dtp, f, isnan (tmp), sign_bit);\
+           return;\
+         }\
+       tmp = sign_bit ? -tmp : tmp;\
+       zero_flag = (tmp == 0.0);\
+\
+       DTOA ## y\
+\
+       if (f->format != FMT_G)\
+         output_float (dtp, f, buffer, size, sign_bit, zero_flag, ndigits, \
+                       edigits);\
+       else \
+         output_float_FMT_G_ ## x (dtp, f, tmp, buffer, size, sign_bit, \
+                                   zero_flag, ndigits, edigits, comp_d);\
+}\
+
+/* Output a real number according to its format.  */
+
+static void
+write_float (st_parameter_dt *dtp, const fnode *f, const char *source, \
+            int len, int comp_d)
+{
+
+#if defined(HAVE_GFC_REAL_16) || __LDBL_DIG__ > 18
+# define MIN_FIELD_WIDTH 49
+#else
+# define MIN_FIELD_WIDTH 32
+#endif
+#define STR(x) STR1(x)
+#define STR1(x) #x
+
+  /* This must be large enough to accurately hold any value.  */
+  char buffer[MIN_FIELD_WIDTH+1];
+  int sign_bit, ndigits, edigits;
+  bool zero_flag;
+  size_t size;
+
+  size = MIN_FIELD_WIDTH+1;
+
+  /* printf pads blanks for us on the exponent so we just need it big enough
+     to handle the largest number of exponent digits expected.  */
+  edigits=4;
+
+  /* Always convert at full precision to avoid double rounding.  */
+    ndigits = MIN_FIELD_WIDTH - 4 - edigits;
+
+  switch (len)
+    {
+    case 4:
+      WRITE_FLOAT(4,)
+      break;
+
+    case 8:
+      WRITE_FLOAT(8,)
+      break;
+
+#ifdef HAVE_GFC_REAL_10
+    case 10:
+      WRITE_FLOAT(10,L)
+      break;
+#endif
+#ifdef HAVE_GFC_REAL_16
+    case 16:
+# ifdef GFC_REAL_16_IS_FLOAT128
+      WRITE_FLOAT(16,Q)
+# else
+      WRITE_FLOAT(16,L)
+# endif
+      break;
+#endif
+    default:
+      internal_error (NULL, "bad real kind");
+    }
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/kinds-override.h b/l4/pkg/libgfortran/lib/contrib/kinds-override.h
new file mode 100644 (file)
index 0000000..952413b
--- /dev/null
@@ -0,0 +1,46 @@
+/* Header used to override things detected by the mk-kinds-h.sh script.
+   Copyright (C) 2010 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* What are the C types corresponding to the real(kind=10) and
+   real(kind=16) types? We currently rely on the following assumptions:
+     -- if real(kind=10) exists, i.e. if HAVE_GFC_REAL_10 is defined,
+        then it is necessarily the "long double" type
+     -- if real(kind=16) exists, then:
+         * if HAVE_GFC_REAL_10, real(kind=16) is "__float128"
+        * otherwise, real(kind=16) is "long double"
+   To allow to change this in the future, we create the
+   GFC_REAL_16_IS_FLOAT128 macro that is used throughout libgfortran.  */
+
+#if defined(HAVE_GFC_REAL_16)
+# if defined(HAVE_GFC_REAL_10)
+#  define GFC_REAL_16_IS_FLOAT128
+#  if !defined(HAVE_FLOAT128)
+#   error "Where has __float128 gone?"
+#  endif
+# else
+#  define GFC_REAL_16_IS_LONG_DOUBLE
+# endif
+#endif
+
diff --git a/l4/pkg/libgfortran/lib/contrib/libgfortran.h b/l4/pkg/libgfortran/lib/contrib/libgfortran.h
new file mode 100644 (file)
index 0000000..148dcfb
--- /dev/null
@@ -0,0 +1,1361 @@
+/* Common declarations for all of libgfortran.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011
+   Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>, and
+   Andy Vaught <andy@xena.eas.asu.edu>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef LIBGFOR_H
+#define LIBGFOR_H
+
+/* Ensure that ANSI conform stdio is used. This needs to be set before
+   any system header file is included.  */
+#if defined __MINGW32__
+#  define _POSIX 1
+#  define gfc_printf gnu_printf
+#else
+#  define gfc_printf __printf__
+#endif
+
+/* config.h MUST be first because it can affect system headers.  */
+#include "config.h"
+
+#include <stdio.h>
+#include <math.h>
+#include <stddef.h>
+#include <float.h>
+#include <stdarg.h>
+
+/* If we're support quad-precision floating-point type, include the
+   header to our support library.  */
+#ifdef HAVE_FLOAT128
+#  include "quadmath_weak.h"
+#endif
+
+#ifdef __MINGW32__
+extern float __strtof (const char *, char **);
+#define gfc_strtof __strtof
+extern double __strtod (const char *, char **);
+#define gfc_strtod __strtod
+extern long double __strtold (const char *, char **);
+#define gfc_strtold __strtold
+#else
+#define gfc_strtof strtof
+#define gfc_strtod strtod
+#define gfc_strtold strtold
+#endif
+
+#if HAVE_COMPLEX_H
+# include <complex.h>
+#else
+#define complex __complex__
+#endif
+
+#include "../gcc/fortran/libgfortran.h"
+
+#include "c99_protos.h"
+
+#if HAVE_IEEEFP_H
+#include <ieeefp.h>
+#endif
+
+#include "gstdint.h"
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef __MINGW32__
+typedef off64_t gfc_offset;
+#else
+typedef off_t gfc_offset;
+#endif
+
+#ifndef NULL
+#define NULL (void *) 0
+#endif
+
+#ifndef __GNUC__
+#define __attribute__(x)
+#define likely(x)       (x)
+#define unlikely(x)     (x)
+#else
+#define likely(x)       __builtin_expect(!!(x), 1)
+#define unlikely(x)     __builtin_expect(!!(x), 0)
+#endif
+
+
+/* Make sure we have ptrdiff_t. */
+#ifndef HAVE_PTRDIFF_T
+typedef intptr_t ptrdiff_t;
+#endif
+
+/* On mingw, work around the buggy Windows snprintf() by using the one
+   mingw provides, __mingw_snprintf().  We also provide a prototype for
+   __mingw_snprintf(), because the mingw headers currently don't have one.  */
+#if HAVE_MINGW_SNPRINTF
+extern int __mingw_snprintf (char *, size_t, const char *, ...)
+     __attribute__ ((format (gnu_printf, 3, 4)));
+#undef snprintf
+#define snprintf __mingw_snprintf
+/* Fallback to sprintf if target does not have snprintf.  */
+#elif !defined(HAVE_SNPRINTF)
+#undef snprintf
+#define snprintf(str, size, ...) sprintf (str, __VA_ARGS__)
+#endif
+
+
+/* For a library, a standard prefix is a requirement in order to partition
+   the namespace.  IPREFIX is for symbols intended to be internal to the
+   library.  */
+#define PREFIX(x)      _gfortran_ ## x
+#define IPREFIX(x)     _gfortrani_ ## x
+
+/* Magic to rename a symbol at the compiler level.  You continue to refer
+   to the symbol as OLD in the source, but it'll be named NEW in the asm.  */
+#define sym_rename(old, new) sym_rename1(old, __USER_LABEL_PREFIX__, new)
+#define sym_rename1(old, ulp, new) sym_rename2(old, ulp, new)
+#define sym_rename2(old, ulp, new) extern __typeof(old) old __asm__(#ulp #new)
+
+/* There are several classifications of routines:
+
+     (1) Symbols used only within the library,
+     (2) Symbols to be exported from the library,
+     (3) Symbols to be exported from the library, but
+        also used inside the library.
+
+   By telling the compiler about these different classifications we can
+   tightly control the interface seen by the user, and get better code
+   from the compiler at the same time.
+
+   One of the following should be used immediately after the declaration
+   of each symbol:
+
+     internal_proto    Marks a symbol used only within the library,
+                       and adds IPREFIX to the assembly-level symbol
+                       name.  The later is important for maintaining
+                       the namespace partition for the static library.
+
+     export_proto      Marks a symbol to be exported, and adds PREFIX
+                       to the assembly-level symbol name.
+
+     export_proto_np   Marks a symbol to be exported without adding PREFIX.
+
+     iexport_proto     Marks a function to be exported, but with the 
+                       understanding that it can be used inside as well.
+
+     iexport_data_proto        Similarly, marks a data symbol to be exported.
+                       Unfortunately, some systems can't play the hidden
+                       symbol renaming trick on data symbols, thanks to
+                       the horribleness of COPY relocations.
+
+   If iexport_proto or iexport_data_proto is used, you must also use
+   iexport or iexport_data after the *definition* of the symbol.  */
+
+#if defined(HAVE_ATTRIBUTE_VISIBILITY)
+# define internal_proto(x) \
+       sym_rename(x, IPREFIX (x)) __attribute__((__visibility__("hidden")))
+#else
+# define internal_proto(x)     sym_rename(x, IPREFIX(x))
+#endif
+
+#if defined(HAVE_ATTRIBUTE_VISIBILITY) && defined(HAVE_ATTRIBUTE_ALIAS)
+# define export_proto(x)       sym_rename(x, PREFIX(x))
+# define export_proto_np(x)    extern char swallow_semicolon
+# define iexport_proto(x)      internal_proto(x)
+# define iexport(x)            iexport1(x, IPREFIX(x))
+# define iexport1(x,y)         iexport2(x,y)
+# define iexport2(x,y) \
+       extern __typeof(x) PREFIX(x) __attribute__((__alias__(#y)))
+#else
+# define export_proto(x)       sym_rename(x, PREFIX(x))
+# define export_proto_np(x)    extern char swallow_semicolon
+# define iexport_proto(x)      export_proto(x)
+# define iexport(x)            extern char swallow_semicolon
+#endif
+
+/* TODO: detect the case when we *can* hide the symbol.  */
+#define iexport_data_proto(x)  export_proto(x)
+#define iexport_data(x)                extern char swallow_semicolon
+
+/* The only reliable way to get the offset of a field in a struct
+   in a system independent way is via this macro.  */
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER)  ((size_t) &((TYPE *) 0)->MEMBER)
+#endif
+
+/* The C99 classification macros isfinite, isinf, isnan, isnormal
+   and signbit are broken or inconsistent on quite a few targets.
+   So, we use GCC's builtins instead.
+
+   Another advantage for GCC's builtins for these type-generic macros
+   is that it handles floating-point types that the system headers
+   may not support (like __float128).  */
+
+#undef isnan
+#define isnan(x) __builtin_isnan(x)
+#undef isfinite
+#define isfinite(x) __builtin_isfinite(x)
+#undef isinf
+#define isinf(x) __builtin_isinf(x)
+#undef isnormal
+#define isnormal(x) __builtin_isnormal(x)
+#undef signbit
+#define signbit(x) __builtin_signbit(x)
+
+/* TODO: find the C99 version of these an move into above ifdef.  */
+#define REALPART(z) (__real__(z))
+#define IMAGPART(z) (__imag__(z))
+#define COMPLEX_ASSIGN(z_, r_, i_) {__real__(z_) = (r_); __imag__(z_) = (i_);}
+
+#include "kinds.h"
+
+/* Define the type used for the current record number for large file I/O.
+   The size must be consistent with the size defined on the compiler side.  */
+#ifdef HAVE_GFC_INTEGER_8
+typedef GFC_INTEGER_8 GFC_IO_INT;
+#else
+#ifdef HAVE_GFC_INTEGER_4
+typedef GFC_INTEGER_4 GFC_IO_INT;
+#else
+#error "GFC_INTEGER_4 should be available for the library to compile".
+#endif
+#endif
+
+/* The following two definitions must be consistent with the types used
+   by the compiler.  */
+/* The type used of array indices, amongst other things.  */
+typedef ptrdiff_t index_type;
+
+/* The type used for the lengths of character variables.  */
+typedef GFC_INTEGER_4 gfc_charlen_type;
+
+/* Definitions of CHARACTER data types:
+     - CHARACTER(KIND=1) corresponds to the C char type,
+     - CHARACTER(KIND=4) corresponds to an unsigned 32-bit integer.  */
+typedef GFC_UINTEGER_4 gfc_char4_t;
+
+/* Byte size of character kinds.  For the kinds currently supported, it's
+   simply equal to the kind parameter itself.  */
+#define GFC_SIZE_OF_CHAR_KIND(kind) (kind)
+
+/* This will be 0 on little-endian machines and one on big-endian machines.  */
+extern int big_endian;
+internal_proto(big_endian);
+
+#define GFOR_POINTER_TO_L1(p, kind) \
+  (big_endian * (kind - 1) + (GFC_LOGICAL_1 *)(p))
+
+#define GFC_INTEGER_1_HUGE \
+  (GFC_INTEGER_1)((((GFC_UINTEGER_1)1) << 7) - 1)
+#define GFC_INTEGER_2_HUGE \
+  (GFC_INTEGER_2)((((GFC_UINTEGER_2)1) << 15) - 1)
+#define GFC_INTEGER_4_HUGE \
+  (GFC_INTEGER_4)((((GFC_UINTEGER_4)1) << 31) - 1)
+#define GFC_INTEGER_8_HUGE \
+  (GFC_INTEGER_8)((((GFC_UINTEGER_8)1) << 63) - 1)
+#ifdef HAVE_GFC_INTEGER_16
+#define GFC_INTEGER_16_HUGE \
+  (GFC_INTEGER_16)((((GFC_UINTEGER_16)1) << 127) - 1)
+#endif
+
+/* M{IN,AX}{LOC,VAL} need also infinities and NaNs if supported.  */
+
+#ifdef __FLT_HAS_INFINITY__
+# define GFC_REAL_4_INFINITY __builtin_inff ()
+#endif
+#ifdef __DBL_HAS_INFINITY__
+# define GFC_REAL_8_INFINITY __builtin_inf ()
+#endif
+#ifdef __LDBL_HAS_INFINITY__
+# ifdef HAVE_GFC_REAL_10
+#  define GFC_REAL_10_INFINITY __builtin_infl ()
+# endif
+# ifdef HAVE_GFC_REAL_16
+#  ifdef GFC_REAL_16_IS_LONG_DOUBLE
+#   define GFC_REAL_16_INFINITY __builtin_infl ()
+#  else
+#   define GFC_REAL_16_INFINITY __builtin_infq ()
+#  endif
+# endif
+#endif
+#ifdef __FLT_HAS_QUIET_NAN__
+# define GFC_REAL_4_QUIET_NAN __builtin_nanf ("")
+#endif
+#ifdef __DBL_HAS_QUIET_NAN__
+# define GFC_REAL_8_QUIET_NAN __builtin_nan ("")
+#endif
+#ifdef __LDBL_HAS_QUIET_NAN__
+# ifdef HAVE_GFC_REAL_10
+#  define GFC_REAL_10_QUIET_NAN __builtin_nanl ("")
+# endif
+# ifdef HAVE_GFC_REAL_16
+#  ifdef GFC_REAL_16_IS_LONG_DOUBLE
+#   define GFC_REAL_16_QUIET_NAN __builtin_nanl ("")
+#  else
+#   define GFC_REAL_16_QUIET_NAN nanq ("")
+#  endif
+# endif
+#endif
+
+typedef struct descriptor_dimension
+{
+  index_type _stride;
+  index_type _lbound;
+  index_type _ubound;
+}
+
+descriptor_dimension;
+
+#define GFC_ARRAY_DESCRIPTOR(r, type) \
+struct {\
+  type *data;\
+  size_t offset;\
+  index_type dtype;\
+  descriptor_dimension dim[r];\
+}
+
+/* Commonly used array descriptor types.  */
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, void) gfc_array_void;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, char) gfc_array_char;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_1) gfc_array_i1;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_2) gfc_array_i2;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_4) gfc_array_i4;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_8) gfc_array_i8;
+#ifdef HAVE_GFC_INTEGER_16
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_16) gfc_array_i16;
+#endif
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_REAL_4) gfc_array_r4;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_REAL_8) gfc_array_r8;
+#ifdef HAVE_GFC_REAL_10
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_REAL_10) gfc_array_r10;
+#endif
+#ifdef HAVE_GFC_REAL_16
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_REAL_16) gfc_array_r16;
+#endif
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_4) gfc_array_c4;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_8) gfc_array_c8;
+#ifdef HAVE_GFC_COMPLEX_10
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_10) gfc_array_c10;
+#endif
+#ifdef HAVE_GFC_COMPLEX_16
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_16) gfc_array_c16;
+#endif
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_1) gfc_array_l1;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_2) gfc_array_l2;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_4) gfc_array_l4;
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_8) gfc_array_l8;
+#ifdef HAVE_GFC_LOGICAL_16
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_16) gfc_array_l16;
+#endif
+
+
+#define GFC_DESCRIPTOR_RANK(desc) ((desc)->dtype & GFC_DTYPE_RANK_MASK)
+#define GFC_DESCRIPTOR_TYPE(desc) (((desc)->dtype & GFC_DTYPE_TYPE_MASK) \
+                                   >> GFC_DTYPE_TYPE_SHIFT)
+#define GFC_DESCRIPTOR_SIZE(desc) ((desc)->dtype >> GFC_DTYPE_SIZE_SHIFT)
+#define GFC_DESCRIPTOR_DATA(desc) ((desc)->data)
+#define GFC_DESCRIPTOR_DTYPE(desc) ((desc)->dtype)
+
+#define GFC_DIMENSION_LBOUND(dim) ((dim)._lbound)
+#define GFC_DIMENSION_UBOUND(dim) ((dim)._ubound)
+#define GFC_DIMENSION_STRIDE(dim) ((dim)._stride)
+#define GFC_DIMENSION_EXTENT(dim) ((dim)._ubound + 1 - (dim)._lbound)
+#define GFC_DIMENSION_SET(dim,lb,ub,str) \
+  do \
+    { \
+      (dim)._lbound = lb;                      \
+      (dim)._ubound = ub;                      \
+      (dim)._stride = str;                     \
+    } while (0)
+           
+
+#define GFC_DESCRIPTOR_LBOUND(desc,i) ((desc)->dim[i]._lbound)
+#define GFC_DESCRIPTOR_UBOUND(desc,i) ((desc)->dim[i]._ubound)
+#define GFC_DESCRIPTOR_EXTENT(desc,i) ((desc)->dim[i]._ubound + 1 \
+                                     - (desc)->dim[i]._lbound)
+#define GFC_DESCRIPTOR_EXTENT_BYTES(desc,i) \
+  (GFC_DESCRIPTOR_EXTENT(desc,i) * GFC_DESCRIPTOR_SIZE(desc))
+
+#define GFC_DESCRIPTOR_STRIDE(desc,i) ((desc)->dim[i]._stride)
+#define GFC_DESCRIPTOR_STRIDE_BYTES(desc,i) \
+  (GFC_DESCRIPTOR_STRIDE(desc,i) * GFC_DESCRIPTOR_SIZE(desc))
+
+/* Macros to get both the size and the type with a single masking operation  */
+
+#define GFC_DTYPE_SIZE_MASK \
+  ((~((index_type) 0) >> GFC_DTYPE_SIZE_SHIFT) << GFC_DTYPE_SIZE_SHIFT)
+#define GFC_DTYPE_TYPE_SIZE_MASK (GFC_DTYPE_SIZE_MASK | GFC_DTYPE_TYPE_MASK)
+
+#define GFC_DTYPE_TYPE_SIZE(desc) ((desc)->dtype & GFC_DTYPE_TYPE_SIZE_MASK)
+
+#define GFC_DTYPE_INTEGER_1 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_1) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_INTEGER_2 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_2) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_INTEGER_4 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_4) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_INTEGER_8 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_8) << GFC_DTYPE_SIZE_SHIFT))
+#ifdef HAVE_GFC_INTEGER_16
+#define GFC_DTYPE_INTEGER_16 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_16) << GFC_DTYPE_SIZE_SHIFT))
+#endif
+
+#define GFC_DTYPE_LOGICAL_1 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_LOGICAL_1) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_LOGICAL_2 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_LOGICAL_2) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_LOGICAL_4 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_LOGICAL_4) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_LOGICAL_8 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_LOGICAL_8) << GFC_DTYPE_SIZE_SHIFT))
+#ifdef HAVE_GFC_LOGICAL_16
+#define GFC_DTYPE_LOGICAL_16 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_LOGICAL_16) << GFC_DTYPE_SIZE_SHIFT))
+#endif
+
+#define GFC_DTYPE_REAL_4 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_REAL_4) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_REAL_8 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_REAL_8) << GFC_DTYPE_SIZE_SHIFT))
+#ifdef HAVE_GFC_REAL_10
+#define GFC_DTYPE_REAL_10  ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_REAL_10) << GFC_DTYPE_SIZE_SHIFT))
+#endif
+#ifdef HAVE_GFC_REAL_16
+#define GFC_DTYPE_REAL_16 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_REAL_16) << GFC_DTYPE_SIZE_SHIFT))
+#endif
+
+#define GFC_DTYPE_COMPLEX_4 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_COMPLEX_4) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_COMPLEX_8 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_COMPLEX_8) << GFC_DTYPE_SIZE_SHIFT))
+#ifdef HAVE_GFC_COMPLEX_10
+#define GFC_DTYPE_COMPLEX_10 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_COMPLEX_10) << GFC_DTYPE_SIZE_SHIFT))
+#endif
+#ifdef HAVE_GFC_COMPLEX_16
+#define GFC_DTYPE_COMPLEX_16 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_COMPLEX_16) << GFC_DTYPE_SIZE_SHIFT))
+#endif
+
+#define GFC_DTYPE_DERIVED_1 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_1) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_DERIVED_2 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_2) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_DERIVED_4 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_4) << GFC_DTYPE_SIZE_SHIFT))
+#define GFC_DTYPE_DERIVED_8 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_8) << GFC_DTYPE_SIZE_SHIFT))
+#ifdef HAVE_GFC_INTEGER_16
+#define GFC_DTYPE_DERIVED_16 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
+   | (sizeof(GFC_INTEGER_16) << GFC_DTYPE_SIZE_SHIFT))
+#endif
+
+/* Macros to determine the alignment of pointers.  */
+
+#define GFC_UNALIGNED_2(x) (((uintptr_t)(x)) & \
+                           (__alignof__(GFC_INTEGER_2) - 1))
+#define GFC_UNALIGNED_4(x) (((uintptr_t)(x)) & \
+                           (__alignof__(GFC_INTEGER_4) - 1))
+#define GFC_UNALIGNED_8(x) (((uintptr_t)(x)) & \
+                           (__alignof__(GFC_INTEGER_8) - 1))
+#ifdef HAVE_GFC_INTEGER_16
+#define GFC_UNALIGNED_16(x) (((uintptr_t)(x)) & \
+                            (__alignof__(GFC_INTEGER_16) - 1))
+#endif
+
+#define GFC_UNALIGNED_C4(x) (((uintptr_t)(x)) & \
+                            (__alignof__(GFC_COMPLEX_4) - 1))
+
+#define GFC_UNALIGNED_C8(x) (((uintptr_t)(x)) & \
+                            (__alignof__(GFC_COMPLEX_8) - 1))
+
+/* Runtime library include.  */
+#define stringize(x) expand_macro(x)
+#define expand_macro(x) # x
+
+/* Runtime options structure.  */
+
+typedef struct
+{
+  int stdin_unit, stdout_unit, stderr_unit, optional_plus;
+  int locus;
+
+  int separator_len;
+  const char *separator;
+
+  int all_unbuffered, unbuffered_preconnected, default_recl;
+  int fpe, backtrace;
+}
+options_t;
+
+extern options_t options;
+internal_proto(options);
+
+extern void backtrace_handler (int);
+internal_proto(backtrace_handler);
+
+
+/* Compile-time options that will influence the library.  */
+
+typedef struct
+{
+  int warn_std;
+  int allow_std;
+  int pedantic;
+  int convert;
+  int backtrace;
+  int sign_zero;
+  size_t record_marker;
+  int max_subrecord_length;
+  int bounds_check;
+  int range_check;
+}
+compile_options_t;
+
+extern compile_options_t compile_options;
+internal_proto(compile_options);
+
+extern void init_compile_options (void);
+internal_proto(init_compile_options);
+
+#define GFC_MAX_SUBRECORD_LENGTH 2147483639   /* 2**31 - 9 */
+
+/* Structure for statement options.  */
+
+typedef struct
+{
+  const char *name;
+  int value;
+}
+st_option;
+
+
+/* This is returned by notification_std to know if, given the flags
+   that were given (-std=, -pedantic) we should issue an error, a warning
+   or nothing.  */
+typedef enum
+{ NOTIFICATION_SILENT, NOTIFICATION_WARNING, NOTIFICATION_ERROR }
+notification;
+
+/* This is returned by notify_std and several io functions.  */
+typedef enum
+{ SUCCESS = 1, FAILURE }
+try;
+
+/* The filename and line number don't go inside the globals structure.
+   They are set by the rest of the program and must be linked to.  */
+
+/* Location of the current library call (optional).  */
+extern unsigned line;
+iexport_data_proto(line);
+
+extern char *filename;
+iexport_data_proto(filename);
+
+/* Avoid conflicting prototypes of alloca() in system headers by using 
+   GCC's builtin alloca().  */
+#define gfc_alloca(x)  __builtin_alloca(x)
+
+
+/* Directory for creating temporary files.  Only used when none of the
+   following environment variables exist: GFORTRAN_TMPDIR, TMP and TEMP.  */
+#define DEFAULT_TEMPDIR "/tmp"
+
+/* The default value of record length for preconnected units is defined
+   here. This value can be overriden by an environment variable.
+   Default value is 1 Gb.  */
+#define DEFAULT_RECL 1073741824
+
+
+#define CHARACTER2(name) \
+              gfc_charlen_type name ## _len; \
+              char * name
+
+typedef struct st_parameter_common
+{
+  GFC_INTEGER_4 flags;
+  GFC_INTEGER_4 unit;
+  const char *filename;
+  GFC_INTEGER_4 line;
+  CHARACTER2 (iomsg);
+  GFC_INTEGER_4 *iostat;
+}
+st_parameter_common;
+
+#undef CHARACTER2
+
+#define IOPARM_LIBRETURN_MASK           (3 << 0)
+#define IOPARM_LIBRETURN_OK             (0 << 0)
+#define IOPARM_LIBRETURN_ERROR          (1 << 0)
+#define IOPARM_LIBRETURN_END            (2 << 0)
+#define IOPARM_LIBRETURN_EOR            (3 << 0)
+#define IOPARM_ERR                      (1 << 2)
+#define IOPARM_END                      (1 << 3)
+#define IOPARM_EOR                      (1 << 4)
+#define IOPARM_HAS_IOSTAT               (1 << 5)
+#define IOPARM_HAS_IOMSG                (1 << 6)
+
+#define IOPARM_COMMON_MASK              ((1 << 7) - 1)
+
+#define IOPARM_OPEN_HAS_RECL_IN         (1 << 7)
+#define IOPARM_OPEN_HAS_FILE            (1 << 8)
+#define IOPARM_OPEN_HAS_STATUS          (1 << 9)
+#define IOPARM_OPEN_HAS_ACCESS          (1 << 10)
+#define IOPARM_OPEN_HAS_FORM            (1 << 11)
+#define IOPARM_OPEN_HAS_BLANK           (1 << 12)
+#define IOPARM_OPEN_HAS_POSITION        (1 << 13)
+#define IOPARM_OPEN_HAS_ACTION          (1 << 14)
+#define IOPARM_OPEN_HAS_DELIM           (1 << 15)
+#define IOPARM_OPEN_HAS_PAD             (1 << 16)
+#define IOPARM_OPEN_HAS_CONVERT         (1 << 17)
+#define IOPARM_OPEN_HAS_DECIMAL                (1 << 18)
+#define IOPARM_OPEN_HAS_ENCODING       (1 << 19)
+#define IOPARM_OPEN_HAS_ROUND          (1 << 20)
+#define IOPARM_OPEN_HAS_SIGN           (1 << 21)
+#define IOPARM_OPEN_HAS_ASYNCHRONOUS   (1 << 22)
+#define IOPARM_OPEN_HAS_NEWUNIT                (1 << 23)
+
+/* library start function and end macro.  These can be expanded if needed
+   in the future.  cmp is st_parameter_common *cmp  */
+
+extern void library_start (st_parameter_common *);
+internal_proto(library_start);
+
+#define library_end()
+
+/* main.c */
+
+extern void stupid_function_name_for_static_linking (void);
+internal_proto(stupid_function_name_for_static_linking);
+
+extern void set_args (int, char **);
+iexport_proto(set_args);
+
+extern void get_args (int *, char ***);
+internal_proto(get_args);
+
+extern void store_exe_path (const char *);
+export_proto(store_exe_path);
+
+extern char * full_exe_path (void);
+internal_proto(full_exe_path);
+
+extern void find_addr2line (void);
+internal_proto(find_addr2line);
+
+/* backtrace.c */
+
+extern void show_backtrace (void);
+internal_proto(show_backtrace);
+
+/* error.c */
+
+#if defined(HAVE_GFC_REAL_16)
+#define GFC_LARGEST_BUF (sizeof (GFC_REAL_16))
+#elif defined(HAVE_GFC_INTEGER_16)
+#define GFC_LARGEST_BUF (sizeof (GFC_INTEGER_LARGEST))
+#elif defined(HAVE_GFC_REAL_10)
+#define GFC_LARGEST_BUF (sizeof (GFC_REAL_10))
+#else
+#define GFC_LARGEST_BUF (sizeof (GFC_INTEGER_LARGEST))
+#endif
+
+#define GFC_ITOA_BUF_SIZE (sizeof (GFC_INTEGER_LARGEST) * 3 + 2)
+#define GFC_XTOA_BUF_SIZE (GFC_LARGEST_BUF * 2 + 1)
+#define GFC_OTOA_BUF_SIZE (GFC_LARGEST_BUF * 3 + 1)
+#define GFC_BTOA_BUF_SIZE (GFC_LARGEST_BUF * 8 + 1)
+
+extern void sys_abort (void) __attribute__ ((noreturn));
+internal_proto(sys_abort);
+
+extern ssize_t estr_write (const char *);
+internal_proto(estr_write);
+
+extern int st_vprintf (const char *, va_list);
+internal_proto(st_vprintf);
+
+extern int st_printf (const char *, ...)
+  __attribute__((format (gfc_printf, 1, 2)));
+internal_proto(st_printf);
+
+extern const char *gfc_xtoa (GFC_UINTEGER_LARGEST, char *, size_t);
+internal_proto(gfc_xtoa);
+
+extern void os_error (const char *) __attribute__ ((noreturn));
+iexport_proto(os_error);
+
+extern void show_locus (st_parameter_common *);
+internal_proto(show_locus);
+
+extern void runtime_error (const char *, ...)
+     __attribute__ ((noreturn, format (gfc_printf, 1, 2)));
+iexport_proto(runtime_error);
+
+extern void runtime_error_at (const char *, const char *, ...)
+     __attribute__ ((noreturn, format (gfc_printf, 2, 3)));
+iexport_proto(runtime_error_at);
+
+extern void runtime_warning_at (const char *, const char *, ...)
+     __attribute__ ((format (gfc_printf, 2, 3)));
+iexport_proto(runtime_warning_at);
+
+extern void internal_error (st_parameter_common *, const char *)
+  __attribute__ ((noreturn));
+internal_proto(internal_error);
+
+extern const char *translate_error (int);
+internal_proto(translate_error);
+
+extern void generate_error (st_parameter_common *, int, const char *);
+iexport_proto(generate_error);
+
+extern void generate_warning (st_parameter_common *, const char *);
+internal_proto(generate_warning);
+
+extern try notify_std (st_parameter_common *, int, const char *);
+internal_proto(notify_std);
+
+extern notification notification_std(int);
+internal_proto(notification_std);
+
+extern char *gf_strerror (int, char *, size_t);
+internal_proto(gf_strerror);
+
+/* fpu.c */
+
+extern void set_fpu (void);
+internal_proto(set_fpu);
+
+/* memory.c */
+
+extern void *get_mem (size_t) __attribute__ ((malloc));
+internal_proto(get_mem);
+
+extern void *internal_malloc_size (size_t) __attribute__ ((malloc));
+internal_proto(internal_malloc_size);
+
+/* environ.c */
+
+extern int check_buffered (int);
+internal_proto(check_buffered);
+
+extern void init_variables (void);
+internal_proto(init_variables);
+
+extern void show_variables (void);
+internal_proto(show_variables);
+
+unit_convert get_unformatted_convert (int);
+internal_proto(get_unformatted_convert);
+
+/* string.c */
+
+extern int find_option (st_parameter_common *, const char *, gfc_charlen_type,
+                       const st_option *, const char *);
+internal_proto(find_option);
+
+extern gfc_charlen_type fstrlen (const char *, gfc_charlen_type);
+internal_proto(fstrlen);
+
+extern gfc_charlen_type fstrcpy (char *, gfc_charlen_type, const char *, gfc_charlen_type);
+internal_proto(fstrcpy);
+
+extern gfc_charlen_type cf_strcpy (char *, gfc_charlen_type, const char *);
+internal_proto(cf_strcpy);
+
+/* io/intrinsics.c */
+
+extern void flush_all_units (void);
+internal_proto(flush_all_units);
+
+/* io.c */
+
+extern void init_units (void);
+internal_proto(init_units);
+
+extern void close_units (void);
+internal_proto(close_units);
+
+extern int unit_to_fd (int);
+internal_proto(unit_to_fd);
+
+extern char * filename_from_unit (int);
+internal_proto(filename_from_unit);
+
+/* stop.c */
+
+extern void stop_string (const char *, GFC_INTEGER_4)
+  __attribute__ ((noreturn));
+export_proto(stop_string);
+
+/* reshape_packed.c */
+
+extern void reshape_packed (char *, index_type, const char *, index_type,
+                           const char *, index_type);
+internal_proto(reshape_packed);
+
+/* Repacking functions.  These are called internally by internal_pack
+   and internal_unpack.  */
+
+GFC_INTEGER_1 *internal_pack_1 (gfc_array_i1 *);
+internal_proto(internal_pack_1);
+
+GFC_INTEGER_2 *internal_pack_2 (gfc_array_i2 *);
+internal_proto(internal_pack_2);
+
+GFC_INTEGER_4 *internal_pack_4 (gfc_array_i4 *);
+internal_proto(internal_pack_4);
+
+GFC_INTEGER_8 *internal_pack_8 (gfc_array_i8 *);
+internal_proto(internal_pack_8);
+
+#if defined HAVE_GFC_INTEGER_16
+GFC_INTEGER_16 *internal_pack_16 (gfc_array_i16 *);
+internal_proto(internal_pack_16);
+#endif
+
+GFC_REAL_4 *internal_pack_r4 (gfc_array_r4 *);
+internal_proto(internal_pack_r4);
+
+GFC_REAL_8 *internal_pack_r8 (gfc_array_r8 *);
+internal_proto(internal_pack_r8);
+
+#if defined HAVE_GFC_REAL_10
+GFC_REAL_10 *internal_pack_r10 (gfc_array_r10 *);
+internal_proto(internal_pack_r10);
+#endif
+
+#if defined HAVE_GFC_REAL_16
+GFC_REAL_16 *internal_pack_r16 (gfc_array_r16 *);
+internal_proto(internal_pack_r16);
+#endif
+
+GFC_COMPLEX_4 *internal_pack_c4 (gfc_array_c4 *);
+internal_proto(internal_pack_c4);
+
+GFC_COMPLEX_8 *internal_pack_c8 (gfc_array_c8 *);
+internal_proto(internal_pack_c8);
+
+#if defined HAVE_GFC_COMPLEX_10
+GFC_COMPLEX_10 *internal_pack_c10 (gfc_array_c10 *);
+internal_proto(internal_pack_c10);
+#endif
+
+#if defined HAVE_GFC_COMPLEX_16
+GFC_COMPLEX_16 *internal_pack_c16 (gfc_array_c16 *);
+internal_proto(internal_pack_c16);
+#endif
+
+extern void internal_unpack_1 (gfc_array_i1 *, const GFC_INTEGER_1 *);
+internal_proto(internal_unpack_1);
+
+extern void internal_unpack_2 (gfc_array_i2 *, const GFC_INTEGER_2 *);
+internal_proto(internal_unpack_2);
+
+extern void internal_unpack_4 (gfc_array_i4 *, const GFC_INTEGER_4 *);
+internal_proto(internal_unpack_4);
+
+extern void internal_unpack_8 (gfc_array_i8 *, const GFC_INTEGER_8 *);
+internal_proto(internal_unpack_8);
+
+#if defined HAVE_GFC_INTEGER_16
+extern void internal_unpack_16 (gfc_array_i16 *, const GFC_INTEGER_16 *);
+internal_proto(internal_unpack_16);
+#endif
+
+extern void internal_unpack_r4 (gfc_array_r4 *, const GFC_REAL_4 *);
+internal_proto(internal_unpack_r4);
+
+extern void internal_unpack_r8 (gfc_array_r8 *, const GFC_REAL_8 *);
+internal_proto(internal_unpack_r8);
+
+#if defined HAVE_GFC_REAL_10
+extern void internal_unpack_r10 (gfc_array_r10 *, const GFC_REAL_10 *);
+internal_proto(internal_unpack_r10);
+#endif
+
+#if defined HAVE_GFC_REAL_16
+extern void internal_unpack_r16 (gfc_array_r16 *, const GFC_REAL_16 *);
+internal_proto(internal_unpack_r16);
+#endif
+
+extern void internal_unpack_c4 (gfc_array_c4 *, const GFC_COMPLEX_4 *);
+internal_proto(internal_unpack_c4);
+
+extern void internal_unpack_c8 (gfc_array_c8 *, const GFC_COMPLEX_8 *);
+internal_proto(internal_unpack_c8);
+
+#if defined HAVE_GFC_COMPLEX_10
+extern void internal_unpack_c10 (gfc_array_c10 *, const GFC_COMPLEX_10 *);
+internal_proto(internal_unpack_c10);
+#endif
+
+#if defined HAVE_GFC_COMPLEX_16
+extern void internal_unpack_c16 (gfc_array_c16 *, const GFC_COMPLEX_16 *);
+internal_proto(internal_unpack_c16);
+#endif
+
+/* Internal auxiliary functions for the pack intrinsic.  */
+
+extern void pack_i1 (gfc_array_i1 *, const gfc_array_i1 *,
+                    const gfc_array_l1 *, const gfc_array_i1 *);
+internal_proto(pack_i1);
+
+extern void pack_i2 (gfc_array_i2 *, const gfc_array_i2 *,
+                    const gfc_array_l1 *, const gfc_array_i2 *);
+internal_proto(pack_i2);
+
+extern void pack_i4 (gfc_array_i4 *, const gfc_array_i4 *,
+                    const gfc_array_l1 *, const gfc_array_i4 *);
+internal_proto(pack_i4);
+
+extern void pack_i8 (gfc_array_i8 *, const gfc_array_i8 *,
+                    const gfc_array_l1 *, const gfc_array_i8 *);
+internal_proto(pack_i8);
+
+#ifdef HAVE_GFC_INTEGER_16
+extern void pack_i16 (gfc_array_i16 *, const gfc_array_i16 *,
+                    const gfc_array_l1 *, const gfc_array_i16 *);
+internal_proto(pack_i16);
+#endif
+
+extern void pack_r4 (gfc_array_r4 *, const gfc_array_r4 *,
+                    const gfc_array_l1 *, const gfc_array_r4 *);
+internal_proto(pack_r4);
+
+extern void pack_r8 (gfc_array_r8 *, const gfc_array_r8 *,
+                    const gfc_array_l1 *, const gfc_array_r8 *);
+internal_proto(pack_r8);
+
+#ifdef HAVE_GFC_REAL_10
+extern void pack_r10 (gfc_array_r10 *, const gfc_array_r10 *,
+                    const gfc_array_l1 *, const gfc_array_r10 *);
+internal_proto(pack_r10);
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+extern void pack_r16 (gfc_array_r16 *, const gfc_array_r16 *,
+                    const gfc_array_l1 *, const gfc_array_r16 *);
+internal_proto(pack_r16);
+#endif
+
+extern void pack_c4 (gfc_array_c4 *, const gfc_array_c4 *,
+                    const gfc_array_l1 *, const gfc_array_c4 *);
+internal_proto(pack_c4);
+
+extern void pack_c8 (gfc_array_c8 *, const gfc_array_c8 *,
+                    const gfc_array_l1 *, const gfc_array_c8 *);
+internal_proto(pack_c8);
+
+#ifdef HAVE_GFC_REAL_10
+extern void pack_c10 (gfc_array_c10 *, const gfc_array_c10 *,
+                    const gfc_array_l1 *, const gfc_array_c10 *);
+internal_proto(pack_c10);
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+extern void pack_c16 (gfc_array_c16 *, const gfc_array_c16 *,
+                    const gfc_array_l1 *, const gfc_array_c16 *);
+internal_proto(pack_c16);
+#endif
+
+/* Internal auxiliary functions for the unpack intrinsic.  */
+
+extern void unpack0_i1 (gfc_array_i1 *, const gfc_array_i1 *,
+                       const gfc_array_l1 *, const GFC_INTEGER_1 *);
+internal_proto(unpack0_i1);
+
+extern void unpack0_i2 (gfc_array_i2 *, const gfc_array_i2 *,
+                       const gfc_array_l1 *, const GFC_INTEGER_2 *);
+internal_proto(unpack0_i2);
+
+extern void unpack0_i4 (gfc_array_i4 *, const gfc_array_i4 *,
+                       const gfc_array_l1 *, const GFC_INTEGER_4 *);
+internal_proto(unpack0_i4);
+
+extern void unpack0_i8 (gfc_array_i8 *, const gfc_array_i8 *,
+                       const gfc_array_l1 *, const GFC_INTEGER_8 *);
+internal_proto(unpack0_i8);
+
+#ifdef HAVE_GFC_INTEGER_16
+
+extern void unpack0_i16 (gfc_array_i16 *, const gfc_array_i16 *,
+                        const gfc_array_l1 *, const GFC_INTEGER_16 *);
+internal_proto(unpack0_i16);
+
+#endif
+
+extern void unpack0_r4 (gfc_array_r4 *, const gfc_array_r4 *,
+                       const gfc_array_l1 *, const GFC_REAL_4 *);
+internal_proto(unpack0_r4);
+
+extern void unpack0_r8 (gfc_array_r8 *, const gfc_array_r8 *,
+                       const gfc_array_l1 *, const GFC_REAL_8 *);
+internal_proto(unpack0_r8);
+
+#ifdef HAVE_GFC_REAL_10
+
+extern void unpack0_r10 (gfc_array_r10 *, const gfc_array_r10 *,
+                        const gfc_array_l1 *, const GFC_REAL_10 *);
+internal_proto(unpack0_r10);
+
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+
+extern void unpack0_r16 (gfc_array_r16 *, const gfc_array_r16 *,
+                        const gfc_array_l1 *, const GFC_REAL_16 *);
+internal_proto(unpack0_r16);
+
+#endif
+
+extern void unpack0_c4 (gfc_array_c4 *, const gfc_array_c4 *,
+                       const gfc_array_l1 *, const GFC_COMPLEX_4 *);
+internal_proto(unpack0_c4);
+
+extern void unpack0_c8 (gfc_array_c8 *, const gfc_array_c8 *,
+                       const gfc_array_l1 *, const GFC_COMPLEX_8 *);
+internal_proto(unpack0_c8);
+
+#ifdef HAVE_GFC_COMPLEX_10
+
+extern void unpack0_c10 (gfc_array_c10 *, const gfc_array_c10 *,
+                        const gfc_array_l1 *mask, const GFC_COMPLEX_10 *);
+internal_proto(unpack0_c10);
+
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_16
+
+extern void unpack0_c16 (gfc_array_c16 *, const gfc_array_c16 *,
+                        const gfc_array_l1 *, const GFC_COMPLEX_16 *);
+internal_proto(unpack0_c16);
+
+#endif
+
+extern void unpack1_i1 (gfc_array_i1 *, const gfc_array_i1 *,
+                       const gfc_array_l1 *, const gfc_array_i1 *);
+internal_proto(unpack1_i1);
+
+extern void unpack1_i2 (gfc_array_i2 *, const gfc_array_i2 *,
+                       const gfc_array_l1 *, const gfc_array_i2 *);
+internal_proto(unpack1_i2);
+
+extern void unpack1_i4 (gfc_array_i4 *, const gfc_array_i4 *,
+                       const gfc_array_l1 *, const gfc_array_i4 *);
+internal_proto(unpack1_i4);
+
+extern void unpack1_i8 (gfc_array_i8 *, const gfc_array_i8 *,
+                       const gfc_array_l1 *, const gfc_array_i8 *);
+internal_proto(unpack1_i8);
+
+#ifdef HAVE_GFC_INTEGER_16
+extern void unpack1_i16 (gfc_array_i16 *, const gfc_array_i16 *,
+                        const gfc_array_l1 *, const gfc_array_i16 *);
+internal_proto(unpack1_i16);
+#endif
+
+extern void unpack1_r4 (gfc_array_r4 *, const gfc_array_r4 *,
+                       const gfc_array_l1 *, const gfc_array_r4 *);
+internal_proto(unpack1_r4);
+
+extern void unpack1_r8 (gfc_array_r8 *, const gfc_array_r8 *,
+                       const gfc_array_l1 *, const gfc_array_r8 *);
+internal_proto(unpack1_r8);
+
+#ifdef HAVE_GFC_REAL_10
+extern void unpack1_r10 (gfc_array_r10 *, const gfc_array_r10 *,
+                        const gfc_array_l1 *, const gfc_array_r10 *);
+internal_proto(unpack1_r10);
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+extern void unpack1_r16 (gfc_array_r16 *, const gfc_array_r16 *,
+                        const gfc_array_l1 *, const gfc_array_r16 *);
+internal_proto(unpack1_r16);
+#endif
+
+extern void unpack1_c4 (gfc_array_c4 *, const gfc_array_c4 *,
+                       const gfc_array_l1 *, const gfc_array_c4 *);
+internal_proto(unpack1_c4);
+
+extern void unpack1_c8 (gfc_array_c8 *, const gfc_array_c8 *,
+                       const gfc_array_l1 *, const gfc_array_c8 *);
+internal_proto(unpack1_c8);
+
+#ifdef HAVE_GFC_COMPLEX_10
+extern void unpack1_c10 (gfc_array_c10 *, const gfc_array_c10 *,
+                        const gfc_array_l1 *, const gfc_array_c10 *);
+internal_proto(unpack1_c10);
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_16
+extern void unpack1_c16 (gfc_array_c16 *, const gfc_array_c16 *,
+                        const gfc_array_l1 *, const gfc_array_c16 *);
+internal_proto(unpack1_c16);
+#endif
+
+/* Helper functions for spread.  */
+
+extern void spread_i1 (gfc_array_i1 *, const gfc_array_i1 *,
+                      const index_type, const index_type);
+internal_proto(spread_i1);
+
+extern void spread_i2 (gfc_array_i2 *, const gfc_array_i2 *,
+                      const index_type, const index_type);
+internal_proto(spread_i2);
+
+extern void spread_i4 (gfc_array_i4 *, const gfc_array_i4 *,
+                      const index_type, const index_type);
+internal_proto(spread_i4);
+
+extern void spread_i8 (gfc_array_i8 *, const gfc_array_i8 *,
+                      const index_type, const index_type);
+internal_proto(spread_i8);
+
+#ifdef HAVE_GFC_INTEGER_16
+extern void spread_i16 (gfc_array_i16 *, const gfc_array_i16 *,
+                      const index_type, const index_type);
+internal_proto(spread_i16);
+
+#endif
+
+extern void spread_r4 (gfc_array_r4 *, const gfc_array_r4 *,
+                      const index_type, const index_type);
+internal_proto(spread_r4);
+
+extern void spread_r8 (gfc_array_r8 *, const gfc_array_r8 *,
+                      const index_type, const index_type);
+internal_proto(spread_r8);
+
+#ifdef HAVE_GFC_REAL_10
+extern void spread_r10 (gfc_array_r10 *, const gfc_array_r10 *,
+                      const index_type, const index_type);
+internal_proto(spread_r10);
+
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+extern void spread_r16 (gfc_array_r16 *, const gfc_array_r16 *,
+                      const index_type, const index_type);
+internal_proto(spread_r16);
+
+#endif
+
+extern void spread_c4 (gfc_array_c4 *, const gfc_array_c4 *,
+                      const index_type, const index_type);
+internal_proto(spread_c4);
+
+extern void spread_c8 (gfc_array_c8 *, const gfc_array_c8 *,
+                      const index_type, const index_type);
+internal_proto(spread_c8);
+
+#ifdef HAVE_GFC_COMPLEX_10
+extern void spread_c10 (gfc_array_c10 *, const gfc_array_c10 *,
+                      const index_type, const index_type);
+internal_proto(spread_c10);
+
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_16
+extern void spread_c16 (gfc_array_c16 *, const gfc_array_c16 *,
+                      const index_type, const index_type);
+internal_proto(spread_c16);
+
+#endif
+
+extern void spread_scalar_i1 (gfc_array_i1 *, const GFC_INTEGER_1 *,
+                             const index_type, const index_type);
+internal_proto(spread_scalar_i1);
+
+extern void spread_scalar_i2 (gfc_array_i2 *, const GFC_INTEGER_2 *,
+                             const index_type, const index_type);
+internal_proto(spread_scalar_i2);
+
+extern void spread_scalar_i4 (gfc_array_i4 *, const GFC_INTEGER_4 *,
+                             const index_type, const index_type);
+internal_proto(spread_scalar_i4);
+
+extern void spread_scalar_i8 (gfc_array_i8 *, const GFC_INTEGER_8 *,
+                             const index_type, const index_type);
+internal_proto(spread_scalar_i8);
+
+#ifdef HAVE_GFC_INTEGER_16
+extern void spread_scalar_i16 (gfc_array_i16 *, const GFC_INTEGER_16 *,
+                              const index_type, const index_type);
+internal_proto(spread_scalar_i16);
+
+#endif
+
+extern void spread_scalar_r4 (gfc_array_r4 *, const GFC_REAL_4 *,
+                             const index_type, const index_type);
+internal_proto(spread_scalar_r4);
+
+extern void spread_scalar_r8 (gfc_array_r8 *, const GFC_REAL_8 *,
+                             const index_type, const index_type);
+internal_proto(spread_scalar_r8);
+
+#ifdef HAVE_GFC_REAL_10
+extern void spread_scalar_r10 (gfc_array_r10 *, const GFC_REAL_10 *,
+                              const index_type, const index_type);
+internal_proto(spread_scalar_r10);
+
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+extern void spread_scalar_r16 (gfc_array_r16 *, const GFC_REAL_16 *,
+                              const index_type, const index_type);
+internal_proto(spread_scalar_r16);
+
+#endif
+
+extern void spread_scalar_c4 (gfc_array_c4 *, const GFC_COMPLEX_4 *,
+                             const index_type, const index_type);
+internal_proto(spread_scalar_c4);
+
+extern void spread_scalar_c8 (gfc_array_c8 *, const GFC_COMPLEX_8 *,
+                             const index_type, const index_type);
+internal_proto(spread_scalar_c8);
+
+#ifdef HAVE_GFC_COMPLEX_10
+extern void spread_scalar_c10 (gfc_array_c10 *, const GFC_COMPLEX_10 *,
+                              const index_type, const index_type);
+internal_proto(spread_scalar_c10);
+
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_16
+extern void spread_scalar_c16 (gfc_array_c16 *, const GFC_COMPLEX_16 *,
+                              const index_type, const index_type);
+internal_proto(spread_scalar_c16);
+
+#endif
+
+/* string_intrinsics.c */
+
+extern int compare_string (gfc_charlen_type, const char *,
+                          gfc_charlen_type, const char *);
+iexport_proto(compare_string);
+
+extern int compare_string_char4 (gfc_charlen_type, const gfc_char4_t *,
+                                gfc_charlen_type, const gfc_char4_t *);
+iexport_proto(compare_string_char4);
+
+extern int memcmp_char4 (const void *, const void *, size_t);
+internal_proto(memcmp_char4);
+
+
+/* random.c */
+
+extern void random_seed_i4 (GFC_INTEGER_4 * size, gfc_array_i4 * put,
+                           gfc_array_i4 * get);
+iexport_proto(random_seed_i4);
+extern void random_seed_i8 (GFC_INTEGER_8 * size, gfc_array_i8 * put,
+                           gfc_array_i8 * get);
+iexport_proto(random_seed_i8);
+
+/* size.c */
+
+typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, void) array_t;
+
+extern index_type size0 (const array_t * array); 
+iexport_proto(size0);
+
+/* bounds.c */
+
+extern void bounds_equal_extents (array_t *, array_t *, const char *,
+                                 const char *);
+internal_proto(bounds_equal_extents);
+
+extern void bounds_reduced_extents (array_t *, array_t *, int, const char *,
+                            const char *intrinsic);
+internal_proto(bounds_reduced_extents);
+
+extern void bounds_iforeach_return (array_t *, array_t *, const char *);
+internal_proto(bounds_iforeach_return);
+
+extern void bounds_ifunction_return (array_t *, const index_type *,
+                                    const char *, const char *);
+internal_proto(bounds_ifunction_return);
+
+extern index_type count_0 (const gfc_array_l1 *);
+
+internal_proto(count_0);
+
+/* Internal auxiliary functions for cshift */
+
+void cshift0_i1 (gfc_array_i1 *, const gfc_array_i1 *, ptrdiff_t, int);
+internal_proto(cshift0_i1);
+
+void cshift0_i2 (gfc_array_i2 *, const gfc_array_i2 *, ptrdiff_t, int);
+internal_proto(cshift0_i2);
+
+void cshift0_i4 (gfc_array_i4 *, const gfc_array_i4 *, ptrdiff_t, int);
+internal_proto(cshift0_i4);
+
+void cshift0_i8 (gfc_array_i8 *, const gfc_array_i8 *, ptrdiff_t, int);
+internal_proto(cshift0_i8);
+
+#ifdef HAVE_GFC_INTEGER_16
+void cshift0_i16 (gfc_array_i16 *, const gfc_array_i16 *, ptrdiff_t, int);
+internal_proto(cshift0_i16);
+#endif
+
+void cshift0_r4 (gfc_array_r4 *, const gfc_array_r4 *, ptrdiff_t, int);
+internal_proto(cshift0_r4);
+
+void cshift0_r8 (gfc_array_r8 *, const gfc_array_r8 *, ptrdiff_t, int);
+internal_proto(cshift0_r8);
+
+#ifdef HAVE_GFC_REAL_10
+void cshift0_r10 (gfc_array_r10 *, const gfc_array_r10 *, ptrdiff_t, int);
+internal_proto(cshift0_r10);
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+void cshift0_r16 (gfc_array_r16 *, const gfc_array_r16 *, ptrdiff_t, int);
+internal_proto(cshift0_r16);
+#endif
+
+void cshift0_c4 (gfc_array_c4 *, const gfc_array_c4 *, ptrdiff_t, int);
+internal_proto(cshift0_c4);
+
+void cshift0_c8 (gfc_array_c8 *, const gfc_array_c8 *, ptrdiff_t, int);
+internal_proto(cshift0_c8);
+
+#ifdef HAVE_GFC_COMPLEX_10
+void cshift0_c10 (gfc_array_c10 *, const gfc_array_c10 *, ptrdiff_t, int);
+internal_proto(cshift0_c10);
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_16
+void cshift0_c16 (gfc_array_c16 *, const gfc_array_c16 *, ptrdiff_t, int);
+internal_proto(cshift0_c16);
+#endif
+
+#endif  /* LIBGFOR_H  */
diff --git a/l4/pkg/libgfortran/lib/contrib/libgfortran.spec.in b/l4/pkg/libgfortran/lib/contrib/libgfortran.spec.in
new file mode 100644 (file)
index 0000000..95aa3f8
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# This spec file is read by gfortran when linking.
+# It is used to specify the libraries we need to link in, in the right
+# order.
+#
+
+%rename lib liborig
+*lib: @LIBQUADSPEC@ -lm %(libgcc) %(liborig)
diff --git a/l4/pkg/libgfortran/lib/contrib/libtool-version b/l4/pkg/libgfortran/lib/contrib/libtool-version
new file mode 100644 (file)
index 0000000..f787e37
--- /dev/null
@@ -0,0 +1,6 @@
+# This file is used to maintain libtool version info for libgfortran.
+# See the libtool manual to understand the meaning of the fields.
+# This is a separate file so that version updates don't involve re-running
+# automake.
+# CURRENT:REVISION:AGE
+3:0:0
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/all.m4 b/l4/pkg/libgfortran/lib/contrib/m4/all.m4
new file mode 100644 (file)
index 0000000..cc17420
--- /dev/null
@@ -0,0 +1,44 @@
+`/* Implementation of the ALL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction_logical.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(1,
+`  /* Return true only if all the elements are set.  */
+  result = 1;',
+`  if (! *src)
+    {
+      result = 0;
+      break;
+    }', `')`
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/any.m4 b/l4/pkg/libgfortran/lib/contrib/m4/any.m4
new file mode 100644 (file)
index 0000000..81ec310
--- /dev/null
@@ -0,0 +1,44 @@
+`/* Implementation of the ANY intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction_logical.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(0,
+`  result = 0;',
+`  /* Return true if any of the elements are set.  */
+  if (*src)
+    {
+      result = 1;
+      break;
+    }', `')`
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/bessel.m4 b/l4/pkg/libgfortran/lib/contrib/m4/bessel.m4
new file mode 100644 (file)
index 0000000..acef7ea
--- /dev/null
@@ -0,0 +1,187 @@
+`/* Implementation of the BESSEL_JN and BESSEL_YN transformational
+   function using a recurrence algorithm.
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(`mtype.m4')dnl
+
+mathfunc_macro
+
+`#if defined (HAVE_'rtype_name`)
+
+
+
+#if 'hasmathfunc(jn)`
+extern void bessel_jn_r'rtype_kind` ('rtype` * const restrict ret, int n1,
+                                    int n2, 'rtype_name` x);
+export_proto(bessel_jn_r'rtype_kind`);
+
+void
+bessel_jn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2, 'rtype_name` x)
+{
+  int i;
+  index_type stride;
+
+  'rtype_name` last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof ('rtype_name`) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      ret->data[0] = 1;
+      for (i = 1; i <= n2-n1; i++)
+        ret->data[i*stride] = 0;
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(jn) (n2, x);
+  ret->data[(n2-n1)*stride] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(jn) (n2 - 1, x);
+  ret->data[(n2-n1-1)*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_'rtype_kind`_LITERAL(2.)/x;
+
+  for (i = n2-n1-2; i >= 0; i--)
+    {
+      ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1;
+      last1 = last2;
+      last2 = ret->data[i*stride];
+    }
+}
+
+#endif
+
+#if 'hasmathfunc(yn)`
+extern void bessel_yn_r'rtype_kind` ('rtype` * const restrict ret,
+                                    int n1, int n2, 'rtype_name` x);
+export_proto(bessel_yn_r'rtype_kind`);
+
+void
+bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2,
+                        'rtype_name` x)
+{
+  int i;
+  index_type stride;
+
+  'rtype_name` last1, last2, x2rev;
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (ret->data == NULL)
+    {
+      size_t size = n2 < n1 ? 0 : n2-n1+1; 
+      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      ret->data = internal_malloc_size (sizeof ('rtype_name`) * size);
+      ret->offset = 0;
+    }
+
+  if (unlikely (n2 < n1))
+    return;
+
+  if (unlikely (compile_options.bounds_check)
+      && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1))
+    runtime_error("Incorrect extent in return value of BESSEL_JN "
+                 "(%ld vs. %ld)", (long int) n2-n1,
+                 (long int) GFC_DESCRIPTOR_EXTENT(ret,0));
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (unlikely (x == 0))
+    {
+      for (i = 0; i <= n2-n1; i++)
+#if defined('rtype_name`_INFINITY)
+        ret->data[i*stride] = -'rtype_name`_INFINITY;
+#else
+        ret->data[i*stride] = -'rtype_name`_HUGE;
+#endif
+      return;
+    }
+
+  ret->data = ret->data;
+  last1 = MATHFUNC(yn) (n1, x);
+  ret->data[0] = last1;
+
+  if (n1 == n2)
+    return;
+
+  last2 = MATHFUNC(yn) (n1 + 1, x);
+  ret->data[1*stride] = last2;
+
+  if (n1 + 1 == n2)
+    return;
+
+  x2rev = GFC_REAL_'rtype_kind`_LITERAL(2.)/x;
+
+  for (i = 2; i <= n1+n2; i++)
+    {
+#if defined('rtype_name`_INFINITY)
+      if (unlikely (last2 == -'rtype_name`_INFINITY))
+       {
+         ret->data[i*stride] = -'rtype_name`_INFINITY;
+       }
+      else
+#endif
+       {
+         ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1;
+         last1 = last2;
+         last2 = ret->data[i*stride];
+       }
+    }
+}
+#endif
+
+#endif'
+
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/count.m4 b/l4/pkg/libgfortran/lib/contrib/m4/count.m4
new file mode 100644 (file)
index 0000000..5998c20
--- /dev/null
@@ -0,0 +1,40 @@
+`/* Implementation of the COUNT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction_logical.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(0,
+`  result = 0;',
+`  if (*src)
+    result++;', `')`
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/cshift0.m4 b/l4/pkg/libgfortran/lib/contrib/m4/cshift0.m4
new file mode 100644 (file)
index 0000000..5c0d22e
--- /dev/null
@@ -0,0 +1,172 @@
+`/* Helper function for cshift functions.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+void
+cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array, ptrdiff_t shift,
+                    int which)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  'rtype_name` *rptr;
+
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const 'rtype_name` *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+
+  which = which - 1;
+  sstride[0] = 0;
+  rstride[0] = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = 1;
+  soffset = 1;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          if (roffset == 0)
+            roffset = 1;
+          soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+          if (soffset == 0)
+            soffset = 1;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (rstride[0] == 0)
+    rstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+
+  shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
+  if (shift < 0)
+    shift += len;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+
+      /* If elements are contiguous, perform the operation
+        in two block moves.  */
+      if (soffset == 1 && roffset == 1)
+       {
+         size_t len1 = shift * sizeof ('rtype_name`);
+         size_t len2 = (len - shift) * sizeof ('rtype_name`);
+         memcpy (rptr, sptr + shift, len2);
+         memcpy (rptr + (len - shift), sptr, len1);
+       }
+      else
+       {
+         /* Otherwise, we will have to perform the copy one element at
+            a time.  */
+         'rtype_name` *dest = rptr;
+         const 'rtype_name` *src = &sptr[shift * soffset];
+
+         for (n = 0; n < len - shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+         for (src = sptr, n = 0; n < shift; n++)
+           {
+             *dest = *src;
+             dest += roffset;
+             src += soffset;
+           }
+       }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+            }
+        }
+    }
+
+  return;
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/cshift1.m4 b/l4/pkg/libgfortran/lib/contrib/m4/cshift1.m4
new file mode 100644 (file)
index 0000000..49a4f73
--- /dev/null
@@ -0,0 +1,274 @@
+`/* Implementation of the CSHIFT intrinsic
+   Copyright 2003, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Feng Wang <wf_cs@yahoo.com>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'atype_name`)
+
+static void
+cshift1 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const 'atype` * const restrict h, 
+       const 'atype_name` * const restrict pwhich)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char *dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const 'atype_name` *hptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  int which;
+  'atype_name` sh;
+  index_type arraysize;
+  index_type size;
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array))
+    runtime_error ("Argument ''`DIM''` is out of range in call to ''`CSHIFT''`");
+
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  arraysize = size0 ((array_t *)array);
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->data = internal_malloc_size (size * arraysize);
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+          ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+           str = GFC_DESCRIPTOR_EXTENT(ret,i-1) *
+             GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+        }
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "CSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "CSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+
+  /* Initialized for avoiding compiler warnings.  */
+  roffset = size;
+  soffset = size;
+  len = 0;
+
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      sh = (div (sh, len)).rem;
+      if (sh < 0)
+        sh += len;
+
+      src = &sptr[sh * soffset];
+      dest = rptr;
+
+      for (n = 0; n < len; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          if (n == len - sh - 1)
+            src = sptr;
+          else
+            src += soffset;
+        }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+            }
+        }
+    }
+}
+
+void cshift1_'atype_kind` (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const 'atype` * const restrict, 
+       const 'atype_name` * const restrict);
+export_proto(cshift1_'atype_kind`);
+
+void
+cshift1_'atype_kind` (gfc_array_char * const restrict ret,
+       const gfc_array_char * const restrict array,
+       const 'atype` * const restrict h, 
+       const 'atype_name` * const restrict pwhich)
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+
+void cshift1_'atype_kind`_char (gfc_array_char * const restrict ret, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict array,
+       const 'atype` * const restrict h, 
+       const 'atype_name` * const restrict pwhich,
+       GFC_INTEGER_4);
+export_proto(cshift1_'atype_kind`_char);
+
+void
+cshift1_'atype_kind`_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array,
+       const 'atype` * const restrict h, 
+       const 'atype_name` * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)))
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+
+void cshift1_'atype_kind`_char4 (gfc_array_char * const restrict ret, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict array,
+       const 'atype` * const restrict h, 
+       const 'atype_name` * const restrict pwhich,
+       GFC_INTEGER_4);
+export_proto(cshift1_'atype_kind`_char4);
+
+void
+cshift1_'atype_kind`_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array,
+       const 'atype` * const restrict h, 
+       const 'atype_name` * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)))
+{
+  cshift1 (ret, array, h, pwhich);
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/eoshift1.m4 b/l4/pkg/libgfortran/lib/contrib/m4/eoshift1.m4
new file mode 100644 (file)
index 0000000..339e1d8
--- /dev/null
@@ -0,0 +1,317 @@
+`/* Implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'atype_name`)
+
+static void
+eoshift1 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array, 
+       const 'atype` * const restrict h,
+       const char * const restrict pbound, 
+       const 'atype_name` * const restrict pwhich, 
+       const char * filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const 'atype_name` *hptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type size;
+  index_type arraysize;
+  int which;
+  'atype_name` sh;
+  'atype_name` delta;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  extent[0] = 1;
+  count[0] = 0;
+
+  arraysize = size0 ((array_t *) array);
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+         ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+
+        }
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      if (( sh >= 0 ? sh : -sh ) > len)
+       {
+         delta = len;
+         sh = len;
+       }
+      else
+       delta = (sh >= 0) ? sh: -sh;
+
+      if (sh > 0)
+        {
+          src = &sptr[delta * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[delta * roffset];
+        }
+      for (n = 0; n < len - delta; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (sh < 0)
+        dest = rptr;
+      n = delta;
+
+      if (pbound)
+       while (n--)
+         {
+           memcpy (dest, pbound, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+            }
+        }
+    }
+}
+
+void eoshift1_'atype_kind` (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const 'atype` * const restrict, const char * const restrict, 
+       const 'atype_name` * const restrict);
+export_proto(eoshift1_'atype_kind`);
+
+void
+eoshift1_'atype_kind` (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const 'atype` * const restrict h, 
+       const char * const restrict pbound,
+       const 'atype_name` * const restrict pwhich)
+{
+  eoshift1 (ret, array, h, pbound, pwhich, "\0", 1);
+}
+
+
+void eoshift1_'atype_kind`_char (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict, 
+       const 'atype` * const restrict,
+       const char * const restrict, 
+       const 'atype_name` * const restrict,
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift1_'atype_kind`_char);
+
+void
+eoshift1_'atype_kind`_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const 'atype` * const restrict h,
+       const char *  const restrict pbound, 
+       const 'atype_name` * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  eoshift1 (ret, array, h, pbound, pwhich, " ", 1);
+}
+
+
+void eoshift1_'atype_kind`_char4 (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict, 
+       const 'atype` * const restrict,
+       const char * const restrict, 
+       const 'atype_name` * const restrict,
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift1_'atype_kind`_char4);
+
+void
+eoshift1_'atype_kind`_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const 'atype` * const restrict h,
+       const char *  const restrict pbound, 
+       const 'atype_name` * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  static const gfc_char4_t space = (unsigned char) ''` ''`;
+  eoshift1 (ret, array, h, pbound, pwhich,
+           (const char *) &space, sizeof (gfc_char4_t));
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/eoshift3.m4 b/l4/pkg/libgfortran/lib/contrib/m4/eoshift3.m4
new file mode 100644 (file)
index 0000000..1c19575
--- /dev/null
@@ -0,0 +1,336 @@
+`/* Implementation of the EOSHIFT intrinsic
+   Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'atype_name`)
+
+static void
+eoshift3 (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array, 
+       const 'atype` * const restrict h,
+       const gfc_array_char * const restrict bound, 
+       const 'atype_name` * const restrict pwhich,
+       const char * filler, index_type filler_len)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type roffset;
+  char *rptr;
+  char * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type soffset;
+  const char *sptr;
+  const char *src;
+  /* h.* indicates the shift array.  */
+  index_type hstride[GFC_MAX_DIMENSIONS];
+  index_type hstride0;
+  const 'atype_name` *hptr;
+  /* b.* indicates the bound array.  */
+  index_type bstride[GFC_MAX_DIMENSIONS];
+  index_type bstride0;
+  const char *bptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dim;
+  index_type len;
+  index_type n;
+  index_type size;
+  index_type arraysize;
+  int which;
+  'atype_name` sh;
+  'atype_name` delta;
+
+  /* The compiler cannot figure out that these are set, initialize
+     them to avoid warnings.  */
+  len = 0;
+  soffset = 0;
+  roffset = 0;
+
+  arraysize = size0 ((array_t *) array);
+  size = GFC_DESCRIPTOR_SIZE(array);
+
+  if (pwhich)
+    which = *pwhich - 1;
+  else
+    which = 0;
+
+  if (ret->data == NULL)
+    {
+      int i;
+
+      ret->data = internal_malloc_size (size * arraysize);
+      ret->offset = 0;
+      ret->dtype = array->dtype;
+      for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+        {
+         index_type ub, str;
+
+         ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+
+          if (i == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
+             * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+
+         GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+
+        }
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
+
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+      bounds_equal_extents ((array_t *) ret, (array_t *) array,
+                                "return value", "EOSHIFT");
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      bounds_reduced_extents ((array_t *) h, (array_t *) array, which,
+                             "SHIFT argument", "EOSHIFT");
+    }
+
+  if (arraysize == 0)
+    return;
+
+  extent[0] = 1;
+  count[0] = 0;
+  n = 0;
+  for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+    {
+      if (dim == which)
+        {
+          roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          if (roffset == 0)
+            roffset = size;
+          soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+          if (soffset == 0)
+            soffset = size;
+          len = GFC_DESCRIPTOR_EXTENT(array,dim);
+        }
+      else
+        {
+          count[n] = 0;
+          extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
+          rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+          sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+          hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+          if (bound)
+            bstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(bound,n);
+          else
+            bstride[n] = 0;
+          n++;
+        }
+    }
+  if (sstride[0] == 0)
+    sstride[0] = size;
+  if (rstride[0] == 0)
+    rstride[0] = size;
+  if (hstride[0] == 0)
+    hstride[0] = 1;
+  if (bound && bstride[0] == 0)
+    bstride[0] = size;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+  hstride0 = hstride[0];
+  bstride0 = bstride[0];
+  rptr = ret->data;
+  sptr = array->data;
+  hptr = h->data;
+  if (bound)
+    bptr = bound->data;
+  else
+    bptr = NULL;
+
+  while (rptr)
+    {
+      /* Do the shift for this dimension.  */
+      sh = *hptr;
+      if (( sh >= 0 ? sh : -sh ) > len)
+       {
+         delta = len;
+         sh = len;
+       }
+      else
+       delta = (sh >= 0) ? sh: -sh;
+
+      if (sh > 0)
+        {
+          src = &sptr[delta * soffset];
+          dest = rptr;
+        }
+      else
+        {
+          src = sptr;
+          dest = &rptr[delta * roffset];
+        }
+      for (n = 0; n < len - delta; n++)
+        {
+          memcpy (dest, src, size);
+          dest += roffset;
+          src += soffset;
+        }
+      if (sh < 0)
+        dest = rptr;
+      n = delta;
+
+      if (bptr)
+       while (n--)
+         {
+           memcpy (dest, bptr, size);
+           dest += roffset;
+         }
+      else
+       while (n--)
+         {
+           index_type i;
+
+           if (filler_len == 1)
+             memset (dest, filler[0], size);
+           else
+             for (i = 0; i < size; i += filler_len)
+               memcpy (&dest[i], filler, filler_len);
+
+           dest += roffset;
+         }
+
+      /* Advance to the next section.  */
+      rptr += rstride0;
+      sptr += sstride0;
+      hptr += hstride0;
+      bptr += bstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          sptr -= sstride[n] * extent[n];
+         hptr -= hstride[n] * extent[n];
+          bptr -= bstride[n] * extent[n];
+          n++;
+          if (n >= dim - 1)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              sptr += sstride[n];
+             hptr += hstride[n];
+              bptr += bstride[n];
+            }
+        }
+    }
+}
+
+extern void eoshift3_'atype_kind` (gfc_array_char * const restrict, 
+       const gfc_array_char * const restrict,
+       const 'atype` * const restrict, 
+       const gfc_array_char * const restrict,
+       const 'atype_name` *);
+export_proto(eoshift3_'atype_kind`);
+
+void
+eoshift3_'atype_kind` (gfc_array_char * const restrict ret, 
+       const gfc_array_char * const restrict array,
+       const 'atype` * const restrict h, 
+       const gfc_array_char * const restrict bound,
+       const 'atype_name` * const restrict pwhich)
+{
+  eoshift3 (ret, array, h, bound, pwhich, "\0", 1);
+}
+
+
+extern void eoshift3_'atype_kind`_char (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict,
+       const 'atype` * const restrict,
+       const gfc_array_char * const restrict,
+       const 'atype_name` * const restrict, 
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift3_'atype_kind`_char);
+
+void
+eoshift3_'atype_kind`_char (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const 'atype` *  const restrict h,
+       const gfc_array_char * const restrict bound,
+       const 'atype_name` * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  eoshift3 (ret, array, h, bound, pwhich, " ", 1);
+}
+
+
+extern void eoshift3_'atype_kind`_char4 (gfc_array_char * const restrict, 
+       GFC_INTEGER_4,
+       const gfc_array_char * const restrict,
+       const 'atype` * const restrict,
+       const gfc_array_char * const restrict,
+       const 'atype_name` * const restrict, 
+       GFC_INTEGER_4, GFC_INTEGER_4);
+export_proto(eoshift3_'atype_kind`_char4);
+
+void
+eoshift3_'atype_kind`_char4 (gfc_array_char * const restrict ret,
+       GFC_INTEGER_4 ret_length __attribute__((unused)),
+       const gfc_array_char * const restrict array, 
+       const 'atype` *  const restrict h,
+       const gfc_array_char * const restrict bound,
+       const 'atype_name` * const restrict pwhich,
+       GFC_INTEGER_4 array_length __attribute__((unused)),
+       GFC_INTEGER_4 bound_length __attribute__((unused)))
+{
+  static const gfc_char4_t space = (unsigned char) ''` ''`;
+  eoshift3 (ret, array, h, bound, pwhich,
+           (const char *) &space, sizeof (gfc_char4_t));
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/exponent.m4 b/l4/pkg/libgfortran/lib/contrib/m4/exponent.m4
new file mode 100644 (file)
index 0000000..043f150
--- /dev/null
@@ -0,0 +1,45 @@
+`/* Implementation of the EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"'
+
+include(`mtype.m4')dnl
+
+mathfunc_macro
+
+`#if defined (HAVE_'real_type`) && 'hasmathfunc(frexp)`
+
+extern GFC_INTEGER_4 exponent_r'kind` ('real_type` s);
+export_proto(exponent_r'kind`);
+
+GFC_INTEGER_4
+exponent_r'kind` ('real_type` s)
+{
+  int ret;
+  MATHFUNC(frexp) (s, &ret);
+  return ret;
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/fraction.m4 b/l4/pkg/libgfortran/lib/contrib/m4/fraction.m4
new file mode 100644 (file)
index 0000000..cca2db9
--- /dev/null
@@ -0,0 +1,44 @@
+`/* Implementation of the FRACTION intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"'
+
+include(`mtype.m4')dnl
+
+mathfunc_macro
+
+`#if defined (HAVE_'real_type`) && 'hasmathfunc(frexp)`
+
+extern 'real_type` fraction_r'kind` ('real_type` s);
+export_proto(fraction_r'kind`);
+
+'real_type`
+fraction_r'kind` ('real_type` s)
+{
+  int dummy_exp;
+  return MATHFUNC(frexp) (s, &dummy_exp);
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/head.m4 b/l4/pkg/libgfortran/lib/contrib/m4/head.m4
new file mode 100644 (file)
index 0000000..30cdea8
--- /dev/null
@@ -0,0 +1,25 @@
+`!   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+!   Contributed by Paul Brook <paul@nowt.org>
+!
+!This file is part of the GNU Fortran 95 runtime library (libgfortran).
+!
+!GNU libgfortran is free software; you can redistribute it and/or
+!modify it under the terms of the GNU General Public
+!License as published by the Free Software Foundation; either
+!version 3 of the License, or (at your option) any later version.
+
+!GNU libgfortran 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.
+!
+!Under Section 7 of GPL version 3, you are granted additional
+!permissions described in the GCC Runtime Library Exception, version
+!3.1, as published by the Free Software Foundation.
+!
+!You should have received a copy of the GNU General Public License and
+!a copy of the GCC Runtime Library Exception along with this program;
+!see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!<http://www.gnu.org/licenses/>.
+!
+!This file is machine generated.'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/iall.m4 b/l4/pkg/libgfortran/lib/contrib/m4/iall.m4
new file mode 100644 (file)
index 0000000..2e6667e
--- /dev/null
@@ -0,0 +1,46 @@
+`/* Implementation of the IALL intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(0,
+`  result = ('rtype_name`) -1;',
+`  result &= *src;')
+
+MASKED_ARRAY_FUNCTION(0,
+`  result = 0;',
+`  if (*msrc)
+    result &= *src;')
+
+SCALAR_ARRAY_FUNCTION(0)
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/iany.m4 b/l4/pkg/libgfortran/lib/contrib/m4/iany.m4
new file mode 100644 (file)
index 0000000..a17d951
--- /dev/null
@@ -0,0 +1,46 @@
+`/* Implementation of the IANY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(0,
+`  result = 0;',
+`  result |= *src;')
+
+MASKED_ARRAY_FUNCTION(0,
+`  result = 0;',
+`  if (*msrc)
+    result |= *src;')
+
+SCALAR_ARRAY_FUNCTION(0)
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/iforeach.m4 b/l4/pkg/libgfortran/lib/contrib/m4/iforeach.m4
new file mode 100644 (file)
index 0000000..14e501c
--- /dev/null
@@ -0,0 +1,279 @@
+dnl Support macro file for intrinsic functions.
+dnl Contains the generic sections of the array functions.
+dnl This file is part of the GNU Fortran 95 Runtime Library (libgfortran)
+dnl Distributed under the GNU GPL with exception.  See COPYING for details.
+define(START_FOREACH_FUNCTION,
+`
+extern void name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       atype * const restrict array);
+export_proto(name`'rtype_qual`_'atype_code);
+
+void
+name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       atype * const restrict array)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  const atype_name *base;
+  rtype_name * restrict dest;
+  index_type rank;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (rtype_name) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                               "u_name");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 1;
+  {
+')dnl
+define(START_FOREACH_BLOCK,
+`  while (base)
+    {
+      do
+       {
+         /* Implementation start.  */
+')dnl
+define(FINISH_FOREACH_FUNCTION,
+`        /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}')dnl
+define(START_MASKED_FOREACH_FUNCTION,
+`
+extern void `m'name`'rtype_qual`_'atype_code (rtype * const restrict, 
+       atype * const restrict, gfc_array_l1 * const restrict);
+export_proto(`m'name`'rtype_qual`_'atype_code);
+
+void
+`m'name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       atype * const restrict array,
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type dstride;
+  rtype_name *dest;
+  const atype_name *base;
+  GFC_LOGICAL_1 *mbase;
+  int rank;
+  index_type n;
+  int mask_kind;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (rtype_name) * rank);
+    }
+  else
+    {
+      if (unlikely (compile_options.bounds_check))
+       {
+
+         bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                                 "u_name");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                                 "MASK argument", "u_name");
+       }
+    }
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  mbase = mask->data;
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+      if (extent[n] <= 0)
+       {
+         /* Set the return value.  */
+         for (n = 0; n < rank; n++)
+           dest[n * dstride] = 0;
+         return;
+       }
+    }
+
+  base = array->data;
+
+  /* Initialize the return value.  */
+  for (n = 0; n < rank; n++)
+    dest[n * dstride] = 0;
+  {
+')dnl
+define(START_MASKED_FOREACH_BLOCK, `START_FOREACH_BLOCK')dnl
+define(FINISH_MASKED_FOREACH_FUNCTION,
+`        /* Implementation end.  */
+         /* Advance to the next element.  */
+         base += sstride[0];
+         mbase += mstride[0];
+       }
+      while (++count[0] != extent[0]);
+      n = 0;
+      do
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the loop.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+           }
+       }
+      while (count[n] == extent[n]);
+    }
+  }
+}')dnl
+define(FOREACH_FUNCTION,
+`START_FOREACH_FUNCTION
+$1
+START_FOREACH_BLOCK
+$2
+FINISH_FOREACH_FUNCTION')dnl
+define(MASKED_FOREACH_FUNCTION,
+`START_MASKED_FOREACH_FUNCTION
+$1
+START_MASKED_FOREACH_BLOCK
+$2
+FINISH_MASKED_FOREACH_FUNCTION')dnl
+define(SCALAR_FOREACH_FUNCTION,
+`
+extern void `s'name`'rtype_qual`_'atype_code (rtype * const restrict, 
+       atype * const restrict, GFC_LOGICAL_4 *);
+export_proto(`s'name`'rtype_qual`_'atype_code);
+
+void
+`s'name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       atype * const restrict array,
+       GFC_LOGICAL_4 * mask)
+{
+  index_type rank;
+  index_type dstride;
+  index_type n;
+  rtype_name *dest;
+
+  if (*mask)
+    {
+      name`'rtype_qual`_'atype_code (retarray, array);
+      return;
+    }
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (rank <= 0)
+    runtime_error ("Rank of array needs to be > 0");
+
+  if (retarray->data == NULL)
+    {
+      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
+      retarray->offset = 0;
+      retarray->data = internal_malloc_size (sizeof (rtype_name) * rank);
+    }
+  else if (unlikely (compile_options.bounds_check))
+    {
+       bounds_iforeach_return ((array_t *) retarray, (array_t *) array,
+                              "u_name");
+    }
+
+  dstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+  dest = retarray->data;
+  for (n = 0; n<rank; n++)
+    dest[n * dstride] = $1 ;
+}')dnl
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/ifunction.m4 b/l4/pkg/libgfortran/lib/contrib/m4/ifunction.m4
new file mode 100644 (file)
index 0000000..68e1c5e
--- /dev/null
@@ -0,0 +1,505 @@
+dnl Support macro file for intrinsic functions.
+dnl Contains the generic sections of the array functions.
+dnl This file is part of the GNU Fortran Runtime Library (libgfortran)
+dnl Distributed under the GNU GPL with exception.  See COPYING for details.
+dnl
+dnl Pass the implementation for a single section as the parameter to
+dnl {MASK_}ARRAY_FUNCTION.
+dnl The variables base, delta, and len describe the input section.
+dnl For masked section the mask is described by mbase and mdelta.
+dnl These should not be modified. The result should be stored in *dest.
+dnl The names count, extent, sstride, dstride, base, dest, rank, dim
+dnl retarray, array, pdim and mstride should not be used.
+dnl The variable n is declared as index_type and may be used.
+dnl Other variable declarations may be placed at the start of the code,
+dnl The types of the array parameter and the return value are
+dnl atype_name and rtype_name respectively.
+dnl Execution should be allowed to continue to the end of the block.
+dnl You should not return or break from the inner loop of the implementation.
+dnl Care should also be taken to avoid using the names defined in iparm.m4
+define(START_ARRAY_FUNCTION,
+`
+extern void name`'rtype_qual`_'atype_code (rtype * const restrict, 
+       atype * const restrict, const index_type * const restrict);
+export_proto(name`'rtype_qual`_'atype_code);
+
+void
+name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       atype * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const atype_name * restrict base;
+  rtype_name * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->data = internal_malloc_size (alloc_size);
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+
+       }
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " u_name intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       bounds_ifunction_return ((array_t *) retarray, extent,
+                                "return value", "u_name");
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const atype_name * restrict src;
+      rtype_name result;
+      src = base;
+      {
+')dnl
+define(START_ARRAY_BLOCK,
+`      if (len <= 0)
+         *dest = '$1`;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+')dnl
+define(FINISH_ARRAY_FUNCTION,
+`            }
+           '$1`
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}')dnl
+define(START_MASKED_ARRAY_FUNCTION,
+`
+extern void `m'name`'rtype_qual`_'atype_code (rtype * const restrict, 
+       atype * const restrict, const index_type * const restrict,
+       gfc_array_l1 * const restrict);
+export_proto(`m'name`'rtype_qual`_'atype_code);
+
+void
+`m'name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       atype * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l1 * const restrict mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  rtype_name * restrict dest;
+  const atype_name * restrict base;
+  const GFC_LOGICAL_1 * restrict mbase;
+  int rank;
+  int dim;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type mdelta;
+  int mask_kind;
+
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len <= 0)
+    return;
+
+  mbase = mask->data;
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
+  else
+    runtime_error ("Funny sized logical array");
+
+  delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+  mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n + 1);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in u_name intrinsic");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         bounds_ifunction_return ((array_t *) retarray, extent,
+                                  "return value", "u_name");
+         bounds_equal_extents ((array_t *) mask, (array_t *) array,
+                               "MASK argument", "u_name");
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  dest = retarray->data;
+  base = array->data;
+
+  while (base)
+    {
+      const atype_name * restrict src;
+      const GFC_LOGICAL_1 * restrict msrc;
+      rtype_name result;
+      src = base;
+      msrc = mbase;
+      {
+')dnl
+define(START_MASKED_ARRAY_BLOCK,
+`      if (len <= 0)
+         *dest = '$1`;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
+             {
+')dnl
+define(FINISH_MASKED_ARRAY_FUNCTION,
+`            }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      mbase += mstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         base -= sstride[n] * extent[n];
+         mbase -= mstride[n] * extent[n];
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             /* Break out of the look.  */
+             base = NULL;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+             mbase += mstride[n];
+             dest += dstride[n];
+           }
+       }
+    }
+}')dnl
+define(SCALAR_ARRAY_FUNCTION,
+`
+extern void `s'name`'rtype_qual`_'atype_code (rtype * const restrict, 
+       atype * const restrict, const index_type * const restrict,
+       GFC_LOGICAL_4 *);
+export_proto(`s'name`'rtype_qual`_'atype_code);
+
+void
+`s'name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       atype * const restrict array, 
+       const index_type * const restrict pdim, 
+       GFC_LOGICAL_4 * mask)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  rtype_name * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type dim;
+
+
+  if (*mask)
+    {
+      name`'rtype_qual`_'atype_code (retarray, array, pdim);
+      return;
+    }
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  for (n = 0; n < dim; n++)
+    {
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  for (n = dim; n < rank; n++)
+    {
+      extent[n] =
+       GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] <= 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+       {
+         if (n == 0)
+           str = 1;
+         else
+           str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+       }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " u_name intrinsic: is %ld, should be %ld",
+                      (long int) (GFC_DESCRIPTOR_RANK (retarray)),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " u_name intrinsic in dimension %ld:"
+                              " is %ld, should be %ld", (long int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+    }
+
+  dest = retarray->data;
+
+  while(1)
+    {
+      *dest = '$1`;
+      count[0]++;
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         /* When we get to the end of a dimension, reset it and increment
+            the next dimension.  */
+         count[n] = 0;
+         /* We could precalculate these products, but this is a less
+            frequently used path so probably not worth it.  */
+         dest -= dstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           return;
+         else
+           {
+             count[n]++;
+             dest += dstride[n];
+           }
+       }
+    }
+}')dnl
+define(ARRAY_FUNCTION,
+`START_ARRAY_FUNCTION
+$2
+START_ARRAY_BLOCK($1)
+$3
+FINISH_ARRAY_FUNCTION($4)')dnl
+define(MASKED_ARRAY_FUNCTION,
+`START_MASKED_ARRAY_FUNCTION
+$2
+START_MASKED_ARRAY_BLOCK($1)
+$3
+FINISH_MASKED_ARRAY_FUNCTION')dnl
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/ifunction_logical.m4 b/l4/pkg/libgfortran/lib/contrib/m4/ifunction_logical.m4
new file mode 100644 (file)
index 0000000..e72f1d8
--- /dev/null
@@ -0,0 +1,208 @@
+dnl Support macro file for intrinsic functions.
+dnl Contains the generic sections of the array functions.
+dnl This file is part of the GNU Fortran 95 Runtime Library (libgfortran)
+dnl Distributed under the GNU GPL with exception.  See COPYING for details.
+dnl
+dnl Pass the implementation for a single section as the parameter to
+dnl {MASK_}ARRAY_FUNCTION.
+dnl The variables base, delta, and len describe the input section.
+dnl For masked section the mask is described by mbase and mdelta.
+dnl These should not be modified. The result should be stored in *dest.
+dnl The names count, extent, sstride, dstride, base, dest, rank, dim
+dnl retarray, array, pdim and mstride should not be used.
+dnl The variable n is declared as index_type and may be used.
+dnl Other variable declarations may be placed at the start of the code,
+dnl The types of the array parameter and the return value are
+dnl atype_name and rtype_name respectively.
+dnl Execution should be allowed to continue to the end of the block.
+dnl You should not return or break from the inner loop of the implementation.
+dnl Care should also be taken to avoid using the names defined in iparm.m4
+define(START_ARRAY_FUNCTION,
+`
+extern void name`'rtype_qual`_'atype_code (rtype * const restrict, 
+       gfc_array_l1 * const restrict, const index_type * const restrict);
+export_proto(name`'rtype_qual`_'atype_code);
+
+void
+name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       gfc_array_l1 * const restrict array, 
+       const index_type * const restrict pdim)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type dstride[GFC_MAX_DIMENSIONS];
+  const GFC_LOGICAL_1 * restrict base;
+  rtype_name * restrict dest;
+  index_type rank;
+  index_type n;
+  index_type len;
+  index_type delta;
+  index_type dim;
+  int src_kind;
+  int continue_loop;
+
+  /* Make dim zero based to avoid confusion.  */
+  dim = (*pdim) - 1;
+  rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+  src_kind = GFC_DESCRIPTOR_SIZE (array);
+
+  len = GFC_DESCRIPTOR_EXTENT(array,dim);
+  if (len < 0)
+    len = 0;
+
+  delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+
+  for (n = 0; n < dim; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+  for (n = dim; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n + 1);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1);
+
+      if (extent[n] < 0)
+       extent[n] = 0;
+    }
+
+  if (retarray->data == NULL)
+    {
+      size_t alloc_size, str;
+
+      for (n = 0; n < rank; n++)
+        {
+          if (n == 0)
+            str = 1;
+          else
+            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
+
+         GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+
+        }
+
+      retarray->offset = 0;
+      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+
+      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
+                  * extent[rank-1];
+
+      if (alloc_size == 0)
+       {
+         /* Make sure we have a zero-sized array.  */
+         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
+         return;
+       }
+      else
+       retarray->data = internal_malloc_size (alloc_size);
+    }
+  else
+    {
+      if (rank != GFC_DESCRIPTOR_RANK (retarray))
+       runtime_error ("rank of return array incorrect in"
+                      " u_name intrinsic: is %ld, should be %ld",
+                      (long int) GFC_DESCRIPTOR_RANK (retarray),
+                      (long int) rank);
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n=0; n < rank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
+             if (extent[n] != ret_extent)
+               runtime_error ("Incorrect extent in return value of"
+                              " u_name intrinsic in dimension %d:"
+                              " is %ld, should be %ld", (int) n + 1,
+                              (long int) ret_extent, (long int) extent[n]);
+           }
+       }
+    }
+
+  for (n = 0; n < rank; n++)
+    {
+      count[n] = 0;
+      dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+      if (extent[n] <= 0)
+       return;
+    }
+
+  base = array->data;
+
+  if (src_kind == 1 || src_kind == 2 || src_kind == 4 || src_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || src_kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, src_kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in u_name intrinsic");
+
+  dest = retarray->data;
+
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      const GFC_LOGICAL_1 * restrict src;
+      rtype_name result;
+      src = base;
+      {
+')dnl
+define(START_ARRAY_BLOCK,
+`        if (len <= 0)
+         *dest = '$1`;
+       else
+         {
+           for (n = 0; n < len; n++, src += delta)
+             {
+')dnl
+define(FINISH_ARRAY_FUNCTION,
+    `          }
+           *dest = result;
+         }
+      }
+      /* Advance to the next element.  */
+      count[0]++;
+      base += sstride[0];
+      dest += dstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          base -= sstride[n] * extent[n];
+          dest -= dstride[n] * extent[n];
+          n++;
+          if (n == rank)
+            {
+              /* Break out of the look.  */
+              continue_loop = 0;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              base += sstride[n];
+              dest += dstride[n];
+            }
+        }
+    }
+}')dnl
+define(ARRAY_FUNCTION,
+`START_ARRAY_FUNCTION
+$2
+START_ARRAY_BLOCK($1)
+$3
+FINISH_ARRAY_FUNCTION')dnl
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/in_pack.m4 b/l4/pkg/libgfortran/lib/contrib/m4/in_pack.m4
new file mode 100644 (file)
index 0000000..a4337aa
--- /dev/null
@@ -0,0 +1,122 @@
+`/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+/* Allocates a block of memory with internal_malloc if the array needs
+   repacking.  */
+'
+dnl The kind (ie size) is used to name the function for logicals, integers
+dnl and reals.  For complex, it's c4 or c8.
+rtype_name` *
+internal_pack_'rtype_ccode` ('rtype` * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const 'rtype_name` *src;
+  'rtype_name` * restrict dest;
+  'rtype_name` *destptr;
+  int n;
+  int packed;
+
+  /* TODO: Investigate how we can figure out if this is a temporary
+     since the stride=0 thing has been removed from the frontend.  */
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+  /* Allocate storage for the destination.  */
+  destptr = ('rtype_name` *)internal_malloc_size (ssize * sizeof ('rtype_name`));
+  dest = destptr;
+  src = source->data;
+  stride0 = stride[0];
+
+
+  while (src)
+    {
+      /* Copy the data.  */
+      *(dest++) = *src;
+      /* Advance to the next element.  */
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n];
+            }
+        }
+    }
+  return destptr;
+}
+
+#endif
+'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/in_unpack.m4 b/l4/pkg/libgfortran/lib/contrib/m4/in_unpack.m4
new file mode 100644 (file)
index 0000000..661c54e
--- /dev/null
@@ -0,0 +1,110 @@
+`/* Helper function for repacking arrays.
+   Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)'
+
+dnl Only the kind (ie size) is used to name the function for integers,
+dnl reals and logicals.  For complex, it's c4 and c8.
+`void
+internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  'rtype_name` * restrict dest;
+  int n;
+
+  dest = d->data;
+  if (src == dest || !src)
+    return;
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * sizeof ('rtype_name`));
+      return;
+    }
+
+  stride0 = stride[0];
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      *dest = *(src++);
+      /* Advance to the next element.  */
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n];
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n];
+            }
+        }
+    }
+}
+
+#endif
+'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/iparity.m4 b/l4/pkg/libgfortran/lib/contrib/m4/iparity.m4
new file mode 100644 (file)
index 0000000..78dbc3d
--- /dev/null
@@ -0,0 +1,46 @@
+`/* Implementation of the IPARITY intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(0,
+`  result = 0;',
+`  result ^= *src;')
+
+MASKED_ARRAY_FUNCTION(0,
+`  result = 0;',
+`  if (*msrc)
+    result ^= *src;')
+
+SCALAR_ARRAY_FUNCTION(0)
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/iparm.m4 b/l4/pkg/libgfortran/lib/contrib/m4/iparm.m4
new file mode 100644 (file)
index 0000000..4ff6247
--- /dev/null
@@ -0,0 +1,37 @@
+dnl Support macro file for intrinsic functions.
+dnl Works out all the function types from the filename.
+dnl This file is part of the GNU Fortran 95 Runtime Library (libgfortran)
+dnl Distributed under the GNU GPL with exception.  See COPYING for details.
+dnl M4 macro file to get type names from filenames
+define(get_typename2, `GFC_$1_$2')dnl
+define(get_typename, `get_typename2(ifelse($1,i,INTEGER,ifelse($1,r,REAL,ifelse($1,l,LOGICAL,ifelse($1,c,COMPLEX,unknown)))),`$2')')dnl
+define(get_arraytype, `gfc_array_$1$2')dnl
+define(define_type, `dnl
+ifelse(regexp($2,`^[0-9]'),-1,`dnl
+define($1_letter, substr($2, 0, 1))dnl
+define($1_kind, substr($2, 1))dnl
+',`dnl
+define($1_letter,i)dnl
+define($1_kind,$2)dnl
+')dnl
+define($1_code,$1_letter`'$1_kind)dnl
+define($1,get_arraytype($1_letter,$1_kind))dnl
+define($1_name, get_typename($1_letter, $1_kind))')dnl
+dnl
+define_type(atype, regexp(file, `_\(.?[0-9]*\)\.c$', `\1'))dnl
+define(rtype_tmp, regexp(file, `_\(.?[0-9]*\)_[^_]*\.c$', `\1'))dnl
+ifelse(rtype_tmp,,`dnl
+define_type(rtype, atype_code)dnl
+define(rtype_qual,`')dnl
+',`dnl
+define_type(rtype, rtype_tmp)dnl
+define(rtype_qual,`_'rtype_kind)dnl
+')dnl
+define(atype_max, atype_name`_HUGE')dnl
+define(atype_min,ifelse(regexp(file, `_\(.\)[0-9]*\.c$', `\1'),`i',`(-'atype_max`-1)',`-'atype_max))dnl
+define(atype_inf, atype_name`_INFINITY')dnl
+define(atype_nan, atype_name`_QUIET_NAN')dnl
+define(name, regexp(regexp(file, `[^/]*$', `\&'), `^\([^_]*\)_', `\1'))dnl
+define(`upcase', `translit(`$*', `a-z', `A-Z')')dnl
+define(`u_name',`regexp(upcase(name),`\([A-Z]*\)',`\1')')dnl
+define(rtype_ccode,ifelse(rtype_letter,`i',rtype_kind,rtype_code))dnl
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/matmul.m4 b/l4/pkg/libgfortran/lib/contrib/m4/matmul.m4
new file mode 100644 (file)
index 0000000..bb42f2a
--- /dev/null
@@ -0,0 +1,378 @@
+`/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+/* Prototype for the BLAS ?gemm subroutine, a pointer to which can be
+   passed to us by the front-end, in which case we''`ll call it for large
+   matrices.  */
+
+typedef void (*blas_call)(const char *, const char *, const int *, const int *,
+                          const int *, const 'rtype_name` *, const 'rtype_name` *,
+                          const int *, const 'rtype_name` *, const int *,
+                          const 'rtype_name` *, 'rtype_name` *, const int *,
+                          int, int);
+
+/* The order of loops is different in the case of plain matrix
+   multiplication C=MATMUL(A,B), and in the frequent special case where
+   the argument A is the temporary result of a TRANSPOSE intrinsic:
+   C=MATMUL(TRANSPOSE(A),B).  Transposed temporaries are detected by
+   looking at their strides.
+
+   The equivalent Fortran pseudo-code is:
+
+   DIMENSION A(M,COUNT), B(COUNT,N), C(M,N)
+   IF (.NOT.IS_TRANSPOSED(A)) THEN
+     C = 0
+     DO J=1,N
+       DO K=1,COUNT
+         DO I=1,M
+           C(I,J) = C(I,J)+A(I,K)*B(K,J)
+   ELSE
+     DO J=1,N
+       DO I=1,M
+         S = 0
+         DO K=1,COUNT
+           S = S+A(I,K)*B(K,J)
+         C(I,J) = S
+   ENDIF
+*/
+
+/* If try_blas is set to a nonzero value, then the matmul function will
+   see if there is a way to perform the matrix multiplication by a call
+   to the BLAS gemm function.  */
+
+extern void matmul_'rtype_code` ('rtype` * const restrict retarray, 
+       'rtype` * const restrict a, 'rtype` * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm);
+export_proto(matmul_'rtype_code`);
+
+void
+matmul_'rtype_code` ('rtype` * const restrict retarray, 
+       'rtype` * const restrict a, 'rtype` * const restrict b, int try_blas,
+       int blas_limit, blas_call gemm)
+{
+  const 'rtype_name` * restrict abase;
+  const 'rtype_name` * restrict bbase;
+  'rtype_name` * restrict dest;
+
+  index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
+  index_type x, y, n, count, xcount, ycount;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+/* C[xcount,ycount] = A[xcount, count] * B[count,ycount]
+
+   Either A or B (but not both) can be rank 1:
+
+   o One-dimensional argument A is implicitly treated as a row matrix
+     dimensioned [1,count], so xcount=1.
+
+   o One-dimensional argument B is implicitly treated as a column matrix
+     dimensioned [count, 1], so ycount=1.
+  */
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+
+      retarray->data
+       = internal_malloc_size (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+'
+sinclude(`matmul_asm_'rtype_code`.m4')dnl
+`
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      /* One-dimensional result may be addressed in the code below
+        either as a row or a column matrix. We want both cases to
+        work. */
+      rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      /* Treat it as a a row matrix A[1,count]. */
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = 1;
+
+      xcount = 1;
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  else
+    {
+      axstride = GFC_DESCRIPTOR_STRIDE(a,0);
+      aystride = GFC_DESCRIPTOR_STRIDE(a,1);
+
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+
+  if (count != GFC_DESCRIPTOR_EXTENT(b,0))
+    {
+      if (count > 0 || GFC_DESCRIPTOR_EXTENT(b,0) > 0)
+       runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
+    }
+
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      /* Treat it as a column matrix B[count,1] */
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+
+      /* bystride should never be used for 1-dimensional b.
+        in case it is we want it to cause a segfault, rather than
+        an incorrect result. */
+      bystride = 0xDEADBEEF;
+      ycount = 1;
+    }
+  else
+    {
+      bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
+      bystride = GFC_DESCRIPTOR_STRIDE(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  abase = a->data;
+  bbase = b->data;
+  dest = retarray->data;
+
+
+  /* Now that everything is set up, we''`re performing the multiplication
+     itself.  */
+
+#define POW3(x) (((float) (x)) * ((float) (x)) * ((float) (x)))
+
+  if (try_blas && rxstride == 1 && (axstride == 1 || aystride == 1)
+      && (bxstride == 1 || bystride == 1)
+      && (((float) xcount) * ((float) ycount) * ((float) count)
+          > POW3(blas_limit)))
+  {
+    const int m = xcount, n = ycount, k = count, ldc = rystride;
+    const 'rtype_name` one = 1, zero = 0;
+    const int lda = (axstride == 1) ? aystride : axstride,
+              ldb = (bxstride == 1) ? bystride : bxstride;
+
+    if (lda > 0 && ldb > 0 && ldc > 0 && m > 1 && n > 1 && k > 1)
+      {
+        assert (gemm != NULL);
+        gemm (axstride == 1 ? "N" : "T", bxstride == 1 ? "N" : "T", &m, &n, &k,
+              &one, abase, &lda, bbase, &ldb, &zero, dest, &ldc, 1, 1);
+        return;
+      }
+  }
+
+  if (rxstride == 1 && axstride == 1 && bxstride == 1)
+    {
+      const 'rtype_name` * restrict bbase_y;
+      'rtype_name` * restrict dest_y;
+      const 'rtype_name` * restrict abase_n;
+      'rtype_name` bbase_yn;
+
+      if (rystride == xcount)
+       memset (dest, 0, (sizeof ('rtype_name`) * xcount * ycount));
+      else
+       {
+         for (y = 0; y < ycount; y++)
+           for (x = 0; x < xcount; x++)
+             dest[x + y*rystride] = ('rtype_name`)0;
+       }
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = bbase + y*bystride;
+         dest_y = dest + y*rystride;
+         for (n = 0; n < count; n++)
+           {
+             abase_n = abase + n*aystride;
+             bbase_yn = bbase_y[n];
+             for (x = 0; x < xcount; x++)
+               {
+                 dest_y[x] += abase_n[x] * bbase_yn;
+               }
+           }
+       }
+    }
+  else if (rxstride == 1 && aystride == 1 && bxstride == 1)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) != 1)
+       {
+         const 'rtype_name` *restrict abase_x;
+         const 'rtype_name` *restrict bbase_y;
+         'rtype_name` *restrict dest_y;
+         'rtype_name` s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             dest_y = &dest[y*rystride];
+             for (x = 0; x < xcount; x++)
+               {
+                 abase_x = &abase[x*axstride];
+                 s = ('rtype_name`) 0;
+                 for (n = 0; n < count; n++)
+                   s += abase_x[n] * bbase_y[n];
+                 dest_y[x] = s;
+               }
+           }
+       }
+      else
+       {
+         const 'rtype_name` *restrict bbase_y;
+         'rtype_name` s;
+
+         for (y = 0; y < ycount; y++)
+           {
+             bbase_y = &bbase[y*bystride];
+             s = ('rtype_name`) 0;
+             for (n = 0; n < count; n++)
+               s += abase[n*axstride] * bbase_y[n];
+             dest[y*rystride] = s;
+           }
+       }
+    }
+  else if (axstride < aystride)
+    {
+      for (y = 0; y < ycount; y++)
+       for (x = 0; x < xcount; x++)
+         dest[x*rxstride + y*rystride] = ('rtype_name`)0;
+
+      for (y = 0; y < ycount; y++)
+       for (n = 0; n < count; n++)
+         for (x = 0; x < xcount; x++)
+           /* dest[x,y] += a[x,n] * b[n,y] */
+           dest[x*rxstride + y*rystride] += abase[x*axstride + n*aystride] * bbase[n*bxstride + y*bystride];
+    }
+  else if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      const 'rtype_name` *restrict bbase_y;
+      'rtype_name` s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         s = ('rtype_name`) 0;
+         for (n = 0; n < count; n++)
+           s += abase[n*axstride] * bbase_y[n*bxstride];
+         dest[y*rxstride] = s;
+       }
+    }
+  else
+    {
+      const 'rtype_name` *restrict abase_x;
+      const 'rtype_name` *restrict bbase_y;
+      'rtype_name` *restrict dest_y;
+      'rtype_name` s;
+
+      for (y = 0; y < ycount; y++)
+       {
+         bbase_y = &bbase[y*bystride];
+         dest_y = &dest[y*rystride];
+         for (x = 0; x < xcount; x++)
+           {
+             abase_x = &abase[x*axstride];
+             s = ('rtype_name`) 0;
+             for (n = 0; n < count; n++)
+               s += abase_x[n*aystride] * bbase_y[n*bxstride];
+             dest_y[x*rxstride] = s;
+           }
+       }
+    }
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/matmull.m4 b/l4/pkg/libgfortran/lib/contrib/m4/matmull.m4
new file mode 100644 (file)
index 0000000..c5bad25
--- /dev/null
@@ -0,0 +1,241 @@
+`/* Implementation of the MATMUL intrinsic
+   Copyright 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+/* Dimensions: retarray(x,y) a(x, count) b(count,y).
+   Either a or b can be rank 1.  In this case x or y is 1.  */
+
+extern void matmul_'rtype_code` ('rtype` * const restrict, 
+       gfc_array_l1 * const restrict, gfc_array_l1 * const restrict);
+export_proto(matmul_'rtype_code`);
+
+void
+matmul_'rtype_code` ('rtype` * const restrict retarray, 
+       gfc_array_l1 * const restrict a, gfc_array_l1 * const restrict b)
+{
+  const GFC_LOGICAL_1 * restrict abase;
+  const GFC_LOGICAL_1 * restrict bbase;
+  'rtype_name` * restrict dest;
+  index_type rxstride;
+  index_type rystride;
+  index_type xcount;
+  index_type ycount;
+  index_type xstride;
+  index_type ystride;
+  index_type x;
+  index_type y;
+  int a_kind;
+  int b_kind;
+
+  const GFC_LOGICAL_1 * restrict pa;
+  const GFC_LOGICAL_1 * restrict pb;
+  index_type astride;
+  index_type bstride;
+  index_type count;
+  index_type n;
+
+  assert (GFC_DESCRIPTOR_RANK (a) == 2
+          || GFC_DESCRIPTOR_RANK (b) == 2);
+
+  if (retarray->data == NULL)
+    {
+      if (GFC_DESCRIPTOR_RANK (a) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+        }
+      else if (GFC_DESCRIPTOR_RANK (b) == 1)
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+        }
+      else
+        {
+         GFC_DIMENSION_SET(retarray->dim[0], 0,
+                           GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+
+          GFC_DIMENSION_SET(retarray->dim[1], 0,
+                           GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+                           GFC_DESCRIPTOR_EXTENT(retarray,0));
+        }
+          
+      retarray->data
+       = internal_malloc_size (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
+      retarray->offset = 0;
+    }
+    else if (unlikely (compile_options.bounds_check))
+      {
+       index_type ret_extent, arg_extent;
+
+       if (GFC_DESCRIPTOR_RANK (a) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+       else if (GFC_DESCRIPTOR_RANK (b) == 1)
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic: is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);         
+         }
+       else
+         {
+           arg_extent = GFC_DESCRIPTOR_EXTENT(a,0);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 1:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+
+           arg_extent = GFC_DESCRIPTOR_EXTENT(b,1);
+           ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,1);
+           if (arg_extent != ret_extent)
+             runtime_error ("Incorrect extent in return array in"
+                            " MATMUL intrinsic for dimension 2:"
+                            " is %ld, should be %ld",
+                            (long int) ret_extent, (long int) arg_extent);
+         }
+      }
+
+  abase = a->data;
+  a_kind = GFC_DESCRIPTOR_SIZE (a);
+
+  if (a_kind == 1 || a_kind == 2 || a_kind == 4 || a_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+     || a_kind == 16
+#endif
+     )
+    abase = GFOR_POINTER_TO_L1 (abase, a_kind);
+  else
+    internal_error (NULL, "Funny sized logical array");
+
+  bbase = b->data;
+  b_kind = GFC_DESCRIPTOR_SIZE (b);
+
+  if (b_kind == 1 || b_kind == 2 || b_kind == 4 || b_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+     || b_kind == 16
+#endif
+     )
+    bbase = GFOR_POINTER_TO_L1 (bbase, b_kind);
+  else
+    internal_error (NULL, "Funny sized logical array");
+
+  dest = retarray->data;
+'
+sinclude(`matmul_asm_'rtype_code`.m4')dnl
+`
+  if (GFC_DESCRIPTOR_RANK (retarray) == 1)
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = rxstride;
+    }
+  else
+    {
+      rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+    }
+
+  /* If we have rank 1 parameters, zero the absent stride, and set the size to
+     one.  */
+  if (GFC_DESCRIPTOR_RANK (a) == 1)
+    {
+      astride = GFC_DESCRIPTOR_STRIDE_BYTES(a,0);
+      count = GFC_DESCRIPTOR_EXTENT(a,0);
+      xstride = 0;
+      rxstride = 0;
+      xcount = 1;
+    }
+  else
+    {
+      astride = GFC_DESCRIPTOR_STRIDE_BYTES(a,1);
+      count = GFC_DESCRIPTOR_EXTENT(a,1);
+      xstride = GFC_DESCRIPTOR_STRIDE_BYTES(a,0);
+      xcount = GFC_DESCRIPTOR_EXTENT(a,0);
+    }
+  if (GFC_DESCRIPTOR_RANK (b) == 1)
+    {
+      bstride = GFC_DESCRIPTOR_STRIDE_BYTES(b,0);
+      assert(count == GFC_DESCRIPTOR_EXTENT(b,0));
+      ystride = 0;
+      rystride = 0;
+      ycount = 1;
+    }
+  else
+    {
+      bstride = GFC_DESCRIPTOR_STRIDE_BYTES(b,0);
+      assert(count == GFC_DESCRIPTOR_EXTENT(b,0));
+      ystride = GFC_DESCRIPTOR_STRIDE_BYTES(b,1);
+      ycount = GFC_DESCRIPTOR_EXTENT(b,1);
+    }
+
+  for (y = 0; y < ycount; y++)
+    {
+      for (x = 0; x < xcount; x++)
+        {
+          /* Do the summation for this element.  For real and integer types
+             this is the same as DOT_PRODUCT.  For complex types we use do
+             a*b, not conjg(a)*b.  */
+          pa = abase;
+          pb = bbase;
+          *dest = 0;
+
+          for (n = 0; n < count; n++)
+            {
+              if (*pa && *pb)
+                {
+                  *dest = 1;
+                  break;
+                }
+              pa += astride;
+              pb += bstride;
+            }
+
+          dest += rxstride;
+          abase += xstride;
+        }
+      abase -= xstride * xcount;
+      bbase += ystride;
+      dest += rystride - (rxstride * xcount);
+    }
+}
+
+#endif
+'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/maxloc0.m4 b/l4/pkg/libgfortran/lib/contrib/m4/maxloc0.m4
new file mode 100644 (file)
index 0000000..aef7b9b
--- /dev/null
@@ -0,0 +1,126 @@
+`/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>'
+
+include(iparm.m4)dnl
+include(iforeach.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+FOREACH_FUNCTION(
+`    atype_name maxval;
+#if defined('atype_nan`)
+    int fast = 0;
+#endif
+
+#if defined('atype_inf`)
+    maxval = -atype_inf;
+#else
+    maxval = atype_min;
+#endif',
+`#if defined('atype_nan`)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base >= maxval)
+               {
+                 fast = 1;
+                 maxval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }')
+
+MASKED_FOREACH_FUNCTION(
+`  atype_name maxval;
+   int fast = 0;
+
+#if defined('atype_inf`)
+    maxval = -atype_inf;
+#else
+    maxval = atype_min;
+#endif',
+`      }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined('atype_nan`)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base >= maxval)
+#endif
+                   {
+                     fast = 1;
+                     maxval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base > maxval)
+           {
+             maxval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }')
+
+SCALAR_FOREACH_FUNCTION(`0')
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/maxloc1.m4 b/l4/pkg/libgfortran/lib/contrib/m4/maxloc1.m4
new file mode 100644 (file)
index 0000000..44872ee
--- /dev/null
@@ -0,0 +1,101 @@
+`/* Implementation of the MAXLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(0,
+`      atype_name maxval;
+#if defined ('atype_inf`)
+       maxval = -atype_inf;
+#else
+       maxval = atype_min;
+#endif
+       result = 1;',
+`#if defined ('atype_nan`)
+               if (*src >= maxval)
+                 {
+                   maxval = *src;
+                   result = (rtype_name)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > maxval)
+                 {
+                   maxval = *src;
+                   result = (rtype_name)n + 1;
+                 }', `')
+
+MASKED_ARRAY_FUNCTION(0,
+`      atype_name maxval;
+#if defined ('atype_inf`)
+       maxval = -atype_inf;
+#else
+       maxval = atype_min;
+#endif
+#if defined ('atype_nan`)
+       rtype_name result2 = 0;
+#endif
+       result = 0;',
+`              if (*msrc)
+                 {
+#if defined ('atype_nan`)
+                   if (!result2)
+                     result2 = (rtype_name)n + 1;
+                   if (*src >= maxval)
+#endif
+                     {
+                       maxval = *src;
+                       result = (rtype_name)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined ('atype_nan`)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src > maxval)
+                 {
+                   maxval = *src;
+                   result = (rtype_name)n + 1;
+                 }')
+
+SCALAR_ARRAY_FUNCTION(0)
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/maxval.m4 b/l4/pkg/libgfortran/lib/contrib/m4/maxval.m4
new file mode 100644 (file)
index 0000000..1539068
--- /dev/null
@@ -0,0 +1,88 @@
+`/* Implementation of the MAXVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(atype_min,
+`#if defined ('atype_inf`)
+       result = -atype_inf;
+#else
+       result = atype_min;
+#endif',
+`#if defined ('atype_nan`)
+               if (*src >= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = atype_nan;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src > result)
+                 result = *src;', `')
+
+MASKED_ARRAY_FUNCTION(atype_min,
+`#if defined ('atype_inf`)
+       result = -atype_inf;
+#else
+       result = atype_min;
+#endif
+#if defined ('atype_nan`)
+       int non_empty_p = 0;
+#endif',
+`#if defined ('atype_inf`) || defined ('atype_nan`)
+               if (*msrc)
+                 {
+#if defined ('atype_nan`)
+                   non_empty_p = 1;
+                   if (*src >= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined ('atype_nan`)
+               result = non_empty_p ? atype_nan : atype_min;
+#else
+               result = atype_min;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src > result)
+                 result = *src;')
+
+SCALAR_ARRAY_FUNCTION(atype_min)
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/minloc0.m4 b/l4/pkg/libgfortran/lib/contrib/m4/minloc0.m4
new file mode 100644 (file)
index 0000000..1345f2d
--- /dev/null
@@ -0,0 +1,126 @@
+`/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>'
+
+include(iparm.m4)dnl
+include(iforeach.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+FOREACH_FUNCTION(
+`    atype_name minval;
+#if defined('atype_nan`)
+    int fast = 0;
+#endif
+
+#if defined('atype_inf`)
+    minval = atype_inf;
+#else
+    minval = atype_max;
+#endif',
+`#if defined('atype_nan`)
+       }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*base <= minval)
+               {
+                 fast = 1;
+                 minval = *base;
+                 for (n = 0; n < rank; n++)
+                   dest[n * dstride] = count[n] + 1;
+                 break;
+               }
+             base += sstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+#endif
+         if (*base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }')
+
+MASKED_FOREACH_FUNCTION(
+`  atype_name minval;
+   int fast = 0;
+
+#if defined('atype_inf`)
+    minval = atype_inf;
+#else
+    minval = atype_max;
+#endif',
+`      }
+      while (0);
+      if (unlikely (!fast))
+       {
+         do
+           {
+             if (*mbase)
+               {
+#if defined('atype_nan`)
+                 if (unlikely (dest[0] == 0))
+                   for (n = 0; n < rank; n++)
+                     dest[n * dstride] = count[n] + 1;
+                 if (*base <= minval)
+#endif
+                   {
+                     fast = 1;
+                     minval = *base;
+                     for (n = 0; n < rank; n++)
+                       dest[n * dstride] = count[n] + 1;
+                     break;
+                   }
+               }
+             base += sstride[0];
+             mbase += mstride[0];
+           }
+         while (++count[0] != extent[0]);
+         if (likely (fast))
+           continue;
+       }
+      else do
+       {
+         if (*mbase && *base < minval)
+           {
+             minval = *base;
+             for (n = 0; n < rank; n++)
+               dest[n * dstride] = count[n] + 1;
+           }')
+
+SCALAR_FOREACH_FUNCTION(`0')
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/minloc1.m4 b/l4/pkg/libgfortran/lib/contrib/m4/minloc1.m4
new file mode 100644 (file)
index 0000000..e0bd3cd
--- /dev/null
@@ -0,0 +1,101 @@
+`/* Implementation of the MINLOC intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <limits.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(0,
+`      atype_name minval;
+#if defined ('atype_inf`)
+       minval = atype_inf;
+#else
+       minval = atype_max;
+#endif
+       result = 1;',
+`#if defined ('atype_nan`)
+               if (*src <= minval)
+                 {
+                   minval = *src;
+                   result = (rtype_name)n + 1;
+                   break;
+                 }
+             }
+           for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < minval)
+                 {
+                   minval = *src;
+                   result = (rtype_name)n + 1;
+                 }')
+
+MASKED_ARRAY_FUNCTION(0,
+`      atype_name minval;
+#if defined ('atype_inf`)
+       minval = atype_inf;
+#else
+       minval = atype_max;
+#endif
+#if defined ('atype_nan`)
+       rtype_name result2 = 0;
+#endif
+       result = 0;',
+`              if (*msrc)
+                 {
+#if defined ('atype_nan`)
+                   if (!result2)
+                     result2 = (rtype_name)n + 1;
+                   if (*src <= minval)
+#endif
+                     {
+                       minval = *src;
+                       result = (rtype_name)n + 1;
+                       break;
+                     }
+                 }
+             }
+#if defined ('atype_nan`)
+           if (unlikely (n >= len))
+             result = result2;
+           else
+#endif
+           for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+               if (*msrc && *src < minval)
+                 {
+                   minval = *src;
+                   result = (rtype_name)n + 1;
+                 }', `')
+
+SCALAR_ARRAY_FUNCTION(0)
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/minval.m4 b/l4/pkg/libgfortran/lib/contrib/m4/minval.m4
new file mode 100644 (file)
index 0000000..037dd67
--- /dev/null
@@ -0,0 +1,88 @@
+`/* Implementation of the MINVAL intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(atype_max,
+`#if defined ('atype_inf`)
+       result = atype_inf;
+#else
+       result = atype_max;
+#endif',
+`#if defined ('atype_nan`)
+               if (*src <= result)
+                 break;
+             }
+           if (unlikely (n >= len))
+             result = atype_nan;
+           else for (; n < len; n++, src += delta)
+             {
+#endif
+               if (*src < result)
+                 result = *src;')
+
+MASKED_ARRAY_FUNCTION(atype_max,
+`#if defined ('atype_inf`)
+       result = atype_inf;
+#else
+       result = atype_max;
+#endif
+#if defined ('atype_nan`)
+       int non_empty_p = 0;
+#endif',
+`#if defined ('atype_inf`) || defined ('atype_nan`)
+               if (*msrc)
+                 {
+#if defined ('atype_nan`)
+                   non_empty_p = 1;
+                   if (*src <= result)
+#endif
+                     break;
+                 }
+             }
+           if (unlikely (n >= len))
+             {
+#if defined ('atype_nan`)
+               result = non_empty_p ? atype_nan : atype_max;
+#else
+               result = atype_max;
+#endif
+             }
+           else for (; n < len; n++, src += delta, msrc += mdelta)
+             {
+#endif
+               if (*msrc && *src < result)
+                 result = *src;', `')
+
+SCALAR_ARRAY_FUNCTION(atype_max)
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/misc_specifics.m4 b/l4/pkg/libgfortran/lib/contrib/m4/misc_specifics.m4
new file mode 100644 (file)
index 0000000..3e40bf0
--- /dev/null
@@ -0,0 +1,64 @@
+include(head.m4)dnl
+dnl
+dnl This file contains the specific functions that are not handled in the
+dnl m4/specific.m4 file.
+
+#include "config.h"
+#include "kinds.inc"
+
+dnl This is from GNU m4 examples file foreach.m4:
+divert(-1)
+# foreach(x, (item_1, item_2, ..., item_n), stmt)
+define(`foreach', `pushdef(`$1', `')_foreach(`$1', `$2',
+`$3')popdef(`$1')')
+define(`_arg1', `$1')
+define(`_foreach',
+        `ifelse(`$2', `()', ,
+                `define(`$1', _arg1$2)$3`'_foreach(`$1', (shift$2),
+`$3')')')
+# traceon(`define', `foreach', `_foreach', `ifelse')
+divert
+
+dnl   NINT specifics
+foreach(`ikind', `(4, 8, 16)', `foreach(`rkind', `(4, 8, 10, 16)', `
+`#if defined (HAVE_GFC_REAL_'rkind`) && defined (HAVE_GFC_INTEGER_'ikind`)'
+elemental function _gfortran_specific__nint_`'ikind`_'rkind (parm)
+   real (kind=rkind) , intent (in) :: parm
+   integer (kind=ikind) :: _gfortran_specific__nint_`'ikind`_'rkind
+   _gfortran_specific__nint_`'ikind`_'rkind = nint (parm)
+end function
+#endif
+')')
+
+dnl   CHAR specifics
+foreach(`ckind', `(1)', `foreach(`ikind', `(4, 8, 16)', `
+`#if defined (HAVE_GFC_INTEGER_'ikind`)'
+elemental function _gfortran_specific__char_`'ckind`_i'ikind (parm)
+   integer (kind=ikind) , intent (in) :: parm
+   character (kind=ckind,len=1) :: _gfortran_specific__char_`'ckind`_i'ikind
+   _gfortran_specific__char_`'ckind`_i'ikind` = char (parm, kind='ckind`)'
+end function
+#endif
+')')
+
+dnl   LEN specifics
+foreach(`ckind', `(1)', `foreach(`ikind', `(4, 8, 16)', `
+`#if defined (HAVE_GFC_INTEGER_'ikind`)'
+elemental function _gfortran_specific__len_`'ckind`_i'ikind (parm)
+   character (kind=ckind,len=*) , intent (in) :: parm
+   integer (kind=ikind) :: _gfortran_specific__len_`'ckind`_i'ikind
+   _gfortran_specific__len_`'ckind`_i'ikind` = len (parm)'
+end function
+#endif
+')')
+
+dnl   INDEX specifics
+foreach(`ckind', `(1)', `foreach(`ikind', `(4, 8, 16)', `
+`#if defined (HAVE_GFC_INTEGER_'ikind`)'
+elemental function _gfortran_specific__index_`'ckind`_i'ikind (parm1, parm2)
+   character (kind=ckind,len=*) , intent (in) :: parm1, parm2
+   integer (kind=ikind) :: _gfortran_specific__index_`'ckind`_i'ikind
+   _gfortran_specific__index_`'ckind`_i'ikind` = index (parm1, parm2)'
+end function
+#endif
+')')
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/mtype.m4 b/l4/pkg/libgfortran/lib/contrib/m4/mtype.m4
new file mode 100644 (file)
index 0000000..b133e57
--- /dev/null
@@ -0,0 +1,13 @@
+dnl Get type kind from filename.
+define(kind,regexp(file, `_.\([0-9]+\).c$', `\1'))dnl
+define(complex_type, `GFC_COMPLEX_'kind)dnl
+define(real_type, `GFC_REAL_'kind)dnl
+define(`upcase', `translit(`$*', `a-z', `A-Z')')dnl
+define(q,ifelse(kind,4,f,ifelse(kind,8,`',ifelse(kind,10,l,ifelse(kind,16,l,`_'kind)))))dnl
+define(Q,translit(q,`a-z',`A-Z'))dnl
+define(hasmathfunc,`ifelse(kind,4,`defined (HAVE_'upcase($1)`F)',ifelse(kind,8,`defined (HAVE_'upcase($1)`)',ifelse(kind,10,`defined (HAVE_'upcase($1)`L)',ifelse(kind,16,`(defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_'upcase($1)`L))',`error out'))))')
+define(mathfunc_macro,`ifelse(kind,16,`#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif',ifelse(kind,8,``#''`define MATHFUNC(funcname) funcname',```#'''`define MATHFUNC(funcname) funcname '```#'''```#'''` 'q))')dnl
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/nearest.m4 b/l4/pkg/libgfortran/lib/contrib/m4/nearest.m4
new file mode 100644 (file)
index 0000000..6434430
--- /dev/null
@@ -0,0 +1,51 @@
+`/* Implementation of the NEAREST intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"'
+
+include(`mtype.m4')dnl
+
+mathfunc_macro
+
+`#if defined (HAVE_'real_type`) && 'hasmathfunc(copysign) && hasmathfunc(nextafter)`
+
+extern 'real_type` nearest_r'kind` ('real_type` s, 'real_type` dir);
+export_proto(nearest_r'kind`);
+
+'real_type`
+nearest_r'kind` ('real_type` s, 'real_type` dir)
+{
+  dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
+  if (FLT_EVAL_METHOD != 0)
+    {
+      /* ??? Work around glibc bug on x86.  */
+      volatile 'real_type` r = MATHFUNC(nextafter) (s, dir);
+      return r;
+    }
+  else
+    return MATHFUNC(nextafter) (s, dir);
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/norm2.m4 b/l4/pkg/libgfortran/lib/contrib/m4/norm2.m4
new file mode 100644 (file)
index 0000000..b2162ac
--- /dev/null
@@ -0,0 +1,61 @@
+`/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+include(`mtype.m4')dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`) && 'hasmathfunc(sqrt) && hasmathfunc(fabs)
+
+mathfunc_macro
+
+ARRAY_FUNCTION(0,
+`      'rtype_name` scale;
+       result = 0;
+       scale = 1;',
+`        if (*src != 0)
+           {
+             'rtype_name` absX, val;
+             absX = MATHFUNC(fabs) (*src);
+             if (scale < absX)
+               {
+                 val = scale / absX;
+                 result = 1 + result * val * val;
+                 scale = absX;
+               }
+             else
+               {
+                 val = absX / scale;
+                 result += val * val;
+               }
+           }',
+`   result = scale * MATHFUNC(sqrt) (result);')
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/pack.m4 b/l4/pkg/libgfortran/lib/contrib/m4/pack.m4
new file mode 100644 (file)
index 0000000..e1882d0
--- /dev/null
@@ -0,0 +1,260 @@
+`/* Specific implementation of the PACK intrinsic
+   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+/* PACK is specified as follows:
+
+   13.14.80 PACK (ARRAY, MASK, [VECTOR])
+
+   Description: Pack an array into an array of rank one under the
+   control of a mask.
+
+   Class: Transformational function.
+
+   Arguments:
+      ARRAY   may be of any type. It shall not be scalar.
+      MASK    shall be of type LOGICAL. It shall be conformable with ARRAY.
+      VECTOR  (optional) shall be of the same type and type parameters
+              as ARRAY. VECTOR shall have at least as many elements as
+              there are true elements in MASK. If MASK is a scalar
+              with the value true, VECTOR shall have at least as many
+              elements as there are in ARRAY.
+
+   Result Characteristics: The result is an array of rank one with the
+   same type and type parameters as ARRAY. If VECTOR is present, the
+   result size is that of VECTOR; otherwise, the result size is the
+   number /t/ of true elements in MASK unless MASK is scalar with the
+   value true, in which case the result size is the size of ARRAY.
+
+   Result Value: Element /i/ of the result is the element of ARRAY
+   that corresponds to the /i/th true element of MASK, taking elements
+   in array element order, for /i/ = 1, 2, ..., /t/. If VECTOR is
+   present and has size /n/ > /t/, element /i/ of the result has the
+   value VECTOR(/i/), for /i/ = /t/ + 1, ..., /n/.
+
+   Examples: The nonzero elements of an array M with the value
+   | 0 0 0 |
+   | 9 0 0 | may be "gathered" by the function PACK. The result of
+   | 0 0 7 |
+   PACK (M, MASK = M.NE.0) is [9,7] and the result of PACK (M, M.NE.0,
+   VECTOR = (/ 2,4,6,8,10,12 /)) is [9,7,6,8,10,12].
+
+There are two variants of the PACK intrinsic: one, where MASK is
+array valued, and the other one where MASK is scalar.  */
+
+void
+pack_'rtype_code` ('rtype` *ret, const 'rtype` *array,
+              const gfc_array_l1 *mask, const 'rtype` *vector)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride0;
+  'rtype_name` * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  const 'rtype_name` *sptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  int zero_sized;
+  index_type n;
+  index_type dim;
+  index_type nelem;
+  index_type total;
+  int mask_kind;
+
+  dim = GFC_DESCRIPTOR_RANK (array);
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  zero_sized = 0;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      if (extent[n] <= 0)
+       zero_sized = 1;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+      mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+    }
+  if (sstride[0] == 0)
+    sstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = mask_kind;
+
+  if (zero_sized)
+    sptr = NULL;
+  else
+    sptr = array->data;
+
+  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+    {
+      /* Count the elements, either for allocating memory or
+        for bounds checking.  */
+
+      if (vector != NULL)
+       {
+         /* The return array will have as many
+            elements as there are in VECTOR.  */
+         total = GFC_DESCRIPTOR_EXTENT(vector,0);
+         if (total < 0)
+           {
+             total = 0;
+             vector = NULL;
+           }
+       }
+      else
+        {
+         /* We have to count the true elements in MASK.  */
+         total = count_0 (mask);
+        }
+
+      if (ret->data == NULL)
+       {
+         /* Setup the array descriptor.  */
+         GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
+
+         ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof ('rtype_name`) * total);
+
+         if (total == 0)
+           return;
+       }
+      else 
+       {
+         /* We come here because of range checking.  */
+         index_type ret_extent;
+
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+         if (total != ret_extent)
+           runtime_error ("Incorrect extent in return value of PACK intrinsic;"
+                          " is %ld, should be %ld", (long int) total,
+                          (long int) ret_extent);
+       }
+    }
+
+  rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
+  if (rstride0 == 0)
+    rstride0 = 1;
+  sstride0 = sstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+
+  while (sptr && mptr)
+    {
+      /* Test this element.  */
+      if (*mptr)
+        {
+          /* Add it.  */
+         *rptr = *sptr;
+          rptr += rstride0;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+
+  /* Add any remaining elements from VECTOR.  */
+  if (vector)
+    {
+      n = GFC_DESCRIPTOR_EXTENT(vector,0);
+      nelem = ((rptr - ret->data) / rstride0);
+      if (n > nelem)
+        {
+          sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+          if (sstride0 == 0)
+            sstride0 = 1;
+
+          sptr = vector->data + sstride0 * nelem;
+          n -= nelem;
+          while (n--)
+            {
+             *rptr = *sptr;
+              rptr += rstride0;
+              sptr += sstride0;
+            }
+        }
+    }
+}
+
+#endif
+'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/parity.m4 b/l4/pkg/libgfortran/lib/contrib/m4/parity.m4
new file mode 100644 (file)
index 0000000..037e96d
--- /dev/null
@@ -0,0 +1,40 @@
+`/* Implementation of the NORM2 intrinsic
+   Copyright 2010 Free Software Foundation, Inc.
+   Contributed by Tobias Burnus  <burnus@net-b.de>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(0,
+`  result = 0;',
+`  result = result != *src;', `')
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/pow.m4 b/l4/pkg/libgfortran/lib/contrib/m4/pow.m4
new file mode 100644 (file)
index 0000000..3814f87
--- /dev/null
@@ -0,0 +1,83 @@
+`/* Support routines for the intrinsic power (**) operator.
+   Copyright 2004, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"'
+
+include(iparm.m4)dnl
+
+/* Use Binary Method to calculate the powi. This is not an optimal but
+   a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of
+   Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art
+   of Computer Programming", 3rd Edition, 1998.  */
+
+`#if defined (HAVE_'rtype_name`) && defined (HAVE_'atype_name`)'
+
+rtype_name `pow_'rtype_code`_'atype_code` ('rtype_name` a, 'atype_name` b);
+export_proto(pow_'rtype_code`_'atype_code`);
+
+'rtype_name`
+pow_'rtype_code`_'atype_code` ('rtype_name` a, 'atype_name` b)
+{
+  'rtype_name` pow, x;
+  'atype_name` n;
+  GFC_UINTEGER_'atype_kind` u;
+  
+  n = b;
+  x = a;
+  pow = 1;
+  if (n != 0)
+    {
+      if (n < 0)
+       {
+'ifelse(rtype_letter,i,`dnl
+         if (x == 1)
+           return 1;
+         if (x == -1)
+           return (n & 1) ? -1 : 1;
+         return (x == 0) ? 1 / x : 0;
+',`
+         u = -n;
+         x = pow / x;
+')dnl
+`      }
+      else
+       {
+          u = n;
+       }
+      for (;;)
+       {
+         if (u & 1)
+           pow *= x;
+         u >>= 1;
+         if (u)
+           x *= x;
+         else
+           break;
+       }
+    }
+  return pow;
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/product.m4 b/l4/pkg/libgfortran/lib/contrib/m4/product.m4
new file mode 100644 (file)
index 0000000..6f6f2c0
--- /dev/null
@@ -0,0 +1,46 @@
+`/* Implementation of the PRODUCT intrinsic
+   Copyright 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(1,
+`  result = 1;',
+`  result *= *src;', `')
+
+MASKED_ARRAY_FUNCTION(1,
+`  result = 1;',
+`  if (*msrc)
+    result *= *src;')
+
+SCALAR_ARRAY_FUNCTION(1)
+
+`#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/reshape.m4 b/l4/pkg/libgfortran/lib/contrib/m4/reshape.m4
new file mode 100644 (file)
index 0000000..d1486f3
--- /dev/null
@@ -0,0 +1,364 @@
+`/* Implementation of the RESHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+typedef GFC_ARRAY_DESCRIPTOR(1, 'index_type`) 'shape_type`;'
+
+dnl For integer routines, only the kind (ie size) is used to name the
+dnl function.  The same function will be used for integer and logical
+dnl arrays of the same kind.
+
+`extern void reshape_'rtype_ccode` ('rtype` * const restrict, 
+       'rtype` * const restrict, 
+       'shape_type` * const restrict,
+       'rtype` * const restrict, 
+       'shape_type` * const restrict);
+export_proto(reshape_'rtype_ccode`);
+
+void
+reshape_'rtype_ccode` ('rtype` * const restrict ret, 
+       'rtype` * const restrict source, 
+       'shape_type` * const restrict shape,
+       'rtype` * const restrict pad, 
+       'shape_type` * const restrict order)
+{
+  /* r.* indicates the return array.  */
+  index_type rcount[GFC_MAX_DIMENSIONS];
+  index_type rextent[GFC_MAX_DIMENSIONS];
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdim;
+  index_type rsize;
+  index_type rs;
+  index_type rex;
+  'rtype_name` *rptr;
+  /* s.* indicates the source array.  */
+  index_type scount[GFC_MAX_DIMENSIONS];
+  index_type sextent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type sdim;
+  index_type ssize;
+  const 'rtype_name` *sptr;
+  /* p.* indicates the pad array.  */
+  index_type pcount[GFC_MAX_DIMENSIONS];
+  index_type pextent[GFC_MAX_DIMENSIONS];
+  index_type pstride[GFC_MAX_DIMENSIONS];
+  index_type pdim;
+  index_type psize;
+  const 'rtype_name` *pptr;
+
+  const 'rtype_name` *src;
+  int n;
+  int dim;
+  int sempty, pempty, shape_empty;
+  index_type shape_data[GFC_MAX_DIMENSIONS];
+
+  rdim = GFC_DESCRIPTOR_EXTENT(shape,0);
+  if (rdim != GFC_DESCRIPTOR_RANK(ret))
+    runtime_error("rank of return array incorrect in RESHAPE intrinsic");
+
+  shape_empty = 0;
+
+  for (n = 0; n < rdim; n++)
+    {
+      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      if (shape_data[n] <= 0)
+      {
+        shape_data[n] = 0;
+       shape_empty = 1;
+      }
+    }
+
+  if (ret->data == NULL)
+    {
+      index_type alloc_size;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rex = shape_data[n];
+
+         GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs);
+
+         rs *= rex;
+       }
+      ret->offset = 0;
+
+      if (unlikely (rs < 1))
+        alloc_size = 1;
+      else
+        alloc_size = rs * sizeof ('rtype_name`);
+
+      ret->data = internal_malloc_size (alloc_size);
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
+    }
+
+  if (shape_empty)
+    return;
+
+  if (pad)
+    {
+      pdim = GFC_DESCRIPTOR_RANK (pad);
+      psize = 1;
+      pempty = 0;
+      for (n = 0; n < pdim; n++)
+        {
+          pcount[n] = 0;
+          pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n);
+          pextent[n] = GFC_DESCRIPTOR_EXTENT(pad,n);
+          if (pextent[n] <= 0)
+           {
+             pempty = 1;
+             pextent[n] = 0;
+           }
+
+          if (psize == pstride[n])
+            psize *= pextent[n];
+          else
+            psize = 0;
+        }
+      pptr = pad->data;
+    }
+  else
+    {
+      pdim = 0;
+      psize = 1;
+      pempty = 1;
+      pptr = NULL;
+    }
+
+  if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, source_extent;
+
+      rs = 1;
+      for (n = 0; n < rdim; n++)
+       {
+         rs *= shape_data[n];
+         ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+         if (ret_extent != shape_data[n])
+           runtime_error("Incorrect extent in return value of RESHAPE"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", (long int) n+1,
+                         (long int) ret_extent, (long int) shape_data[n]);
+       }
+
+      source_extent = 1;
+      sdim = GFC_DESCRIPTOR_RANK (source);
+      for (n = 0; n < sdim; n++)
+       {
+         index_type se;
+         se = GFC_DESCRIPTOR_EXTENT(source,n);
+         source_extent *= se > 0 ? se : 0;
+       }
+
+      if (rs > source_extent && (!pad || pempty))
+       runtime_error("Incorrect size in SOURCE argument to RESHAPE"
+                     " intrinsic: is %ld, should be %ld",
+                     (long int) source_extent, (long int) rs);
+
+      if (order)
+       {
+         int seen[GFC_MAX_DIMENSIONS];
+         index_type v;
+
+         for (n = 0; n < rdim; n++)
+           seen[n] = 0;
+
+         for (n = 0; n < rdim; n++)
+           {
+             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+
+             if (v < 0 || v >= rdim)
+               runtime_error("Value %ld out of range in ORDER argument"
+                             " to RESHAPE intrinsic", (long int) v + 1);
+
+             if (seen[v] != 0)
+               runtime_error("Duplicate value %ld in ORDER argument to"
+                             " RESHAPE intrinsic", (long int) v + 1);
+               
+             seen[v] = 1;
+           }
+       }
+    }
+
+  rsize = 1;
+  for (n = 0; n < rdim; n++)
+    {
+      if (order)
+        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+      else
+        dim = n;
+
+      rcount[n] = 0;
+      rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
+      rextent[n] = GFC_DESCRIPTOR_EXTENT(ret,dim);
+      if (rextent[n] < 0)
+        rextent[n] = 0;
+
+      if (rextent[n] != shape_data[dim])
+        runtime_error ("shape and target do not conform");
+
+      if (rsize == rstride[n])
+        rsize *= rextent[n];
+      else
+        rsize = 0;
+      if (rextent[n] <= 0)
+        return;
+    }
+
+  sdim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  sempty = 0;
+  for (n = 0; n < sdim; n++)
+    {
+      scount[n] = 0;
+      sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      sextent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (sextent[n] <= 0)
+       {
+         sempty = 1;
+         sextent[n] = 0;
+       }
+
+      if (ssize == sstride[n])
+        ssize *= sextent[n];
+      else
+        ssize = 0;
+    }
+
+  if (rsize != 0 && ssize != 0 && psize != 0)
+    {
+      rsize *= sizeof ('rtype_name`);
+      ssize *= sizeof ('rtype_name`);
+      psize *= sizeof ('rtype_name`);
+      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
+                     ssize, pad ? (char *)pad->data : NULL, psize);
+      return;
+    }
+  rptr = ret->data;
+  src = sptr = source->data;
+  rstride0 = rstride[0];
+  sstride0 = sstride[0];
+
+  if (sempty && pempty)
+    abort ();
+
+  if (sempty)
+    {
+      /* Pretend we are using the pad array the first time around, too.  */
+      src = pptr;
+      sptr = pptr;
+      sdim = pdim;
+      for (dim = 0; dim < pdim; dim++)
+       {
+         scount[dim] = pcount[dim];
+         sextent[dim] = pextent[dim];
+         sstride[dim] = pstride[dim];
+         sstride0 = pstride[0];
+       }
+    }
+
+  while (rptr)
+    {
+      /* Select between the source and pad arrays.  */
+      *rptr = *src;
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      src += sstride0;
+      rcount[0]++;
+      scount[0]++;
+
+      /* Advance to the next destination element.  */
+      n = 0;
+      while (rcount[n] == rextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          rcount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * rextent[n];
+          n++;
+          if (n == rdim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              rcount[n]++;
+              rptr += rstride[n];
+            }
+        }
+      /* Advance to the next source element.  */
+      n = 0;
+      while (scount[n] == sextent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          scount[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= sstride[n] * sextent[n];
+          n++;
+          if (n == sdim)
+            {
+              if (sptr && pad)
+                {
+                  /* Switch to the pad array.  */
+                  sptr = NULL;
+                  sdim = pdim;
+                  for (dim = 0; dim < pdim; dim++)
+                    {
+                      scount[dim] = pcount[dim];
+                      sextent[dim] = pextent[dim];
+                      sstride[dim] = pstride[dim];
+                      sstride0 = sstride[0];
+                    }
+                }
+              /* We now start again from the beginning of the pad array.  */
+              src = pptr;
+              break;
+            }
+          else
+            {
+              scount[n]++;
+              src += sstride[n];
+            }
+        }
+    }
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/rrspacing.m4 b/l4/pkg/libgfortran/lib/contrib/m4/rrspacing.m4
new file mode 100644 (file)
index 0000000..5f11d5b
--- /dev/null
@@ -0,0 +1,54 @@
+`/* Implementation of the RRSPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"'
+
+include(`mtype.m4')dnl
+
+mathfunc_macro
+
+`#if defined (HAVE_'real_type`) && 'hasmathfunc(fabs) && hasmathfunc(frexp)`
+
+extern 'real_type` rrspacing_r'kind` ('real_type` s, int p);
+export_proto(rrspacing_r'kind`);
+
+'real_type`
+rrspacing_r'kind` ('real_type` s, int p)
+{
+  int e;
+  'real_type` x;
+  x = MATHFUNC(fabs) (s);
+  if (x == 0.)
+    return 0.;
+  MATHFUNC(frexp) (s, &e);
+#if 'hasmathfunc(ldexp)`
+  return MATHFUNC(ldexp) (x, p - e);
+#else
+  return MATHFUNC(scalbn) (x, p - e);
+#endif
+
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/set_exponent.m4 b/l4/pkg/libgfortran/lib/contrib/m4/set_exponent.m4
new file mode 100644 (file)
index 0000000..5f31ab6
--- /dev/null
@@ -0,0 +1,44 @@
+`/* Implementation of the SET_EXPONENT intrinsic
+   Copyright 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"'
+
+include(`mtype.m4')dnl
+
+mathfunc_macro
+
+`#if defined (HAVE_'real_type`) && 'hasmathfunc(scalbn) && hasmathfunc(frexp)`
+
+extern 'real_type` set_exponent_r'kind` ('real_type` s, GFC_INTEGER_4 i);
+export_proto(set_exponent_r'kind`);
+
+'real_type`
+set_exponent_r'kind` ('real_type` s, GFC_INTEGER_4 i)
+{
+  int dummy_exp;
+  return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/shape.m4 b/l4/pkg/libgfortran/lib/contrib/m4/shape.m4
new file mode 100644 (file)
index 0000000..c079cca
--- /dev/null
@@ -0,0 +1,68 @@
+`/* Implementation of the SHAPE intrinsic
+   Copyright 2002, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+extern void shape_'rtype_kind` ('rtype` * const restrict ret, 
+       const 'rtype` * const restrict array);
+export_proto(shape_'rtype_kind`);
+
+void
+shape_'rtype_kind` ('rtype` * const restrict ret, 
+       const 'rtype` * const restrict array)
+{
+  int n;
+  index_type stride;
+  index_type extent;
+  int rank;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+
+  if (ret->data == NULL)
+    {
+      GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
+      ret->offset = 0;
+      ret->data = internal_malloc_size (sizeof ('rtype_name`) * rank);
+    }
+
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
+    return;
+
+  for (n = 0; n < rank; n++)
+    {
+      extent = GFC_DESCRIPTOR_EXTENT(array,n);
+      ret->data[n * stride] = extent > 0 ? extent : 0 ;
+    }
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/spacing.m4 b/l4/pkg/libgfortran/lib/contrib/m4/spacing.m4
new file mode 100644 (file)
index 0000000..faae6d1
--- /dev/null
@@ -0,0 +1,53 @@
+`/* Implementation of the SPACING intrinsic
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"'
+
+include(`mtype.m4')dnl
+
+mathfunc_macro
+
+`#if defined (HAVE_'real_type`) && 'hasmathfunc(frexp)`
+
+extern 'real_type` spacing_r'kind` ('real_type` s, int p, int emin, 'real_type` tiny);
+export_proto(spacing_r'kind`);
+
+'real_type`
+spacing_r'kind` ('real_type` s, int p, int emin, 'real_type` tiny)
+{
+  int e;
+  if (s == 0.)
+    return tiny;
+  MATHFUNC(frexp) (s, &e);
+  e = e - p;
+  e = e > emin ? e : emin;
+#if 'hasmathfunc(ldexp)`
+  return MATHFUNC(ldexp) (1., e);
+#else
+  return MATHFUNC(scalbn) (1., e);
+#endif
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/specific.m4 b/l4/pkg/libgfortran/lib/contrib/m4/specific.m4
new file mode 100644 (file)
index 0000000..ebc8983
--- /dev/null
@@ -0,0 +1,43 @@
+include(head.m4)
+define(atype_code,regexp(file,`_\([ircl][0-9]+\).[fF]90',`\1'))dnl
+define(atype_letter,substr(atype_code, 0, 1))dnl
+define(atype_kind,substr(atype_code, 1))dnl
+define(get_typename2, `$1 (kind=$2)')dnl
+define(get_typename, `get_typename2(ifelse($1,i,integer,ifelse($1,r,real,ifelse($1,l,logical,ifelse($1,c,complex,unknown)))),`$2')')dnl
+define(atype_name, get_typename(atype_letter,atype_kind))dnl
+define(name, regexp(regexp(file, `[^/]*$', `\&'), `^_\([^_]*\)_', `\1'))dnl
+define(rtype_name,get_typename(ifelse(name,abs,ifelse(atype_letter,c,r,atype_letter),ifelse(name,aimag,ifelse(atype_letter,c,r,atype_letter),atype_letter)),atype_kind))dnl
+define(function_name,ifelse(name,conjg,`_gfortran_specific__conjg_'atype_kind,`_gfortran_specific__'name`_'atype_code))dnl
+
+define(type,ifelse(atype_letter,l,LOGICAL,ifelse(atype_letter,i,INTEGER,ifelse(atype_letter,r,REAL,ifelse(atype_letter,c,COMPLEX,UNKNOW)))))dnl
+define(Q,ifelse(atype_kind,4,F,ifelse(atype_kind,8,`',ifelse(atype_kind,10,L,ifelse(atype_kind,16,L,`_'atype_kind)))))dnl
+
+dnl A few specifics require a function other than their name, or
+dnl nothing. The list is currently:
+dnl    - integer and logical specifics require no libm function
+dnl    - AINT requires the trunc() family functions
+dnl    - ANINT requires round()
+dnl    - AIMAG, CONJG, DIM, SIGN require no libm function
+define(needed,ifelse(atype_letter,i,`none',ifelse(atype_letter,l,`none',ifelse(name,aint,trunc,ifelse(name,anint,round,ifelse(name,aimag,none,ifelse(name,conjg,none,ifelse(name,dim,none,ifelse(name,sign,none,ifelse(name,abs,fabs,name))))))))))dnl
+define(prefix,ifelse(atype_letter,c,C,`'))dnl
+
+dnl Special case for fabs, for which the corresponding complex function
+dnl is not cfabs but cabs.
+define(NEEDED,translit(ifelse(prefix`'needed,`Cfabs',`abs',needed),`a-z',`A-Z'))dnl
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+`#if defined (HAVE_GFC_'type`_'atype_kind`)'
+ifelse(NEEDED,NONE,`',`#ifdef HAVE_'prefix`'NEEDED`'Q)
+
+elemental function function_name (parm)
+   atype_name, intent (in) :: parm
+   rtype_name :: function_name
+
+   function_name = name (parm)
+end function
+
+ifelse(NEEDED,NONE,`',`#endif')
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/specific2.m4 b/l4/pkg/libgfortran/lib/contrib/m4/specific2.m4
new file mode 100644 (file)
index 0000000..d05e8db
--- /dev/null
@@ -0,0 +1,30 @@
+include(head.m4)
+define(atype_code,regexp(file,`_\([ircl][0-9]+\).[fF]90',`\1'))dnl
+define(atype_letter,substr(atype_code, 0, 1))dnl
+define(atype_kind,substr(atype_code, 1))dnl
+define(get_typename2, `$1 (kind=$2)')dnl
+define(get_typename, `get_typename2(ifelse($1,i,integer,ifelse($1,r,real,ifelse($1,l,logical,ifelse($1,c,complex,unknown)))),`$2')')dnl
+define(atype_name, get_typename(atype_letter,atype_kind))dnl
+define(name, regexp(regexp(file, `[^/]*$', `\&'), `^_\([^_]*\)_', `\1'))dnl
+define(function_name,`_gfortran_specific__'name`_'atype_code)dnl
+
+define(Q,ifelse(atype_kind,4,F,ifelse(atype_kind,8,`',ifelse(atype_kind,10,L,ifelse(atype_kind,16,L,`_'atype_kind)))))dnl
+
+#include "config.h"
+#include "kinds.inc"
+#include "c99_protos.inc"
+
+`#if defined (HAVE_GFC_'ifelse(atype_letter,l,LOGICAL,ifelse(atype_letter,i,INTEGER,ifelse(atype_letter,r,REAL,ifelse(atype_letter,c,COMPLEX,UNKNOW))))`_'atype_kind`)'
+
+ifelse(name,atan2,`#ifdef HAVE_ATAN2'Q,)
+
+elemental function function_name (p1, p2)
+   atype_name, intent (in) :: p1, p2
+   atype_name :: function_name
+
+   function_name = name (p1, p2)
+end function
+
+ifelse(name,atan2,`#endif',)
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/spread.m4 b/l4/pkg/libgfortran/lib/contrib/m4/spread.m4
new file mode 100644 (file)
index 0000000..89a2e65
--- /dev/null
@@ -0,0 +1,270 @@
+`/* Special implementation of the SPREAD intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   spread_generic.c written by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+void
+spread_'rtype_code` ('rtype` *ret, const 'rtype` *source,
+                const index_type along, const index_type pncopies)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rdelta = 0;
+  index_type rrank;
+  index_type rs;
+  'rtype_name` *rptr;
+  'rtype_name` * restrict dest;
+  /* s.* indicates the source array.  */
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type sstride0;
+  index_type srank;
+  const 'rtype_name` *sptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+  index_type ncopies;
+
+  srank = GFC_DESCRIPTOR_RANK(source);
+
+  rrank = srank + 1;
+  if (rrank > GFC_MAX_DIMENSIONS)
+    runtime_error ("return rank too large in spread()");
+
+  if (along > rrank)
+      runtime_error ("dim outside of rank in spread()");
+
+  ncopies = pncopies;
+
+  if (ret->data == NULL)
+    {
+
+      size_t ub, stride;
+
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      dim = 0;
+      rs = 1;
+      for (n = 0; n < rrank; n++)
+       {
+         stride = rs;
+         if (n == along - 1)
+           {
+             ub = ncopies - 1;
+             rdelta = rs;
+             rs *= ncopies;
+           }
+         else
+           {
+             count[dim] = 0;
+             extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+             sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+             rstride[dim] = rs;
+
+             ub = extent[dim] - 1;
+             rs *= extent[dim];
+             dim++;
+           }
+         GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
+       }
+      ret->offset = 0;
+
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (rs * sizeof('rtype_name`));
+      if (rs <= 0)
+        return;
+    }
+  else
+    {
+      int zero_sized;
+
+      zero_sized = 0;
+
+      dim = 0;
+      if (GFC_DESCRIPTOR_RANK(ret) != rrank)
+       runtime_error ("rank mismatch in spread()");
+
+      if (unlikely (compile_options.bounds_check))
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             index_type ret_extent;
+
+             ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n);
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+
+                 if (ret_extent != ncopies)
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (ret_extent != extent[dim])
+                   runtime_error("Incorrect extent in return value of SPREAD"
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
+                                 (long int) extent[dim]);
+                   
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+      else
+       {
+         for (n = 0; n < rrank; n++)
+           {
+             if (n == along - 1)
+               {
+                 rdelta = GFC_DESCRIPTOR_STRIDE(ret,n);
+               }
+             else
+               {
+                 count[dim] = 0;
+                 extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
+                 if (extent[dim] <= 0)
+                   zero_sized = 1;
+                 sstride[dim] = GFC_DESCRIPTOR_STRIDE(source,dim);
+                 rstride[dim] = GFC_DESCRIPTOR_STRIDE(ret,n);
+                 dim++;
+               }
+           }
+       }
+
+      if (zero_sized)
+       return;
+
+      if (sstride[0] == 0)
+       sstride[0] = 1;
+    }
+  sstride0 = sstride[0];
+  rstride0 = rstride[0];
+  rptr = ret->data;
+  sptr = source->data;
+
+  while (sptr)
+    {
+      /* Spread this element.  */
+      dest = rptr;
+      for (n = 0; n < ncopies; n++)
+        {
+         *dest = *sptr;
+          dest += rdelta;
+        }
+      /* Advance to the next element.  */
+      sptr += sstride0;
+      rptr += rstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          sptr -= sstride[n] * extent[n];
+          rptr -= rstride[n] * extent[n];
+          n++;
+          if (n >= srank)
+            {
+              /* Break out of the loop.  */
+              sptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              sptr += sstride[n];
+              rptr += rstride[n];
+            }
+        }
+    }
+}
+
+/* This version of spread_internal treats the special case of a scalar
+   source.  This is much simpler than the more general case above.  */
+
+void
+spread_scalar_'rtype_code` ('rtype` *ret, const 'rtype_name` *source,
+                       const index_type along, const index_type pncopies)
+{
+  int n;
+  int ncopies = pncopies;
+  'rtype_name` * restrict dest;
+  index_type stride;
+
+  if (GFC_DESCRIPTOR_RANK (ret) != 1)
+    runtime_error ("incorrect destination rank in spread()");
+
+  if (along > 1)
+    runtime_error ("dim outside of rank in spread()");
+
+  if (ret->data == NULL)
+    {
+      ret->data = internal_malloc_size (ncopies * sizeof ('rtype_name`));
+      ret->offset = 0;
+      GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
+    }
+  else
+    {
+      if (ncopies - 1 > (GFC_DESCRIPTOR_EXTENT(ret,0) - 1)
+                          / GFC_DESCRIPTOR_STRIDE(ret,0))
+       runtime_error ("dim too large in spread()");
+    }
+
+  dest = ret->data;
+  stride = GFC_DESCRIPTOR_STRIDE(ret,0);
+
+  for (n = 0; n < ncopies; n++)
+    {
+      *dest = *source;
+      dest += stride;
+    }
+}
+
+#endif
+'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/sum.m4 b/l4/pkg/libgfortran/lib/contrib/m4/sum.m4
new file mode 100644 (file)
index 0000000..b502c6e
--- /dev/null
@@ -0,0 +1,46 @@
+`/* Implementation of the SUM intrinsic
+   Copyright 2002, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>'
+
+include(iparm.m4)dnl
+include(ifunction.m4)dnl
+
+`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
+
+ARRAY_FUNCTION(0,
+`  result = 0;',
+`  result += *src;')
+
+MASKED_ARRAY_FUNCTION(0,
+`  result = 0;',
+`  if (*msrc)
+    result += *src;')
+
+SCALAR_ARRAY_FUNCTION(0)
+
+#endif
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/transpose.m4 b/l4/pkg/libgfortran/lib/contrib/m4/transpose.m4
new file mode 100644 (file)
index 0000000..34c2d6c
--- /dev/null
@@ -0,0 +1,115 @@
+`/* Implementation of the TRANSPOSE intrinsic
+   Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Tobias Schlüter
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+extern void transpose_'rtype_code` ('rtype` * const restrict ret, 
+       'rtype` * const restrict source);
+export_proto(transpose_'rtype_code`);
+
+void
+transpose_'rtype_code` ('rtype` * const restrict ret, 
+       'rtype` * const restrict source)
+{
+  /* r.* indicates the return array.  */
+  index_type rxstride, rystride;
+  'rtype_name` * restrict rptr;
+  /* s.* indicates the source array.  */
+  index_type sxstride, systride;
+  const 'rtype_name` *sptr;
+
+  index_type xcount, ycount;
+  index_type x, y;
+
+  assert (GFC_DESCRIPTOR_RANK (source) == 2);
+
+  if (ret->data == NULL)
+    {
+      assert (GFC_DESCRIPTOR_RANK (ret) == 2);
+      assert (ret->dtype == source->dtype);
+
+      GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
+                       1);
+
+      GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
+                       GFC_DESCRIPTOR_EXTENT(source, 1));
+
+      ret->data = internal_malloc_size (sizeof ('rtype_name`) * size0 ((array_t *) ret));
+      ret->offset = 0;
+    } else if (unlikely (compile_options.bounds_check))
+    {
+      index_type ret_extent, src_extent;
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 1: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+      ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
+      src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
+
+      if (src_extent != ret_extent)
+       runtime_error ("Incorrect extent in return value of TRANSPOSE"
+                      " intrinsic in dimension 2: is %ld,"
+                      " should be %ld", (long int) src_extent,
+                      (long int) ret_extent);
+
+    }
+
+  sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
+  systride = GFC_DESCRIPTOR_STRIDE(source,1);
+  xcount = GFC_DESCRIPTOR_EXTENT(source,0);
+  ycount = GFC_DESCRIPTOR_EXTENT(source,1);
+
+  rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
+  rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
+
+  rptr = ret->data;
+  sptr = source->data;
+
+  for (y=0; y < ycount; y++)
+    {
+      for (x=0; x < xcount; x++)
+        {
+          *rptr = *sptr;
+
+          sptr += sxstride;
+          rptr += rystride;
+        }
+        sptr += systride - (sxstride * xcount);
+        rptr += rxstride - (rystride * xcount);
+    }
+}
+
+#endif'
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/types.m4 b/l4/pkg/libgfortran/lib/contrib/m4/types.m4
new file mode 100644 (file)
index 0000000..cb80829
--- /dev/null
@@ -0,0 +1,4 @@
+define(get_typename2, `GFC_$1_$2')dnl
+define(get_typename, `get_typename2(ifelse($1,i,INTEGER,ifelse($1,r,REAL,ifelse($1,l,LOGICAL,ifelse($1,c,COMPLEX,unknown)))),`$2')')dnl
+define(get_arraytype, `gfc_array_$1$2')dnl
+define(name, regexp(regexp(file, `[^/]*$', `\&'), `^\([^_]*\)_', `\1'))dnl
diff --git a/l4/pkg/libgfortran/lib/contrib/m4/unpack.m4 b/l4/pkg/libgfortran/lib/contrib/m4/unpack.m4
new file mode 100644 (file)
index 0000000..bf348ae
--- /dev/null
@@ -0,0 +1,332 @@
+`/* Specific implementation of the UNPACK intrinsic
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
+   unpack_generic.c by Paul Brook <paul@nowt.org>.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Ligbfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+void
+unpack0_'rtype_code` ('rtype` *ret, const 'rtype` *vector,
+                const gfc_array_l1 *mask, const 'rtype_name` *fptr)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  'rtype_name` * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  'rtype_name` *vptr;
+  /* Value for field, this is constant.  */
+  const 'rtype_name` fval = *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof ('rtype_name`));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+         /* From vector.  */
+         *rptr = *vptr;
+         vptr += vstride0;
+        }
+      else
+        {
+         /* From field.  */
+         *rptr = fval;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+void
+unpack1_'rtype_code` ('rtype` *ret, const 'rtype` *vector,
+                const gfc_array_l1 *mask, const 'rtype` *field)
+{
+  /* r.* indicates the return array.  */
+  index_type rstride[GFC_MAX_DIMENSIONS];
+  index_type rstride0;
+  index_type rs;
+  'rtype_name` * restrict rptr;
+  /* v.* indicates the vector array.  */
+  index_type vstride0;
+  'rtype_name` *vptr;
+  /* f.* indicates the field array.  */
+  index_type fstride[GFC_MAX_DIMENSIONS];
+  index_type fstride0;
+  const 'rtype_name` *fptr;
+  /* m.* indicates the mask array.  */
+  index_type mstride[GFC_MAX_DIMENSIONS];
+  index_type mstride0;
+  const GFC_LOGICAL_1 *mptr;
+
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type n;
+  index_type dim;
+
+  int empty;
+  int mask_kind;
+
+  empty = 0;
+
+  mptr = mask->data;
+
+  /* Use the same loop for all logical types, by using GFC_LOGICAL_1
+     and using shifting to address size and endian issues.  */
+
+  mask_kind = GFC_DESCRIPTOR_SIZE (mask);
+
+  if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || mask_kind == 16
+#endif
+      )
+    {
+      /*  Do not convert a NULL pointer as we use test for NULL below.  */
+      if (mptr)
+       mptr = GFOR_POINTER_TO_L1 (mptr, mask_kind);
+    }
+  else
+    runtime_error ("Funny sized logical array");
+
+  if (ret->data == NULL)
+    {
+      /* The front end has signalled that we need to populate the
+        return array descriptor.  */
+      dim = GFC_DESCRIPTOR_RANK (mask);
+      rs = 1;
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         GFC_DIMENSION_SET(ret->dim[n], 0,
+                           GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs);
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+         rs *= extent[n];
+       }
+      ret->offset = 0;
+      ret->data = internal_malloc_size (rs * sizeof ('rtype_name`));
+    }
+  else
+    {
+      dim = GFC_DESCRIPTOR_RANK (ret);
+      for (n = 0; n < dim; n++)
+       {
+         count[n] = 0;
+         extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n);
+         empty = empty || extent[n] <= 0;
+         rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
+         fstride[n] = GFC_DESCRIPTOR_STRIDE(field,n);
+         mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
+       }
+      if (rstride[0] == 0)
+       rstride[0] = 1;
+    }
+
+  if (empty)
+    return;
+
+  if (fstride[0] == 0)
+    fstride[0] = 1;
+  if (mstride[0] == 0)
+    mstride[0] = 1;
+
+  vstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
+  if (vstride0 == 0)
+    vstride0 = 1;
+  rstride0 = rstride[0];
+  fstride0 = fstride[0];
+  mstride0 = mstride[0];
+  rptr = ret->data;
+  fptr = field->data;
+  vptr = vector->data;
+
+  while (rptr)
+    {
+      if (*mptr)
+        {
+          /* From vector.  */
+         *rptr = *vptr;
+          vptr += vstride0;
+        }
+      else
+        {
+          /* From field.  */
+         *rptr = *fptr;
+        }
+      /* Advance to the next element.  */
+      rptr += rstride0;
+      fptr += fstride0;
+      mptr += mstride0;
+      count[0]++;
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          rptr -= rstride[n] * extent[n];
+          fptr -= fstride[n] * extent[n];
+          mptr -= mstride[n] * extent[n];
+          n++;
+          if (n >= dim)
+            {
+              /* Break out of the loop.  */
+              rptr = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              rptr += rstride[n];
+              fptr += fstride[n];
+              mptr += mstride[n];
+            }
+        }
+    }
+}
+
+#endif
+'
diff --git a/l4/pkg/libgfortran/lib/contrib/mk-kinds-h.sh b/l4/pkg/libgfortran/lib/contrib/mk-kinds-h.sh
new file mode 100755 (executable)
index 0000000..98a95ab
--- /dev/null
@@ -0,0 +1,119 @@
+#!/bin/sh
+LC_ALL=C
+export LC_ALL
+
+compile="$1"
+
+# Possible types must be listed in ascending order
+possible_integer_kinds="1 2 4 8 16"
+possible_real_kinds="4 8 10 16"
+
+
+largest=""
+smallest=""
+for k in $possible_integer_kinds; do
+  echo "  integer (kind=$k) :: i" > tmp$$.f90
+  echo "  i = 1_$k" >> tmp$$.f90
+  echo "  end" >> tmp$$.f90
+  if $compile -S tmp$$.f90 > /dev/null 2>&1; then
+    s=`expr 8 \* $k`
+    largest="$k"
+
+    if [ $s -eq 128 ]; then
+      prefix="__"
+    else
+      prefix=""
+    fi
+
+    if [ "$smallest" = "" ]; then
+       smallest="$k"
+    fi
+
+    echo "typedef ${prefix}int${s}_t GFC_INTEGER_${k};"
+    echo "typedef ${prefix}uint${s}_t GFC_UINTEGER_${k};"
+    echo "typedef GFC_INTEGER_${k} GFC_LOGICAL_${k};"
+    echo "#define HAVE_GFC_LOGICAL_${k}"
+    echo "#define HAVE_GFC_INTEGER_${k}"
+    echo ""
+  fi
+  rm -f tmp$$.*
+done
+
+echo "#define GFC_INTEGER_LARGEST GFC_INTEGER_${largest}"
+echo "#define GFC_UINTEGER_LARGEST GFC_UINTEGER_${largest}"
+echo "#define GFC_DEFAULT_CHAR ${smallest}"
+echo ""
+
+
+# Get the kind value for long double, so we may disambiguate it
+# from __float128.
+echo "use iso_c_binding; print *, c_long_double ; end" > tmq$$.f90
+long_double_kind=`$compile -S -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
+                       | sed 's/ *TRANSFER *//'`
+rm -f tmq$$.*
+
+
+for k in $possible_real_kinds; do
+  echo "  real (kind=$k) :: x" > tmp$$.f90
+  echo "  x = 1.0_$k" >> tmp$$.f90
+  echo "  end" >> tmp$$.f90
+  if $compile -S tmp$$.f90 > /dev/null 2>&1; then
+    case $k in
+      4) ctype="float" ; cplxtype="complex float" ; suffix="f" ;;
+      8) ctype="double" ; cplxtype="complex double" ; suffix="" ;;
+      10) ctype="long double" ; cplxtype="complex long double" ; suffix="l" ;;
+      16) if [ $long_double_kind -eq 10 ]; then
+           ctype="__float128"
+           cplxtype="_Complex float __attribute__((mode(TC)))"
+           suffix="q"
+         else
+           ctype="long double"
+           cplxtype="complex long double"
+           suffix="l"
+         fi ;;
+      *) echo "$0: Unknown type" >&2 ; exit 1 ;;
+    esac
+
+    # Check for the value of HUGE
+    echo "print *, huge(0._$k) ; end" > tmq$$.f90
+    huge=`$compile -S -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
+               | sed 's/ *TRANSFER *//' | sed 's/_.*//'`
+    rm -f tmq$$.*
+
+    # Check for the value of DIGITS
+    echo "print *, digits(0._$k) ; end" > tmq$$.f90
+    digits=`$compile -S -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
+               | sed 's/ *TRANSFER *//'`
+    rm -f tmq$$.*
+
+    # Check for the value of RADIX
+    echo "print *, radix(0._$k) ; end" > tmq$$.f90
+    radix=`$compile -S -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
+               | sed 's/ *TRANSFER *//'`
+    rm -f tmq$$.*
+
+    # Output the information we've gathered
+    echo "typedef ${ctype} GFC_REAL_${k};"
+    echo "typedef ${cplxtype} GFC_COMPLEX_${k};"
+    echo "#define HAVE_GFC_REAL_${k}"
+    echo "#define HAVE_GFC_COMPLEX_${k}"
+    echo "#define GFC_REAL_${k}_HUGE ${huge}${suffix}"
+    echo "#define GFC_REAL_${k}_LITERAL_SUFFIX ${suffix}"
+    if [ "x$suffix" = "x" ]; then
+      echo "#define GFC_REAL_${k}_LITERAL(X) (X)"
+    else
+      echo "#define GFC_REAL_${k}_LITERAL(X) (X ## ${suffix})"
+    fi
+    echo "#define GFC_REAL_${k}_DIGITS ${digits}"
+    echo "#define GFC_REAL_${k}_RADIX ${radix}"
+    echo ""
+  fi
+  rm -f tmp$$.*
+done
+
+
+# After this, we include a header that can override some of the 
+# autodetected settings.
+echo '#include "kinds-override.h"'
+
+exit 0
diff --git a/l4/pkg/libgfortran/lib/contrib/mk-sik-inc.sh b/l4/pkg/libgfortran/lib/contrib/mk-sik-inc.sh
new file mode 100755 (executable)
index 0000000..68c042f
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+compile="$1"
+kinds=""
+possible_kinds="1 2 4 8 16"
+c=0
+
+for k in $possible_kinds; do
+  echo "  integer (kind=$k) :: x" > tmp$$.f90
+  echo "  x = 1_$k" >> tmp$$.f90
+  echo "  end" >> tmp$$.f90
+  if $compile -S tmp$$.f90 > /dev/null 2>&1; then
+    kinds="$kinds $k"
+    c=`expr $c + 1`
+  fi
+  rm -f tmp$$.*
+done
+
+echo "  integer, parameter :: c = $c"
+echo "  type (int_info), parameter :: int_infos(c) = (/ &"
+
+i=0
+for k in $kinds; do
+  # echo -n is not portable
+  str="    int_info ($k, range(0_$k))"
+  i=`expr $i + 1`
+  if [ $i -lt $c ]; then
+    echo "$str, &"
+  else
+    echo "$str /)"
+  fi
+done
+
+exit 0
diff --git a/l4/pkg/libgfortran/lib/contrib/mk-srk-inc.sh b/l4/pkg/libgfortran/lib/contrib/mk-srk-inc.sh
new file mode 100755 (executable)
index 0000000..402441c
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+compile="$1"
+kinds=""
+possible_kinds="4 8 10 16"
+c=0
+
+for k in $possible_kinds; do
+  echo "  real (kind=$k) :: x" > tmp$$.f90
+  echo "  x = 1.0_$k" >> tmp$$.f90
+  echo "  end" >> tmp$$.f90
+  if $compile -S tmp$$.f90 > /dev/null 2>&1; then
+    kinds="$kinds $k"
+    c=`expr $c + 1`
+  fi
+  rm -f tmp$$.*
+done
+
+echo "  integer, parameter :: c = $c"
+echo "  type (real_info), parameter :: real_infos(c) = (/ &"
+
+i=0
+for k in $kinds; do
+  # echo -n is not portable
+  str="    real_info ($k, precision(0.0_$k), range(0.0_$k), radix(0.0_$k))"
+  i=`expr $i + 1`
+  if [ $i -lt $c ]; then
+    echo "$str, &"
+  else
+    echo "$str /)"
+  fi
+done
+
+exit 0
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/backtrace.c b/l4/pkg/libgfortran/lib/contrib/runtime/backtrace.c
new file mode 100644 (file)
index 0000000..6bfc560
--- /dev/null
@@ -0,0 +1,279 @@
+/* Copyright (C) 2006, 2007, 2009, 2011, 2012 Free Software Foundation, Inc.
+   Contributed by François-Xavier Coudert
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#include <limits.h>
+
+#include "unwind.h"
+
+
+/* Macros for common sets of capabilities: can we fork and exec, and
+   can we use pipes to communicate with the subprocess.  */
+#define CAN_FORK (defined(HAVE_FORK) && defined(HAVE_EXECVE) \
+                 && defined(HAVE_WAIT))
+#define CAN_PIPE (CAN_FORK && defined(HAVE_PIPE) \
+                 && defined(HAVE_DUP2) && defined(HAVE_CLOSE))
+
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
+
+/* GDB style #NUM index for each stack frame.  */
+
+static void 
+bt_header (int num)
+{
+  st_printf ("#%d  ", num);
+}
+
+
+/* fgets()-like function that reads a line from a fd, without
+   needing to malloc() a buffer, and does not use locks, hence should
+   be async-signal-safe.  */
+
+static char *
+fd_gets (char *s, int size, int fd)
+{
+  for (int i = 0; i < size; i++)
+    {
+      char c;
+      ssize_t nread = read (fd, &c, 1);
+      if (nread == 1)
+       {
+         s[i] = c;
+         if (c == '\n')
+           {
+             if (i + 1 < size)
+               s[i+1] = '\0';
+             else
+               s[i] = '\0';
+             break;
+           }
+       }
+      else
+       {
+         s[i] = '\0';
+         if (i == 0)
+           return NULL;
+         break;
+       }
+    }
+  return s;
+}
+
+
+extern char *addr2line_path;
+
+/* Struct containing backtrace state.  */
+typedef struct
+{
+  int frame_number;
+  int direct_output;
+  int outfd;
+  int infd;
+  int error;
+}
+bt_state;
+
+static _Unwind_Reason_Code
+trace_function (struct _Unwind_Context *context, void *state_ptr)
+{
+  bt_state* state = (bt_state*) state_ptr;
+  _Unwind_Ptr ip;
+#ifdef HAVE_GETIPINFO
+  int ip_before_insn = 0;
+  ip = _Unwind_GetIPInfo (context, &ip_before_insn);
+  
+  /* If the unwinder gave us a 'return' address, roll it back a little
+     to ensure we get the correct line number for the call itself.  */
+  if (! ip_before_insn)
+    --ip;
+#else  
+  ip = _Unwind_GetIP (context);
+#endif
+
+  if (state->direct_output)
+    {
+      bt_header(state->frame_number);
+      st_printf ("%p\n", (void*) ip);
+    }
+  else
+    {
+      char addr_buf[GFC_XTOA_BUF_SIZE], func[1024], file[PATH_MAX];
+      char *p;
+      const char* addr = gfc_xtoa (ip, addr_buf, sizeof (addr_buf));
+      write (state->outfd, addr, strlen (addr));
+      write (state->outfd, "\n", 1);
+
+      if (! fd_gets (func, sizeof(func), state->infd))
+       {
+         state->error = 1;
+         goto done;
+       }
+      if (! fd_gets (file, sizeof(file), state->infd))
+       {
+         state->error = 1;
+         goto done;
+       }
+           
+       for (p = func; *p != '\n' && *p != '\r'; p++)
+         ;
+       *p = '\0';
+       
+       /* _start is a setup routine that calls main(), and main() is
+          the frontend routine that calls some setup stuff and then
+          calls MAIN__, so at this point we should stop.  */
+       if (strcmp (func, "_start") == 0 || strcmp (func, "main") == 0)
+         return _URC_END_OF_STACK;
+       
+       bt_header (state->frame_number);
+       estr_write ("0x");
+       estr_write (addr);
+
+       if (func[0] != '?' && func[1] != '?')
+         {
+           estr_write (" in ");
+           estr_write (func);
+         }
+       
+       if (strncmp (file, "??", 2) == 0)
+         estr_write ("\n");
+       else
+         {
+           estr_write (" at ");
+           estr_write (file);
+         }
+    }
+
+ done:
+
+  state->frame_number++;
+  
+  return _URC_NO_REASON;
+}
+
+
+/* Display the backtrace.  */
+
+void
+show_backtrace (void)
+{
+  bt_state state;
+  state.frame_number = 0;
+  state.error = 0;
+
+  estr_write ("\nBacktrace for this error:\n");
+
+#if CAN_PIPE
+
+  if (addr2line_path == NULL)
+    goto fallback_noerr;
+
+  /* We attempt to extract file and line information from addr2line.  */
+  do
+  {
+    /* Local variables.  */
+    int f[2], pid, inp[2];
+
+    /* Don't output an error message if something goes wrong, we'll simply
+       fall back to printing the addresses.  */
+    if (pipe (f) != 0)
+      break;
+    if (pipe (inp) != 0)
+      break;
+    if ((pid = fork ()) == -1)
+      break;
+
+    if (pid == 0)
+      {
+       /* Child process.  */
+#define NUM_FIXEDARGS 7
+       char *arg[NUM_FIXEDARGS];
+       char *newenv[] = { NULL };
+
+       close (f[0]);
+
+       close (inp[1]);
+       if (dup2 (inp[0], STDIN_FILENO) == -1)
+         _exit (1);
+       close (inp[0]);
+
+       close (STDERR_FILENO);
+
+       if (dup2 (f[1], STDOUT_FILENO) == -1)
+         _exit (1);
+       close (f[1]);
+
+       arg[0] = addr2line_path;
+       arg[1] = (char *) "-e";
+       arg[2] = full_exe_path ();
+       arg[3] = (char *) "-f";
+       arg[4] = (char *) "-s";
+       arg[5] = (char *) "-C";
+       arg[6] = NULL;
+       execve (addr2line_path, arg, newenv);
+       _exit (1);
+#undef NUM_FIXEDARGS
+      }
+
+    /* Father process.  */
+    close (f[1]);
+    close (inp[0]);
+
+    state.outfd = inp[1];
+    state.infd = f[0];
+    state.direct_output = 0;
+    _Unwind_Backtrace (trace_function, &state);
+    if (state.error)
+      goto fallback;
+    close (inp[1]);
+    wait (NULL);
+    return;
+
+fallback:
+    estr_write ("** Something went wrong while running addr2line. **\n"
+               "** Falling back to a simpler backtrace scheme. **\n");
+  }
+  while (0);
+
+#endif /* CAN_PIPE */
+
+fallback_noerr:
+  /* Fallback to the simple backtrace without addr2line.  */
+  state.direct_output = 1;
+  _Unwind_Backtrace (trace_function, &state);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/bounds.c b/l4/pkg/libgfortran/lib/contrib/runtime/bounds.c
new file mode 100644 (file)
index 0000000..35bfa1e
--- /dev/null
@@ -0,0 +1,272 @@
+/* Copyright (C) 2009
+   Free Software Foundation, Inc.
+   Contributed by Thomas Koenig
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <assert.h>
+
+/* Auxiliary functions for bounds checking, mostly to reduce library size.  */
+
+/* Bounds checking for the return values of the iforeach functions (such
+   as maxloc and minloc).  The extent of ret_array must
+   must match the rank of array.  */
+
+void
+bounds_iforeach_return (array_t *retarray, array_t *array, const char *name)
+{
+  index_type rank;
+  index_type ret_rank;
+  index_type ret_extent;
+
+  ret_rank = GFC_DESCRIPTOR_RANK (retarray);
+
+  if (ret_rank != 1)
+    runtime_error ("Incorrect rank of return array in %s intrinsic:"
+                  "is %ld, should be 1", name, (long int) ret_rank);
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0);
+  if (ret_extent != rank)
+    runtime_error ("Incorrect extent in return value of"
+                  " %s intrinsic: is %ld, should be %ld",
+                  name, (long int) ret_extent, (long int) rank);
+
+}
+
+/* Check the return of functions generated from ifunction.m4.
+   We check the array descriptor "a" against the extents precomputed
+   from ifunction.m4, and complain about the argument a_name in the
+   intrinsic function. */
+
+void
+bounds_ifunction_return (array_t * a, const index_type * extent,
+                        const char * a_name, const char * intrinsic)
+{
+  int empty;
+  int n;
+  int rank;
+  index_type a_size;
+
+  rank = GFC_DESCRIPTOR_RANK (a);
+  a_size = size0 (a);
+
+  empty = 0;
+  for (n = 0; n < rank; n++)
+    {
+      if (extent[n] == 0)
+       empty = 1;
+    }
+  if (empty)
+    {
+      if (a_size != 0)
+       runtime_error ("Incorrect size in %s of %s"
+                      " intrinsic: should be zero-sized",
+                      a_name, intrinsic);
+    }
+  else
+    {
+      if (a_size == 0)
+       runtime_error ("Incorrect size of %s in %s"
+                      " intrinsic: should not be zero-sized",
+                      a_name, intrinsic);
+
+      for (n = 0; n < rank; n++)
+       {
+         index_type a_extent;
+         a_extent = GFC_DESCRIPTOR_EXTENT(a, n);
+         if (a_extent != extent[n])
+           runtime_error("Incorrect extent in %s of %s"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", a_name, intrinsic, (long int) n + 1,
+                         (long int) a_extent, (long int) extent[n]);
+
+       }
+    }
+}
+
+/* Check that two arrays have equal extents, or are both zero-sized.  Abort
+   with a runtime error if this is not the case.  Complain that a has the
+   wrong size.  */
+
+void
+bounds_equal_extents (array_t *a, array_t *b, const char *a_name,
+                     const char *intrinsic)
+{
+  index_type a_size, b_size, n;
+
+  assert (GFC_DESCRIPTOR_RANK(a) == GFC_DESCRIPTOR_RANK(b));
+
+  a_size = size0 (a);
+  b_size = size0 (b);
+
+  if (b_size == 0)
+    {
+      if (a_size != 0)
+       runtime_error ("Incorrect size of %s in %s"
+                      " intrinsic: should be zero-sized",
+                      a_name, intrinsic);
+    }
+  else
+    {
+      if (a_size == 0) 
+       runtime_error ("Incorrect size of %s of %s"
+                      " intrinsic: Should not be zero-sized",
+                      a_name, intrinsic);
+
+      for (n = 0; n < GFC_DESCRIPTOR_RANK (b); n++)
+       {
+         index_type a_extent, b_extent;
+         
+         a_extent = GFC_DESCRIPTOR_EXTENT(a, n);
+         b_extent = GFC_DESCRIPTOR_EXTENT(b, n);
+         if (a_extent != b_extent)
+           runtime_error("Incorrect extent in %s of %s"
+                         " intrinsic in dimension %ld: is %ld,"
+                         " should be %ld", a_name, intrinsic, (long int) n + 1,
+                         (long int) a_extent, (long int) b_extent);
+       }
+    }
+}
+
+/* Check that the extents of a and b agree, except that a has a missing
+   dimension in argument which.  Complain about a if anything is wrong.  */
+
+void
+bounds_reduced_extents (array_t *a, array_t *b, int which, const char *a_name,
+                     const char *intrinsic)
+{
+
+  index_type i, n, a_size, b_size;
+
+  assert (GFC_DESCRIPTOR_RANK(a) == GFC_DESCRIPTOR_RANK(b) - 1);
+
+  a_size = size0 (a);
+  b_size = size0 (b);
+
+  if (b_size == 0)
+    {
+      if (a_size != 0)
+       runtime_error ("Incorrect size in %s of %s"
+                      " intrinsic: should not be zero-sized",
+                      a_name, intrinsic);
+    }
+  else
+    {
+      if (a_size == 0) 
+       runtime_error ("Incorrect size of %s of %s"
+                      " intrinsic: should be zero-sized",
+                      a_name, intrinsic);
+
+      i = 0;
+      for (n = 0; n < GFC_DESCRIPTOR_RANK (b); n++)
+       {
+         index_type a_extent, b_extent;
+
+         if (n != which)
+           {
+             a_extent = GFC_DESCRIPTOR_EXTENT(a, i);
+             b_extent = GFC_DESCRIPTOR_EXTENT(b, n);
+             if (a_extent != b_extent)
+               runtime_error("Incorrect extent in %s of %s"
+                             " intrinsic in dimension %ld: is %ld,"
+                             " should be %ld", a_name, intrinsic, (long int) i + 1,
+                             (long int) a_extent, (long int) b_extent);
+             i++;
+           }
+       }
+    }
+}
+
+/* count_0 - count all the true elements in an array.  The front
+   end usually inlines this, we need this for bounds checking
+   for unpack.  */
+
+index_type count_0 (const gfc_array_l1 * array)
+{
+  const GFC_LOGICAL_1 * restrict base;
+  index_type rank;
+  int kind;
+  int continue_loop;
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type sstride[GFC_MAX_DIMENSIONS];
+  index_type result;
+  index_type n;
+
+  rank = GFC_DESCRIPTOR_RANK (array);
+  kind = GFC_DESCRIPTOR_SIZE (array);
+
+  base = array->data;
+
+  if (kind == 1 || kind == 2 || kind == 4 || kind == 8
+#ifdef HAVE_GFC_LOGICAL_16
+      || kind == 16
+#endif
+    )
+    {
+      if (base)
+       base = GFOR_POINTER_TO_L1 (base, kind);
+    }
+  else
+    internal_error (NULL, "Funny sized logical array in count_0");
+
+  for (n = 0; n < rank; n++)
+    {
+      sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
+      count[n] = 0;
+
+      if (extent[n] <= 0)
+       return 0;
+    }
+
+  result = 0;
+  continue_loop = 1;
+  while (continue_loop)
+    {
+      if (*base)
+       result ++;
+
+      count[0]++;
+      base += sstride[0];
+      n = 0;
+      while (count[n] == extent[n])
+       {
+         count[n] = 0;
+         base -= sstride[n] * extent[n];
+         n++;
+         if (n == rank)
+           {
+             continue_loop = 0;
+             break;
+           }
+         else
+           {
+             count[n]++;
+             base += sstride[n];
+           }
+       }
+    }
+  return result;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/compile_options.c b/l4/pkg/libgfortran/lib/contrib/runtime/compile_options.c
new file mode 100644 (file)
index 0000000..0e657f7
--- /dev/null
@@ -0,0 +1,277 @@
+/* Handling of compile-time options that influence the library.
+   Copyright (C) 2005, 2007, 2009, 2010, 2011, 2012
+   Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <signal.h>
+
+
+/* Useful compile-time options will be stored in here.  */
+compile_options_t compile_options;
+
+
+volatile sig_atomic_t fatal_error_in_progress = 0;
+
+
+/* Helper function for backtrace_handler to write information about the
+   received signal to stderr before actually giving the backtrace.  */
+static void
+show_signal (int signum)
+{
+  const char * name = NULL, * desc = NULL;
+
+  switch (signum)
+    {
+#if defined(SIGQUIT)
+      case SIGQUIT:
+       name = "SIGQUIT";
+       desc = "Terminal quit signal";
+       break;
+#endif
+
+      /* The following 4 signals are defined by C89.  */
+      case SIGILL:
+       name = "SIGILL";
+       desc = "Illegal instruction";
+       break;
+
+      case SIGABRT:
+       name = "SIGABRT";
+       desc = "Process abort signal";
+       break;
+
+      case SIGFPE:
+       name = "SIGFPE";
+       desc = "Floating-point exception - erroneous arithmetic operation";
+       break;
+
+      case SIGSEGV:
+       name = "SIGSEGV";
+       desc = "Segmentation fault - invalid memory reference";
+       break;
+
+#if defined(SIGBUS)
+      case SIGBUS:
+       name = "SIGBUS";
+       desc = "Access to an undefined portion of a memory object";
+       break;
+#endif
+
+#if defined(SIGSYS)
+      case SIGSYS:
+       name = "SIGSYS";
+       desc = "Bad system call";
+       break;
+#endif
+
+#if defined(SIGTRAP)
+      case SIGTRAP:
+       name = "SIGTRAP";
+       desc = "Trace/breakpoint trap";
+       break;
+#endif
+
+#if defined(SIGXCPU)
+      case SIGXCPU:
+       name = "SIGXCPU";
+       desc = "CPU time limit exceeded";
+       break;
+#endif
+
+#if defined(SIGXFSZ)
+      case SIGXFSZ:
+       name = "SIGXFSZ";
+       desc = "File size limit exceeded";
+       break;
+#endif
+    }
+
+  if (name)
+    st_printf ("\nProgram received signal %s: %s.\n", name, desc);
+  else
+    st_printf ("\nProgram received signal %d.\n", signum);
+}
+
+
+/* A signal handler to allow us to output a backtrace.  */
+void
+backtrace_handler (int signum)
+{
+  /* Since this handler is established for more than one kind of signal, 
+     it might still get invoked recursively by delivery of some other kind
+     of signal.  Use a static variable to keep track of that. */
+  if (fatal_error_in_progress)
+    raise (signum);
+  fatal_error_in_progress = 1;
+
+  show_signal (signum);
+  show_backtrace();
+
+  /* Now reraise the signal.  We reactivate the signal's
+     default handling, which is to terminate the process.
+     We could just call exit or abort,
+     but reraising the signal sets the return status
+     from the process correctly. */
+  signal (signum, SIG_DFL);
+  raise (signum);
+}
+
+
+/* Helper function for set_options because we need to access the
+   global variable options which is not seen in set_options.  */
+static void
+maybe_find_addr2line (void)
+{
+  if (options.backtrace == -1)
+    find_addr2line ();
+}
+
+/* Set the usual compile-time options.  */
+extern void set_options (int , int []);
+export_proto(set_options);
+
+void
+set_options (int num, int options[])
+{
+  if (num >= 1)
+    compile_options.warn_std = options[0];
+  if (num >= 2)
+    compile_options.allow_std = options[1];
+  if (num >= 3)
+    compile_options.pedantic = options[2];
+  /* options[3] is the removed -fdump-core option. It's place in the
+     options array is retained due to ABI compatibility. Remove when
+     bumping the library ABI.  */
+  if (num >= 5)
+    compile_options.backtrace = options[4];
+  if (num >= 6)
+    compile_options.sign_zero = options[5];
+  if (num >= 7)
+    compile_options.bounds_check = options[6];
+  if (num >= 8)
+    compile_options.range_check = options[7];
+
+  /* If backtrace is required, we set signal handlers on the POSIX
+     2001 signals with core action.  */
+  if (compile_options.backtrace)
+    {
+#if defined(SIGQUIT)
+      signal (SIGQUIT, backtrace_handler);
+#endif
+
+      /* The following 4 signals are defined by C89.  */
+      signal (SIGILL, backtrace_handler);
+      signal (SIGABRT, backtrace_handler);
+      signal (SIGFPE, backtrace_handler);
+      signal (SIGSEGV, backtrace_handler);
+
+#if defined(SIGBUS)
+      signal (SIGBUS, backtrace_handler);
+#endif
+
+#if defined(SIGSYS)
+      signal (SIGSYS, backtrace_handler);
+#endif
+
+#if defined(SIGTRAP)
+      signal (SIGTRAP, backtrace_handler);
+#endif
+
+#if defined(SIGXCPU)
+      signal (SIGXCPU, backtrace_handler);
+#endif
+
+#if defined(SIGXFSZ)
+      signal (SIGXFSZ, backtrace_handler);
+#endif
+
+      maybe_find_addr2line ();
+    }
+}
+
+
+/* Default values for the compile-time options.  Keep in sync with
+   gcc/fortran/options.c (gfc_init_options).  */
+void
+init_compile_options (void)
+{
+  compile_options.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY;
+  compile_options.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
+    | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77
+    | GFC_STD_F2008_OBS | GFC_STD_GNU | GFC_STD_LEGACY;
+  compile_options.pedantic = 0;
+  compile_options.backtrace = 0;
+  compile_options.sign_zero = 1;
+  compile_options.range_check = 1;
+}
+
+/* Function called by the front-end to tell us the
+   default for unformatted data conversion.  */
+
+extern void set_convert (int);
+export_proto (set_convert);
+
+void
+set_convert (int conv)
+{
+  compile_options.convert = conv;
+}
+
+extern void set_record_marker (int);
+export_proto (set_record_marker);
+
+
+void
+set_record_marker (int val)
+{
+
+  switch(val)
+    {
+    case 4:
+      compile_options.record_marker = sizeof (GFC_INTEGER_4);
+      break;
+
+    case 8:
+      compile_options.record_marker = sizeof (GFC_INTEGER_8);
+      break;
+
+    default:
+      runtime_error ("Invalid value for record marker");
+      break;
+    }
+}
+
+extern void set_max_subrecord_length (int);
+export_proto (set_max_subrecord_length);
+
+void set_max_subrecord_length(int val)
+{
+  if (val > GFC_MAX_SUBRECORD_LENGTH || val < 1)
+    {
+      runtime_error ("Invalid value for maximum subrecord length");
+      return;
+    }
+
+  compile_options.max_subrecord_length = val;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/convert_char.c b/l4/pkg/libgfortran/lib/contrib/runtime/convert_char.c
new file mode 100644 (file)
index 0000000..540c2bf
--- /dev/null
@@ -0,0 +1,69 @@
+/* Runtime conversion of strings from one character kind to another.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+
+extern void convert_char1_to_char4 (gfc_char4_t **, gfc_charlen_type,
+                                   const unsigned char *);
+export_proto(convert_char1_to_char4);
+
+extern void convert_char4_to_char1 (unsigned char **, gfc_charlen_type,
+                                   const gfc_char4_t *);
+export_proto(convert_char4_to_char1);
+
+
+void
+convert_char1_to_char4 (gfc_char4_t **dst, gfc_charlen_type len,
+                       const unsigned char *src)
+{
+  gfc_charlen_type i, l;
+
+  l = len > 0 ? len : 0;
+  *dst = get_mem ((l + 1) * sizeof (gfc_char4_t));
+
+  for (i = 0; i < l; i++)
+    (*dst)[i] = src[i];
+
+  (*dst)[l] = '\0';
+}
+
+
+void
+convert_char4_to_char1 (unsigned char **dst, gfc_charlen_type len,
+                       const gfc_char4_t *src)
+{
+  gfc_charlen_type i, l;
+
+  l = len > 0 ? len : 0;
+  *dst = get_mem ((l + 1) * sizeof (unsigned char));
+
+  for (i = 0; i < l; i++)
+    (*dst)[i] = src[i];
+
+  (*dst)[l] = '\0';
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/environ.c b/l4/pkg/libgfortran/lib/contrib/runtime/environ.c
new file mode 100644 (file)
index 0000000..6bd8886
--- /dev/null
@@ -0,0 +1,830 @@
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+
+/* Environment scanner.  Examine the environment for controlling minor
+ * aspects of the program's execution.  Our philosophy here that the
+ * environment should not prevent the program from running, so an
+ * environment variable with a messed-up value will be interpreted in
+ * the default way.
+ *
+ * Most of the environment is checked early in the startup sequence,
+ * but other variables are checked during execution of the user's
+ * program. */
+
+options_t options;
+
+
+typedef struct variable
+{
+  const char *name;
+  int value, *var;
+  void (*init) (struct variable *);
+  void (*show) (struct variable *);
+  const char *desc;
+  int bad;
+}
+variable;
+
+static void init_unformatted (variable *);
+
+/* print_spaces()-- Print a particular number of spaces.  */
+
+static void
+print_spaces (int n)
+{
+  char buffer[80];
+  int i;
+
+  if (n <= 0)
+    return;
+
+  for (i = 0; i < n; i++)
+    buffer[i] = ' ';
+
+  buffer[i] = '\0';
+
+  estr_write (buffer);
+}
+
+
+/* var_source()-- Return a string that describes where the value of a
+ * variable comes from */
+
+static const char *
+var_source (variable * v)
+{
+  if (getenv (v->name) == NULL)
+    return "Default";
+
+  if (v->bad)
+    return "Bad    ";
+
+  return "Set    ";
+}
+
+
+/* init_integer()-- Initialize an integer environment variable.  */
+
+static void
+init_integer (variable * v)
+{
+  char *p, *q;
+
+  p = getenv (v->name);
+  if (p == NULL)
+    goto set_default;
+
+  for (q = p; *q; q++)
+    if (!isdigit (*q) && (p != q || *q != '-'))
+      {
+       v->bad = 1;
+       goto set_default;
+      }
+
+  *v->var = atoi (p);
+  return;
+
+ set_default:
+  *v->var = v->value;
+  return;
+}
+
+
+/* init_unsigned_integer()-- Initialize an integer environment variable
+   which has to be positive.  */
+
+static void
+init_unsigned_integer (variable * v)
+{
+  char *p, *q;
+
+  p = getenv (v->name);
+  if (p == NULL)
+    goto set_default;
+
+  for (q = p; *q; q++)
+    if (!isdigit (*q))
+      {
+       v->bad = 1;
+       goto set_default;
+      }
+
+  *v->var = atoi (p);
+  return;
+
+ set_default:
+  *v->var = v->value;
+  return;
+}
+
+
+/* show_integer()-- Show an integer environment variable */
+
+static void
+show_integer (variable * v)
+{
+  st_printf ("%s  %d\n", var_source (v), *v->var);
+}
+
+
+/* init_boolean()-- Initialize a boolean environment variable.  We
+ * only look at the first letter of the variable. */
+
+static void
+init_boolean (variable * v)
+{
+  char *p;
+
+  p = getenv (v->name);
+  if (p == NULL)
+    goto set_default;
+
+  if (*p == '1' || *p == 'Y' || *p == 'y')
+    {
+      *v->var = 1;
+      return;
+    }
+
+  if (*p == '0' || *p == 'N' || *p == 'n')
+    {
+      *v->var = 0;
+      return;
+    }
+
+  v->bad = 1;
+
+set_default:
+  *v->var = v->value;
+  return;
+}
+
+
+/* show_boolean()-- Show a boolean environment variable */
+
+static void
+show_boolean (variable * v)
+{
+  st_printf ("%s  %s\n", var_source (v), *v->var ? "Yes" : "No");
+}
+
+
+static void
+init_sep (variable * v)
+{
+  int seen_comma;
+  char *p;
+
+  p = getenv (v->name);
+  if (p == NULL)
+    goto set_default;
+
+  v->bad = 1;
+  options.separator = p;
+  options.separator_len = strlen (p);
+
+  /* Make sure the separator is valid */
+
+  if (options.separator_len == 0)
+    goto set_default;
+  seen_comma = 0;
+
+  while (*p)
+    {
+      if (*p == ',')
+       {
+         if (seen_comma)
+           goto set_default;
+         seen_comma = 1;
+         p++;
+         continue;
+       }
+
+      if (*p++ != ' ')
+       goto set_default;
+    }
+
+  v->bad = 0;
+  return;
+
+set_default:
+  options.separator = " ";
+  options.separator_len = 1;
+}
+
+
+static void
+show_sep (variable * v)
+{
+  st_printf ("%s  \"%s\"\n", var_source (v), options.separator);
+}
+
+
+static void
+init_string (variable * v __attribute__ ((unused)))
+{
+}
+
+static void
+show_string (variable * v)
+{
+  const char *p;
+
+  p = getenv (v->name);
+  if (p == NULL)
+    p = "";
+
+  estr_write (var_source (v));
+  estr_write ("  \"");
+  estr_write (p);
+  estr_write ("\"\n");
+}
+
+
+static variable variable_table[] = {
+  {"GFORTRAN_STDIN_UNIT", GFC_STDIN_UNIT_NUMBER, &options.stdin_unit,
+   init_integer, show_integer,
+   "Unit number that will be preconnected to standard input\n"
+   "(No preconnection if negative)", 0},
+
+  {"GFORTRAN_STDOUT_UNIT", GFC_STDOUT_UNIT_NUMBER, &options.stdout_unit,
+   init_integer, show_integer,
+   "Unit number that will be preconnected to standard output\n"
+   "(No preconnection if negative)", 0},
+
+  {"GFORTRAN_STDERR_UNIT", GFC_STDERR_UNIT_NUMBER, &options.stderr_unit,
+   init_integer, show_integer,
+   "Unit number that will be preconnected to standard error\n"
+   "(No preconnection if negative)", 0},
+
+  {"GFORTRAN_TMPDIR", 0, NULL, init_string, show_string,
+   "Directory for scratch files.  Overrides the TMP environment variable\n"
+   "If TMP is not set " DEFAULT_TEMPDIR " is used.", 0},
+
+  {"GFORTRAN_UNBUFFERED_ALL", 0, &options.all_unbuffered, init_boolean,
+   show_boolean,
+   "If TRUE, all output is unbuffered.  This will slow down large writes "
+   "but can be\nuseful for forcing data to be displayed immediately.", 0},
+
+  {"GFORTRAN_UNBUFFERED_PRECONNECTED", 0, &options.unbuffered_preconnected,
+   init_boolean, show_boolean,
+   "If TRUE, output to preconnected units is unbuffered.", 0},
+
+  {"GFORTRAN_SHOW_LOCUS", 1, &options.locus, init_boolean, show_boolean,
+   "If TRUE, print filename and line number where runtime errors happen.", 0},
+
+  {"GFORTRAN_OPTIONAL_PLUS", 0, &options.optional_plus, init_boolean, show_boolean,
+   "Print optional plus signs in numbers where permitted.  Default FALSE.", 0},
+
+  {"GFORTRAN_DEFAULT_RECL", DEFAULT_RECL, &options.default_recl,
+   init_unsigned_integer, show_integer,
+   "Default maximum record length for sequential files.  Most useful for\n"
+   "adjusting line length of preconnected units.  Default "
+   stringize (DEFAULT_RECL), 0},
+
+  {"GFORTRAN_LIST_SEPARATOR", 0, NULL, init_sep, show_sep,
+   "Separator to use when writing list output.  May contain any number of "
+   "spaces\nand at most one comma.  Default is a single space.", 0},
+
+  /* GFORTRAN_CONVERT_UNIT - Set the default data conversion for
+   unformatted I/O.  */
+  {"GFORTRAN_CONVERT_UNIT", 0, 0, init_unformatted, show_string,
+   "Set format for unformatted files", 0},
+
+  {"GFORTRAN_ERROR_BACKTRACE", -1, &options.backtrace,
+    init_boolean, show_boolean,
+    "Print out a backtrace (if possible) on runtime error", -1},
+
+  {NULL, 0, NULL, NULL, NULL, NULL, 0}
+};
+
+
+/* init_variables()-- Initialize most runtime variables from
+ * environment variables. */
+
+void
+init_variables (void)
+{
+  variable *v;
+
+  for (v = variable_table; v->name; v++)
+    v->init (v);
+}
+
+
+void
+show_variables (void)
+{
+  variable *v;
+  int n;
+
+  /* TODO: print version number.  */
+  estr_write ("GNU Fortran runtime library version "
+            "UNKNOWN" "\n\n");
+
+  estr_write ("Environment variables:\n");
+  estr_write ("----------------------\n");
+
+  for (v = variable_table; v->name; v++)
+    {
+      n = estr_write (v->name);
+      print_spaces (25 - n);
+
+      if (v->show == show_integer)
+       estr_write ("Integer ");
+      else if (v->show == show_boolean)
+       estr_write ("Boolean ");
+      else
+       estr_write ("String  ");
+
+      v->show (v);
+      estr_write (v->desc);
+      estr_write ("\n\n");
+    }
+
+  /* System error codes */
+
+  estr_write ("\nRuntime error codes:");
+  estr_write ("\n--------------------\n");
+
+  for (n = LIBERROR_FIRST + 1; n < LIBERROR_LAST; n++)
+    if (n < 0 || n > 9)
+      st_printf ("%d  %s\n", n, translate_error (n));
+    else
+      st_printf (" %d  %s\n", n, translate_error (n));
+
+  estr_write ("\nCommand line arguments:\n");
+  estr_write ("  --help               Print this list\n");
+
+  exit (0);
+}
+
+/* This is the handling of the GFORTRAN_CONVERT_UNITS environment variable.
+   It is called from environ.c to parse this variable, and from
+   open.c to determine if the user specified a default for an
+   unformatted file.
+   The syntax of the environment variable is, in bison grammar:
+
+   GFORTRAN_CONVERT_UNITS: mode | mode ';' exception ;
+   mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
+   exception: mode ':' unit_list | unit_list ;
+   unit_list: unit_spec | unit_list unit_spec ;
+   unit_spec: INTEGER | INTEGER '-' INTEGER ;
+*/
+
+/* Defines for the tokens.  Other valid tokens are ',', ':', '-'.  */
+
+
+#define NATIVE   257
+#define SWAP     258
+#define BIG      259
+#define LITTLE   260
+/* Some space for additional tokens later.  */
+#define INTEGER  273
+#define END      (-1)
+#define ILLEGAL  (-2)
+
+typedef struct
+{
+  int unit;
+  unit_convert conv;
+} exception_t;
+
+
+static char *p;            /* Main character pointer for parsing.  */
+static char *lastpos;      /* Auxiliary pointer, for backing up.  */
+static int unit_num;       /* The last unit number read.  */
+static int unit_count;     /* The number of units found. */
+static int do_count;       /* Parsing is done twice - first to count the number
+                             of units, then to fill in the table.  This
+                             variable controls what to do.  */
+static exception_t *elist; /* The list of exceptions to the default. This is
+                             sorted according to unit number.  */
+static int n_elist;        /* Number of exceptions to the default.  */
+
+static unit_convert endian; /* Current endianness.  */
+
+static unit_convert def; /* Default as specified (if any).  */
+
+/* Search for a unit number, using a binary search.  The
+   first argument is the unit number to search for.  The second argument
+   is a pointer to an index.
+   If the unit number is found, the function returns 1, and the index
+   is that of the element.
+   If the unit number is not found, the function returns 0, and the
+   index is the one where the element would be inserted.  */
+
+static int
+search_unit (int unit, int *ip)
+{
+  int low, high, mid;
+
+  low = -1;
+  high = n_elist;
+  while (high - low > 1)
+    {
+      mid = (low + high) / 2;
+      if (unit <= elist[mid].unit)
+       high = mid;
+      else
+       low = mid;
+    }
+  *ip = high;
+  if (elist[high].unit == unit)
+    return 1;
+  else
+    return 0;
+}
+
+/* This matches a keyword.  If it is found, return the token supplied,
+   otherwise return ILLEGAL.  */
+
+static int
+match_word (const char *word, int tok)
+{
+  int res;
+
+  if (strncasecmp (p, word, strlen (word)) == 0)
+    {
+      p += strlen (word);
+      res = tok;
+    }
+  else
+    res = ILLEGAL;
+  return res;
+
+}
+
+/* Match an integer and store its value in unit_num.  This only works
+   if p actually points to the start of an integer.  The caller has
+   to ensure this.  */
+
+static int
+match_integer (void)
+{
+  unit_num = 0;
+  while (isdigit (*p))
+    unit_num = unit_num * 10 + (*p++ - '0');
+  return INTEGER;
+
+}
+
+/* This reads the next token from the GFORTRAN_CONVERT_UNITS variable.
+   Returned values are the different tokens.  */
+
+static int
+next_token (void)
+{
+  int result;
+
+  lastpos = p;
+  switch (*p)
+    {
+    case '\0':
+      result = END;
+      break;
+      
+    case ':':
+    case ',': 
+    case '-':
+    case ';':
+      result = *p;
+      p++;
+      break;
+
+    case 'b':
+    case 'B':
+      result = match_word ("big_endian", BIG);
+      break;
+
+    case 'l':
+    case 'L':
+      result = match_word ("little_endian", LITTLE);
+      break;
+
+    case 'n':
+    case 'N':
+      result = match_word ("native", NATIVE);
+      break;
+
+    case 's':
+    case 'S':
+      result = match_word ("swap", SWAP);
+      break;
+
+    case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+      result = match_integer ();
+      break;
+
+    default:
+      result = ILLEGAL;
+      break;
+    }
+  return result;
+}
+
+/* Back up the last token by setting back the character pointer.  */
+
+static void
+push_token (void)
+{
+  p = lastpos;
+}
+
+/* This is called when a unit is identified.  If do_count is nonzero,
+   increment the number of units by one.  If do_count is zero,
+   put the unit into the table.  */
+
+static void
+mark_single (int unit)
+{
+  int i,j;
+
+  if (do_count)
+    {
+      unit_count++;
+      return;
+    }
+  if (search_unit (unit, &i))
+    {
+      elist[unit].conv = endian;
+    }
+  else
+    {
+      for (j=n_elist; j>=i; j--)
+       elist[j+1] = elist[j];
+    
+      n_elist += 1;
+      elist[i].unit = unit;
+      elist[i].conv = endian;
+    }
+}
+
+/* This is called when a unit range is identified.  If do_count is
+   nonzero, increase the number of units.  If do_count is zero,
+   put the unit into the table.  */
+
+static void
+mark_range (int unit1, int unit2)
+{
+  int i;
+  if (do_count)
+    unit_count += abs (unit2 - unit1) + 1;
+  else
+    {
+      if (unit2 < unit1)
+       for (i=unit2; i<=unit1; i++)
+         mark_single (i);
+      else
+       for (i=unit1; i<=unit2; i++)
+         mark_single (i);
+    }
+}
+
+/* Parse the GFORTRAN_CONVERT_UNITS variable.  This is called
+   twice, once to count the units and once to actually mark them in
+   the table.  When counting, we don't check for double occurrences
+   of units.  */
+
+static int
+do_parse (void)
+{
+  int tok;
+  int unit1;
+  int continue_ulist;
+  char *start;
+
+  unit_count = 0;
+
+  start = p;
+
+  /* Parse the string.  First, let's look for a default.  */
+  tok = next_token ();
+  switch (tok)
+    {
+    case NATIVE:
+      endian = GFC_CONVERT_NATIVE;
+      break;
+
+    case SWAP:
+      endian = GFC_CONVERT_SWAP;
+      break;
+
+    case BIG:
+      endian = GFC_CONVERT_BIG;
+      break;
+
+    case LITTLE:
+      endian = GFC_CONVERT_LITTLE;
+      break;
+
+    case INTEGER:
+      /* A leading digit means that we are looking at an exception.
+        Reset the position to the beginning, and continue processing
+        at the exception list.  */
+      p = start;
+      goto exceptions;
+      break;
+
+    case END:
+      goto end;
+      break;
+
+    default:
+      goto error;
+      break;
+    }
+
+  tok = next_token ();
+  switch (tok)
+    {
+    case ';':
+      def = endian;
+      break;
+
+    case ':':
+      /* This isn't a default after all.  Reset the position to the
+        beginning, and continue processing at the exception list.  */
+      p = start;
+      goto exceptions;
+      break;
+
+    case END:
+      def = endian;
+      goto end;
+      break;
+
+    default:
+      goto error;
+      break;
+    }
+
+ exceptions:
+
+  /* Loop over all exceptions.  */
+  while(1)
+    {
+      tok = next_token ();
+      switch (tok)
+       {
+       case NATIVE:
+         if (next_token () != ':')
+           goto error;
+         endian = GFC_CONVERT_NATIVE;
+         break;
+
+       case SWAP:
+         if (next_token () != ':')
+           goto error;
+         endian = GFC_CONVERT_SWAP;
+         break;
+
+       case LITTLE:
+         if (next_token () != ':')
+           goto error;
+         endian = GFC_CONVERT_LITTLE;
+         break;
+
+       case BIG:
+         if (next_token () != ':')
+           goto error;
+         endian = GFC_CONVERT_BIG;
+         break;
+
+       case INTEGER:
+         push_token ();
+         break;
+
+       case END:
+         goto end;
+         break;
+
+       default:
+         goto error;
+         break;
+       }
+      /* We arrive here when we want to parse a list of
+        numbers.  */
+      continue_ulist = 1;
+      do
+       {
+         tok = next_token ();
+         if (tok != INTEGER)
+           goto error;
+
+         unit1 = unit_num;
+         tok = next_token ();
+         /* The number can be followed by a - and another number,
+            which means that this is a unit range, a comma
+            or a semicolon.  */
+         if (tok == '-')
+           {
+             if (next_token () != INTEGER)
+               goto error;
+
+             mark_range (unit1, unit_num);
+             tok = next_token ();
+             if (tok == END)
+               goto end;
+             else if (tok == ';')
+               continue_ulist = 0;
+             else if (tok != ',')
+               goto error;
+           }
+         else
+           {
+             mark_single (unit1);
+             switch (tok)
+               {
+               case ';':
+                 continue_ulist = 0;
+                 break;
+
+               case ',':
+                 break;
+
+               case END:
+                 goto end;
+                 break;
+
+               default:
+                 goto error;
+               }
+           }
+       } while (continue_ulist);
+    }
+ end:
+  return 0;
+ error:
+  def = GFC_CONVERT_NONE;
+  return -1;
+}
+
+void init_unformatted (variable * v)
+{
+  char *val;
+  val = getenv (v->name);
+  def = GFC_CONVERT_NONE;
+  n_elist = 0;
+
+  if (val == NULL)
+    return;
+  do_count = 1;
+  p = val;
+  do_parse ();
+  if (do_count <= 0)
+    {
+      n_elist = 0;
+      elist = NULL;
+    }
+  else
+    {
+      elist = get_mem (unit_count * sizeof (exception_t));
+      do_count = 0;
+      p = val;
+      do_parse ();
+    }
+}
+
+/* Get the default conversion for for an unformatted unit.  */
+
+unit_convert
+get_unformatted_convert (int unit)
+{
+  int i;
+
+  if (elist == NULL)
+    return def;
+  else if (search_unit (unit, &i))
+    return elist[i].conv;
+  else
+    return def;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/error.c b/l4/pkg/libgfortran/lib/contrib/runtime/error.c
new file mode 100644 (file)
index 0000000..7e523bc
--- /dev/null
@@ -0,0 +1,614 @@
+/* Copyright (C) 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+
+#include "libgfortran.h"
+#include <assert.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <stdlib.h>
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* <sys/time.h> has to be included before <sys/resource.h> to work
+   around PR 30518; otherwise, MacOS 10.3.9 headers are just broken.  */
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+
+#ifdef __MINGW32__
+#define HAVE_GETPID 1
+#include <process.h>
+#endif
+
+
+/* Termination of a program: F2008 2.3.5 talks about "normal
+   termination" and "error termination". Normal termination occurs as
+   a result of e.g. executing the end program statement, and executing
+   the STOP statement. It includes the effect of the C exit()
+   function. 
+
+   Error termination is initiated when the ERROR STOP statement is
+   executed, when ALLOCATE/DEALLOCATE fails without STAT= being
+   specified, when some of the co-array synchronization statements
+   fail without STAT= being specified, and some I/O errors if
+   ERR/IOSTAT/END/EOR is not present, and finally EXECUTE_COMMAND_LINE
+   failure without CMDSTAT=.
+
+   2.3.5 also explains how co-images synchronize during termination.
+
+   In libgfortran we have two ways of ending a program. exit(code) is
+   a normal exit; calling exit() also causes open units to be
+   closed. No backtrace or core dump is needed here. When something
+   goes wrong, we have sys_abort() which tries to print the backtrace
+   if -fbacktrace is enabled, and then dumps core; whether a core file
+   is generated is system dependent. When aborting, we don't flush and
+   close open units, as program memory might be corrupted and we'd
+   rather risk losing dirty data in the buffers rather than corrupting
+   files on disk.
+
+*/
+
+/* Error conditions.  The tricky part here is printing a message when
+ * it is the I/O subsystem that is severely wounded.  Our goal is to
+ * try and print something making the fewest assumptions possible,
+ * then try to clean up before actually exiting.
+ *
+ * The following exit conditions are defined:
+ * 0    Normal program exit.
+ * 1    Terminated because of operating system error.
+ * 2    Error in the runtime library
+ * 3    Internal error in runtime library
+ *
+ * Other error returns are reserved for the STOP statement with a numeric code.
+ */
+
+
+/* Write a null-terminated C string to standard error. This function
+   is async-signal-safe.  */
+
+ssize_t
+estr_write (const char *str)
+{
+  return write (STDERR_FILENO, str, strlen (str));
+}
+
+
+/* st_vprintf()-- vsnprintf-like function for error output.  We use a
+   stack allocated buffer for formatting; since this function might be
+   called from within a signal handler, printing directly to stderr
+   with vfprintf is not safe since the stderr locking might lead to a
+   deadlock.  */
+
+#define ST_VPRINTF_SIZE 512
+
+int
+st_vprintf (const char *format, va_list ap)
+{
+  int written;
+  char buffer[ST_VPRINTF_SIZE];
+
+#ifdef HAVE_VSNPRINTF
+  written = vsnprintf(buffer, ST_VPRINTF_SIZE, format, ap);
+#else
+  written = vsprintf(buffer, format, ap);
+
+  if (written >= ST_VPRINTF_SIZE - 1)
+    {
+      /* The error message was longer than our buffer.  Ouch.  Because
+        we may have messed up things badly, report the error and
+        quit.  */
+#define ERROR_MESSAGE "Internal error: buffer overrun in st_vprintf()\n"
+      write (STDERR_FILENO, buffer, ST_VPRINTF_SIZE - 1);
+      write (STDERR_FILENO, ERROR_MESSAGE, strlen(ERROR_MESSAGE));
+      sys_abort ();
+#undef ERROR_MESSAGE
+
+    }
+#endif
+
+  written = write (STDERR_FILENO, buffer, written);
+  return written;
+}
+
+
+int
+st_printf (const char * format, ...)
+{
+  int written;
+  va_list ap;
+  va_start (ap, format);
+  written = st_vprintf (format, ap);
+  va_end (ap);
+  return written;
+}
+
+
+/* sys_abort()-- Terminate the program showing backtrace and dumping
+   core.  */
+
+void
+sys_abort (void)
+{
+  /* If backtracing is enabled, print backtrace and disable signal
+     handler for ABRT.  */
+  if (options.backtrace == 1
+      || (options.backtrace == -1 && compile_options.backtrace == 1))
+    {
+      show_backtrace ();
+      signal (SIGABRT, SIG_DFL);
+    }
+
+  abort();
+}
+
+
+/* gfc_xtoa()-- Integer to hexadecimal conversion.  */
+
+const char *
+gfc_xtoa (GFC_UINTEGER_LARGEST n, char *buffer, size_t len)
+{
+  int digit;
+  char *p;
+
+  assert (len >= GFC_XTOA_BUF_SIZE);
+
+  if (n == 0)
+    return "0";
+
+  p = buffer + GFC_XTOA_BUF_SIZE - 1;
+  *p = '\0';
+
+  while (n != 0)
+    {
+      digit = n & 0xF;
+      if (digit > 9)
+       digit += 'A' - '0' - 10;
+
+      *--p = '0' + digit;
+      n >>= 4;
+    }
+
+  return p;
+}
+
+
+/* Hopefully thread-safe wrapper for a strerror_r() style function.  */
+
+char *
+gf_strerror (int errnum, 
+             char * buf __attribute__((unused)), 
+            size_t buflen __attribute__((unused)))
+{
+#ifdef HAVE_STRERROR_R
+  return
+    __builtin_choose_expr (__builtin_classify_type (strerror_r (0, buf, 0))
+                          == 5,
+                          /* GNU strerror_r()  */
+                          strerror_r (errnum, buf, buflen),
+                          /* POSIX strerror_r ()  */
+                          (strerror_r (errnum, buf, buflen), buf));
+#else
+  /* strerror () is not necessarily thread-safe, but should at least
+     be available everywhere.  */
+  return strerror (errnum);
+#endif
+}
+
+
+/* show_locus()-- Print a line number and filename describing where
+ * something went wrong */
+
+void
+show_locus (st_parameter_common *cmp)
+{
+  char *filename;
+
+  if (!options.locus || cmp == NULL || cmp->filename == NULL)
+    return;
+  
+  if (cmp->unit > 0)
+    {
+      filename = filename_from_unit (cmp->unit);
+
+      if (filename != NULL)
+       {
+         st_printf ("At line %d of file %s (unit = %d, file = '%s')\n",
+                  (int) cmp->line, cmp->filename, (int) cmp->unit, filename);
+         free (filename);
+       }
+      else
+       {
+         st_printf ("At line %d of file %s (unit = %d)\n",
+                  (int) cmp->line, cmp->filename, (int) cmp->unit);
+       }
+      return;
+    }
+
+  st_printf ("At line %d of file %s\n", (int) cmp->line, cmp->filename);
+}
+
+
+/* recursion_check()-- It's possible for additional errors to occur
+ * during fatal error processing.  We detect this condition here and
+ * exit with code 4 immediately. */
+
+#define MAGIC 0x20DE8101
+
+static void
+recursion_check (void)
+{
+  static int magic = 0;
+
+  /* Don't even try to print something at this point */
+  if (magic == MAGIC)
+    sys_abort ();
+
+  magic = MAGIC;
+}
+
+
+#define STRERR_MAXSZ 256
+
+/* os_error()-- Operating system error.  We get a message from the
+ * operating system, show it and leave.  Some operating system errors
+ * are caught and processed by the library.  If not, we come here. */
+
+void
+os_error (const char *message)
+{
+  char errmsg[STRERR_MAXSZ];
+  recursion_check ();
+  estr_write ("Operating system error: ");
+  estr_write (gf_strerror (errno, errmsg, STRERR_MAXSZ));
+  estr_write ("\n");
+  estr_write (message);
+  estr_write ("\n");
+  exit (1);
+}
+iexport(os_error);
+
+
+/* void runtime_error()-- These are errors associated with an
+ * invalid fortran program. */
+
+void
+runtime_error (const char *message, ...)
+{
+  va_list ap;
+
+  recursion_check ();
+  estr_write ("Fortran runtime error: ");
+  va_start (ap, message);
+  st_vprintf (message, ap);
+  va_end (ap);
+  estr_write ("\n");
+  exit (2);
+}
+iexport(runtime_error);
+
+/* void runtime_error_at()-- These are errors associated with a
+ * run time error generated by the front end compiler.  */
+
+void
+runtime_error_at (const char *where, const char *message, ...)
+{
+  va_list ap;
+
+  recursion_check ();
+  estr_write (where);
+  estr_write ("\nFortran runtime error: ");
+  va_start (ap, message);
+  st_vprintf (message, ap);
+  va_end (ap);
+  estr_write ("\n");
+  exit (2);
+}
+iexport(runtime_error_at);
+
+
+void
+runtime_warning_at (const char *where, const char *message, ...)
+{
+  va_list ap;
+
+  estr_write (where);
+  estr_write ("\nFortran runtime warning: ");
+  va_start (ap, message);
+  st_vprintf (message, ap);
+  va_end (ap);
+  estr_write ("\n");
+}
+iexport(runtime_warning_at);
+
+
+/* void internal_error()-- These are this-can't-happen errors
+ * that indicate something deeply wrong. */
+
+void
+internal_error (st_parameter_common *cmp, const char *message)
+{
+  recursion_check ();
+  show_locus (cmp);
+  estr_write ("Internal Error: ");
+  estr_write (message);
+  estr_write ("\n");
+
+  /* This function call is here to get the main.o object file included
+     when linking statically. This works because error.o is supposed to
+     be always linked in (and the function call is in internal_error
+     because hopefully it doesn't happen too often).  */
+  stupid_function_name_for_static_linking();
+
+  exit (3);
+}
+
+
+/* translate_error()-- Given an integer error code, return a string
+ * describing the error. */
+
+const char *
+translate_error (int code)
+{
+  const char *p;
+
+  switch (code)
+    {
+    case LIBERROR_EOR:
+      p = "End of record";
+      break;
+
+    case LIBERROR_END:
+      p = "End of file";
+      break;
+
+    case LIBERROR_OK:
+      p = "Successful return";
+      break;
+
+    case LIBERROR_OS:
+      p = "Operating system error";
+      break;
+
+    case LIBERROR_BAD_OPTION:
+      p = "Bad statement option";
+      break;
+
+    case LIBERROR_MISSING_OPTION:
+      p = "Missing statement option";
+      break;
+
+    case LIBERROR_OPTION_CONFLICT:
+      p = "Conflicting statement options";
+      break;
+
+    case LIBERROR_ALREADY_OPEN:
+      p = "File already opened in another unit";
+      break;
+
+    case LIBERROR_BAD_UNIT:
+      p = "Unattached unit";
+      break;
+
+    case LIBERROR_FORMAT:
+      p = "FORMAT error";
+      break;
+
+    case LIBERROR_BAD_ACTION:
+      p = "Incorrect ACTION specified";
+      break;
+
+    case LIBERROR_ENDFILE:
+      p = "Read past ENDFILE record";
+      break;
+
+    case LIBERROR_BAD_US:
+      p = "Corrupt unformatted sequential file";
+      break;
+
+    case LIBERROR_READ_VALUE:
+      p = "Bad value during read";
+      break;
+
+    case LIBERROR_READ_OVERFLOW:
+      p = "Numeric overflow on read";
+      break;
+
+    case LIBERROR_INTERNAL:
+      p = "Internal error in run-time library";
+      break;
+
+    case LIBERROR_INTERNAL_UNIT:
+      p = "Internal unit I/O error";
+      break;
+
+    case LIBERROR_DIRECT_EOR:
+      p = "Write exceeds length of DIRECT access record";
+      break;
+
+    case LIBERROR_SHORT_RECORD:
+      p = "I/O past end of record on unformatted file";
+      break;
+
+    case LIBERROR_CORRUPT_FILE:
+      p = "Unformatted file structure has been corrupted";
+      break;
+
+    default:
+      p = "Unknown error code";
+      break;
+    }
+
+  return p;
+}
+
+
+/* generate_error()-- Come here when an error happens.  This
+ * subroutine is called if it is possible to continue on after the error.
+ * If an IOSTAT or IOMSG variable exists, we set it.  If IOSTAT or
+ * ERR labels are present, we return, otherwise we terminate the program
+ * after printing a message.  The error code is always required but the
+ * message parameter can be NULL, in which case a string describing
+ * the most recent operating system error is used. */
+
+void
+generate_error (st_parameter_common *cmp, int family, const char *message)
+{
+  char errmsg[STRERR_MAXSZ];
+
+  /* If there was a previous error, don't mask it with another
+     error message, EOF or EOR condition.  */
+
+  if ((cmp->flags & IOPARM_LIBRETURN_MASK) == IOPARM_LIBRETURN_ERROR)
+    return;
+
+  /* Set the error status.  */
+  if ((cmp->flags & IOPARM_HAS_IOSTAT))
+    *cmp->iostat = (family == LIBERROR_OS) ? errno : family;
+
+  if (message == NULL)
+    message =
+      (family == LIBERROR_OS) ? gf_strerror (errno, errmsg, STRERR_MAXSZ) :
+      translate_error (family);
+
+  if (cmp->flags & IOPARM_HAS_IOMSG)
+    cf_strcpy (cmp->iomsg, cmp->iomsg_len, message);
+
+  /* Report status back to the compiler.  */
+  cmp->flags &= ~IOPARM_LIBRETURN_MASK;
+  switch (family)
+    {
+    case LIBERROR_EOR:
+      cmp->flags |= IOPARM_LIBRETURN_EOR;
+      if ((cmp->flags & IOPARM_EOR))
+       return;
+      break;
+
+    case LIBERROR_END:
+      cmp->flags |= IOPARM_LIBRETURN_END;
+      if ((cmp->flags & IOPARM_END))
+       return;
+      break;
+
+    default:
+      cmp->flags |= IOPARM_LIBRETURN_ERROR;
+      if ((cmp->flags & IOPARM_ERR))
+       return;
+      break;
+    }
+
+  /* Return if the user supplied an iostat variable.  */
+  if ((cmp->flags & IOPARM_HAS_IOSTAT))
+    return;
+
+  /* Terminate the program */
+
+  recursion_check ();
+  show_locus (cmp);
+  estr_write ("Fortran runtime error: ");
+  estr_write (message);
+  estr_write ("\n");
+  exit (2);
+}
+iexport(generate_error);
+
+
+/* generate_warning()-- Similar to generate_error but just give a warning.  */
+
+void
+generate_warning (st_parameter_common *cmp, const char *message)
+{
+  if (message == NULL)
+    message = " ";
+
+  show_locus (cmp);
+  estr_write ("Fortran runtime warning: ");
+  estr_write (message);
+  estr_write ("\n");
+}
+
+
+/* Whether, for a feature included in a given standard set (GFC_STD_*),
+   we should issue an error or a warning, or be quiet.  */
+
+notification
+notification_std (int std)
+{
+  int warning;
+
+  if (!compile_options.pedantic)
+    return NOTIFICATION_SILENT;
+
+  warning = compile_options.warn_std & std;
+  if ((compile_options.allow_std & std) != 0 && !warning)
+    return NOTIFICATION_SILENT;
+
+  return warning ? NOTIFICATION_WARNING : NOTIFICATION_ERROR;
+}
+
+
+/* Possibly issue a warning/error about use of a nonstandard (or deleted)
+   feature.  An error/warning will be issued if the currently selected
+   standard does not contain the requested bits.  */
+
+try
+notify_std (st_parameter_common *cmp, int std, const char * message)
+{
+  int warning;
+
+  if (!compile_options.pedantic)
+    return SUCCESS;
+
+  warning = compile_options.warn_std & std;
+  if ((compile_options.allow_std & std) != 0 && !warning)
+    return SUCCESS;
+
+  if (!warning)
+    {
+      recursion_check ();
+      show_locus (cmp);
+      estr_write ("Fortran runtime error: ");
+      estr_write (message);
+      estr_write ("\n");
+      exit (2);
+    }
+  else
+    {
+      show_locus (cmp);
+      estr_write ("Fortran runtime warning: ");
+      estr_write (message);
+      estr_write ("\n");
+    }
+  return FAILURE;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/fpu.c b/l4/pkg/libgfortran/lib/contrib/runtime/fpu.c
new file mode 100644 (file)
index 0000000..ce745dd
--- /dev/null
@@ -0,0 +1,41 @@
+/* Set FPU mask.
+   Copyright 2005 Free Software Foundation, Inc.
+   Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+/* We include the platform-dependent code.  */
+#include "fpu-target.h"
+
+/* Function called by the front-end to tell us
+   when a FPE should be raised.  */
+extern void set_fpe (int);
+export_proto(set_fpe);
+
+void
+set_fpe (int exceptions)
+{
+  options.fpe = exceptions;
+  set_fpu ();
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/in_pack_generic.c b/l4/pkg/libgfortran/lib/contrib/runtime/in_pack_generic.c
new file mode 100644 (file)
index 0000000..64ae662
--- /dev/null
@@ -0,0 +1,218 @@
+/* Generic helper function for repacking arrays.
+   Copyright 2003, 2004, 2005, 2007, 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+extern void *internal_pack (gfc_array_char *);
+export_proto(internal_pack);
+
+void *
+internal_pack (gfc_array_char * source)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type ssize;
+  const char *src;
+  char *dest;
+  void *destptr;
+  int n;
+  int packed;
+  index_type size;
+  index_type type_size;
+
+  type_size = GFC_DTYPE_TYPE_SIZE(source);
+  size = GFC_DESCRIPTOR_SIZE (source);
+  switch (type_size)
+    {
+    case GFC_DTYPE_INTEGER_1:
+    case GFC_DTYPE_LOGICAL_1:
+    case GFC_DTYPE_DERIVED_1:
+      return internal_pack_1 ((gfc_array_i1 *) source);
+
+    case GFC_DTYPE_INTEGER_2:
+    case GFC_DTYPE_LOGICAL_2:
+      return internal_pack_2 ((gfc_array_i2 *) source);
+
+    case GFC_DTYPE_INTEGER_4:
+    case GFC_DTYPE_LOGICAL_4:
+      return internal_pack_4 ((gfc_array_i4 *) source);
+       
+    case GFC_DTYPE_INTEGER_8:
+    case GFC_DTYPE_LOGICAL_8:
+      return internal_pack_8 ((gfc_array_i8 *) source);
+
+#if defined(HAVE_GFC_INTEGER_16)
+    case GFC_DTYPE_INTEGER_16:
+    case GFC_DTYPE_LOGICAL_16:
+      return internal_pack_16 ((gfc_array_i16 *) source);
+#endif
+    case GFC_DTYPE_REAL_4:
+      return internal_pack_r4 ((gfc_array_r4 *) source);
+
+    case GFC_DTYPE_REAL_8:
+      return internal_pack_r8 ((gfc_array_r8 *) source);
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# if defined (HAVE_GFC_REAL_10)
+    case GFC_DTYPE_REAL_10:
+      return internal_pack_r10 ((gfc_array_r10 *) source);
+# endif
+
+# if defined (HAVE_GFC_REAL_16)
+    case GFC_DTYPE_REAL_16:
+      return internal_pack_r16 ((gfc_array_r16 *) source);
+# endif
+#endif
+
+    case GFC_DTYPE_COMPLEX_4:
+      return internal_pack_c4 ((gfc_array_c4 *) source);
+       
+    case GFC_DTYPE_COMPLEX_8:
+      return internal_pack_c8 ((gfc_array_c8 *) source);
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# if defined (HAVE_GFC_COMPLEX_10)
+    case GFC_DTYPE_COMPLEX_10:
+      return internal_pack_c10 ((gfc_array_c10 *) source);
+# endif
+
+# if defined (HAVE_GFC_COMPLEX_16)
+    case GFC_DTYPE_COMPLEX_16:
+      return internal_pack_c16 ((gfc_array_c16 *) source);
+# endif
+#endif
+
+    case GFC_DTYPE_DERIVED_2:
+      if (GFC_UNALIGNED_2(source->data))
+       break;
+      else
+       return internal_pack_2 ((gfc_array_i2 *) source);
+
+    case GFC_DTYPE_DERIVED_4:
+      if (GFC_UNALIGNED_4(source->data))
+       break;
+      else
+       return internal_pack_4 ((gfc_array_i4 *) source);
+
+    case GFC_DTYPE_DERIVED_8:
+      if (GFC_UNALIGNED_8(source->data))
+       break;
+      else
+       return internal_pack_8 ((gfc_array_i8 *) source);
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_DERIVED_16:
+      if (GFC_UNALIGNED_16(source->data))
+       break;
+      else
+       return internal_pack_16 ((gfc_array_i16 *) source);
+#endif
+
+    default:
+      break;
+    }
+
+  dim = GFC_DESCRIPTOR_RANK (source);
+  ssize = 1;
+  packed = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(source,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(source,n);
+      if (extent[n] <= 0)
+        {
+          /* Do nothing.  */
+          packed = 1;
+          break;
+        }
+
+      if (ssize != stride[n])
+        packed = 0;
+
+      ssize *= extent[n];
+    }
+
+  if (packed)
+    return source->data;
+
+   /* Allocate storage for the destination.  */
+  destptr = internal_malloc_size (ssize * size);
+  dest = (char *)destptr;
+  src = source->data;
+  stride0 = stride[0] * size;
+
+  while (src)
+    {
+      /* Copy the data.  */
+      memcpy(dest, src, size);
+      /* Advance to the next element.  */
+      dest += size;
+      src += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          src -= stride[n] * extent[n] * size;
+          n++;
+          if (n == dim)
+            {
+              src = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              src += stride[n] * size;
+            }
+        }
+    }
+  return destptr;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/in_unpack_generic.c b/l4/pkg/libgfortran/lib/contrib/runtime/in_unpack_generic.c
new file mode 100644 (file)
index 0000000..32cc94b
--- /dev/null
@@ -0,0 +1,242 @@
+/* Generic helper function for repacking arrays.
+   Copyright 2003, 2004, 2005, 2007, 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+extern void internal_unpack (gfc_array_char *, const void *);
+export_proto(internal_unpack);
+
+void
+internal_unpack (gfc_array_char * d, const void * s)
+{
+  index_type count[GFC_MAX_DIMENSIONS];
+  index_type extent[GFC_MAX_DIMENSIONS];
+  index_type stride[GFC_MAX_DIMENSIONS];
+  index_type stride0;
+  index_type dim;
+  index_type dsize;
+  char *dest;
+  const char *src;
+  int n;
+  int size;
+  int type_size;
+
+  dest = d->data;
+  /* This check may be redundant, but do it anyway.  */
+  if (s == dest || !s)
+    return;
+
+  type_size = GFC_DTYPE_TYPE_SIZE (d);
+  switch (type_size)
+    {
+    case GFC_DTYPE_INTEGER_1:
+    case GFC_DTYPE_LOGICAL_1:
+    case GFC_DTYPE_DERIVED_1:
+      internal_unpack_1 ((gfc_array_i1 *) d, (const GFC_INTEGER_1 *) s);
+      return;
+
+    case GFC_DTYPE_INTEGER_2:
+    case GFC_DTYPE_LOGICAL_2:
+      internal_unpack_2 ((gfc_array_i2 *) d, (const GFC_INTEGER_2 *) s);
+      return;
+
+    case GFC_DTYPE_INTEGER_4:
+    case GFC_DTYPE_LOGICAL_4:
+      internal_unpack_4 ((gfc_array_i4 *) d, (const GFC_INTEGER_4 *) s);
+      return;
+
+    case GFC_DTYPE_INTEGER_8:
+    case GFC_DTYPE_LOGICAL_8:
+      internal_unpack_8 ((gfc_array_i8 *) d, (const GFC_INTEGER_8 *) s);
+      return;
+
+#if defined (HAVE_GFC_INTEGER_16)
+    case GFC_DTYPE_INTEGER_16:
+    case GFC_DTYPE_LOGICAL_16:
+      internal_unpack_16 ((gfc_array_i16 *) d, (const GFC_INTEGER_16 *) s);
+      return;
+#endif
+
+    case GFC_DTYPE_REAL_4:
+      internal_unpack_r4 ((gfc_array_r4 *) d, (const GFC_REAL_4 *) s);
+      return;
+
+    case GFC_DTYPE_REAL_8:
+      internal_unpack_r8 ((gfc_array_r8 *) d, (const GFC_REAL_8 *) s);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# if defined(HAVE_GFC_REAL_10)
+    case GFC_DTYPE_REAL_10:
+      internal_unpack_r10 ((gfc_array_r10 *) d, (const GFC_REAL_10 *) s);
+      return;
+# endif
+
+# if defined(HAVE_GFC_REAL_16)
+    case GFC_DTYPE_REAL_16:
+      internal_unpack_r16 ((gfc_array_r16 *) d, (const GFC_REAL_16 *) s);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_COMPLEX_4:
+      internal_unpack_c4 ((gfc_array_c4 *)d, (const GFC_COMPLEX_4 *)s);
+      return;
+
+    case GFC_DTYPE_COMPLEX_8:
+      internal_unpack_c8 ((gfc_array_c8 *)d, (const GFC_COMPLEX_8 *)s);
+      return;
+
+/* FIXME: This here is a hack, which will have to be removed when
+   the array descriptor is reworked.  Currently, we don't store the
+   kind value for the type, but only the size.  Because on targets with
+   __float128, we have sizeof(logn double) == sizeof(__float128),
+   we cannot discriminate here and have to fall back to the generic
+   handling (which is suboptimal).  */
+#if !defined(GFC_REAL_16_IS_FLOAT128)
+# if defined(HAVE_GFC_COMPLEX_10)
+    case GFC_DTYPE_COMPLEX_10:
+      internal_unpack_c10 ((gfc_array_c10 *) d, (const GFC_COMPLEX_10 *) s);
+      return;
+# endif
+
+# if defined(HAVE_GFC_COMPLEX_16)
+    case GFC_DTYPE_COMPLEX_16:
+      internal_unpack_c16 ((gfc_array_c16 *) d, (const GFC_COMPLEX_16 *) s);
+      return;
+# endif
+#endif
+
+    case GFC_DTYPE_DERIVED_2:
+      if (GFC_UNALIGNED_2(d->data) || GFC_UNALIGNED_2(s))
+       break;
+      else
+       {
+         internal_unpack_2 ((gfc_array_i2 *) d, (const GFC_INTEGER_2 *) s);
+         return;
+       }
+    case GFC_DTYPE_DERIVED_4:
+      if (GFC_UNALIGNED_4(d->data) || GFC_UNALIGNED_4(s))
+       break;
+      else
+       {
+         internal_unpack_4 ((gfc_array_i4 *) d, (const GFC_INTEGER_4 *) s);
+         return;
+       }
+
+    case GFC_DTYPE_DERIVED_8:
+      if (GFC_UNALIGNED_8(d->data) || GFC_UNALIGNED_8(s))
+       break;
+      else
+       {
+         internal_unpack_8 ((gfc_array_i8 *) d, (const GFC_INTEGER_8 *) s);
+         return;
+       }
+
+#ifdef HAVE_GFC_INTEGER_16
+    case GFC_DTYPE_DERIVED_16:
+      if (GFC_UNALIGNED_16(d->data) || GFC_UNALIGNED_16(s))
+       break;
+      else
+       {
+         internal_unpack_16 ((gfc_array_i16 *) d, (const GFC_INTEGER_16 *) s);
+         return;
+       }
+#endif
+
+    default:
+      break;
+    }
+
+  size = GFC_DESCRIPTOR_SIZE (d);
+
+  dim = GFC_DESCRIPTOR_RANK (d);
+  dsize = 1;
+  for (n = 0; n < dim; n++)
+    {
+      count[n] = 0;
+      stride[n] = GFC_DESCRIPTOR_STRIDE(d,n);
+      extent[n] = GFC_DESCRIPTOR_EXTENT(d,n);
+      if (extent[n] <= 0)
+       return;
+
+      if (dsize == stride[n])
+       dsize *= extent[n];
+      else
+       dsize = 0;
+    }
+
+  src = s;
+
+  if (dsize != 0)
+    {
+      memcpy (dest, src, dsize * size);
+      return;
+    }
+
+  stride0 = stride[0] * size;
+
+  while (dest)
+    {
+      /* Copy the data.  */
+      memcpy (dest, src, size);
+      /* Advance to the next element.  */
+      src += size;
+      dest += stride0;
+      count[0]++;
+      /* Advance to the next source element.  */
+      n = 0;
+      while (count[n] == extent[n])
+        {
+          /* When we get to the end of a dimension, reset it and increment
+             the next dimension.  */
+          count[n] = 0;
+          /* We could precalculate these products, but this is a less
+             frequently used path so probably not worth it.  */
+          dest -= stride[n] * extent[n] * size;
+          n++;
+          if (n == dim)
+            {
+              dest = NULL;
+              break;
+            }
+          else
+            {
+              count[n]++;
+              dest += stride[n] * size;
+            }
+        }
+    }
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/main.c b/l4/pkg/libgfortran/lib/contrib/runtime/main.c
new file mode 100644 (file)
index 0000000..79659e5
--- /dev/null
@@ -0,0 +1,257 @@
+/* Copyright (C) 2002-2003, 2005, 2007, 2009, 2011 
+   Free Software Foundation, Inc.
+   Contributed by Andy Vaught and Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* Stupid function to be sure the constructor is always linked in, even
+   in the case of static linking.  See PR libfortran/22298 for details.  */
+void
+stupid_function_name_for_static_linking (void)
+{
+  return;
+}
+
+/* This will be 0 for little-endian
+   machines and 1 for big-endian machines.  */
+int big_endian = 0;
+
+
+/* Figure out endianness for this machine.  */
+
+static void
+determine_endianness (void)
+{
+  union
+  {
+    GFC_LOGICAL_8 l8;
+    GFC_LOGICAL_4 l4[2];
+  } u;
+
+  u.l8 = 1;
+  if (u.l4[0])
+    big_endian = 0;
+  else if (u.l4[1])
+    big_endian = 1;
+  else
+    runtime_error ("Unable to determine machine endianness");
+}
+
+
+static int argc_save;
+static char **argv_save;
+
+static const char *exe_path;
+static int please_free_exe_path_when_done;
+
+/* Save the path under which the program was called, for use in the
+   backtrace routines.  */
+void
+store_exe_path (const char * argv0)
+{
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR   
+#define DIR_SEPARATOR '/'
+#endif
+
+  char buf[PATH_MAX], *path;
+  const char *cwd;
+
+  /* This can only happen if store_exe_path is called multiple times.  */
+  if (please_free_exe_path_when_done)
+    free ((char *) exe_path);
+
+  /* Reading the /proc/self/exe symlink is Linux-specific(?), but if
+     it works it gives the correct answer.  */
+#ifdef HAVE_READLINK
+  int len;
+  if ((len = readlink ("/proc/self/exe", buf, sizeof (buf) - 1)) != -1)
+    {
+      buf[len] = '\0';
+      exe_path = strdup (buf);
+      please_free_exe_path_when_done = 1;
+      return;
+    }
+#endif
+
+  /* If the path is absolute or on a simulator where argv is not set.  */
+#ifdef __MINGW32__
+  if (argv0 == NULL
+      || ('A' <= argv0[0] && argv0[0] <= 'Z' && argv0[1] == ':')
+      || ('a' <= argv0[0] && argv0[0] <= 'z' && argv0[1] == ':')
+      || (argv0[0] == '/' && argv0[1] == '/')
+      || (argv0[0] == '\\' && argv0[1] == '\\'))
+#else
+  if (argv0 == NULL || argv0[0] == DIR_SEPARATOR)
+#endif
+    {
+      exe_path = argv0;
+      please_free_exe_path_when_done = 0;
+      return;
+    }
+
+#ifdef HAVE_GETCWD
+  cwd = getcwd (buf, sizeof (buf));
+#else
+  cwd = NULL;
+#endif
+
+  if (!cwd)
+    {
+      exe_path = argv0;
+      please_free_exe_path_when_done = 0;
+      return;
+    }
+
+  /* exe_path will be cwd + "/" + argv[0] + "\0".  This will not work
+     if the executable is not in the cwd, but at this point we're out
+     of better ideas.  */
+  size_t pathlen = strlen (cwd) + 1 + strlen (argv0) + 1;
+  path = malloc (pathlen);
+  snprintf (path, pathlen, "%s%c%s", cwd, DIR_SEPARATOR, argv0);
+  exe_path = path;
+  please_free_exe_path_when_done = 1;
+}
+
+
+/* Return the full path of the executable.  */
+char *
+full_exe_path (void)
+{
+  return (char *) exe_path;
+}
+
+
+char *addr2line_path;
+
+/* Find addr2line and store the path.  */
+
+void
+find_addr2line (void)
+{
+#ifdef HAVE_ACCESS
+#define A2L_LEN 10
+  char *path = getenv ("PATH");
+  if (!path)
+    return;
+  size_t n = strlen (path);
+  char ap[n + 1 + A2L_LEN];
+  size_t ai = 0;
+  for (size_t i = 0; i < n; i++)
+    {
+      if (path[i] != ':')
+       ap[ai++] = path[i];
+      else
+       {
+         ap[ai++] = '/';
+         memcpy (ap + ai, "addr2line", A2L_LEN);
+         if (access (ap, R_OK|X_OK) == 0)
+           {
+             addr2line_path = strdup (ap);
+             return;
+           }
+         else
+           ai = 0;
+       }
+    }
+#endif
+}
+
+
+/* Set the saved values of the command line arguments.  */
+
+void
+set_args (int argc, char **argv)
+{
+  argc_save = argc;
+  argv_save = argv;
+  store_exe_path (argv[0]);
+}
+iexport(set_args);
+
+
+/* Retrieve the saved values of the command line arguments.  */
+
+void
+get_args (int *argc, char ***argv)
+{
+  *argc = argc_save;
+  *argv = argv_save;
+}
+
+
+/* Initialize the runtime library.  */
+
+static void __attribute__((constructor))
+init (void)
+{
+  /* Figure out the machine endianness.  */
+  determine_endianness ();
+
+  /* Must be first */
+  init_variables ();
+
+  init_units ();
+  set_fpu ();
+  init_compile_options ();
+
+#ifdef DEBUG
+  /* Check for special command lines.  */
+
+  if (argc > 1 && strcmp (argv[1], "--help") == 0)
+    show_variables ();
+
+  /* if (argc > 1 && strcmp(argv[1], "--resume") == 0) resume();  */
+#endif
+
+  if (options.backtrace == 1)
+    find_addr2line ();
+
+  random_seed_i4 (NULL, NULL, NULL);
+}
+
+
+/* Cleanup the runtime library.  */
+
+static void __attribute__((destructor))
+cleanup (void)
+{
+  close_units ();
+  
+  if (please_free_exe_path_when_done)
+    free ((char *) exe_path);
+
+  free (addr2line_path);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/memory.c b/l4/pkg/libgfortran/lib/contrib/runtime/memory.c
new file mode 100644 (file)
index 0000000..a26d9e5
--- /dev/null
@@ -0,0 +1,61 @@
+/* Memory management routines.
+   Copyright 2002, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+
+/* If GFC_CLEAR_MEMORY is defined, the memory allocation routines will
+   return memory that is guaranteed to be set to zero.  This can have
+   a severe efficiency penalty, so it should never be set if good
+   performance is desired, but it can help when you're debugging code.  */
+/* #define GFC_CLEAR_MEMORY */
+
+void *
+get_mem (size_t n)
+{
+  void *p;
+
+#ifdef GFC_CLEAR_MEMORY
+  p = (void *) calloc (1, n);
+#else
+  p = (void *) malloc (n);
+#endif
+  if (p == NULL)
+    os_error ("Memory allocation failed");
+
+  return p;
+}
+
+
+/* Allocate memory for internal (compiler generated) use.  */
+
+void *
+internal_malloc_size (size_t size)
+{
+  if (unlikely (size == 0))
+    size = 1;
+
+  return get_mem (size);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/pause.c b/l4/pkg/libgfortran/lib/contrib/runtime/pause.c
new file mode 100644 (file)
index 0000000..0e3c8ae
--- /dev/null
@@ -0,0 +1,70 @@
+/* Implementation of the PAUSE statement.
+   Copyright 2002, 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <string.h>
+#include <unistd.h>
+
+static void
+do_pause (void)
+{
+  char buff[4];
+  estr_write ("To resume execution, type go.  "
+             "Other input will terminate the job.\n");
+
+  fgets(buff, 4, stdin);
+  if (strncmp(buff, "go\n", 3) != 0)
+    stop_string ('\0', 0);
+  estr_write ("RESUMED\n");
+}
+
+/* A numeric PAUSE statement.  */
+
+extern void pause_numeric (GFC_INTEGER_4);
+export_proto(pause_numeric);
+
+void
+pause_numeric (GFC_INTEGER_4 code)
+{
+  st_printf ("PAUSE %d\n", (int) code);
+  do_pause ();
+}
+
+/* A character string or blank PAUSE statement.  */
+
+extern void pause_string (char *string, GFC_INTEGER_4 len);
+export_proto(pause_string);
+
+void
+pause_string (char *string, GFC_INTEGER_4 len)
+{
+  estr_write ("PAUSE ");
+  ssize_t w = write (STDERR_FILENO, string, len);
+  (void) sizeof (w); /* Avoid compiler warning about not using write
+                       return val.  */
+  estr_write ("\n");
+
+  do_pause ();
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/select.c b/l4/pkg/libgfortran/lib/contrib/runtime/select.c
new file mode 100644 (file)
index 0000000..e9d7f35
--- /dev/null
@@ -0,0 +1,46 @@
+/* Implement the SELECT statement for character variables.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+
+
+/* The string selection function is defined using a few generic macros
+   in select_inc.c, so we avoid code duplication between the various
+   character type kinds.  */
+
+#undef  CHARTYPE
+#define CHARTYPE char
+#undef  SUFFIX
+#define SUFFIX(x) x
+
+#include "select_inc.c"
+
+
+#undef  CHARTYPE
+#define CHARTYPE gfc_char4_t
+#undef  SUFFIX
+#define SUFFIX(x) x ## _char4
+
+#include "select_inc.c"
+
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/select_inc.c b/l4/pkg/libgfortran/lib/contrib/runtime/select_inc.c
new file mode 100644 (file)
index 0000000..904ad4d
--- /dev/null
@@ -0,0 +1,133 @@
+/* Implement the SELECT statement for character variables.
+   Copyright 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#define select_string SUFFIX(select_string)
+#define select_struct SUFFIX(select_struct)
+#define compare_string SUFFIX(compare_string)
+
+typedef struct
+{
+  CHARTYPE *low;
+  gfc_charlen_type low_len;
+  CHARTYPE *high;
+  gfc_charlen_type high_len;
+  int address;
+}
+select_struct;
+
+extern int select_string (select_struct *table, int table_len,
+                         const CHARTYPE *selector,
+                         gfc_charlen_type selector_len);
+export_proto(select_string);
+
+
+/* select_string()-- Given a selector string and a table of
+ * select_struct structures, return the address to jump to. */
+
+int
+select_string (select_struct *table, int table_len, const CHARTYPE *selector,
+              gfc_charlen_type selector_len)
+{
+  select_struct *t;
+  int i, low, high, mid;
+  int default_jump = -1;
+
+  if (table_len == 0)
+    return -1;
+
+  /* Record the default address if present */
+
+  if (table->low == NULL && table->high == NULL)
+    {
+      default_jump = table->address;
+
+      table++;
+      table_len--;
+      if (table_len == 0)
+        return default_jump;
+    }
+
+  /* Try the high and low bounds if present. */
+
+  if (table->low == NULL)
+    {
+      if (compare_string (table->high_len, table->high,
+                         selector_len, selector) >= 0)
+        return table->address;
+
+      table++;
+      table_len--;
+      if (table_len == 0)
+        return default_jump;
+    }
+
+  t = table + table_len - 1;
+
+  if (t->high == NULL)
+    {
+      if (compare_string (t->low_len, t->low, selector_len, selector) <= 0)
+        return t->address;
+
+      table_len--;
+      if (table_len == 0)
+        return default_jump;
+    }
+
+  /* At this point, the only table entries are bounded entries.  Find
+     the right entry with a binary chop. */
+
+  low = -1;
+  high = table_len;
+
+  while (low + 1 < high)
+    {
+      mid = (low + high) / 2;
+
+      t = table + mid;
+      i = compare_string (t->low_len, t->low, selector_len, selector);
+
+      if (i == 0)
+        return t->address;
+
+      if (i < 0)
+        low = mid;
+      else
+        high = mid;
+    }
+
+  /* The string now lies between the low indeces of the now-adjacent
+     high and low entries.  Because it is less than the low entry of
+     'high', it can't be that one.  If low is still -1, then no
+     entries match.  Otherwise, we have to check the high entry of
+     'low'. */
+
+  if (low == -1)
+    return default_jump;
+
+  t = table + low;
+  if (compare_string (selector_len, selector, t->high_len, t->high) <= 0)
+    return t->address;
+
+  return default_jump;
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/stop.c b/l4/pkg/libgfortran/lib/contrib/runtime/stop.c
new file mode 100644 (file)
index 0000000..36174b7
--- /dev/null
@@ -0,0 +1,109 @@
+/* Implementation of the STOP statement.
+   Copyright 2002, 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@nowt.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/* A numeric STOP statement.  */
+
+extern void stop_numeric (GFC_INTEGER_4)
+  __attribute__ ((noreturn));
+export_proto(stop_numeric);
+
+void
+stop_numeric (GFC_INTEGER_4 code)
+{
+  if (code == -1)
+    code = 0;
+  else
+    st_printf ("STOP %d\n", (int)code);
+
+  exit (code);
+}
+
+
+/* A Fortran 2008 numeric STOP statement.  */
+
+extern void stop_numeric_f08 (GFC_INTEGER_4)
+  __attribute__ ((noreturn));
+export_proto(stop_numeric_f08);
+
+void
+stop_numeric_f08 (GFC_INTEGER_4 code)
+{
+  st_printf ("STOP %d\n", (int)code);
+  exit (code);
+}
+
+
+/* A character string or blank STOP statement.  */
+
+void
+stop_string (const char *string, GFC_INTEGER_4 len)
+{
+  if (string)
+    {
+      estr_write ("STOP ");
+      (void) write (STDERR_FILENO, string, len);
+      estr_write ("\n");
+    }
+  exit (0);
+}
+
+
+/* Per Fortran 2008, section 8.4:  "Execution of a STOP statement initiates
+   normal termination of execution. Execution of an ERROR STOP statement
+   initiates error termination of execution."  Thus, error_stop_string returns
+   a nonzero exit status code.  */
+
+extern void error_stop_string (const char *, GFC_INTEGER_4)
+  __attribute__ ((noreturn));
+export_proto(error_stop_string);
+
+void
+error_stop_string (const char *string, GFC_INTEGER_4 len)
+{
+  estr_write ("ERROR STOP ");
+  (void) write (STDERR_FILENO, string, len);
+  estr_write ("\n");
+
+  exit (1);
+}
+
+
+/* A numeric ERROR STOP statement.  */
+
+extern void error_stop_numeric (GFC_INTEGER_4)
+  __attribute__ ((noreturn));
+export_proto(error_stop_numeric);
+
+void
+error_stop_numeric (GFC_INTEGER_4 code)
+{
+  st_printf ("ERROR STOP %d\n", (int) code);
+  exit (code);
+}
diff --git a/l4/pkg/libgfortran/lib/contrib/runtime/string.c b/l4/pkg/libgfortran/lib/contrib/runtime/string.c
new file mode 100644 (file)
index 0000000..ac2d53d
--- /dev/null
@@ -0,0 +1,112 @@
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Paul Brook
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#include "libgfortran.h"
+#include <string.h>
+
+
+/* Given a fortran string, return its length exclusive of the trailing
+   spaces.  */
+
+gfc_charlen_type
+fstrlen (const char *string, gfc_charlen_type len)
+{
+  for (; len > 0; len--)
+    if (string[len-1] != ' ')
+      break;
+
+  return len;
+}
+
+
+/* Copy a Fortran string (not null-terminated, hence length arguments
+   for both source and destination strings. Returns the non-padded
+   length of the destination.  */
+
+gfc_charlen_type
+fstrcpy (char *dest, gfc_charlen_type destlen, 
+        const char *src, gfc_charlen_type srclen)
+{
+  if (srclen >= destlen)
+    {
+      /* This will truncate if too long.  */
+      memcpy (dest, src, destlen);
+      return destlen;
+    }
+  else
+    {
+      memcpy (dest, src, srclen);
+      /* Pad with spaces.  */
+      memset (&dest[srclen], ' ', destlen - srclen);
+      return srclen;
+    }
+}
+
+
+/* Copy a null-terminated C string to a non-null-terminated Fortran
+   string. Returns the non-padded length of the destination string.  */
+
+gfc_charlen_type
+cf_strcpy (char *dest, gfc_charlen_type dest_len, const char *src)
+{
+  size_t src_len;
+
+  src_len = strlen (src);
+
+  if (src_len >= (size_t) dest_len)
+    {
+      /* This will truncate if too long.  */
+      memcpy (dest, src, dest_len);
+      return dest_len;
+    }
+  else
+    {
+      memcpy (dest, src, src_len);
+      /* Pad with spaces.  */
+      memset (&dest[src_len], ' ', dest_len - src_len);
+      return src_len;
+    }
+}
+
+
+/* Given a fortran string and an array of st_option structures, search through
+   the array to find a match.  If the option is not found, we generate an error
+   if no default is provided.  */
+
+int
+find_option (st_parameter_common *cmp, const char *s1, gfc_charlen_type s1_len,
+            const st_option * opts, const char *error_message)
+{
+  /* Strip trailing blanks from the Fortran string.  */
+  size_t len = (size_t) fstrlen (s1, s1_len);
+
+  for (; opts->name; opts++)
+    if (len == strlen(opts->name) && strncasecmp (s1, opts->name, len) == 0)
+      return opts->value;
+
+  generate_error (cmp, LIBERROR_BAD_OPTION, error_message);
+
+  return -1;
+}
diff --git a/l4/pkg/libgfortran/lib/gcc/fortran/libgfortran.h b/l4/pkg/libgfortran/lib/gcc/fortran/libgfortran.h
new file mode 100644 (file)
index 0000000..3f36fe8
--- /dev/null
@@ -0,0 +1,134 @@
+/* Header file to the Fortran front-end and runtime library
+   Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC 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 GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* Flags to specify which standard/extension contains a feature.
+   Note that no features were obsoleted nor deleted in F2003.
+   Please remember to keep those definitions in sync with
+   gfortran.texi.  */
+#define GFC_STD_F2008_TS       (1<<9)  /* POST-F2008 technical reports.  */
+#define GFC_STD_F2008_OBS      (1<<8)  /* Obsolescent in F2008.  */
+#define GFC_STD_F2008          (1<<7)  /* New in F2008.  */
+#define GFC_STD_LEGACY         (1<<6)  /* Backward compatibility.  */
+#define GFC_STD_GNU            (1<<5)  /* GNU Fortran extension.  */
+#define GFC_STD_F2003          (1<<4)  /* New in F2003.  */
+#define GFC_STD_F95            (1<<3)  /* New in F95.  */
+#define GFC_STD_F95_DEL                (1<<2)  /* Deleted in F95.  */
+#define GFC_STD_F95_OBS                (1<<1)  /* Obsolescent in F95.  */
+#define GFC_STD_F77            (1<<0)  /* Included in F77, but not deleted or
+                                          obsolescent in later standards.  */
+
+
+/* Bitmasks for the various FPE that can be enabled.  */
+#define GFC_FPE_INVALID    (1<<0)
+#define GFC_FPE_DENORMAL   (1<<1)
+#define GFC_FPE_ZERO       (1<<2)
+#define GFC_FPE_OVERFLOW   (1<<3)
+#define GFC_FPE_UNDERFLOW  (1<<4)
+#define GFC_FPE_INEXACT    (1<<5)
+
+
+/* Bitmasks for the various runtime checks that can be enabled.  */
+#define GFC_RTCHECK_BOUNDS      (1<<0)
+#define GFC_RTCHECK_ARRAY_TEMPS (1<<1)
+#define GFC_RTCHECK_RECURSION   (1<<2)
+#define GFC_RTCHECK_DO          (1<<3)
+#define GFC_RTCHECK_POINTER     (1<<4)
+#define GFC_RTCHECK_MEM         (1<<5)
+#define GFC_RTCHECK_ALL        (GFC_RTCHECK_BOUNDS | GFC_RTCHECK_ARRAY_TEMPS \
+                               | GFC_RTCHECK_RECURSION | GFC_RTCHECK_DO \
+                               | GFC_RTCHECK_POINTER | GFC_RTCHECK_MEM)
+
+
+/* Possible values for the CONVERT I/O specifier.  */
+typedef enum
+{
+  GFC_CONVERT_NONE = -1,
+  GFC_CONVERT_NATIVE = 0,
+  GFC_CONVERT_SWAP,
+  GFC_CONVERT_BIG,
+  GFC_CONVERT_LITTLE
+}
+unit_convert;
+
+
+/* Runtime errors.  */
+typedef enum
+{
+  LIBERROR_FIRST = -3,         /* Marker for the first error.  */
+  LIBERROR_EOR = -2,           /* End of record, must be negative.  */
+  LIBERROR_END = -1,           /* End of file, must be negative.  */
+  LIBERROR_OK = 0,             /* Indicates success, must be zero.  */
+  LIBERROR_OS = 5000,          /* OS error, more info in errno.  */
+  LIBERROR_OPTION_CONFLICT,
+  LIBERROR_BAD_OPTION,
+  LIBERROR_MISSING_OPTION,
+  LIBERROR_ALREADY_OPEN,
+  LIBERROR_BAD_UNIT,
+  LIBERROR_FORMAT,
+  LIBERROR_BAD_ACTION,
+  LIBERROR_ENDFILE,
+  LIBERROR_BAD_US,
+  LIBERROR_READ_VALUE,
+  LIBERROR_READ_OVERFLOW,
+  LIBERROR_INTERNAL,
+  LIBERROR_INTERNAL_UNIT,
+  LIBERROR_ALLOCATION,
+  LIBERROR_DIRECT_EOR,
+  LIBERROR_SHORT_RECORD,
+  LIBERROR_CORRUPT_FILE,
+  LIBERROR_INQUIRE_INTERNAL_UNIT, /* Must be different from STAT_STOPPED_IMAGE.  */
+  LIBERROR_LAST                        /* Not a real error, the last error # + 1.  */
+}
+libgfortran_error_codes;
+
+/* Must kept in sync with libgfortrancaf.h.  */
+typedef enum
+{
+  GFC_STAT_UNLOCKED = 0,
+  GFC_STAT_LOCKED,
+  GFC_STAT_LOCKED_OTHER_IMAGE,
+  GFC_STAT_STOPPED_IMAGE = 6000 /* See LIBERROR_INQUIRE_INTERNAL_UNIT above. */
+}
+libgfortran_stat_codes;
+
+/* Default unit number for preconnected standard input and output.  */
+#define GFC_STDIN_UNIT_NUMBER 5
+#define GFC_STDOUT_UNIT_NUMBER 6
+#define GFC_STDERR_UNIT_NUMBER 0
+
+
+/* FIXME: Increase to 15 for Fortran 2008. Also needs changes to
+   GFC_DTYPE_RANK_MASK. See PR 36825.  */
+#define GFC_MAX_DIMENSIONS 7
+
+#define GFC_DTYPE_RANK_MASK 0x07
+#define GFC_DTYPE_TYPE_SHIFT 3
+#define GFC_DTYPE_TYPE_MASK 0x38
+#define GFC_DTYPE_SIZE_SHIFT 6
+
+/* Basic types.  BT_VOID is used by ISO C Binding so funcs like c_f_pointer
+   can take any arg with the pointer attribute as a param.  These are also
+   used in the run-time library for IO.  */
+typedef enum
+{ BT_UNKNOWN = 0, BT_INTEGER, BT_LOGICAL, BT_REAL, BT_COMPLEX,
+  BT_DERIVED, BT_CHARACTER, BT_CLASS, BT_PROCEDURE, BT_HOLLERITH, BT_VOID
+}
+bt;
diff --git a/l4/pkg/libgomp/lib/build/ARCH-amd64/gcc-4.3/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-amd64/gcc-4.3/libgomp_f.h
new file mode 100644 (file)
index 0000000..b5761dd
--- /dev/null
@@ -0,0 +1,68 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   Libgomp 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 Lesser General Public License for
+   more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with libgomp; see the file COPYING.LIB.  If not, write to the
+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+/* As a special exception, if you link this library with other files, some
+   of which are compiled with GCC, to produce an executable, this library
+   does not by itself cause the resulting executable to be covered by the
+   GNU General Public License.  This exception does not however invalidate
+   any other reasons why the executable file might be covered by the GNU
+   General Public License.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (40 == 8) \
+    && (8 <= 40)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (48 == 8) \
+    && (8 <= 48)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(40 != sizeof (omp_lock_t)
+            || 8 != __alignof (omp_lock_t)
+            || 48 != sizeof (omp_nest_lock_t)
+            || 8 != __alignof (omp_nest_lock_t)
+            || 8 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/build/ARCH-amd64/gcc-4.7/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-amd64/gcc-4.7/libgomp_f.h
new file mode 100644 (file)
index 0000000..3ed3151
--- /dev/null
@@ -0,0 +1,93 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (4 == 4) \
+    && (4 <= 4)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (16 == 8) \
+    && (8 <= 16)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (4 == 4) \
+    && (4 <= 4)
+# define OMP_LOCK_25_DIRECT
+typedef omp_lock_25_t *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_lock_25_t *lock; uint64_t u; } *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+#if (8 == 8) \
+    && (4 <= 8)
+# define OMP_NEST_LOCK_25_DIRECT
+typedef omp_nest_lock_25_t *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_25_t *lock; uint64_t u; } *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(32 != sizeof (omp_lock_t)
+            || 8 != __alignof (omp_lock_t)
+            || 48 != sizeof (omp_nest_lock_t)
+            || 8 != __alignof (omp_nest_lock_t)
+            || 32 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+  char test2[(40 != sizeof (omp_lock_25_t)
+            || 8 != __alignof (omp_lock_25_t)
+            || 48 != sizeof (omp_nest_lock_25_t)
+            || 8 != __alignof (omp_nest_lock_25_t)
+            || 40 != sizeof (*(omp_lock_25_arg_t) 0)
+            || 48
+               != sizeof (*(omp_nest_lock_25_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/build/ARCH-arm/gcc-4.3/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-arm/gcc-4.3/libgomp_f.h
new file mode 100644 (file)
index 0000000..cc82e8c
--- /dev/null
@@ -0,0 +1,68 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   Libgomp 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 Lesser General Public License for
+   more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with libgomp; see the file COPYING.LIB.  If not, write to the
+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+/* As a special exception, if you link this library with other files, some
+   of which are compiled with GCC, to produce an executable, this library
+   does not by itself cause the resulting executable to be covered by the
+   GNU General Public License.  This exception does not however invalidate
+   any other reasons why the executable file might be covered by the GNU
+   General Public License.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (24 == 8) \
+    && (4 <= 24)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (28 == 8) \
+    && (4 <= 28)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(24 != sizeof (omp_lock_t)
+            || 4 != __alignof (omp_lock_t)
+            || 28 != sizeof (omp_nest_lock_t)
+            || 4 != __alignof (omp_nest_lock_t)
+            || 8 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/build/ARCH-arm/gcc-4.7/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-arm/gcc-4.7/libgomp_f.h
new file mode 100644 (file)
index 0000000..7e4bc5f
--- /dev/null
@@ -0,0 +1,93 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (16 == 16) \
+    && (4 <= 4)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (24 == 8) \
+    && (4 <= 24)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (24 == 24) \
+    && (4 <= 24)
+# define OMP_LOCK_25_DIRECT
+typedef omp_lock_25_t *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_lock_25_t *lock; uint64_t u; } *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+#if (28 == 28) \
+    && (4 <= 28)
+# define OMP_NEST_LOCK_25_DIRECT
+typedef omp_nest_lock_25_t *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_25_t *lock; uint64_t u; } *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(16 != sizeof (omp_lock_t)
+            || 4 != __alignof (omp_lock_t)
+            || 24 != sizeof (omp_nest_lock_t)
+            || 4 != __alignof (omp_nest_lock_t)
+            || 16 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+  char test2[(24 != sizeof (omp_lock_25_t)
+            || 4 != __alignof (omp_lock_25_t)
+            || 28 != sizeof (omp_nest_lock_25_t)
+            || 4 != __alignof (omp_nest_lock_25_t)
+            || 24 != sizeof (*(omp_lock_25_arg_t) 0)
+            || 28
+               != sizeof (*(omp_nest_lock_25_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/build/ARCH-ppc32/gcc-4.3/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-ppc32/gcc-4.3/libgomp_f.h
new file mode 100644 (file)
index 0000000..cc82e8c
--- /dev/null
@@ -0,0 +1,68 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   Libgomp 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 Lesser General Public License for
+   more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with libgomp; see the file COPYING.LIB.  If not, write to the
+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+/* As a special exception, if you link this library with other files, some
+   of which are compiled with GCC, to produce an executable, this library
+   does not by itself cause the resulting executable to be covered by the
+   GNU General Public License.  This exception does not however invalidate
+   any other reasons why the executable file might be covered by the GNU
+   General Public License.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (24 == 8) \
+    && (4 <= 24)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (28 == 8) \
+    && (4 <= 28)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(24 != sizeof (omp_lock_t)
+            || 4 != __alignof (omp_lock_t)
+            || 28 != sizeof (omp_nest_lock_t)
+            || 4 != __alignof (omp_nest_lock_t)
+            || 8 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/build/ARCH-ppc32/gcc-4.7/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-ppc32/gcc-4.7/libgomp_f.h
new file mode 100644 (file)
index 0000000..7e4bc5f
--- /dev/null
@@ -0,0 +1,93 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (16 == 16) \
+    && (4 <= 4)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (24 == 8) \
+    && (4 <= 24)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (24 == 24) \
+    && (4 <= 24)
+# define OMP_LOCK_25_DIRECT
+typedef omp_lock_25_t *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_lock_25_t *lock; uint64_t u; } *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+#if (28 == 28) \
+    && (4 <= 28)
+# define OMP_NEST_LOCK_25_DIRECT
+typedef omp_nest_lock_25_t *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_25_t *lock; uint64_t u; } *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(16 != sizeof (omp_lock_t)
+            || 4 != __alignof (omp_lock_t)
+            || 24 != sizeof (omp_nest_lock_t)
+            || 4 != __alignof (omp_nest_lock_t)
+            || 16 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+  char test2[(24 != sizeof (omp_lock_25_t)
+            || 4 != __alignof (omp_lock_25_t)
+            || 28 != sizeof (omp_nest_lock_25_t)
+            || 4 != __alignof (omp_nest_lock_25_t)
+            || 24 != sizeof (*(omp_lock_25_arg_t) 0)
+            || 28
+               != sizeof (*(omp_nest_lock_25_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/build/ARCH-sparc/gcc-4.3/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-sparc/gcc-4.3/libgomp_f.h
new file mode 100644 (file)
index 0000000..cc82e8c
--- /dev/null
@@ -0,0 +1,68 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   Libgomp 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 Lesser General Public License for
+   more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with libgomp; see the file COPYING.LIB.  If not, write to the
+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+/* As a special exception, if you link this library with other files, some
+   of which are compiled with GCC, to produce an executable, this library
+   does not by itself cause the resulting executable to be covered by the
+   GNU General Public License.  This exception does not however invalidate
+   any other reasons why the executable file might be covered by the GNU
+   General Public License.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (24 == 8) \
+    && (4 <= 24)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (28 == 8) \
+    && (4 <= 28)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(24 != sizeof (omp_lock_t)
+            || 4 != __alignof (omp_lock_t)
+            || 28 != sizeof (omp_nest_lock_t)
+            || 4 != __alignof (omp_nest_lock_t)
+            || 8 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/build/ARCH-sparc/gcc-4.7/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-sparc/gcc-4.7/libgomp_f.h
new file mode 100644 (file)
index 0000000..7e4bc5f
--- /dev/null
@@ -0,0 +1,93 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (16 == 16) \
+    && (4 <= 4)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (24 == 8) \
+    && (4 <= 24)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (24 == 24) \
+    && (4 <= 24)
+# define OMP_LOCK_25_DIRECT
+typedef omp_lock_25_t *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_lock_25_t *lock; uint64_t u; } *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+#if (28 == 28) \
+    && (4 <= 28)
+# define OMP_NEST_LOCK_25_DIRECT
+typedef omp_nest_lock_25_t *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_25_t *lock; uint64_t u; } *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(16 != sizeof (omp_lock_t)
+            || 4 != __alignof (omp_lock_t)
+            || 24 != sizeof (omp_nest_lock_t)
+            || 4 != __alignof (omp_nest_lock_t)
+            || 16 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+  char test2[(24 != sizeof (omp_lock_25_t)
+            || 4 != __alignof (omp_lock_25_t)
+            || 28 != sizeof (omp_nest_lock_25_t)
+            || 4 != __alignof (omp_nest_lock_25_t)
+            || 24 != sizeof (*(omp_lock_25_arg_t) 0)
+            || 28
+               != sizeof (*(omp_nest_lock_25_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/build/ARCH-x86/gcc-4.3/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-x86/gcc-4.3/libgomp_f.h
new file mode 100644 (file)
index 0000000..cc82e8c
--- /dev/null
@@ -0,0 +1,68 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   Libgomp 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 Lesser General Public License for
+   more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with libgomp; see the file COPYING.LIB.  If not, write to the
+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+/* As a special exception, if you link this library with other files, some
+   of which are compiled with GCC, to produce an executable, this library
+   does not by itself cause the resulting executable to be covered by the
+   GNU General Public License.  This exception does not however invalidate
+   any other reasons why the executable file might be covered by the GNU
+   General Public License.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (24 == 8) \
+    && (4 <= 24)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (28 == 8) \
+    && (4 <= 28)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(24 != sizeof (omp_lock_t)
+            || 4 != __alignof (omp_lock_t)
+            || 28 != sizeof (omp_nest_lock_t)
+            || 4 != __alignof (omp_nest_lock_t)
+            || 8 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/build/ARCH-x86/gcc-4.7/libgomp_f.h b/l4/pkg/libgomp/lib/build/ARCH-x86/gcc-4.7/libgomp_f.h
new file mode 100644 (file)
index 0000000..7e4bc5f
--- /dev/null
@@ -0,0 +1,93 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (16 == 16) \
+    && (4 <= 4)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (24 == 8) \
+    && (4 <= 24)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (24 == 24) \
+    && (4 <= 24)
+# define OMP_LOCK_25_DIRECT
+typedef omp_lock_25_t *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_lock_25_t *lock; uint64_t u; } *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+#if (28 == 28) \
+    && (4 <= 28)
+# define OMP_NEST_LOCK_25_DIRECT
+typedef omp_nest_lock_25_t *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_25_t *lock; uint64_t u; } *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(16 != sizeof (omp_lock_t)
+            || 4 != __alignof (omp_lock_t)
+            || 24 != sizeof (omp_nest_lock_t)
+            || 4 != __alignof (omp_nest_lock_t)
+            || 16 != sizeof (*(omp_lock_arg_t) 0)
+            || 8 != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+  char test2[(24 != sizeof (omp_lock_25_t)
+            || 4 != __alignof (omp_lock_25_t)
+            || 28 != sizeof (omp_nest_lock_25_t)
+            || 4 != __alignof (omp_nest_lock_25_t)
+            || 24 != sizeof (*(omp_lock_25_arg_t) 0)
+            || 28
+               != sizeof (*(omp_nest_lock_25_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
index deefb046f820a993eee16ecfd0d5ae17fbd87427..a99a0017470ea7e6b720cf023ec0963f79141de3 100644 (file)
@@ -15,17 +15,22 @@ ifneq ($(SYSTEM),)
  endif
 endif
 
-PRIVATE_INCDIR = $(PKGDIR)/lib/contrib/gcc-4.3/libgomp \
-                 $(PKGDIR)/lib/contrib/gcc-4.3/libgomp/config/posix \
+USE_VERSION = $(if $(filter 4.2 4.3 4.4 4.5 4.6,$(GCCVERSION)),4.3,4.7)
+
+PRIVATE_INCDIR = $(PKGDIR)/lib/contrib/gcc-$(USE_VERSION)/libgomp \
+                 $(PKGDIR)/lib/contrib/gcc-$(USE_VERSION)/libgomp/config/posix \
                  $(PKGDIR)/lib/build \
-                 $(PKGDIR)/lib/build/ARCH-$(BUILD_ARCH)
+                 $(PKGDIR)/lib/build/ARCH-$(BUILD_ARCH)/gcc-$(USE_VERSION)
+
+vpath %.c $(PKGDIR)/lib/contrib/gcc-$(USE_VERSION)/libgomp \
+          $(PKGDIR)/lib/contrib/gcc-$(USE_VERSION)/libgomp/config/posix
 
-vpath %.c $(PKGDIR)/lib/contrib/gcc-4.3/libgomp \
-          $(PKGDIR)/lib/contrib/gcc-4.3/libgomp/config/posix
+SRC_C     = affinity.c alloc.c critical.c error.c iter.c loop.c ordered.c \
+           sections.c work.c barrier.c env.c fortran.c parallel.c proc.c sem.c \
+            time.c team.c lock.c mutex.c single.c bar.c
+SRC_C-4.7 = task.c iter_ull.c loop_ull.c ptrlock.c 
+SRC_C    += $(SRC_C-$(USE_VERSION))
 
-SRC_C = affinity.c alloc.c bar.c barrier.c critical.c env.c error.c \
-        fortran.c iter.c lock.c loop.c mutex.c ordered.c parallel.c proc.c \
-        sections.c sem.c single.c team.c time.c work.c
 REQUIRES_LIBS = libpthread
 
 include $(L4DIR)/mk/lib.mk
index 9115688a0bf0b8ef547ade427d88d5ec91cb6360..e008b806a7a46d0c13c86b1a3e474f649536eae5 100644 (file)
@@ -1,6 +1,9 @@
-/* config.h.  Generated by configure.  */
+/* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Define to 1 if the target assembler supports .symver directive. */
+#define HAVE_AS_SYMVER_DIRECTIVE 1
+
 /* Define to 1 if the target supports __attribute__((alias(...))). */
 #define HAVE_ATTRIBUTE_ALIAS 1
 
 /* Define if the POSIX Semaphores do not work on your system. */
 /* #undef HAVE_BROKEN_POSIX_SEMAPHORES */
 
+/* Define to 1 if the target assembler supports thread-local storage. */
+/* #undef HAVE_CC_TLS */
+
 /* Define to 1 if you have the `clock_gettime' function. */
-#define HAVE_CLOCK_GETTIME 1
+/* #undef HAVE_CLOCK_GETTIME */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
 
 /* Define to 1 if you have the `getloadavg' function. */
 /* #undef HAVE_GETLOADAVG */
 /* Define to 1 if you have the <string.h> header file. */
 #define HAVE_STRING_H 1
 
+/* Define to 1 if you have the `strtoull' function. */
+#define HAVE_STRTOULL 1
+
+/* Define to 1 if the target runtime linker supports binding the same symbol
+   to different versions. */
+#define HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1
+
 /* Define to 1 if the target supports __sync_*_compare_and_swap */
-/* #undef HAVE_SYNC_BUILTINS */
+#define HAVE_SYNC_BUILTINS 1
 
 /* Define to 1 if you have the <sys/loadavg.h> header file. */
 /* #undef HAVE_SYS_LOADAVG_H */
 #define HAVE_SYS_TYPES_H 1
 
 /* Define to 1 if the target supports thread-local storage. */
-/* #undef HAVE_TLS */
+#define HAVE_TLS 1
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #define HAVE_UNISTD_H 1
 
+/* Define to 1 if GNU symbol versioning is used for libgomp. */
+#define LIBGOMP_GNU_SYMBOL_VERSIONING 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
 /* Name of package */
 #define PACKAGE "libgomp"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libgomp"
 
+/* Define to the home page for this package. */
+#define PACKAGE_URL "http://www.gnu.org/software/libgomp/"
+
 /* Define to the version of this package. */
 #define PACKAGE_VERSION "1.0"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
+/* Define if you can safely include both <string.h> and <strings.h>. */
+#define STRING_WITH_STRINGS 1
+
 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
 #define TIME_WITH_SYS_TIME 1
 
index 140601042baf35313dd73aad136d2105a4134be4..72bb848e059fe493974b466a896db156709ef199 100644 (file)
@@ -1,4 +1,4 @@
-/* generated for  gcc (Debian 4.3.2-1) 4.3.2 */
+/* generated for  xgcc (GCC) 4.7.3 20121125 (prerelease) */
 
 #ifndef GCC_GENERATED_STDINT_H
 #define GCC_GENERATED_STDINT_H 1
diff --git a/l4/pkg/libgomp/lib/build/libgomp_f_size.h b/l4/pkg/libgomp/lib/build/libgomp_f_size.h
new file mode 100644 (file)
index 0000000..2758e26
--- /dev/null
@@ -0,0 +1,15 @@
+#define YY(n, v) char foo_##n[v];
+
+YY(OMP_LOCK_SIZE,  sizeof (omp_lock_t));
+YY(OMP_LOCK_ALIGN,  __alignof (omp_lock_t));
+YY(OMP_NEST_LOCK_SIZE,  sizeof (omp_nest_lock_t));
+YY(OMP_NEST_LOCK_ALIGN,  __alignof (omp_nest_lock_t));
+YY(sizeof_star_omp_lock_arg_t,  sizeof (*(omp_lock_arg_t) 0));
+YY(sizeof_star_omp_nest_lock_arg_t, sizeof (*(omp_nest_lock_arg_t) 0));
+YY(OMP_LOCK_25_SIZE,  sizeof (omp_lock_25_t));
+YY(OMP_LOCK_25_ALIGN,  __alignof (omp_lock_25_t));
+YY(OMP_NEST_LOCK_25_SIZE,  sizeof (omp_nest_lock_25_t));
+YY(OMP_NEST_LOCK_25_ALIGN,  __alignof (omp_nest_lock_25_t));
+YY(sizeof_star_omp_lock_25_arg_t,  sizeof (*(omp_lock_25_arg_t) 0));
+YY(sizeof_star_omp_nest_lock_25_arg_t,  sizeof (*(omp_nest_lock_25_arg_t) 0));
+
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/README.L4 b/l4/pkg/libgomp/lib/contrib/gcc-4.7/README.L4
new file mode 100644 (file)
index 0000000..5b78be4
--- /dev/null
@@ -0,0 +1 @@
+Taken from svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch, r195923
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/ChangeLog b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/ChangeLog
new file mode 100644 (file)
index 0000000..7422a81
--- /dev/null
@@ -0,0 +1,3300 @@
+2013-01-22  Alan Modra  <amodra@gmail.com>
+
+       PR libgomp/51376
+       PR libgomp/56073
+       * task.c (GOMP_task): Revert 2011-12-09 change.
+       (GOMP_taskwait): Likewise.  Instead use atomic load with acquire
+       barrier to read task->children..
+       (gomp_barrier_handle_tasks): ..and matching atomic store with
+       release barrier here when setting parent->children to NULL.
+
+2012-11-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/55411
+       * team.c (gomp_free_thread): Decrease gomp_managed_threads
+       if pool had any threads_used.
+
+2012-09-20  Release Manager
+
+       * GCC 4.7.2 released.
+
+2012-06-14  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2012-06-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/53580
+       * testsuite/libgomp.c/pr26943-2.c: Remove #pragma omp barrier,
+       use GOMP_barrier () call instead.
+       * testsuite/libgomp.c/pr26943-3.c: Likewise.
+       * testsuite/libgomp.c/pr26943-4.c: Likewise.
+       * testsuite/libgomp.fortran/vla4.f90: Remove !$omp barrier,
+       call GOMP_barrier instead.
+       * testsuite/libgomp.fortran/vla5.f90: Likewise.
+
+       2012-06-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/52993
+       * config/linux/lock.c (gomp_init_nest_lock_25): Fix up last
+       argument to memset call.
+
+2012-06-14  Release Manager
+
+       * GCC 4.7.1 released.
+
+2012-03-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/52547
+       * testsuite/libgomp.c/pr52547.c: New test.
+
+2012-03-22  Release Manager
+
+       * GCC 4.7.0 released.
+
+2012-02-29  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * config/linux/sparc/futex.h (cpu_relax): Read from CC register.
+
+2012-02-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR libstdc++/52188
+       * acinclude.m4 (LIBGOMP_ENABLE_SYMVERS): Remove symvers_renaming.
+       Remove ENABLE_SYMVERS_SOL2.
+       * configure: Regenerate.
+       * Makefile.am [LIBGOMP_BUILD_VERSIONED_SHLIB] (comma): New variable.
+       (PREPROCESS): New variable.
+       (libgomp.ver): New target.
+       [LIBGOMP_BUILD_VERSIONED_SHLIB &&
+       LIBGOMP_BUILD_VERSIONED_SHLIB_GNU]: Remove
+       LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2 handling.
+       Use libgomp.ver.
+       [LIBGOMP_BUILD_VERSIONED_SHLIB_SUN]: Use libgomp.ver, libgomp.ver-sun.
+       * Makefile.in: Regenerate.
+
+2012-02-14  Walter Lee  <walt@tilera.com>
+
+       * configure.tgt: Handle tilegx and tilepro.
+       * config/linux/tile/futex.h: New file.
+
+2012-02-08  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/46886
+       * testsuite/libgomp.c/pr46886.c: New testcase.
+
+2012-01-25  Matthias Klose  <doko@ubuntu.com>
+
+       * config/linux/arm: Remove empty directory.
+       * configure.tgt (config_path): Remove linux-arm for arm*-*-linux*.
+
+2011-12-09  Alan Modra  <amodra@gmail.com>
+
+       PR libgomp/51376
+       * task.c (GOMP_taskwait): Don't access task->children outside of
+       task_lock mutex region.
+       (GOMP_task): Likewise.
+
+2011-12-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/51132
+       * testsuite/libgomp.graphite/force-parallel-1.c: Move large arrays
+       to file scope.
+       * testsuite/libgomp.graphite/force-parallel-3.c: Likewise.
+       * testsuite/libgomp.graphite/force-parallel-6.c: Likewise.
+       * testsuite/libgomp.graphite/force-parallel-7.c: Likewise.
+       * testsuite/libgomp.graphite/force-parallel-8.c: Likewise.
+       * testsuite/libgomp.graphite/force-parallel-9.c: Likewise.
+
+2011-12-02  Alan Modra  <amodra@gmail.com>
+
+       * config/linux/affinity.c: Use atomic rather than sync builtin.
+       * config/linux/lock.c: Likewise.
+       * config/linux/ptrlock.h: Likewise.
+       * config/linux/ptrlock.c: Likewise.
+       * config/linux/ptrlock.h (gomp_ptrlock_set): Always write here..
+       * config/linux/ptrlock.c (gomp_ptrlock_set_slow): ..not here.
+       * config/linux/futex.h (atomic_write_barrier): Delete unused function.
+       * config/linux/alpha/futex.h (atomic_write_barrier): Likewise.
+       * config/linux/ia64/futex.h (atomic_write_barrier): Likewise.
+       * config/linux/mips/futex.h (atomic_write_barrier): Likewise.
+       * config/linux/powerpc/futex.h (atomic_write_barrier): Likewise.
+       * config/linux/s390/futex.h (atomic_write_barrier): Likewise.
+       * config/linux/sparc/futex.h (atomic_write_barrier): Likewise.
+       * config/linux/x86/futex.h (atomic_write_barrier): Likewise.
+
+2011-11-30  Alan Modra  <amodra@gmail.com>
+
+       PR libgomp/51298
+       * config/linux/bar.h: Use atomic rather than sync builtins.
+       * config/linux/bar.c: Likewise.  Add missing acquire
+       synchronisation on generation field.
+       * task.c (gomp_barrier_handle_tasks): Regain lock so as to not
+       double unlock.
+
+2011-11-30  Alan Modra  <amodra@gmail.com>
+
+       * ordered.c (gomp_ordered_sync): Add MEMMODEL_ACQ_REL fence.
+       * critical.c (GOMP_critical_start): Add MEMMODEL_RELEASE fence.
+       * config/linux/mutex.h: Use atomic rather than sync builtins.
+       * config/linux/mutex.c: Likewise.  Comment.  Use -1 for waiting state.
+       * config/linux/omp-lock.h: Comment fix.
+       * config/linux/arm/mutex.h: Delete.
+       * config/linux/powerpc/mutex.h: Delete.
+       * config/linux/ia64/mutex.h: Delete.
+       * config/linux/mips/mutex.h: Delete.
+
+2011-11-30  Alan Modra  <amodra@gmail.com>
+
+       PR libgomp/51249
+       * config/linux/sem.h: Rewrite.
+       * config/linux/sem.c: Rewrite.
+
+2011-11-28  Richard Henderson  <rth@redhat.com>
+
+       * libgomp.h (enum memmodel): New.
+
+2011-11-21  Andreas Tobler  <andreast@fgznet.ch>
+
+       * configure: Regenerate.
+
+2011-10-10  Matthias Klose  <doko@ubuntu.com>
+
+       * config/posix95: Remove empty directory.
+
+2011-08-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/threadprivate4.f90: New test.
+
+2011-08-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/49792
+       * testsuite/libgomp.fortran/pr49792-1.f90: New test.
+       * testsuite/libgomp.fortran/pr49792-2.f90: New test.
+
+2011-08-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * config/posix95/lock.c, posix95/omp-lock.h: Remove.
+
+2011-08-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR libgomp/49965
+       * testsuite/libgomp.c++/task-8.C: Replaced err by errval.
+
+2011-08-03  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/linux/proc.h: New.
+       * config/linux/proc.c: Include "proc.h".  Do not include <sched.h>.
+       (gomp_cpuset_popcount): Rename from cpuset_popcount.  No more static.
+       (gomp_init_num_threads): Update call to cpuset_popcount.
+       (get_num_procs): Ditto.
+       * config/linux/affinity.c (gomp_init_affinity): Call
+       gomp_cpuset_popcount.
+
+2011-08-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/42041
+       PR fortran/46752
+       * omp.h.in (omp_in_final): New prototype.
+       * omp_lib.f90.in (omp_in_final): New interface.
+       (omp_integer_kind, omp_logical_kind): Remove
+       and replace all its uses in the module with 4.
+       (openmp_version): Change to 201107.
+       * omp_lib.h.in (omp_sched_static, omp_sched_dynamic,
+       omp_sched_guided, omp_sched_auto): Use omp_sched_kind
+       kind for the parameters.
+       (omp_in_final): New external.
+       (openmp_version): Change to 201107.
+       * task.c (omp_in_final): New function.
+       (gomp_init_task): Initialize final_task.
+       (GOMP_task): Remove unused attribute from flags.  Handle final
+       tasks.
+       (GOMP_taskyield): New function.
+       (omp_in_final): Return true if if (false) or final (true) task
+       or descendant of final (true).
+       * fortran.c (omp_in_final_): New function.
+       * libgomp.map (OMP_3.1): Export omp_in_final and omp_in_final_.
+       (GOMP_3.0): Export GOMP_taskyield.
+       * env.c (gomp_nthreads_var_list, gomp_nthreads_var_list_len): New
+       variables.
+       (parse_unsigned_long_list): New function.
+       (initialize_env): Use it for OMP_NUM_THREADS.  Call parse_boolean
+       with "OMP_PROC_BIND".  If OMP_PROC_BIND=true, call gomp_init_affinity
+       even if parse_affinity returned false.
+       * config/linux/affinity.c (gomp_init_affinity): Handle
+       gomp_cpu_affinity_len == 0.
+       * libgomp_g.h (GOMP_taskyield): New prototype.
+       * libgomp.h (struct gomp_task): Add final_task field.
+       (gomp_nthreads_var_list, gomp_nthreads_var_list_len): New externs.
+       * team.c (gomp_team_start): Override new task's nthreads_var icv
+       if list form OMP_NUM_THREADS has been used and it has value for
+       the new nesting level.
+
+       * testsuite/libgomp.c/atomic-11.c: New test.
+       * testsuite/libgomp.c/atomic-12.c: New test.
+       * testsuite/libgomp.c/atomic-13.c: New test.
+       * testsuite/libgomp.c/atomic-14.c: New test.
+       * testsuite/libgomp.c/reduction-6.c: New test.
+       * testsuite/libgomp.c/task-5.c: New test.
+       * testsuite/libgomp.c++/atomic-2.C: New test.
+       * testsuite/libgomp.c++/atomic-3.C: New test.
+       * testsuite/libgomp.c++/atomic-4.C: New test.
+       * testsuite/libgomp.c++/atomic-5.C: New test.
+       * testsuite/libgomp.c++/atomic-6.C: New test.
+       * testsuite/libgomp.c++/atomic-7.C: New test.
+       * testsuite/libgomp.c++/atomic-8.C: New test.
+       * testsuite/libgomp.c++/atomic-9.C: New test.
+       * testsuite/libgomp.c++/task-8.C: New test.
+       * testsuite/libgomp.c++/reduction-4.C: New test.
+       * testsuite/libgomp.fortran/allocatable7.f90: New test.
+       * testsuite/libgomp.fortran/allocatable8.f90: New test.
+       * testsuite/libgomp.fortran/crayptr3.f90: New test.
+       * testsuite/libgomp.fortran/omp_atomic3.f90: New test.
+       * testsuite/libgomp.fortran/omp_atomic4.f90: New test.
+       * testsuite/libgomp.fortran/pointer1.f90: New test.
+       * testsuite/libgomp.fortran/pointer2.f90: New test.
+       * testsuite/libgomp.fortran/task4.f90: New test.
+
+2011-08-02  Tobias Burnus  <burnus@net-b.de>
+
+       * libgomp.texi: Update OpenMP spec references to 3.1.
+       (omp_in_final,OMP_PROC_BIND): New sections.
+       (OMP_NUM_THREADS): Document that the value can be now a list.
+       (GOMP_STACKSIZE,GOMP_CPU_AFFINITY): Update @ref.
+
+2011-08-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/linux/x86/futex.h: Check __x86_64__ instead of
+       __LP64__.
+
+2011-07-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/49897
+       PR middle-end/49898
+       * testsuite/libgomp.c/pr49897-1.c: New test.
+       * testsuite/libgomp.c/pr49897-2.c: New test.
+       * testsuite/libgomp.c/pr49898-1.c: New test.
+       * testsuite/libgomp.c/pr49898-2.c: New test.
+
+2011-07-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * testsuite/lib/libgomp.exp (libgomp_init): Add -march=i486
+       for ia32 instead of ilp32.
+
+       * testsuite/libgomp.c/atomic-1.c: Require ia32 instead of ilp32.
+       * testsuite/libgomp.c/atomic-6.c: Likewise.
+
+2011-07-23  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * testsuite/libgomp.graphite/force-parallel-1.c: Un-xfail.
+       * testsuite/libgomp.graphite/force-parallel-2.c: Adjust pattern.
+
+2011-07-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR libgomp/45351
+       * config/osf/sem.h: New file.
+       * configure.tgt (alpha*-dec-osf*): Prepend osf to config_path.
+
+2011-07-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR target/49541
+       * testsuite/lib/libgomp.exp (libgomp_init): Don't add -lgomp to
+       ldflags.
+
+2011-07-15  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/linux/wait.h (do_spin): New inline, largely copied
+       from do_wait, just don't do futex_wait here, instead return true if
+       it should be done.
+       (do_wait): Implement using do_spin.
+       * config/linux/mutex.h (gomp_mutex_lock_slow): Add an int argument
+       to prototype.
+       (gomp_mutex_lock): Use __sync_val_compare_and_swap instead of
+       __sync_bool_compare_and_swap, pass the oldval to
+       gomp_mutex_lock_slow.
+       * config/linux/mutex.c (gomp_mutex_lock_slow): Add oldval argument.
+       If all mutex contenders are just spinning and not sleeping, don't
+       change state to 2 unnecessarily.  Optimize the loop when state has
+       already become 2 to use just one atomic operation per loop instead
+       of two.
+       * config/linux/ia64/mutex.h (gomp_mutex_lock_slow): Add an int argument
+       to prototype.
+       (gomp_mutex_lock): Use __sync_val_compare_and_swap instead of
+       __sync_bool_compare_and_swap, pass the oldval to
+       gomp_mutex_lock_slow.
+
+2011-06-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/49490
+       * iter.c (gomp_iter_static_next): For chunk size 0
+       only use n ceil/ nthreads size for the first
+       n % nthreads threads in the team instead of
+       all threads except for the last few ones which
+       get less work or none at all.
+       * iter_ull.c (gomp_iter_ull_static_next): Likewise.
+       * env.c (parse_schedule): If OMP_SCHEDULE doesn't have
+       chunk argument, set run_sched_modifier to 0 for static
+       resp. 1 for other kinds.  If chunk argument is 0
+       and not static, set value to 1.
+
+2011-05-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/49043
+       * testsuite/libgomp.c++/pr49043.C: New test.
+
+       PR c++/48869
+       * testsuite/libgomp.c++/pr48869.C: New test.
+
+2011-05-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/48894
+       * fortran.c: Include limits.h.
+       (TO_INT): Define.
+       (omp_set_dynamic_8_, omp_set_num_threads_8_): Use !!*set instead of
+       *set.
+       (omp_set_num_threads_8_, omp_set_schedule_8_,
+       omp_set_max_active_levels_8_, omp_get_ancestor_thread_num_8_,
+       omp_get_team_size_8_): Use TO_INT macro.
+       * testsuite/libgomp.fortran/pr48894.f90: New test.
+
+2011-04-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/48591
+       * testsuite/libgomp.c/pr48591.c: New test.
+
+2011-03-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR bootstrap/48135
+       * acinclude.m4 (enable_symvers): Handle --disable-symvers.
+       * configure: Regenerate.
+
+2011-02-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/47886
+       * testsuite/libgomp.fortran/task3.f90: New test.
+
+2011-02-24  Tobias Burnus  <burnus@net-b.de>
+
+       * libgomp.texi (GOMP_STACKSIZE): Fix @ref to OMP_STACKSIZE.
+
+2011-02-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/47854
+       * libgomp.texi (omp_get_wtime): Don't say time in the past
+       must be Unix Epoch.
+
+2011-02-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/47804
+       * testsuite/libgomp.fortran/fortran.exp: Check for both
+       libquadmath.a and libquadmath.${shlib_ext}.  If neither exists,
+       but $blddir != "", still append ${blddir}/${lang_library_path}
+       to ld_library_path.
+
+2011-02-16  Tobias Burnus  <burnus@net-b.de>
+
+       PR libgomp/47758
+       * testsuite/libgomp.fortran/fortran.exp: Check for the existence
+       of libquadmath.a before adding its libpath to ldflags.
+
+2011-02-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/47731
+       * config/linux/futex.h (futex_wait): Pass NULL as timeout argument
+       to FUTEX_WAIT futex syscall.
+       * config/linux/wait.h: Include <futex.h> instead of "futex.h".
+
+2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure: Regenerate.
+
+2011-01-20  Benjamin Kosnik  <bkoz@redhat.com>
+
+       PR libstdc++/36104
+       * acinclude.m4 (LIBGOMP_ENABLE_SYMVERS): Accept gnu variants.
+
+2011-01-16  Gerald Pfeifer
+
+       * configure.tgt (*-*-freebsd*): Add -lpthread to XLDFLAGS.
+
+2010-12-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/46874
+       * libgomp.fortran/allocatable6.f90: New test.
+
+2010-12-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * acinclude.m4 (symvers_renaming): Also set if enable_symvers = no.
+       * configure: Regenerate.
+
+2010-12-06  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       PR target/40125
+       PR lto/46695
+       * configure.ac: Invoke ACX_LT_HOST_FLAGS.
+       * Makefile.am (libgomp_la_LDFLAGS): Use lt_host_flags.
+       * aclocal.m4: Regenerate.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+       * testsuite/Makefile.in: Regenerate.
+
+2010-12-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/46753
+       * libgomp.fortran/pr46753.f90: New test.
+
+       PR libgomp/43706
+       * env.c (initialize_env): Default to spin count 300000
+       instead of 20000000 if neither OMP_WAIT_POLICY nor GOMP_SPINCOUNT
+       is specified.
+
+       PR libgomp/45240
+       * parallel.c (GOMP_parallel_end): Unlock gomp_remaining_threads_lock
+       at the end if sync builtins aren't supported.
+
+2010-12-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure.tgt (mips-sgi-irix6*): Add -lpthread to XLDFLAGS.
+
+2010-12-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * testsuite/libgomp.fortran/vla8.f90: Use dg-timeout-factor 2.0.
+
+2010-11-24  Iain Sandoe  <iains@gcc.gnu.org>
+
+       * testsuite/libgomp.fortran/fortran.exp: Add paths for libquadmath.
+
+2010-11-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+           Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/32049
+       * configure.ac:
+       * configure: Regenerate.
+
+2010-10-06  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+       * config/linux/futex.h: New.
+       * config/linux/arm/mutex.h: New.
+       * configure.tgt (arm*-*-linux*): Add config path.
+
+2010-09-30  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * testsuite/libgomp.graphite/force-parallel-1.c: Adjust.
+
+2010-09-23  Tobias Burnus  <burnus@net-b.de>
+
+       * libgomp.texi (omp_get_nested, omp_set_nested, omp_set_dynamic):
+       Change Fortran datatype to LOGICAL.
+       (omp_set_lock, omp_test_lock, omp_unset_lock, omp_set_nested_lock,
+       omp_unset_nested_lock): Use intent(inout) instead of intent(out).
+
+2010-08-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure: Regenerate.
+
+2010-07-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * libgomp.texi: Add function keyword to a couple of Fortran
+       interfaces, use integer instead of int for Fortran.
+
+2010-07-26  Aldy Hernandez  <aldyh@redhat.com>
+
+       * libgomp.texi: Fix spelling and pasto problems throughout.
+       Adjust prototypes to match code.
+
+2010-07-24  Tobias Burnus  <burnus@net-b.de>
+
+       * testsuite/libgomp.fortran/appendix-a/a.28.5.f90: Add -w to
+       silence -fwhole-file warning.
+
+2010-07-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure.tgt (*-*-solaris2.[56]*): Removed.
+
+2010-07-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * acinclude.m4 (LIBGOMP_ENABLE_SYMVERS): Handle sun style.
+       Define LIBGOMP_BUILD_VERSIONED_SHLIB_GNU,
+       LIBGOMP_BUILD_VERSIONED_SHLIB_SUN automake conditionals.
+       (HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT): Define unless
+       targetting solaris2*.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+       * Makefile.am [LIBGOMP_BUILD_VERSIONED_SHLIB]: Protect
+       libgomp_version_script with LIBGOMP_BUILD_VERSIONED_SHLIB_GNU.
+       Add libgomp_version_dep.
+       [LIBGOMP_BUILD_VERSIONED_SHLIB_SUN]: Handle Sun symbol
+       versioning.
+       [!LIBGOMP_BUILD_VERSIONED_SHLIB]: Add libgomp_version_dep.
+       (libgomp_la_DEPENDENCIES): Set to $(libgomp_version_dep).
+       * Makefile.in: Regenerate.
+
+       * libgomp.h (LIBGOMP_GNU_SYMBOL_VERSIONING): Undef unless
+       HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT.
+       * libgomp.map (OMP_1.0): Move symbols both in OMP_1.0 and OMP_3.0
+       to common block, protected by
+       HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT.
+
+2010-06-10  Gerald Pfeifer  <gerald@pfeifer.com>
+
+       * libgomp.texi: Move to GFDL version 1.3.  Update copyright years.
+
+2010-06-09  Iain Sandoe  <iains@gcc.gnu.org>
+
+       PR bootstrap/43170
+       * configure: Regenerate.
+
+2010-05-04  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       PR other/43620
+       * configure.ac (AM_INIT_AUTOMAKE): Add no-dist.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+       * testsuite/Makefile.in: Regenerate.
+
+2010-04-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/43893
+       * testsuite/libgomp.c/pr43893.c: New test.
+       * testsuite/libgomp.c++/pr43893.C: New test.
+
+2010-04-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/43570
+       * testsuite/libgomp.fortran/vla8.f90: New test.
+
+2010-04-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/43706
+       * config/linux/affinity.c (gomp_init_affinity): Decrease
+       gomp_available_cpus if affinity mask confines the process to fewer
+       CPUs.
+       * config/linux/proc.c (get_num_procs): If gomp_cpu_affinity is
+       non-NULL, just return gomp_available_cpus.
+
+       PR libgomp/43569
+       * sections.c (gomp_sections_init): Initialize ws->mode.
+
+2010-04-14  Uros Bizjak  <ubizjak@gmail.com>
+
+       * acinclude.m4 (LIBGOMP_CHECK_SYNC_BUILTINS): Remove set but
+       not unused bar variable.
+       * configure: Regenerate.
+
+2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+       * testsuite/Makefile.in: Regenerate.
+
+2010-03-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/42942
+       * env.c (parse_unsigned_long): Add ALLOW_ZERO argument.
+       (initialize_env): Adjust callers.
+       (omp_set_max_active_levels): Set gomp_max_active_levels_var even
+       when the argument is 0.
+
+       * testsuite/libgomp.c/pr42942.c: New test.
+
+2010-03-08  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+       PR middle-end/42644
+       PR middle-end/42130
+       * testsuite/libgomp.graphite/force-parallel-1.c: Adjust.
+       * testsuite/libgomp.graphite/force-parallel-2.c: Adjust.
+
+2010-01-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * testsuite/libgomp.c++/task-1.C: Renamed err to e.
+       * testsuite/libgomp.c++/task-6.C: Likewise.
+
+2010-01-28  Steve Ellcey  <sje@cup.hp.com>
+
+       * configure.tgt (*-*-hpux*): Add -frandom-seed flag.
+
+2010-01-26  Paolo Bonzini  <bonzini@gnu.org>
+
+       * configure.ac: Test for executability of _the first word_ of GFORTRAN.
+       * configure: Regenerate.
+
+2010-01-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/42866
+       * testsuite/libgomp.fortran/allocatable5.f90: New test.
+
+2010-01-20  Paolo Bonzini  <bonzini@gnu.org>
+
+       * configure.ac: Test for executability of GFORTRAN.
+       * configure: Regenerate.
+
+2010-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure: Regenerate.
+
+2010-01-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR libgomp/42602
+       * libgomp.fortran/recursion1.f90 (sub): Make 's' atomic.
+
+2010-01-03  Richard Guenther  <rguenther@suse.de>
+
+       * testsuite/libgomp.fortran/recursion1.f90: New testcase.
+
+2009-12-23  Sebastian Pop  <sebpop@gmail.com>
+
+       * testsuite/libgomp.graphite/pr4118.c: New.
+
+2009-12-22  Iain Sandoe  <iain.sandoe@sandoe-acoustics.co.uk>
+
+       * testsuite/libgomp.fortran/crayptr2.f90: Remove forced static linkage
+       for darwin, protect the test with require-effective-target tls_runtime.
+       * testsuite/libgomp.fortran/pr32550.f90: Ditto.
+
+2009-12-22  Iain Sandoe  <iain.sandoe@sandoe-acoustics.co.uk>
+
+       PR target/41605
+       * testsuite/lib/libgomp.exp: Provide -B options to allow for
+       link spec %s substitutions for static libraries.
+
+2009-12-18  Jack Howarth <howarth@bromo.med.uc.edu>
+
+       PR testsuite/42135
+       * libgomp.graphite/force-parallel-2.c: Reduce array size.
+
+2009-12-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+       * testsuite/Makefile.in: Regenerate.
+
+2009-11-30  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       * testsuite/lib/libgomp.exp (libgomp_init): Add host-dependent
+       settings for LC_ALL and LANG.
+
+2009-11-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/42162
+       * testsuite/libgomp.fortran/pr42162.f90: New test.
+
+2009-11-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/42029
+       * testsuite/libgomp.c/pr42029.c: New test.
+
+2009-10-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Avoid using too many
+       *s.  Accept ld version without text in ()s.
+       * configure: Regenerated.
+
+2009-10-22  Razya Ladelsky  <razya@il.ibm.com>
+
+       * testsuite/libgomp.graphite/force-parallel-2.c: Adjust scan.
+
+2009-10-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       PR libgomp/41418
+       * configure.ac: Set FC to "no" if $GFORTRAN starts with "no"
+       or a hyphen (happens with fortran language disabled).
+       * configure: Regenerate.
+
+2009-09-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Avoid 'head',
+       use sed script portable to Solaris /bin/sed for extracting ld
+       version.
+       * configure: Regenerate.
+
+2009-09-17  Alexander Monakov  <amonakov@ispras.ru>
+
+       * testsuite/libgomp.graphite/bounds.c: New test.
+
+2009-09-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.am (libgomp_la_LINK): New.
+       * Makefile.in: Regenerate.
+
+2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure.ac (AC_PREREQ): Bump to 2.64.
+
+2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.am (install-html, install-pdf): Remove.
+       * Makefile.in: Regenerate.
+
+       * Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * testsuite/Makefile.in: Regenerate.
+
+2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * Makefile.am (LINK): Add $(AM_LIBTOOLFLAGS) and $(LIBTOOLFLAGS).
+       * Makefile.in: Regenerate.
+
+2009-08-20  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       * Makefile.am (libgomp_la_LDFLAGS): Add -bindir flag.
+       * Makefile.in: Regenerate.
+
+2009-08-19  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/41102
+       omp_lib.h.in: Fix -std=f95 errors.
+
+
+2009-08-14  David Edelsohn  <edelsohn@gnu.org>
+
+       * testsuite/libgomp.graphite: Move from gcc.dg/graphite.
+       * testsuite/libgomp.graphite/graphite_autopar.exp: Delete.
+       * testsuite/libgomp.graphite/graphite.exp: New.
+
+2009-08-05  Andreas Tobler  <a.tobler@schweiz.org>
+
+       * testsuite/libgomp.fortran/fortran.exp: Add flags in case of shared
+       only build.
+
+2009-08-04  David Daney  <ddaney@caviumnetworks.com>
+
+       * config/linux/mutex.h (gomp_mutex_unlock): Add comment about
+       needed memory barrier semantics.
+       * config/linux/mips/mutex.h: New file.
+
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
+2009-07-16  Joseph Myers  <joseph@codesourcery.com>
+
+       * configure: Regenerate.
+
+2009-07-11  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       PR testsuite/40699
+       PR testsuite/40707
+       PR testsuite/40709
+       * testsuite/lib/libgomp.exp: Revert 2009-07-02 and 2009-06-30 commits.
+       * testsuite/libgomp.c/c.exp, testsuite/libgomp.c++/c++.exp,
+       testsuite/libgomp.fortran/fortran.exp: Revert 2009-06-30 commits.
+
+2009-07-02  Richard Sandiford  <r.sandiford@uk.ibm.com>
+
+       * testsuite/lib/libgomp.exp (libgomp_init): Use the ALWAYS_CFLAGS
+       options when choosing a multilib.
+
+2009-06-30  Richard Sandiford  <r.sandiford@uk.ibm.com>
+
+       * testsuite/lib/libgomp.exp (libgomp_init): Don't add "." to
+       ld_library_path.  Use add_path.  Add just find_libgcc_s to
+       ld_library_path, not every libgcc multilib directory.
+       * testsuite/libgomp.c/c.exp (ld_library_path): Don't call
+       gcc-set-multilib-library-path; rely on $always_ld_library_path instead.
+       * testsuite/libgomp.c++/c++.exp (ld_library_path): Likewise.
+       Use add_path.
+       * testsuite/libgomp.fortran/fortran.exp (ld_library_path): Likewise.
+
+2009-06-09  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * Makefile.am (LTLDFLAGS): Define.
+       (LINK): Define.
+       * Makefile.in: Regenerate.
+
+2009-05-27  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR fortran/39718
+       * testsuite/libgomp.fortran/fortran.exp: Don't link with
+       libgfortranbegin, check existence of libgfortran.a instead of
+       libgfortranbegin.a.
+
+2009-05-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/40174
+       * team.c (gomp_thread_start): Destroy thr->release semaphore.
+       (gomp_free_pool_helper): Likewise.
+
+2009-04-20  Vasilis Liaskovitis  <vliaskov@gmail.com>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/35423
+       * testsuite/libgomp.fortran/workshare2.f90: New test.
+
+2009-04-09  Nick Clifton  <nickc@redhat.com>
+
+       * iter.c: Change copyright header to refer to version 3 of the
+       GNU General Public License with version 3.1 of the GCC Runtime
+       Library Exception and to point readers at the COPYING3 and
+       COPYING3.RUNTIME files and the FSF's license web page.
+       * alloc.c: Likewise.
+       * barrier.c: Likewise.
+       * config/bsd/proc.c: Likewise.
+       * config/linux/affinity.c: Likewise.
+       * config/linux/alpha/futex.h: Likewise.
+       * config/linux/bar.c: Likewise.
+       * config/linux/bar.h: Likewise.
+       * config/linux/ia64/futex.h: Likewise.
+       * config/linux/ia64/mutex.h: Likewise.
+       * config/linux/lock.c: Likewise.
+       * config/linux/mips/futex.h: Likewise.
+       * config/linux/mutex.c: Likewise.
+       * config/linux/mutex.h: Likewise.
+       * config/linux/powerpc/futex.h: Likewise.
+       * config/linux/proc.c: Likewise.
+       * config/linux/ptrlock.c: Likewise.
+       * config/linux/ptrlock.h: Likewise.
+       * config/linux/s390/futex.h: Likewise.
+       * config/linux/sem.c: Likewise.
+       * config/linux/sem.h: Likewise.
+       * config/linux/sparc/futex.h: Likewise.
+       * config/linux/wait.h: Likewise.
+       * config/linux/x86/futex.h: Likewise.
+       * config/mingw32/proc.c: Likewise.
+       * config/mingw32/time.c: Likewise.
+       * config/posix/affinity.c: Likewise.
+       * config/posix/bar.c: Likewise.
+       * config/posix/bar.h: Likewise.
+       * config/posix/lock.c: Likewise.
+       * config/posix/mutex.h: Likewise.
+       * config/posix/proc.c: Likewise.
+       * config/posix/ptrlock.h: Likewise.
+       * config/posix/sem.c: Likewise.
+       * config/posix/sem.h: Likewise.
+       * config/posix/time.c: Likewise.
+       * config/posix95/lock.c: Likewise.
+       * critical.c: Likewise.
+       * env.c: Likewise.
+       * error.c: Likewise.
+       * fortran.c: Likewise.
+       * iter_ull.c: Likewise.
+       * libgomp.h: Likewise.
+       * libgomp_f.h.in: Likewise.
+       * libgomp_g.h: Likewise.
+       * loop.c: Likewise.
+       * loop_ull.c: Likewise.
+       * omp.h.in: Likewise.
+       * omp_lib.f90.in: Likewise.
+       * omp_lib.h.in: Likewise.
+       * ordered.c: Likewise.
+       * parallel.c: Likewise.
+       * sections.c: Likewise.
+       * single.c: Likewise.
+       * task.c: Likewise.
+       * team.c: Likewise.
+       * work.c: Likewise.
+
+2009-04-09  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/config/default.exp: Change copyright header to refer to
+       version 3 of the GNU General Public License and to point readers
+       at the COPYING3 file and the FSF's license web page.
+
+2009-04-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/39573
+       * libgomp.c++/pr39573.C: New test.
+
+2009-04-01  Jakub Jelinek  <jakub@redhat.com>
+
+       PR other/39591
+       * testsuite/libgomp.c/pr39591-1.c: New test.
+       * testsuite/libgomp.c/pr39591-2.c: New test.
+       * testsuite/libgomp.c/pr39591-3.c: New test.
+
+2009-03-25  Uros Bizjak  <ubizjak@gmail.com>
+
+       * testsuite/libgomp.c/atomic-5.c: Cleanup cpuid usage.
+       * testsuite/libgomp.c/atomic-6.c: Ditto.
+
+2009-03-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/39495
+       * testsuite/libgomp.c/loop-12.c: New test.
+       * testsuite/libgomp.c/loop-11.c: New test.
+       * testsuite/libgomp.c++/loop-11.C: New test.
+       * testsuite/libgomp.c++/loop-12.C: New test.
+       * testsuite/libgomp.c++/for-8.C: New test.
+
+2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure: Regenerate.
+
+2009-02-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/39154
+       * testsuite/libgomp.c/pr39154.c: New test.
+
+2009-01-30  Ian Lance Taylor  <iant@google.com>
+
+       * acinclude.m4 (LIBCOMP_CHECK_LINKER_FEATURES): Set
+       libgomp_ld_is_gold.  Get gold version number.
+       (LIBGOMP_ENABLE_SYMVERS): Gold always support symbol versioning.
+       * configure: Rebuild.
+
+2009-01-19  Iain Sandoe  <iain.sandoe@sandoe-acoustics.co.uk>
+
+       * testsuite/lib/libgomp.exp: Add -B option for targets that
+       use libgfortran.a%s in their specs.
+
+2009-01-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/38086
+       * acinclude.m4 (HAVE_AS_SYMVER_DIRECTIVE): New check.
+       * libgomp.h (LIBGOMP_GNU_SYMBOL_VERSIONING): Undefine if
+       HAVE_AS_SYMVER_DIRECTIVE is not defined.
+       * configure: Regenerated.
+       * config.h.in: Likewise.
+
+2008-12-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/38650
+       * testsuite/libgomp.c/pr38650.c: New test.
+       * testsuite/libgomp.c++/pr38650.C: New test.
+
+2008-12-27  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.c/collapse-1.c (main): Add private(k) clause.
+
+2008-12-26  Uros Bizjak  <ubizjak@gmail.com>
+
+       * testsuite/libgomp.c/atomic-6.c: Add -mieee for alpha*-*-* targets.
+
+2008-12-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure: Regenerate.
+
+2008-12-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/36802
+       * testsuite/libgomp.c/pr36802-1.c: New test.
+       * testsuite/libgomp.c/pr36802-2.c: New test.
+       * testsuite/libgomp.c/pr36802-3.c: New test.
+
+2008-12-01  Janis Johnson  <janis187@us.ibm.com>
+
+       PR libgomp/38270
+       * config/linux/powerpc/mutex.h: New.
+
+2008-12-01  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/38257
+       * testsuite/libgomp.c++/for-7.C: New test.
+
+       PR c++/38348
+       * testsuite/libgomp.c++/for-6.C: New test.
+
+2008-11-26  Janis Johnson  <janis187@us.ibm.com>
+
+       PR testsuite/28870
+       * testsuite/lib/libgomp.exp: Include new timeout library files.
+       (libgomp_target_compile): Set timeout value from new proc.
+
+2008-11-13  Steve Ellcey  <sje@cup.hp.com>
+
+       PR libgomp/37938
+       * config/linux/ia64/mutex.h: New.
+
+2008-11-04  Tobias Burnus  <burnus@net-b.de>
+
+       PR libgomp/37935
+       * libgomp.texi (Runtime library routines, environment variables):
+       Update for OpenMP version 3.0.
+
+2008-09-26  Peter O'Gorman  <pogma@thewrittenword.com>
+           Steve Ellcey  <sje@cup.hp.com>
+
+       * configure: Regenerate for new libtool.
+       * Makefile.in: Ditto.
+       * testsuite/Makefile.in: Ditto.
+
+2008-09-19  Jakub Jelinek  <jakub@redhat.com>
+           Andreas Tobler  <a.tobler@schweiz.org>
+
+       * config/bsd/proc.c: New file.
+       * configure.tgt (*-*-darwin*): Use config_path "bsd posix".
+       * configure.ac: Check for header <sys/sysctl.h>
+       * configure: Regenerate.
+       * config.h.in: Likewise.
+
+2008-09-05  Janis Johnson  <janis187@us.ibm.com>
+
+       * testsuite/ligbomp.c/c.exp: Unset lang_test_file only if it exists.
+
+2008-08-31  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>
+
+       * Makefile.am (libgomp_la_LDFLAGS): Add -no-undefined.
+       * Makefile.in: Regenerated.
+       * testsuite/Makefile.in: Regenerated.
+
+2008-08-21  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * testsuite/lib/libgomp.exp (libgomp_init): Only set things that
+       depend on blddir if blddir exists.
+       (libgomp_target_compile): Likewise.
+       * testsuite/libgomp.c++/c++.exp: Likewise.
+       * testsuite/libgomp.fortran/fortran.exp: Likewise.
+
+2008-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * libgomp.texi: Update to GFDL 1.2.  Update copyright years.
+       Do not list GPL as Invariant Section.
+
+2008-07-28  Ilie Garbacea  <ilie@mips.com>
+           Chao-ying Fu  <fu@mips.com>
+
+       * configure.tgt: Enable futex for MIPS.
+       * config/linux/mips/futex.h: New file.
+
+2008-07-16  Jakub Jelinek  <jakub@redhat.com>
+
+       * team.c (gomp_team_end): Free team immediately if it has
+       just one thread.
+
+2008-07-08  David Edelsohn  <edelsohn@gnu.org>
+
+       * testsuite/libgomp.c++/c++.exp: Append multilib library path.
+       * testsuite/libgomp.fortran/fortran.exp: Same.
+       * testsuite/libgomp.c/c.exp: Same.
+       * testsuite/lib/libgomp.exp: Append AIX libgcc pthread multilib
+       directory to library path first.
+
+2008-06-29  Krister Walfridsson  <krister.walfridsson@gmail.com>
+
+       * env.c (parse_stacksize): Add cast to avoid warning.
+       (parse_spincount): Likewise.
+
+2008-06-27  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.c/loop-10.c: New test.
+       * libgomp.c/loop-3.c (main): Add lastprivate clause.
+       * libgomp.c++/loop-6.C (main): Likewise.
+
+       PR debug/36617
+       * testsuite/libgomp.c/debug-1.c: New test.
+
+2008-06-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.c/nqueens-1.c: New test.
+
+       PR c++/36523
+       * testsuite/libgomp.c++/task-7.C: New function.
+
+2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * configure: Regenerate.
+
+2008-06-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       * env.c (initialize_env): Always initialize gomp_remaining_threads_lock
+       mutex when HAVE_SYNC_BUILTINS isn't defined.
+
+2008-06-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * libgomp.texi (omp_test_lock): Fix typo.
+
+2008-06-12  Tobias Burnus  <burnus@net-b.de>
+
+       * omp_lib.f90.in: Add "implicit none".
+
+2008-06-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/36506
+       * testsuite/libgomp.c/reduction-5.c: New test.
+
+2008-06-11  Jakub Jelinek  <jakub@redhat.com>
+
+       * libgomp.h (struct gomp_task): Add in_tied_task field.
+       * task.c (gomp_init_task): Initialize it.
+       (GOMP_task): Likewise.  Call gomp_team_barrier_set_task_pending
+       unconditionally.  Don't call gomp_team_barrier_wake if
+       current task is implicit or if(0) from implicit and number of
+       running tasks is equal to nthreads - 1.
+
+       PR libgomp/36471
+       * omp_lib.f90.in (omp_get_ancestor_thread_num_8,
+       omp_get_team_size_8): Fix pastos.
+
+       PR libgomp/36469
+       * configure.ac: Add AC_CHECK_FUNCS (strtoull).
+       * configure: Regenerated.
+       * config.h.in: Regenerated.
+       * env.c (strtoull): Define to strtoul if HAVE_STRTOULL is not
+       defined.
+
+2008-06-06  Andreas Tobler  <a.tobler@schweiz.org>
+
+       PR bootstrap/36452
+       * loop_ull.c (GOMP_loop_ull_static_start): Adjust API.
+       (GOMP_loop_ull_dynamic_start): Likewise.
+       (GOMP_loop_ull_guided_start): Likewise.
+       (GOMP_loop_ull_ordered_static_start): Likewise.
+       (GOMP_loop_ull_ordered_dynamic_start): Likewise.
+       (GOMP_loop_ull_ordered_guided_start): Likewise.
+
+2008-06-06  Jakub Jelinek  <jakub@redhat.com>
+           Richard Henderson  <rth@redhat.com>
+           Ulrich Drepper  <drepper@redhat.com>
+           Jakob Blomer  <jakob.blomer@ira.uka.de>
+
+       * configure.ac (LIBGOMP_GNU_SYMBOL_VERSIONING): New AC_DEFINE.
+       Substitute also OMP_*LOCK_25*.
+       * configure: Regenerated.
+       * config.h.in: Regenerated.
+       * Makefile.am (libgomp_la_SOURCES): Add loop_ull.c, iter_ull.c,
+       ptrlock.c and task.c.
+       * Makefile.in: Regenerated.
+       * testsuite/Makefile.in: Regenerated.
+       * task.c: New file.
+       * loop_ull.c: New file.
+       * iter_ull.c: New file.
+       * libgomp.h: Include ptrlock.h.
+       (enum gomp_task_kind): New type.
+       (struct gomp_team): Add task_lock, task_queue, task_count,
+       task_running_count, single_count fields.  Add
+       work_share_list_free_lock ifndef HAVE_SYNC_BUILTINS.
+       Remove work_share_lock, generation_mask,
+       oldest_live_gen, num_live_gen and init_work_shares fields, add
+       work work_share_list_alloc, work_share_list_free and work_share_chunk
+       fields.  Change work_shares from pointer to pointers into an array.
+       Change ordered_release field into gomp_sem_t ** from flexible array
+       member.  Add implicit_task and initial_work_shares fields.
+       Move close to the end of the struct.
+       (struct gomp_team_state): Add single_count, last_work_share,
+       active_level and level fields, remove work_share_generation.
+       (gomp_barrier_handle_tasks): New prototype.
+       (gomp_finish_task): New inline function.
+       (struct gomp_work_share): Move chunk_size, end, incr into
+       transparent union/struct, add chunk_size_ull, end_ll, incr_ll and
+       next_ll fields.  Reshuffle fields.  Add next_alloc,
+       next_ws, next_free and inline_ordered_team_ids fields, change
+       ordered_team_ids into pointer from flexible array member.
+       Add mode field.  Put lock and next into a different cache line
+       from most of the write-once fields.
+       (gomp_iter_ull_static_next, gomp_iter_ull_dynamic_next_locked,
+       gomp_iter_ull_guided_next_locked, gomp_iter_ull_dynamic_next,
+       gomp_iter_ull_guided_next): New prototypes.
+       (gomp_new_icv): New prototype.
+       (struct gomp_thread): Add thread_pool and task fields.
+       (struct gomp_thread_pool): New type.
+       (gomp_new_team): New prototype.
+       (gomp_team_start): Change type of last argument.
+       (gomp_new_work_share): Removed.
+       (gomp_init_work_share, gomp_fini_work_share): New prototypes.
+       (gomp_work_share_init_done): New static inline.
+       (gomp_throttled_spin_count_var, gomp_available_cpus,
+       gomp_managed_threads): New extern decls.
+       (gomp_init_task): New prototype.
+       (gomp_spin_count_var): New extern var decl.
+       (LIBGOMP_GNU_SYMBOL_VERSIONING): Undef if no visibility
+       or no alias support, or if not PIC.
+       (gomp_init_lock_30, gomp_destroy_lock_30, gomp_set_lock_30,
+       gomp_unset_lock_30, gomp_test_lock_30, gomp_init_nest_lock_30,
+       gomp_destroy_nest_lock_30, gomp_set_nest_lock_30,
+       gomp_unset_nest_lock_30, gomp_test_nest_lock_30, gomp_init_lock_25,
+       gomp_destroy_lock_25, gomp_set_lock_25, gomp_unset_lock_25,
+       gomp_test_lock_25, gomp_init_nest_lock_25, gomp_destroy_nest_lock_25,
+       gomp_set_nest_lock_25, gomp_unset_nest_lock_25,
+       gomp_test_nest_lock_25): New prototypes.
+       (omp_lock_symver, strong_alias): Define.
+       (gomp_remaining_threads_count, gomp_remaining_threads_lock): New
+       decls.
+       (gomp_end_task): New.
+       (struct gomp_task_icv, gomp_global_icv): New.
+       (gomp_thread_limit_var, gomp_max_active_levels_var): New.
+       (struct gomp_task): New.
+       (gomp_nthreads_var, gomp_dyn_var, gomp_nest_var,
+       gomp_run_sched_var, gomp_run_sched_chunk): Remove.
+       (gomp_icv): New.
+       (gomp_schedule_type): Reorder enum to match
+       omp_sched_t.
+       * team.c (struct gomp_thread_start_data): Add thread_pool and task
+       fields.
+       (gomp_thread_start): Add gomp_team_barrier_wait call.
+       For non-nested case remove clearing of docked thread thr fields.
+       Use pool fields instead of global gomp_* variables.  Use
+       gomp_barrier_wait_last when needed.  Initialize ts.active_level.
+       Create tasks for each member thread.
+       (free_team): Only destroy team barrier, task_lock here and free it.
+       (gomp_free_thread): Free last_team if non-NULL.
+       (gomp_team_end): Call gomp_team_barrier_wait instead of
+       gomp_barrier_wait.  For nested case call one extra
+       gomp_barrier_wait.  Move here some destruction from free_team.
+       Call free_team on pool->last_team if any, rather than freeing
+       current team.  Destroy work_share_list_free_lock ifndef
+       HAVE_SYNC_BUILTINS.
+       (gomp_new_icv): New function.
+       (gomp_threads, gomp_threads_size, gomp_threads_used,
+       gomp_threads_dock): Removed.
+       (gomp_thread_destructor): New variable.
+       (gomp_new_thread_pool, gomp_free_pool_helper, gomp_free_thread): New
+       functions.
+       (gomp_team_start): Create new pool if current thread doesn't have
+       one.  Use pool fields instead of global gomp_* variables.
+       Initialize thread_pool field for new threads.  Clear single_count.
+       Change last argument from ws to team, don't create
+       new team, set ts.work_share to &team->work_shares[0] and clear
+       ts.last_work_share.  Don't clear ts.work_share_generation.
+       If number of threads changed, adjust atomically gomp_managed_threads.
+       Use gomp_init_task instead of gomp_new_task,
+       set thr->task to the corresponding implicit_task array entry.
+       Create tasks for each member thread.  Initialize ts.level.
+       (initialize_team): Call pthread_key_create on
+       gomp_thread_destructor.
+       (team_destructor): New function.
+       (new_team): Removed.
+       (gomp_new_team): New function.
+       (free_team): Free gomp_work_share blocks chained through next_alloc,
+       instead of freeing work_shares and destroying work_share_lock.
+       (gomp_team_end): Call gomp_fini_work_share.  If number of threads
+       changed, adjust atomically gomp_managed_threads.  Use gomp_end_task.
+       * barrier.c (GOMP_barrier): Call gomp_team_barrier_wait instead
+       of gomp_barrier_wait.
+       * single.c (GOMP_single_copy_start): Call gomp_team_barrier_wait
+       instead of gomp_barrier_wait.  Call gomp_work_share_init_done
+       if gomp_work_share_start returned true.  Don't unlock ws->lock.
+       (GOMP_single_copy_end): Call gomp_team_barrier_wait instead
+       of gomp_barrier_wait.
+       (GOMP_single_start): Rewritten if HAVE_SYNC_BUILTINS.  Call
+       gomp_work_share_init_done if gomp_work_share_start returned true.
+       Don't unlock ws->lock.
+       * work.c: Include stddef.h.
+       (free_work_share): Use work_share_list_free_lock instead
+       of atomic chaining ifndef HAVE_SYNC_BUILTINS.  Add team argument.
+       Call gomp_fini_work_share and then either free ws if orphaned, or
+       put it into work_share_list_free list of the current team.
+       (alloc_work_share, gomp_init_work_share, gomp_fini_work_share): New
+       functions.
+       (gomp_work_share_start, gomp_work_share_end,
+       gomp_work_share_end_nowait): Rewritten.
+       * omp_lib.f90.in Change some tabs to spaces to prevent warnings.
+       (openmp_version): Set to 200805.
+       (omp_sched_kind, omp_sched_static, omp_sched_dynamic,
+       omp_sched_guided, omp_sched_auto): New parameters.
+       (omp_set_schedule, omp_get_schedule, omp_get_thread_limit,
+       omp_set_max_active_levels, omp_get_max_active_levels,
+       omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size,
+       omp_get_active_level): New interfaces.
+       * omp_lib.h.in (openmp_version): Set to 200805.
+       (omp_sched_kind, omp_sched_static, omp_sched_dynamic,
+       omp_sched_guided, omp_sched_auto): New parameters.
+       (omp_set_schedule, omp_get_schedule, omp_get_thread_limit,
+       omp_set_max_active_levels, omp_get_max_active_levels,
+       omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size,
+       omp_get_active_level): New externals.
+       * loop.c: Include limits.h.
+       (GOMP_loop_runtime_next, GOMP_loop_ordered_runtime_next): Handle
+       GFS_AUTO.
+       (GOMP_loop_runtime_start, GOMP_loop_ordered_runtime_start):
+       Likewise.  Use gomp_icv.
+       (gomp_loop_static_start, gomp_loop_dynamic_start): Clear
+       ts.static_trip here.
+       (gomp_loop_static_start, gomp_loop_ordered_static_start): Call
+       gomp_work_share_init_done after gomp_loop_init.  Don't unlock ws->lock.
+       (gomp_loop_dynamic_start, gomp_loop_guided_start): Call
+       gomp_work_share_init_done after gomp_loop_init.  If HAVE_SYNC_BUILTINS,
+       don't unlock ws->lock, otherwise lock it.
+       (gomp_loop_ordered_dynamic_start, gomp_loop_ordered_guided_start): Call
+       gomp_work_share_init_done after gomp_loop_init.  Lock ws->lock.
+       (gomp_parallel_loop_start): Call gomp_new_team instead of
+       gomp_new_work_share.  Call gomp_loop_init on &team->work_shares[0].
+       Adjust gomp_team_start caller.  Pass 0 as second argument to
+       gomp_resolve_num_threads.
+       (gomp_loop_init): For GFS_DYNAMIC, multiply ws->chunk_size by incr.
+       If adding ws->chunk_size nthreads + 1 times after end won't
+       overflow, set ws->mode to 1.
+       * libgomp_g.h (GOMP_loop_ull_static_start, GOMP_loop_ull_dynamic_start,
+       GOMP_loop_ull_guided_start, GOMP_loop_ull_runtime_start,
+       GOMP_loop_ull_ordered_static_start,
+       GOMP_loop_ull_ordered_dynamic_start,
+       GOMP_loop_ull_ordered_guided_start,
+       GOMP_loop_ull_ordered_runtime_start, GOMP_loop_ull_static_next,
+       GOMP_loop_ull_dynamic_next, GOMP_loop_ull_guided_next,
+       GOMP_loop_ull_runtime_next, GOMP_loop_ull_ordered_static_next,
+       GOMP_loop_ull_ordered_dynamic_next, GOMP_loop_ull_ordered_guided_next,
+       GOMP_loop_ull_ordered_runtime_next, GOMP_task, GOMP_taskwait): New
+       prototypes.
+       * libgomp.map: Export lock routines also @@OMP_2.0.
+       (GOMP_loop_ordered_dynamic_first,
+       GOMP_loop_ordered_guided_first, GOMP_loop_ordered_runtime_first,
+       GOMP_loop_ordered_static_first): Remove.
+       (GOMP_loop_ull_dynamic_next, GOMP_loop_ull_dynamic_start,
+       GOMP_loop_ull_guided_next, GOMP_loop_ull_guided_start,
+       GOMP_loop_ull_ordered_dynamic_next,
+       GOMP_loop_ull_ordered_dynamic_start,
+       GOMP_loop_ull_ordered_guided_next,
+       GOMP_loop_ull_ordered_guided_start,
+       GOMP_loop_ull_ordered_runtime_next,
+       GOMP_loop_ull_ordered_runtime_start,
+       GOMP_loop_ull_ordered_static_next,
+       GOMP_loop_ull_ordered_static_start,
+       GOMP_loop_ull_runtime_next, GOMP_loop_ull_runtime_start,
+       GOMP_loop_ull_static_next, GOMP_loop_ull_static_start,
+       GOMP_task, GOMP_taskwait): Export @@GOMP_2.0.
+       (omp_set_schedule, omp_get_schedule,
+       omp_get_thread_limit, omp_set_max_active_levels,
+       omp_get_max_active_levels, omp_get_level,
+       omp_get_ancestor_thread_num, omp_get_team_size, omp_get_active_level,
+       omp_set_schedule_, omp_set_schedule_8_,
+       omp_get_schedule_, omp_get_schedule_8_, omp_get_thread_limit_,
+       omp_set_max_active_levels_, omp_set_max_active_levels_8_,
+       omp_get_max_active_levels_, omp_get_level_,
+       omp_get_ancestor_thread_num_, omp_get_ancestor_thread_num_8_,
+       omp_get_team_size_, omp_get_team_size_8_, omp_get_active_level_):
+       New exports @@OMP_3.0.
+       * omp.h.in (omp_sched_t): New type.
+       (omp_set_schedule, omp_get_schedule, omp_get_thread_limit,
+       omp_set_max_active_levels, omp_get_max_active_levels,
+       omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size,
+       omp_get_active_level): New prototypes.
+       * env.c (gomp_spin_count_var, gomp_throttled_spin_count_var,
+       gomp_available_cpus, gomp_managed_threads, gomp_max_active_levels_var,
+       gomp_thread_limit_var, gomp_remaining_threads_count,
+       gomp_remaining_threads_lock): New variables.
+       (parse_spincount): New function.
+       (initialize_env): Call gomp_init_num_threads unconditionally.
+       Initialize gomp_available_cpus.  Call parse_spincount,
+       initialize gomp_{,throttled_}spin_count_var
+       depending on presence and value of OMP_WAIT_POLICY and
+       GOMP_SPINCOUNT env vars.  Handle GOMP_BLOCKTIME env var.
+       Handle OMP_WAIT_POLICY, OMP_MAX_ACTIVE_LEVELS,
+       OMP_THREAD_LIMIT, OMP_STACKSIZE env vars.  Handle unit specification
+       for GOMP_STACKSIZE.  Initialize gomp_remaining_threads_count and
+       gomp_remaining_threads_lock if needed.  Use gomp_global_icv.
+       (gomp_nthreads_var, gomp_dyn_var, gomp_nest_var,
+       gomp_run_sched_var, gomp_run_sched_chunk): Remove.
+       (gomp_global_icv): New.
+       (parse_schedule): Use it.  Parse "auto".
+       (omp_set_num_threads): Use gomp_icv.
+       (omp_set_dynamic, omp_get_dynamic, omp_set_nested, omp_get_nested):
+       Likewise.
+       (omp_get_max_threads): Move from parallel.c.
+       (omp_set_schedule, omp_get_schedule, omp_get_thread_limit,
+       omp_set_max_active_levels, omp_get_max_active_levels): New functions,
+       add ialias.
+       (parse_stacksize, parse_wait_policy): New functions.
+       * fortran.c: Rewrite lock wrappers, if symbol versioning provide
+       both wrappers for compatibility and new locks.
+       (omp_set_schedule, omp_get_schedule,
+       omp_get_thread_limit, omp_set_max_active_levels,
+       omp_get_max_active_levels, omp_get_level,
+       omp_get_ancestor_thread_num, omp_get_team_size,
+       omp_get_active_level): New ialias_redirect.
+       (omp_set_schedule_, omp_set_schedule_8_,
+       omp_get_schedule_, omp_get_schedule_8_, omp_get_thread_limit_,
+       omp_set_max_active_levels_, omp_set_max_active_levels_8_,
+       omp_get_max_active_levels_, omp_get_level_,
+       omp_get_ancestor_thread_num_, omp_get_ancestor_thread_num_8_,
+       omp_get_team_size_, omp_get_team_size_8_, omp_get_active_level_):
+       New functions.
+       * parallel.c: Include limits.h.
+       (gomp_resolve_num_threads): Add count argument.  Rewritten.
+       (GOMP_parallel_start): Call gomp_new_team and pass that as last
+       argument to gomp_team_start.  Pass 0 as second argument to
+       gomp_resolve_num_threads.
+       (GOMP_parallel_end): Decrease gomp_remaining_threads_count
+       if gomp_thread_limit_var != ULONG_MAX.
+       (omp_in_parallel): Implement using ts.active_level.
+       (omp_get_max_threads): Move to env.c.
+       (omp_get_level, omp_get_ancestor_thread_num,
+       omp_get_team_size, omp_get_active_level): New functions,
+       add ialias.
+       * sections.c (GOMP_sections_start): Call gomp_work_share_init_done
+       after gomp_sections_init.  If HAVE_SYNC_BUILTINS, call
+       gomp_iter_dynamic_next instead of the _locked variant and don't take
+       lock around it, otherwise acquire it before calling
+       gomp_iter_dynamic_next_locked.
+       (GOMP_sections_next): If HAVE_SYNC_BUILTINS, call
+       gomp_iter_dynamic_next instead of the _locked variant and don't take
+       lock around it.
+       (GOMP_parallel_sections_start): Call gomp_new_team instead of
+       gomp_new_work_share.  Call gomp_sections_init on &team->work_shares[0].
+       Adjust gomp_team_start caller.  Pass count as second argument to
+       gomp_resolve_num_threads, don't adjust num_threads after the call.
+       Use gomp_icv.
+       * iter.c (gomp_iter_dynamic_next_locked): Don't multiply
+       ws->chunk_size by incr.
+       (gomp_iter_dynamic_next): Likewise.  If ws->mode, use more efficient
+       code.
+       * libgomp_f.h.in (omp_lock_25_arg_t, omp_nest_lock_25_arg_t): New
+       types.
+       (omp_lock_25_arg, omp_nest_lock_25_arg): New macros.
+       (omp_check_defines): Check even the compat defines.
+       * config/linux/ptrlock.c: New file.
+       * config/linux/ptrlock.h: New file.
+       * config/linux/wait.h: New file.
+       * config/posix/ptrlock.c: New file.
+       * config/posix/ptrlock.h: New file.
+       * config/linux/bar.h (gomp_team_barrier_wait,
+       gomp_team_barrier_wait_end, gomp_team_barrier_wake): New prototypes.
+       (gomp_team_barrier_set_task_pending,
+       gomp_team_barrier_clear_task_pending,
+       gomp_team_barrier_set_waiting_for_tasks,
+       gomp_team_barrier_waiting_for_tasks,
+       gomp_team_barrier_done): New inlines.
+       (gomp_barrier_t): Rewritten.
+       (gomp_barrier_state_t): New typedef.
+       (gomp_barrier_init, gomp_barrier_reinit, gomp_barrier_destroy,
+       gomp_barrier_wait_start): Rewritten.
+       (gomp_barrier_wait_end): Change second argument to
+       gomp_barrier_state_t.
+       (gomp_barrier_last_thread, gomp_barrier_wait_last): New static
+       inlines.
+       * config/linux/bar.c: Include wait.h instead of libgomp.h and
+       futex.h.
+       (gomp_barrier_wait_end): Rewritten.
+       (gomp_team_barrier_wait, gomp_team_barrier_wait_end,
+       gomp_team_barrier_wake, gomp_barrier_wait_last): New functions.
+       * config/posix/bar.h (gomp_barrier_t): Add generation field.
+       (gomp_barrier_state_t): New typedef.
+       (gomp_team_barrier_wait,
+       gomp_team_barrier_wait_end, gomp_team_barrier_wake): New prototypes.
+       (gomp_barrier_wait_start): Or all but low 2 bits from generation
+       into the return value.  Return gomp_barrier_state_t.
+       (gomp_team_barrier_set_task_pending,
+       gomp_team_barrier_clear_task_pending,
+       gomp_team_barrier_set_waiting_for_tasks,
+       gomp_team_barrier_waiting_for_tasks,
+       gomp_team_barrier_done): New inlines.
+       (gomp_barrier_wait_end): Change second argument to
+       gomp_barrier_state_t.
+       (gomp_barrier_last_thread, gomp_barrier_wait_last): New static
+       inlines.
+       * config/posix/bar.c (gomp_barrier_init): Clear generation field.
+       (gomp_barrier_wait_end): Change second argument to
+       gomp_barrier_state_t.
+       (gomp_team_barrier_wait, gomp_team_barrier_wait_end,
+       gomp_team_barrier_wake): New functions.
+       * config/linux/mutex.c: Include wait.h instead of libgomp.h and
+       futex.h.
+       (gomp_futex_wake, gomp_futex_wait): New variables.
+       (gomp_mutex_lock_slow): Call do_wait instead of futex_wait.
+       * config/linux/lock.c: Rewrite to make locks task owned,
+       for backwards compatibility provide the old entrypoints
+       if symbol versioning.  Include wait.h instead of libgomp.h and
+       futex.h.
+       (gomp_set_nest_lock_25): Call do_wait instead of futex_wait.
+       * config/posix95/lock.c: Rewrite to make locks task owned,
+       for backwards compatibility provide the old entrypoints
+       if symbol versioning.
+       * config/posix/lock.c: Rewrite to make locks task owned,
+       for backwards compatibility provide the old entrypoints
+       if symbol versioning.
+       * config/linux/proc.c (gomp_init_num_threads): Use gomp_global_icv.
+       (get_num_procs, gomp_dynamic_max_threads): Use gomp_icv.
+       * config/posix/proc.c, config/mingw32/proc.c: Similarly.
+       * config/linux/powerpc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
+       (sys_futex0): Return error code.
+       (futex_wake, futex_wait): If ENOSYS was returned, clear
+       FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
+       (cpu_relax, atomic_write_barrier): New static inlines.
+       * config/linux/alpha/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
+       (futex_wake, futex_wait): If ENOSYS was returned, clear
+       FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
+       (cpu_relax, atomic_write_barrier): New static inlines.
+       * config/linux/x86/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
+       (sys_futex0): Return error code.
+       (futex_wake, futex_wait): If ENOSYS was returned, clear
+       FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
+       (cpu_relax, atomic_write_barrier): New static inlines.
+       * config/linux/s390/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
+       (sys_futex0): Return error code.
+       (futex_wake, futex_wait): If ENOSYS was returned, clear
+       FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
+       (cpu_relax, atomic_write_barrier): New static inlines.
+       * config/linux/ia64/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
+       (sys_futex0): Return error code.
+       (futex_wake, futex_wait): If ENOSYS was returned, clear
+       FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
+       (cpu_relax, atomic_write_barrier): New static inlines.
+       * config/linux/sparc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
+       (sys_futex0): Return error code.
+       (futex_wake, futex_wait): If ENOSYS was returned, clear
+       FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
+       (cpu_relax, atomic_write_barrier): New static inlines.
+       * config/linux/sem.c: Include wait.h instead of libgomp.h and
+       futex.h.
+       (gomp_sem_wait_slow): Call do_wait instead of futex_wait.
+       * config/linux/affinity.c: Assume HAVE_SYNC_BUILTINS.
+       * config/linux/omp-lock.h (omp_lock_25_t, omp_nest_lock_25_t): New
+       types.
+       (omp_nest_lock_t): Change owner into void *, add lock field.
+       * config/posix95/omp-lock.h: Include semaphore.h.
+       (omp_lock_25_t, omp_nest_lock_25_t): New types.
+       (omp_lock_t): Use sem_t instead of mutex if semaphores
+       aren't broken.
+       (omp_nest_lock_t): Likewise.  Change owner to void *.
+       * config/posix/omp-lock.h: Include semaphore.h.
+       (omp_lock_25_t, omp_nest_lock_25_t): New types.
+       (omp_lock_t): Use sem_t instead of mutex if semaphores
+       aren't broken.
+       (omp_nest_lock_t): Likewise.  Add owner field.
+
+2008-06-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.c/collapse-1.c: New test.
+       * testsuite/libgomp.c/collapse-2.c: New test.
+       * testsuite/libgomp.c/collapse-3.c: New test.
+       * testsuite/libgomp.c/icv-1.c: New test.
+       * testsuite/libgomp.c/icv-2.c: New test.
+       * testsuite/libgomp.c/lib-2.c: New test.
+       * testsuite/libgomp.c/lock-1.c: New test.
+       * testsuite/libgomp.c/lock-2.c: New test.
+       * testsuite/libgomp.c/lock-3.c: New test.
+       * testsuite/libgomp.c/loop-4.c: New test.
+       * testsuite/libgomp.c/loop-5.c: New test.
+       * testsuite/libgomp.c/loop-6.c: New test.
+       * testsuite/libgomp.c/loop-7.c: New test.
+       * testsuite/libgomp.c/loop-8.c: New test.
+       * testsuite/libgomp.c/loop-9.c: New test.
+       * testsuite/libgomp.c/nested-3.c: New test.
+       * testsuite/libgomp.c/nestedfn-6.c: New test.
+       * testsuite/libgomp.c/sort-1.c: New test.
+       * testsuite/libgomp.c/task-1.c: New test.
+       * testsuite/libgomp.c/task-2.c: New test.
+       * testsuite/libgomp.c/task-3.c: New test.
+       * testsuite/libgomp.c/task-4.c: New test.
+       * testsuite/libgomp.c++/c++.exp: Add libstdc++-v3 build includes
+       to C++ testsuite default compiler options.
+       * testsuite/libgomp.c++/collapse-1.C: New test.
+       * testsuite/libgomp.c++/collapse-2.C: New test.
+       * testsuite/libgomp.c++/ctor-10.C: New test.
+       * testsuite/libgomp.c++/for-1.C: New test.
+       * testsuite/libgomp.c++/for-2.C: New test.
+       * testsuite/libgomp.c++/for-3.C: New test.
+       * testsuite/libgomp.c++/for-4.C: New test.
+       * testsuite/libgomp.c++/for-5.C: New test.
+       * testsuite/libgomp.c++/loop-8.C: New test.
+       * testsuite/libgomp.c++/loop-9.C: New test.
+       * testsuite/libgomp.c++/loop-10.C: New test.
+       * testsuite/libgomp.c++/task-1.C: New test.
+       * testsuite/libgomp.c++/task-2.C: New test.
+       * testsuite/libgomp.c++/task-3.C: New test.
+       * testsuite/libgomp.c++/task-4.C: New test.
+       * testsuite/libgomp.c++/task-5.C: New test.
+       * testsuite/libgomp.c++/task-6.C: New test.
+       * testsuite/libgomp.fortran/allocatable1.f90: New test.
+       * testsuite/libgomp.fortran/allocatable2.f90: New test.
+       * testsuite/libgomp.fortran/allocatable3.f90: New test.
+       * testsuite/libgomp.fortran/allocatable4.f90: New test.
+       * testsuite/libgomp.fortran/collapse1.f90: New test.
+       * testsuite/libgomp.fortran/collapse2.f90: New test.
+       * testsuite/libgomp.fortran/collapse3.f90: New test.
+       * testsuite/libgomp.fortran/collapse4.f90: New test.
+       * testsuite/libgomp.fortran/lastprivate1.f90: New test.
+       * testsuite/libgomp.fortran/lastprivate2.f90: New test.
+       * testsuite/libgomp.fortran/lib4.f90: New test.
+       * testsuite/libgomp.fortran/lock-1.f90: New test.
+       * testsuite/libgomp.fortran/lock-2.f90: New test.
+       * testsuite/libgomp.fortran/nested1.f90: New test.
+       * testsuite/libgomp.fortran/nestedfn4.f90: New test.
+       * testsuite/libgomp.fortran/strassen.f90: New test.
+       * testsuite/libgomp.fortran/tabs1.f90: New test.
+       * testsuite/libgomp.fortran/tabs2.f: New test.
+       * testsuite/libgomp.fortran/task1.f90: New test.
+       * testsuite/libgomp.fortran/task2.f90: New test.
+       * testsuite/libgomp.fortran/vla4.f90: Add dg-warning.
+       * testsuite/libgomp.fortran/vla5.f90: Likewise.
+       * testsuite/libgomp.c/pr26943-2.c: Likewise.
+       * testsuite/libgomp.c/pr26943-3.c: Likewise.
+       * testsuite/libgomp.c/pr26943-4.c: Likewise.
+
+2008-05-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/36308
+       * testsuite/libgomp.c++/ctor-11.C: New test.
+       * testsuite/libgomp.c++/ctor-12.C: New test.
+
+2008-05-15  Janis Johnson  <janis187@us.ibm.com>
+
+       * testsuite/lib/libgomp.exp: Load torture-options.exp from gcc lib.
+
+2008-05-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/36106
+       * testsuite/libgomp.c/atomic-5.c: New test.
+       * testsuite/libgomp.c/atomic-6.c: New test.
+       * testsuite/libgomp.c/autopar-1.c: New test.
+
+2008-04-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * acinclude.m4 (LIBGOMP_CHECK_SYNC_BUILTINS)
+       (LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY)
+       (LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT)
+       (LIBGOMP_CHECK_ATTRIBUTE_ALIAS): Fix cache variable names.
+       * configure: Regenerate.
+       * Makefile.in, testsuite/Makefile.in: Likewise.
+
+2008-04-18  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR bootstrap/35457
+       * aclocal.m4: Regenerate.
+       * configure: Regenerate.
+
+2008-03-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/35611
+       * testsuite/libgomp.c/atomic-4.c: New test.
+
+       PR libgomp/35625
+       * iter.c (gomp_iter_guided_next_locked): If q > n, set end to ws->end.
+       (gomp_iter_guided_next): Likewise.
+       * testsuite/libgomp.c/pr35625.c: New test.
+
+2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * aclocal.m4: Regenerate.
+       * configure: Likewise.
+       * Makefile.in: Likewise.
+       * testsuite/Makefile.in: Likewise.
+
+2008-03-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/35185
+       * testsuite/libgomp.c++/pr35185.C: New test.
+
+2008-03-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/35549
+       * testsuite/libgomp.c/pr35549.c: New test.
+
+2008-03-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.c/atomic-3.c: New test.
+
+2008-03-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/33197
+       * testsuite/libgomp.fortran/fortran.exp: Add .f08 and
+       .F08 file suffixes.
+
+2008-03-03  Peter O'Gorman  <pogma@thewrittenword.com>
+
+       PR libgomp/33131
+       * configure.ac: Add ACX_HEADER_STRING.
+       * env.c: Include strings.h.
+       * aclocal.m4: Regenerate.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+       * testsuite/Makefile.in: Regenerate.
+
+2008-02-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/35196
+       * testsuite/libgomp.c/pr35196.c: New test.
+
+       PR middle-end/35130
+       * testsuite/libgomp.fortran/pr35130.f90: New test.
+       * testsuite/libgomp.c/pr35130.c: New test.
+
+2008-01-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/33880
+       * testsuite/libgomp.c/pr33880.c: New test.
+       * testsuite/libgomp.fortran/pr33880.f90: New test.
+
+2008-01-24  David Edelsohn  <edelsohn@gnu.org>
+
+       * configure: Regenerate.
+
+2008-01-08  Jakub Jelinek  <jakub@redhat.com>
+
+       * configure.ac: Move futex checking into ../config/futex.m4.
+       * configure: Rebuilt.
+       * aclocal.m4: Rebuilt.
+       * Makefile.in: Rebuilt.
+
+       * configure.tgt: Rename have_tls to gcc_cv_have_tls to match
+       2007-10-15 ../config/tls.m4 change.
+
+2007-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/34513
+       * testsuite/libgomp.c/pr34513.c: New test.
+       * testsuite/libgomp.c++/pr34513.C: New test.
+
+2007-12-17  Jack Howarth  <howarth@bromo.med.uc.edu>
+
+       PR target/32765
+       * testsuite/libgomp.fortran/crayptr2.f90: Move dg-options for darwin.
+
+2007-12-04  Jakub Jelinek  <jakub@redhat.com>
+
+       * omp.h.in (__GOMP_NOTHROW): Define.  Use it on omp_* prototypes.
+
+2007-12-03  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.c/private-1.c: New test.
+
+2007-11-29  Andris Pavenis <andris.pavenis@iki.fi>
+           Paolo Bonzini  <bonzini@gnu.org>
+
+       * Makefile.am: Use space as vpath separator.  Use 'vpath %'
+       instead of 'VPATH ='.
+       * Makefile.in: Regenerate.
+
+2007-11-23  Matthias Klose  <doko@ubuntu.com>
+
+       * configure.ac: Adjust makeinfo version check.
+       * configure: Regenerate.
+
+2007-11-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/34020
+       * testsuite/libgomp.fortran/pr34020.f90: New test.
+
+2007-11-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/33894
+       * testsuite/libgomp.c++/atomic-1.C: New test.
+
+2007-10-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/33275
+       * testsuite/libgomp.fortran/omp_parse3.f90 (test_threadprivate):
+       Make x and y integers rather than (implicit) reals.  Add private (j)
+       clause to the last omp parallel.
+
+2007-10-15  Maciej W. Rozycki  <macro@linux-mips.org>
+
+       * configure: Regenerate following changes to ../config/tls.m4.
+
+2007-09-28  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/stack.f90: New test.
+
+2007-09-10  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * config/mingw32/proc.c: New file.
+
+2007-09-05  Uros Bizjak  <ubizjak@gmail.com>
+
+       * testsuite/libgomp.c/atomic-1.c: Include cpuid.h for i386 targets.
+       (main): Use __get_cpuid to get i386 target fetaures.
+       * testsuite/libgomp.c/atomic-2.c: Include cpuid.h for x86_64 targets.
+       (main): Use __get_cpuid to get x86_64 target fetaures.
+
+2007-08-15  Jack Howarth  <howarth@bromo.med.uc.edu>
+
+       PR target/32765
+       * testsuite/libgomp.fortran/pr32550.f90: Use -static-libgcc on Darwin.
+       * testsuite/libgomp.fortran/crayptr2.f90: Likwise.
+
+2007-07-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/32550
+       * testsuite/libgomp.fortran/pr32550.f90: New test.
+       * testsuite/libgomp.fortran/crayptr2.f90: New test.
+
+2007-07-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * aclocal.m4: Regenerated.
+
+2007-07-05  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/32359
+       * testsuite/libgomp.fortran/pr32359.f90: New.
+
+2007-07-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/32468
+       * sections.c (GOMP_parallel_sections_start): Only decrease
+       number of threads to COUNT if dyn_var is true.
+       * testsuite/libgomp.c/pr32468.c: New test.
+
+2007-07-02  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+       PR libgomp/26308
+       * config/posix/lock.c (_XOPEN_SOURCE): Don't define on Tru64 UNIX.
+
+2007-06-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/32362
+       * testsuite/libgomp.c/pr32362-1.c: New test.
+       * testsuite/libgomp.c/pr32362-2.c: New test.
+       * testsuite/libgomp.c/pr32362-3.c: New test.
+
+2007-06-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * team.c (gomp_team_start): Fix setting up thread_attr
+       stack size.
+
+2007-06-02  Paolo Bonzini  <bonzini@gnu.org>
+
+       * configure: Regenerate.
+
+2007-05-23  Steve Ellcey  <sje@cup.hp.com>
+
+       * Makefile.in: Regenerate.
+       * configure: Regenerate.
+       * aclocal.m4: Regenerate.
+       * testsuite/Makefile.in: Regenerate.
+
+2007-05-04  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/linux/proc.c: New file.
+
+       PR libgomp/28482
+       * configure.tgt: Don't link with -Wl,-z,nodlopen even on Linux.
+
+2007-04-19  Daniel Franke  <franke.daniel@gmail.com>
+
+       * libgomp.texi (GOMP_CPU_AFFINITY): Updated.
+
+2007-04-16  Matthias Klose  <doko@debian.org>
+
+       * configure.tgt (i[456]86-*-linux*): Only add ia32 specific
+       flags if not building with -m64.
+       * testsuite/lib/libgomp-dg.exp (libgomp_init): Don't add -march
+       flag for i?86-*-* targets, if current target matches -m64.
+
+2007-04-14  Steve Ellcey  <sje@cup.hp.com>
+
+       * Makefile.am: Add -I .. to ACLOCAL_AMFLAGS.
+       * Makefile.in: Regenerate.
+
+2007-04-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR testsuite/31369
+       * testsuite/libgomp.c++/c++.exp: Don't use concat when setting
+       ld_library_path.
+       * testsuite/libgomp.fortran/fortran.exp: Likewise.
+
+2007-04-04  Jakub Jelinek  <jakub@redhat.com>
+
+       * libgomp.h (gomp_cpu_affinity, gomp_cpu_affinity_len): New extern
+       decls.
+       (gomp_init_affinity, gomp_init_thread_affinity): New prototypes.
+       * env.c (gomp_cpu_affinity, gomp_cpu_affinity_len): New variables.
+       (parse_affinity): New function.
+       (initialize_env): Call it and gomp_init_affinity.
+       * team.c (gomp_team_start): If gomp_cpu_affinity != NULL,
+       create new pthread_attr_t and call gomp_init_thread_affinity
+       on it for each thread before passing the attribute to pthread_create.
+       * config/linux/affinity.c: New file.
+       * config/posix/affinity.c: New file.
+       * configure.ac (HAVE_PTHREAD_AFFINITY_NP): New test.
+       * configure: Rebuilt.
+       * config.h.in: Rebuilt.
+       * Makefile.am (libgomp_la_SOURCES): Add affinity.c.
+       * Makefile.in: Rebuilt.
+
+2007-03-23  Andreas Tobler  <a.tobler@schweiz.org>
+
+       * testsuite/lib/libgomp.exp (libgomp_init): Add -shared-libgcc for
+       *-*-darwin*.
+       * testsuite/libgomp.c++/c++.exp: Look for shared libstdc++ library
+       and use it if found.
+
+2007-03-18  Uros Bizjak  <ubizjak@gmail.com>
+
+       * testsuite/config/default.exp: New file.
+       * testsuite/lib/libgomp.exp: New file.
+       * testsuite/lib/libgomp.dg (load_gcc_lib, libgomp_init,
+       libgomp_target_compile, libgomp_option_help, libgomp_option_proc,
+       load_lib *, load_gcc_lib *): Move to libgomp.exp.
+       (libgomp_load): Remove.
+       * testsuite/lib/libgomp.exp (libgomp_init): Compute
+       always_ld_library_path, not ld_library_path.  Set additional_flags
+       to -march=i486 for ilp32 x86_64-*-* and i386-*-* targets.
+       (target_compile): Do not call libgomp_init.  Append lang_library_path
+       and lang_link_flags to options.
+       * testsuite/libgomp.c/c.exp: Set DEFAULT_FLAGS to -O2.  Set
+       ld_library_path from always_ld_library_path.  Set LD_LIBRARY_PATH
+       here.
+       * testsuite/libgomp.c++/c++.exp: Set ld_library_path from
+       always_ld_library_path.  Set LD_LIBRARY_PATH here.
+       * testsuite/libgomp.fortran/fortran.exp: Ditto.
+       * testsuite/libgomp.c/atomic-1.c: Set dg-options to
+       "-O2 -march=pentium" for ilp32 x86 targets. Simplify check for
+       CX8 flag.
+       * testsuite/libgomp.c/atomic-2.c: Set dg-options to "-O2 -mcx16" for
+       lp64 x86 targets. Do not check for SSE3 bit. Do not define bit_SSE3.
+       * testsuite/libgomp.c/pr29947-1.c: Remove default dg-options.
+       * testsuite/libgomp.c/pr29947-1.c: Ditto.
+       * testsuite/libgomp.c/atomic-10.c: Ditto.
+
+2007-03-21  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/appendix-a/a.22.8.f90: Add
+       dg-final cleanup-modules line.
+       * testsuite/libgomp.fortran/appendix-a/a.40.1.f90: Likewise.
+       * testsuite/libgomp.fortran/appendix-a/a.31.5.f90: Likewise.
+       * testsuite/libgomp.fortran/appendix-a/a.31.4.f90: Likewise.
+       * testsuite/libgomp.fortran/threadprivate2.f90: Likewise.
+       * testsuite/libgomp.fortran/reduction5.f90: Likewise.
+       * testsuite/libgomp.fortran/threadprivate3.f90: Likewise.
+       * testsuite/libgomp.fortran/threadprivate1.f90: Likewise.
+
+2007-03-18  Andreas Schwab  <schwab@suse.de>
+
+       * acinclude.m4: Adjust regular expression for ld version
+       extraction.
+       * configure: Regenerate.
+
+2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
+
+       * Makefile.am: Add install-pdf target as copied from
+       automake v1.10 rules.
+       * Makefile.in: Regenerate
+
+2007-02-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/28486
+       * configure: Regenerate.
+
+       PR c++/30703
+       * testsuite/libgomp.c++/pr30703.C: New test.
+
+2007-02-02  Jakub Jelinek  <jakub@redhat.com>
+
+       Revert:
+       2006-07-05  Eric Christopher  <echristo@apple.com>
+       * configure.ac: Depend addition of -pthread on host OS.
+       * configure: Regenerate.
+
+2007-01-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * libgomp.texi: Fix spacing after abbreviations.
+
+2007-01-31  Daniel Franke <franke.daniel@gmail.com>
+
+       PR libgomp/30546
+       * configure.ac: Add check for makeinfo
+       * Makefile.am: Redefined target libgomp.info, build libgomp.info only
+       if an appropiate version of makeinfo is found.
+       * aclocal.m4: Regenerated.
+       * configure: Regenerated.
+       * Makefile.in: Regenerated.
+       * testsuite/Makefile.in: Regenerated.
+
+2007-01-29  Daniel Franke <franke.daniel@gmail.com>
+
+       PR libgomp/30540
+       * libgomp.texi: More about implementation-dependent settings.
+
+2007-01-26  Tobias Burnus  <burnus@net-b.de>
+
+       * testsuite/libgomp.fortran/fortran.exp: Support .f03 extension.
+
+2007-01-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/30494
+       * testsuite/libgomp.c/pr30494.c: New test.
+
+2007-01-15  Tom Tromey  <tromey@redhat.com>
+
+       * configure: Rebuilt.
+       * configure.ac: Fixed comment.
+
+2007-01-14  Daniel Franke  <franke.daniel@gmail.com>
+
+       * libgomp.texi: Document implementation specific default values of
+       environment variables.
+
+2006-12-21  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR libgomp/28209
+       * libgomp.texi: New file.
+       * configure.ac: Add --enable-generated-files-in-srcdir option.
+       * Makefile.am: Add info, dvi, pdf, html targets. On request, copy
+       files to srcdir.
+       * Makefile.in: Regenerated.
+       * config.h.in: Regenerated.
+       * testsuite/Makefile.in: Regenerated.
+       * NOTES: Removed.
+
+2006-12-04  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR libgomp/29949
+       * env.c (omp_set_num_threads): Set illegal thread count to 1.
+
+2006-12-04  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * configure: Regenerate.
+
+2006-12-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/29947
+       * loop.c (gomp_loop_init): Make parameters signed.  Set ws->end to
+       start if there shouldn't be any loop iterations.
+       (gomp_loop_ordered_static_start): Remove start == end test.
+       * testsuite/libgomp.c/pr29947-1.c: New test.
+       * testsuite/libgomp.c/pr29947-2.c: New test.
+
+2006-12-02  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * configure.tgt: Force initial-exec TLS model on Linux only.
+
+2006-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * configure: Regenerated.
+
+2006-11-09  Uros Bizjak  <ubizjak@gmail.com>
+
+       * env.c (parse_schedule): Reject out of range values.
+       (parse_unsigned_long): Reject out of range, negative or zero values.
+
+2006-10-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/29629
+       * testsuite/libgomp.fortran/pr29629.f90: New test.
+
+2006-10-24  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR libgomp/29494
+       * configure.tgt: Use posix95 configuration for Solaris 2.5.1 and 2.6.
+       * config/posix95: New directory.
+       * config/posix95/omp-lock.h: New file.
+       * config/posix95/lock.c: Likewise.
+
+2006-10-14  Geoffrey Keating  <geoffk@apple.com>
+
+       * aclocal.m4: Regenerate.
+       * configure: Regenerate.
+
+2006-10-05  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * testsuite/libgomp.c/barrier-1.c: Change timestamp tests from
+       '<' to '<='.
+
+2006-10-05  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * acinclude.m4 (HAVE_ATTRIBUTE_ALIAS): Remove __USER_LABEL_PREFIX__ from
+       test.
+       * configure: Regenerate.
+       * fortran.c  (ialias_redirect): Add __USER_LABEL_PREFIX__ to alias.
+
+2006-09-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/25261
+       PR middle-end/28790
+       * testsuite/libgomp.c/nestedfn-4.c: New test.
+       * testsuite/libgomp.c/nestedfn-5.c: New test.
+       * testsuite/libgomp.fortran/nestedfn3.f90: New test.
+
+       PR fortran/29097
+       * testsuite/libgomp.fortran/condinc1.f: New test.
+       * testsuite/libgomp.fortran/condinc2.f: New test.
+       * testsuite/libgomp.fortran/condinc3.f90: New test.
+       * testsuite/libgomp.fortran/condinc4.f90: New test.
+       * testsuite/libgomp.fortran/condinc1.inc: New file.
+
+2006-09-18  Tom Tromey  <tromey@redhat.com>
+
+       * configure: Rebuilt.
+
+2006-09-13  Joseph S. Myers  <joseph@codesourcery.com>
+
+       PR c/28768
+       PR preprocessor/14634
+       * configure.ac (HAVE_CLOCK_GETTIME): Add missing second argument
+       to AC_DEFINE.
+       * configure: Regenerate.
+
+2006-09-08  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * testsuite/libgomp.fortran/reduction3.f90: Change
+       -2147483648 to -huge(i)-1 to avoid overflow.
+       * testsuite/libgomp.fortran/reduction4.f90: Change
+       Z'ffffffff' to not(0) to avoid overflow.
+
+2006-08-26  Joseph S. Myers  <joseph@codesourcery.com>
+
+       PR libgomp/25938
+       * Makefile.am (libsubincludedir): New.
+       (nodist_include_HEADERS): Rename to nodist_libsubinclude_HEADERS.
+       * Makefile.in: Regenerate.
+
+2006-08-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/28725
+       * env.c: Include ctype.h.
+       (parse_schedule, parse_unsigned_long, parse_boolean): Allow
+       leading and/or trailing whitespace and compare strings case
+       insensitively.
+
+2006-07-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/28390
+       * testsuite/libgomp.fortran/pr28390.f: New test.
+
+2006-07-05  Eric Christopher  <echristo@apple.com>
+
+       * configure.ac: Depend addition of -pthread on host OS.
+       * configure: Regenerate.
+
+2006-06-21  Jakub Jelinek  <jakub@redhat.com>
+
+       * critical.c (GOMP_critical_name_start): Fix *pptr initialization
+       when gomp_mutex_t is larger than pointer and HAVE_SYNC_BUILTINS is
+       defined.
+
+2006-06-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/26175
+       PR libgomp/26477
+       * configure.ac: If neither --enable-linux-futex nor
+       --disable-linux-futex is passed, determine the default by checking
+       for compiling and/or running against NPTL.  With --enable-linux-futex,
+       check if SYS_gettid and SYS_futex are defined.
+       * configure: Rebuilt.
+
+2006-06-14  Richard Henderson  <rth@redhat.com>
+
+       PR libgomp/28008
+       * env.c (initialize_env): Avoid using PTHREAD_STACK_MIN when
+       undefined.  Use GOMP_STACKSIZE not OMP_STACKSIZE for environment.
+
+2006-06-09  Richard Henderson  <rth@redhat.com>
+
+       * env.c (gomp_nthreads_var): Change to unsigned long.
+       (gomp_run_sched_chunk): Likewise.
+       (parse_unsigned_long): Rename from parse_num_threads and generalize.
+       (initialize_env): Initialize gomp_thread_attr.
+       * libgomp.h (gomp_nthreads_var): Update decl.
+       (gomp_run_sched_chunk): Likewise.
+       (gomp_thread_attr): Declare.
+       * team.c (gomp_thread_attr): Export.
+       (initialize_team): Don't initialize it.
+
+2006-06-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/27916
+       * testsuite/libgomp.fortran/pr27916-1.f90: New test.
+       * testsuite/libgomp.fortran/pr27916-2.f90: New test.
+
+2006-06-06  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * config/mingw32/time.c: New file.
+       * configure.tgt: Use it.
+
+2006-05-23  Carlos O'Donell  <carlos@codesourcery.com>
+
+       * Makefile.am: Add install-html target. Add install-html to .PHONY
+       * Makefile.in: Regenerate.
+
+2006-05-22  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR libgomp/27612
+       * testsuite/libgomp.c/sections-1.c: Require sync_int_long.
+       * testsuite/libgomp.c/critical-1.c: Likewise.
+       * testsuite/libgomp.c/loop-1.c: Likewise.
+       * testsuite/libgomp.c/loop-2.c: Likewise.
+       * testsuite/libgomp.c/single-1.c: Likewise.
+       * testsuite/libgomp.c/ordered-1.c: Likewise.
+       * testsuite/libgomp.c/ordered-2.c: Likewise.
+
+2006-05-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/27416
+       * libgomp.fortran/pr27416-1.f90: New test.
+
+2006-05-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/27395
+       * testsuite/libgomp.fortran/pr27395-1.f90: New test.
+       * testsuite/libgomp.fortran/pr27395-2.f90: New test.
+
+2006-05-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/26943
+       * testsuite/libgomp.c/pr26943-1.c: New test.
+       * testsuite/libgomp.c/pr26943-2.c: New test.
+       * testsuite/libgomp.c/pr26943-3.c: New test.
+       * testsuite/libgomp.c/pr26943-4.c: New test.
+       * testsuite/libgomp.c++/pr27337.C: Remove barrier.
+       * testsuite/libgomp.c++/pr26943.C: New test.
+
+2006-05-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/27337
+       * testsuite/libgomp.c++/pr27337.C: New test.
+
+2006-04-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/26171
+       * testsuite/libgomp.c/pr26171.c: New test.
+
+2006-04-25  Richard Henderson  <rth@redhat.com>
+
+       PR libgomp/25865
+       * configure.ac: Use GCC_CHECK_TLS.
+       * acinclude.m4 (LIBGOMP_CHECK_TLS): Remove.
+       * Makefile.in, aclocal.m4, configure: Regenerate.
+
+2006-04-10  Matthias Klose  <doko@debian.org>
+
+       * testsuite/lib/libgomp.exp (libgomp_init): Recognize multilib
+       directory names containing underscores.
+
+2006-03-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/26691
+       * testsuite/libgomp.c++/pr26691.C: New test.
+
+2006-03-13  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/retval2.f90: New test.
+
+2006-03-09  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.c++: New directory.
+
+2006-02-25  Shantonu Sen  <ssen@opendarwin.org>
+
+       * config/posix/sem.h: Define BROKEN_POSIX_SEMAPHORES functions.
+       * config/posix/sem.c: Implement the above.
+
+2006-02-25  Andreas Tobler  <a.tobler@schweiz.ch>
+
+       * configure.ac (HAVE_BROKEN_POSIX_SEMAPHORES): Check for darwin and
+       define HAVE_BROKEN_POSIX_SEMAPHORES.
+       * configure: Rebuilt.
+       * config.h.in: Rebuilt.
+
+2006-02-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR bootstrap/26161
+       * configure.ac: Remove AC_CHECK_HEADER for pthread.h. Add comment
+       for the other pthread check.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2006-02-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/25938
+       PR libgomp/25984
+       * Makefile.am (fincludedir): New variable.
+       (nodist_include_HEADERS): Remove Fortran files.
+       (nodist_finclude_HEADERS): New variable.
+       * Makefile.in: Regenerated.
+
+2006-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/vla7.f90: Add -w to options.
+       Remove tests for returning assumed character length arrays.
+
+2006-02-12  Roger Sayle  <roger@eyesopen.com>
+           John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       PR libgomp/25936
+       * configure.tgt: Link against -lrt for sem_init on HPUX v11 systems.
+
+2006-02-08  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * testsuite/lib/libgomp-dg.exp: Load scanrtl.exp library.
+
+2006-02-07  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * testsuite/lib/libgomp-dg.exp (libgomp_init): Compute multilib related
+       part of LD_LIBRARY_PATH manually.
+
+2006-02-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR libgomp/25852
+       * testsuite/lib/libgomp-dg.exp (blddir): Set it in
+       libgomp_init.
+
+2005-01-25  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR libgomp/25884
+       * Makefile.am (omp.h, omp_lib.h, omp_lib.f90, libgomp_f.h): Remove.
+       * configure.ac (PERL): Don't set.
+       (gstdint.h, omp.h, omp_lib.h, omp_lib.f90, libgomp_f.h): Create here.
+       (OMP_LOCK_SIZE, OMP_LOCK_ALIGN, OMP_LOCK_KIND, OMP_NEST_LOCK_SIZE,
+       OMP_NEST_LOCK_ALIGN, OMP_NEST_LOCK_KIND): New substitutions.
+       * omp.h.in: Wrap the new configure substitutions with @ characters.
+       * omp_lib.h.in, omp_lib.f90.in, libgomp_f.h.in: Likewise.
+       * aclocal.m4, configure, Makefile.in: Regenerate.
+       * mkomp_h.pl: Delete.
+
+2005-01-24  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR libgomp/25259
+       * configure.ac: Use GCC_HEADER_STDINT.
+       * libgomp.h: Include gstdint.h.
+       * libgomp_f.h.in: Don't include stdint.h or inttypes.h.
+       * configure, Makefile.in, testsuite/Makefile.in, aclocal.m4: Rebuild.
+
+2006-01-24  Richard Henderson  <rth@redhat.com>
+
+       PR libgomp/25942
+       * configure.ac: Add AM_MAINTAINER_MODE.
+       * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Rebuild.
+
+2006-01-24  Diego Novillo  <dnovillo@redhat.com>
+
+       * Makefile.in: Regenerate.
+       * testsuite/Makefile.in: Regenerate.
+       * aclocal.m4: Regenerate.
+
+2006-01-23  Andreas Tobler  <a.tobler@schweiz.ch>
+
+       * config/posix/proc.c: Conditional include of sys/loadavg.h for
+       Solaris.
+       * configure.ac: Add check for loadavg.h.
+       (link_gomp): Adjust comment.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2006-01-21  Steve Ellcey  <sje@cup.hp.com>
+
+       PR libgomp/25877
+       * configure.ac: Remove check for alloca.h.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+       * libgomp.h: define gomp_alloca to be __builtin_alloca.
+       * team.c: Remove use of alloca.h.
+       Call gomp_alloca instead of alloca.
+
+2006-01-20  Steve Ellcey  <sje@cup.hp.com>
+
+       PR libgomp/25877
+       * team.c: Add include of alloca.h.
+       * configure.ac: Add check for alloca.h.
+       * configure: Regenerate.
+       * config.h.in: Regenerate.
+
+2006-01-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/25219
+       * testsuite/libgomp.fortran/pr25219.f90: New test.
+
+2005-12-05  Uros Bizjak  <uros@kss-loka.si>
+
+       * testsuite/libgomp.c/pr24455.c, testsuite/libgomp.c/copyin-1.c,
+       testsuite/libgomp.c/copyin-2.c, testsuite/libgomp.c/copyin-3.c,
+       testsuite/libgomp.c++/copyin-1.C, testsuite/libgomp.c++/copyin-2.C,
+       testsuite/libgomp.c++/ctor-5.C, testsuite/libgomp.c++/ctor-8.C,
+       testsuite/libgomp.c++/ctor-9.C, testsuite/libgomp.c++/pr24455.C,
+       testsuite/libgomp.fortran/threadprivate1.f90,
+       testsuite/libgomp.fortran/threadprivate2.f90,
+       testsuite/libgomp.fortran/threadprivate3.f90,
+       testsuite/libgomp.fortran/appendix-a/a.22.7.f9,
+       testsuite/libgomp.fortran/appendix-a/a.22.8.f9,
+       testsuite/libgomp.fortran/omp_parse3.f90: Change required
+       effective-target to TLS runtime.
+
+       * testsuite/libgomp.fortran/pr25162.f: Require
+       effective-target TLS runtime.
+
+2005-12-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/nestedfn2.f90: New test.
+       * testsuite/libgomp.c/nestedfn-3.c: New test.
+
+2005-11-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/25162
+       * testsuite/libgomp.fortran/pr25162.f: New test.
+
+2005-11-28  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/posix/time.c (omp_get_wtime, omp_get_wtick): Fall back to
+       CLOCK_REALTIME if clock_* (CLOCK_MONOTONIC, &ts) call failed.
+
+2005-11-25  Jakub Jelinek  <jakub@redhat.com>
+
+       * alloc.c, barrier.c, critical.c, env.c, error.c, fortran.c, iter.c,
+       libgomp.h, libgomp_f.h.in, libgomp_g.h, loop.c, mkomp_h.pl, omp.h.in,
+       omp_lib.f90.in, omp_lib.h.in, ordered.c, parallel.c, sections.c,
+       single.c, team.c, work.c, config/linux/alpha/futex.h,
+       config/linux/bar.c, config/linux/bar.h, config/linux/ia64/futex.h,
+       config/linux/lock.c, config/linux/mutex.c, config/linux/mutex.h,
+       config/linux/powerpc/futex.h, config/linux/s390/futex.h,
+       config/linux/sem.c, config/linux/sem.h, config/linux/sparc/futex.h,
+       config/linux/x86/futex.h, config/posix/bar.c, config/posix/bar.h,
+       config/posix/lock.c, config/posix/mutex.h, config/posix/proc.c,
+       config/posix/sem.c, config/posix/sem.h, config/posix/time.c: Update
+       FSF address.
+
+2005-11-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * Makefile.am: Move libgomp_f.h from nodist_include_HEADERS
+       to nodist_noinst_HEADERS.
+       * Makefile.in: Rebuilt.
+
+       * config/posix/omp-lock.h (omp_nest_lock_t): Change into struct,
+       add integer count field.
+       * config/posix/lock.c (omp_destroy_nest_lock): Adjust for
+       omp_nest_lock_t type change.
+       (omp_init_nest_lock): Likewise.  Initialize count to 0.
+       (omp_set_nest_lock): Adjust for omp_nest_lock_t type change.
+       Increment count.
+       (omp_unset_nest_lock): Adjust for omp_nest_lock_t type change.
+       Decrement count.
+       (omp_test_nest_lock): Adjust for omp_nest_lock_t type change.
+       Increment count if successful and return the new nesting level.
+       * config/linux/lock.c (omp_test_nest_lock): Return new nesting level.
+       * omp_lib.f90.in (omp_test_lock): Fix LOCK argument type.
+       * testsuite/libgomp.c/lib-1.c: New test.
+       * testsuite/libgomp.fortran/lib1.f90: New test.
+       * testsuite/libgomp.fortran/lib2.f: New test.
+       * testsuite/libgomp.fortran/lib3.f: New test.
+
+2005-11-17  Richard Henderson  <rth@redhat.com>
+
+       PR 24845
+       * Makefile.am (nodist_toolexeclib_HEADERS): New.
+       * configure.ac (link_gomp): New.  Substitute it.
+       (AC_CONFIG_FILES): Add libgomp.spec.
+       * libgomp.spec.in: New file.
+       * Makefile.in, testsuite/Makefile.in, configure: Rebuild.
+       * testsuite/lib/libgomp-dg.exp: Add -B${blddir}/ to flags.
+
+2005-11-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/reduction1.f90: Adjust for
+       reduction(-:var) behaving the same as reduction(+:var).
+       * testsuite/libgomp.c/reduction-4.c: New test.
+
+2005-11-15  Uros Bizjak  <uros@kss-loka.si>
+
+       * testsuite/libgomp.c/pr24455-1.c, testsuite/libgomp.c/pr24455.c,
+       testsuite/libgomp.c/copyin-1.c, testsuite/libgomp.c/copyin-2.c,
+       testsuite/libgomp.c/copyin-3.c,
+       testsuite/libgomp.c++/copyin-1.C, testsuite/libgomp.c++/copyin-2.C,
+       testsuite/libgomp.c++/ctor-5.C, testsuite/libgomp.c++/ctor-8.C,
+       testsuite/libgomp.c++/ctor-9.C, testsuite/libgomp.c++/pr24455-1.C,
+       testsuite/libgomp.c++/pr24455.C,
+       testsuite/libgomp.fortran/threadprivate1.f90,
+       testsuite/libgomp.fortran/threadprivate2.f90,
+       testsuite/libgomp.fortran/threadprivate3.f90,
+       testsuite/libgomp.fortran/appendix-a/a.22.7.f9,
+       testsuite/libgomp.fortran/appendix-a/a.22.8.f9,
+       testsuite/libgomp.fortran/omp_parse3.f90: Require
+       effective-target TLS.
+
+2005-11-14  Diego Novillo  <dnovillo@redhat.com>
+
+       * HEADER: Remove.
+
+2005-11-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/24797
+       * team.c (initialize_team): Pass NULL rather than free as
+       pthread_key_create destructor.  Initialize thread specific data
+       pointer in initial thread to a static local variable rather than
+       malloced memory.
+
+2005-11-11  Uros Bizjak  <uros@kss-loka.si>
+
+       * testsuite/lib/libgomp-dg.exp: Locate libgcc.a and append
+       its location to ld_library_path.
+
+2005-11-10  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.c/c.exp: Rename from dg.exp.
+
+2005-11-10  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.c: Rename from libgomp.dg.
+
+2005-11-09  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.c++/pr24455.C: Add copyin clause for
+       threadprivate variable 'i'.
+
+2005-11-09  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/linux/s390/futex.h: New file.
+       * configure.tgt: Use it.
+
+       * testsuite/libgomp.fortran/omp_parse4.f90: Move n initialization
+       before the parallel.
+
+2005-11-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/24734
+       * testsuite/libgomp.c++/master-1.C: New test.
+
+2005-11-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.dg/copyin-3.c: New test.
+
+2005-11-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/retval1.f90: New test.
+       * testsuite/libgomp.fortran/vla7.f90: New test.
+
+2005-11-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/vla2.f90: New test.
+       * testsuite/libgomp.fortran/vla3.f90: New test.
+       * testsuite/libgomp.fortran/vla4.f90: New test.
+       * testsuite/libgomp.fortran/vla5.f90: New test.
+       * testsuite/libgomp.fortran/vla6.f90: New test.
+
+2005-11-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/linux/sparc/futex.h: New file.
+       * configure.tgt: Use it.
+       * testsuite/lib/libgomp-dg.exp: Use -mcpu=v9 for sparc testing.
+
+       * critical.c: Include stdlib.h.
+       * acinclude.m4 (LIBGOMP_CHECK_SYNC_BUILTINS): Avoid warnings about
+       ignoring return value.
+       * configure.ac: Don't put -Wc,-pthread into XCFLAGS until after
+       LIBGOMP_CHECK_SYNC_BUILTINS check.
+       * configure: Rebuilt.
+
+2005-10-31  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/vla1.f90: New test.
+
+2005-10-31  Richard Henderson  <rth@redhat.com>
+
+       * testsuite/libgomp.fortran/character2.f90: Fix race condition
+       setting 's' in different threads.
+
+2005-10-31  Jakub Jelinek  <jakub@redhat.com>
+
+       * libgomp.h (attribute_hidden, ialias): Define.
+       * config/posix/proc.c (omp_get_num_procs): Add ialias.
+       * config/posix/time.c (omp_get_wtime, omp_get_wtick): Likewise.
+       * config/posix/lock.c (omp_init_lock, omp_init_nest_lock,
+       omp_destroy_lock, omp_destroy_nest_lock, omp_set_lock,
+       omp_set_nest_lock, omp_unset_lock, omp_unset_nest_lock,
+       omp_test_lock, omp_test_nest_lock): Likewise.
+       * config/linux/lock.c (omp_init_lock, omp_init_nest_lock,
+       omp_destroy_lock, omp_destroy_nest_lock, omp_set_lock,
+       omp_set_nest_lock, omp_unset_lock, omp_unset_nest_lock,
+       omp_test_lock, omp_test_nest_lock): Likewise.
+       * env.c (omp_set_dynamic, omp_set_nested, omp_set_num_threads,
+       omp_get_dynamic, omp_get_nested): Likewise.
+       * parallel.c (omp_get_num_threads, omp_get_max_threads,
+       omp_get_thread_num, omp_in_parallel): Likewise.
+       * fortran.c (ialias_redirect): Define.
+       (omp_init_lock, omp_init_nest_lock, omp_destroy_lock,
+       omp_destroy_nest_lock, omp_set_lock, omp_set_nest_lock,
+       omp_unset_lock, omp_unset_nest_lock, omp_test_lock,
+       omp_test_nest_lock, omp_set_dynamic, omp_set_nested,
+       omp_set_num_threads, omp_get_dynamic, omp_get_nested,
+       omp_in_parallel, omp_get_max_threads, omp_get_num_procs,
+       omp_get_num_threads, omp_get_thread_num, omp_get_wtick,
+       omp_get_wtime): Add ialias_redirect.
+
+2005-10-30  Jakub Jelinek  <jakub@redhat.com>
+
+       * fortran.c: Include stdlib.h.
+
+2005-10-29  Jakub Jelinek  <jakub@redhat.com>
+
+       * Makefile.am (env.o, env.lo): Depend on libgomp_f.h.
+       * Makefile.in: Regenerated.
+
+2005-10-28  Jakub Jelinek  <jakub@redhat.com>
+
+       * mkomp_h.pl: Remove all -Wc, option prefixes in $COMPILE.
+       * libgomp_f.h.in (omp_check_defines): New function.
+       * env.c: Include libgomp_f.h.
+       (initialize_env): Call omp_check_defines.
+
+       * testsuite/libgomp.dg/copyin-2.c: New test.
+       * testsuite/libgomp.c++/copyin-2.C: New test.
+       * testsuite/libgomp.fortran/threadprivate3.f90: New test.
+
+       * testsuite/libgomp.fortran/threadprivate2.f90: New test.
+       * testsuite/libgomp.fortran/sharing2.f90: New test.
+
+       * testsuite/libgomp.dg/copyin-1.c: New test.
+       * testsuite/libgomp.c++/copyin-1.C: New test.
+
+2005-10-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/crayptr1.f90: New test.
+
+       * testsuite/libgomp.fortran/workshare1.f90: New test.
+
+       * libgomp.fortran/appendix-a/a.28.5.f90: Change into compile
+       only test.
+       * libgomp.fortran/sharing1.f90: New test.
+
+2005-10-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/24502
+       * testsuite/libgomp.c++/loop-7.C: New test.
+
+       * testsuite/libgomp.dg/nestedfn-2.c: New test.
+
+       * testsuite/libgomp.dg/nestedfn-1.c: New test.
+       * testsuite/libgomp.fortran/reduction6.f90: New test.
+       * testsuite/libgomp.fortran/nestedfn1.f90: New test.
+
+2005-10-23  Richard Henderson  <rth@redhat.com>
+
+       * testsuite/libgomp.c++/ctor-1.C: New.
+       * testsuite/libgomp.c++/ctor-2.C: New.
+       * testsuite/libgomp.c++/ctor-3.C: New.
+       * testsuite/libgomp.c++/ctor-4.C: New.
+       * testsuite/libgomp.c++/ctor-5.C: New.
+       * testsuite/libgomp.c++/ctor-6.C: New.
+       * testsuite/libgomp.c++/ctor-7.C: New.
+       * testsuite/libgomp.c++/ctor-8.C: New.
+       * testsuite/libgomp.c++/ctor-9.C: New.
+
+2005-10-21  Diego Novillo  <dnovillo@redhat.com>
+
+       PR 24455
+       * testsuite/libgomp.c++/pr24455-1.C: New test.
+       * testsuite/libgomp.c++/pr24455.C: New test.
+       * testsuite/libgomp.dg/pr24455-1.c: New test.
+       * testsuite/libgomp.dg/pr24455.c: New test.
+
+2005-10-20  Richard Henderson  <rth@redhat.com>
+
+       * testsuite/libgomp.c++/loop-6.C: New.
+       * testsuite/libgomp.dg/loop-3.c: New.
+
+2005-10-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/jacobi.f: Don't make i and j
+       explicitly private.
+       * testsuite/libgomp.fortran/omp_parse1.f90 (test_do): Make i
+       explicitly shared.
+
+2005-10-19  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.fortran/jacobi.f: New test.
+
+2005-10-19  Richard Henderson  <rth@redhat.com>
+
+       * configure.tgt (i?86-linux): Default to with_arch instead of
+       CFLAGS.  Add -mtune to match target_cpu.
+       (x86_64-linux): Tune to i686.
+
+       * fortran.c (omp_test_nest_lock_): Fix typo.
+
+2005-10-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * ordered.c (gomp_ordered_first, gomp_ordered_last, gomp_ordered_next,
+       gomp_ordered_sync): Do nothing if team->nthreads == 1.
+       * testsuite/libgomp.dg/ordered-3.c: New test.
+
+       * testsuite/libgomp.dg/appendix-a/a.18.1.c: Remove unconditional abort.
+       Remove volatile keyword.
+
+       * testsuite/libgomp.fortran/appendix-a/a.19.1.f90: Reorder variables
+       in COMMON block to avoid warnings on 64-bit targets.
+
+2005-10-18  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/shared-3.c: New test.
+
+2005-10-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/appendix-a/a.31.3.f90: Removed.
+       * testsuite/libgomp.fortran/reduction5.f90: New test.
+
+2005-10-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/appendix-a/a.40.1.f90: Add -ffixed-form to
+       dg-options.
+       * testsuite/libgomp.fortran/appendix-a/a.18.1.f90: Likewise.  Enable
+       flush loop now that __sync_synchronize has proper memory barrier.
+       * testsuite/libgomp.fortran/appendix-a/a.3.1.f90: Fix a typo.
+       Add -ffixed-form to dg-options.
+
+2005-10-17  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.fortran/fortran.exp: Also gather tests
+       from subdirectories.
+       * testsuite/libgomp.fortran/appendix-a/a.15.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.16.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.18.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.19.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.2.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.21.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.22.7.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.22.8.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.26.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.28.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.28.2.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.28.3.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.28.4.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.28.5.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.3.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.31.3.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.31.4.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.31.5.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.33.3.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.38.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.39.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.4.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.40.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a.5.1.f90: New test.
+       * testsuite/libgomp.fortran/appendix-a/a10.1.f90: New test.
+
+2005-10-17  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.dg/dg.exp: Only unset lang_* if
+       lang_library_path exists.  Use find instead of glob to gather tests.
+       * testsuite/libgomp.dg/appendix-a/appendix-a.exp: Removed.
+
+2005-10-17  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/appendix-a/a.15.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.16.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.18.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.19.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.2.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.21.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.26.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.29.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.3.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.39.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.4.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/a.5.1.c: New test.
+       * testsuite/libgomp.dg/appendix-a/appendix-a.exp: New file.
+
+2005-10-15  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.dg/vla-1.c: New test.
+
+       * testsuite/libgomp.fortran/reference2.f90: New test.
+
+       * testsuite/libgomp.fortran/character2.f90: Remove explicit
+       declaration of omp_get_thread_num.
+       * testsuite/libgomp.fortran/threadprivate1.f90: Likewise.  Add
+       use omp_lib.
+
+       * testsuite/libgomp.fortran/reduction1.f90: New test.
+       * testsuite/libgomp.fortran/reduction2.f90: New test.
+       * testsuite/libgomp.fortran/reduction3.f90: New test.
+       * testsuite/libgomp.fortran/reduction4.f90: New test.
+
+2005-10-13  Richard Henderson  <rth@redhat.com>
+
+       * Makefile.am (libgomp_la_SOURCES): Add bar.c.
+       * Makefile.in: Regenerate.
+       * barrier.c (GOMP_barrier): Use gomp_barrier_wait.
+       * libgomp.h: Include bar.h.
+       (struct gomp_barrier): Remove.
+       (struct gomp_team): Add barrier.  Replace master_barrier with
+       master_release.  Replace threads with ordered_release.
+       (struct gomp_thread): Replace barrier with release.
+       * ordered.c (gomp_ordered_first): Update for ordered_release change.
+       (gomp_ordered_last, gomp_ordered_next, gomp_ordered_static_init,
+       gomp_ordered_static_next, gomp_ordered_sync): Likewise.
+       * single.c (GOMP_single_copy_start): Use gomp_barrier_wait.
+       (GOMP_single_copy_end): Likewise.
+       * team.c (gomp_threads_dock): New.
+       (gomp_barrier_init, gomp_barrier_destroy): Remove.
+       (gomp_thread_start): Use gomp_barrier_wait.
+       (new_team, free_team): Update for gomp_team changes.
+       (gomp_team_start): Use gomp_barrier_wait and gomp_barrier_reinit.
+       (gomp_team_end): Use gomp_barrier_wait.
+       (initialize_team): Update for gomp_thread changes.
+       * work.c (gomp_work_share_end): Use gomp_barrier_wait_start.
+       (gomp_work_share_end_nowait): Use atomic ops when available.
+       * config/linux/bar.c, config/linux/bar.h: New files.
+       * config/posix/bar.c, config/posix/bar.h: New files.
+
+2005-10-13  Jakub Jelinek  <jakub@redhat.com>
+
+       * single.c (GOMP_single_copy_end): Don't segfault if team is NULL.
+       * testsuite/libgomp.dg/single-2.c: New test.
+
+       * testsuite/libgomp.dg/dg.exp (lang_library_path, lang_test_file,
+       lang_link_flags): Unset, so that they aren't inherited from previously
+       sourced *.exp.
+
+       * testsuite/libgomp.fortran/threadprivate1.f90: New test.
+
+2005-10-12  Richard Henderson  <rth@redhat.com>
+
+       * testsuite/lib/libgomp-dg.exp: Set blddir at toplevel.
+       (libgomp_init): Use lang_test_file, lang_library_path, and
+       lang_link_flags, set by the subdirectory files.  Add -fopenmp here.
+
+       * testsuite/libgomp.fortran/fortran.exp (lang_library_path): New.
+       (lang_test_file, lang_link_flags): New.
+       (DEFAULT_FFLAGS, ALWAYS_CFLAGS, multilibs, blddir): Remove.
+
+       * testsuite/libgomp.c++/c++.exp, testsuite/libgomp.c++/loop-1.C,
+       testsuite/libgomp.c++/loop-2.C, testsuite/libgomp.c++/loop-3.C,
+       testsuite/libgomp.c++/loop-4.C, testsuite/libgomp.c++/nested-1.C,
+       testsuite/libgomp.c++/parallel-1.C,
+       testsuite/libgomp.c++/reduction-1.C,
+       testsuite/libgomp.c++/reduction-2.C,
+       testsuite/libgomp.c++/reduction-3.C,
+       testsuite/libgomp.c++/sections-1.C, testsuite/libgomp.c++/shared-1.C,
+       testsuite/libgomp.c++/shared-2.C, testsuite/libgomp.c++/single-1.C,
+       testsuite/libgomp.c++/single-2.C, testsuite/libgomp.c++/single-3.C:
+       New files, largely cribbed from the C testsuite.
+
+2005-10-12  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/character1.f90: New test.
+       * testsuite/libgomp.fortran/character2.f90: New test.
+
+       * testsuite/libgomp.dg/nested-1.c: New test.
+       * testsuite/libgomp.dg/nested-2.c: New test.
+       * testsuite/libgomp.fortran/do1.f90: New test.
+       * testsuite/libgomp.fortran/do2.f90: New test.
+
+       * testsuite/libgomp.fortran/reference1.f90: New test.
+
+2005-10-11  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.dg/reduction-1.c: New test.
+       * testsuite/libgomp.dg/reduction-2.c: New test.
+       * testsuite/libgomp.dg/reduction-3.c: New test.
+
+2005-10-10  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.dg/atomic-1.c: New test.
+       * testsuite/libgomp.dg/atomic-2.c: New test.
+
+2005-10-09  Richard Henderson  <rth@redhat.com>
+
+       * critical.c (atomic_lock): New.
+       (initialize_critical): Initialize it.
+       (GOMP_atomic_start, GOMP_atomic_end): New.
+       * libgomp.map: Export them.
+       * libgomp_g.h: Declare them.
+
+       * testsuite/libgomp.dg/atomic-10.c: Move from gcc testsuite.
+
+2005-10-02  Richard Henderson  <rth@redhat.com>
+
+       * configure.ac: Move save_CFLAGS hack earlier.  Append -Wall/-Werror
+       to XCFLAGS instead of CFLAGS.
+
+2005-09-30  Richard Henderson  <rth@redhat.com>
+
+       * configure.ac: Determine whether -pthread or -lpthread is needed.
+       * Makefile.am (libgomp_la_LDFLAGS): Remove explicit -lpthread.
+       * Makefine.in, configure: Rebuild.
+
+2005-09-28  Richard Henderson  <rth@redhat.com>
+
+       * testsuite/libgomp.dg/omp-loop03.c: Fix return code.
+       * testsuite/libgomp.dg/omp-single-3.c: New test.
+
+2005-09-28  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/omp-single-2.c: New test.
+       * testsuite/libgomp.dg/shared-2.c: Fix return code.
+
+2005-09-27  Richard Henderson  <rth@redhat.com>
+
+       * testsuite/libgomp.dg/omp-loop03.c: Add initial barrier.
+       * testsuite/libgomp.dg/omp-parallel-for.c: Specify static schedule.
+
+2005-09-27  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.dg/omp-loop03.c: New test.
+
+2005-09-27  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/omp-parallel-for.c: New test.
+
+2005-09-27  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/omp-single-1.c: New test.
+       * testsuite/libgomp.dg/shared-1.c: Return 0.
+       Add prototype for abort.
+       * testsuite/libgomp.dg/shared-2.c: Likewise.
+
+2005-09-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/omp_parse3.f90: Fix non-conforming
+       constructs.
+
+2005-09-26  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/shared-1.c: New test.
+       * testsuite/libgomp.dg/shared-2.c: New test.
+
+2005-09-24  Richard Henderson  <rth@redhat.com>
+
+       * testsuite/libgomp.dg/omp_workshare3.c: Mark dg-error.
+
+2005-09-24  Richard Henderson  <rth@redhat.com>
+
+       * iter.c (gomp_iter_static_next): Round up when computing number
+       of iterations.  Don't bother distributing a remainder equally.
+
+       * testsuite/libgomp.dg/omp-loop01.c (main1): Rename from main.
+       Don't call srand.  Zero b before testing.
+       (main): New.
+
+2005-09-24  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/omp_atomic1.f90: New test.
+       * testsuite/libgomp.fortran/omp_atomic2.f90: New test.
+
+2005-09-23  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/omp_parse1.f90: Add a test for !$omp do
+       without !$omp end do, followed immediately by subroutine end.
+
+2005-09-23  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/omp-parallel-if.c: New test.
+
+2005-09-22  Richard Henderson  <rth@redhat.com>
+
+       * critical.c (GOMP_critical_name_start): Change argument to void**.
+       Reuse the pointer space if the mutex fits.
+       (GOMP_critical_name_end): Likewise.
+       (initialize_critical): Don't define if GOMP_MUTEX_INIT_0.
+       * libgomp_g.h (GOMP_critical_name_start): Update decl.
+       (GOMP_critical_name_end): Likewise.
+       * config/linux/mutex.h (GOMP_MUTEX_INIT_0): New.
+       * config/posix/mutex.h (GOMP_MUTEX_INIT_0): New.
+
+2005-09-20  Richard Henderson  <rth@redhat.com>
+
+       * critical.c (GOMP_critical_name_start, GOMP_critical_name_end): New.
+       (create_lock_lock): New.
+       (initialize_critical): Initialize it.
+       * libgomp.map (GOMP_critical_name_start, GOMP_critical_name_end): New.
+       * libgomp_g.h (GOMP_ordered_start, GOMP_ordered_end): Declare.
+
+2005-09-20  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgom.dg/omp-loop01.c: Include stdio.h.
+
+2005-09-20  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/omp-loop01.c: New test.
+       * testsuite/libgomp.dg/omp-loop02.c: New test.
+
+2005-09-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * configure.ac (AC_PROG_FC): Add.
+       (USE_FORTRAN): New automake conditional.
+       * configure: Rebuilt.
+       * Makefile.am (libgomp_la_SOURCES): Add fortran.c.
+       (nodist_include_HEADERS): Add omp_lib.h, omp_lib.f90 and libgomp_f.h.
+       If USE_FORTRAN, add also omp_lib.mod and omp_lib_kinds.mod.
+       Add rules to build them.
+       * Makefile.in: Rebuilt.
+       * mkomp_h.pl: Compute and replace also OMP_LOCK_KIND and
+       OMP_NEST_LOCK_KIND.
+       * libgomp.map: Add Fortran wrappers.
+       * libgomp_f.h.in: New file.
+       * omp_lib.h.in: New file.
+       * omp_lib.f90.in: New file.
+       * fortran.c: New file.
+       * testsuite/lib/libgomp-dg.exp: Load a few more .exp files.
+       Append libgfortran directory to LD_LIBRARY_PATH if it exists.
+       Add -Lpath_to_libgfortran and -lgfortran -lgfortranbegin if
+       libgfortran has been built.
+       * testsuite/libgomp.fortran/fortran.exp: New file.
+       * testsuite/libgomp.fortran/omp_cond1.f: New test.
+       * testsuite/libgomp.fortran/omp_cond2.f: New test.
+       * testsuite/libgomp.fortran/omp_cond3.F90: New test.
+       * testsuite/libgomp.fortran/omp_cond4.F90: New test.
+       * testsuite/libgomp.fortran/omp_hello.f: New test.
+       * testsuite/libgomp.fortran/omp_orphan.f: New test.
+       * testsuite/libgomp.fortran/omp_parse1.f90: New test.
+       * testsuite/libgomp.fortran/omp_parse2.f90: New test.
+       * testsuite/libgomp.fortran/omp_parse3.f90: New test.
+       * testsuite/libgomp.fortran/omp_parse4.f90: New test.
+       * testsuite/libgomp.fortran/omp_reduction.f: New test.
+       * testsuite/libgomp.fortran/omp_workshare1.f: New test.
+       * testsuite/libgomp.fortran/omp_workshare2.f: New test.
+
+2005-08-30  Richard Henderson  <rth@redhat.com>
+
+       * loop.c (GOMP_loop_static_start): Provide fallback wrapper
+       function for when aliases are not usable.
+       (GOMP_loop_dynamic_start, GOMP_loop_guided_start,
+       GOMP_loop_ordered_static_start, GOMP_loop_ordered_dynamic_start,
+       GOMP_loop_ordered_guided_start, GOMP_loop_static_next,
+       GOMP_loop_dynamic_next, GOMP_loop_guided_next,
+       GOMP_loop_ordered_static_next, GOMP_loop_ordered_dynamic_next,
+       GOMP_loop_ordered_guided_next): Likewise.
+       * ordered.c (GOMP_ordered_start): Likewise.
+
+2005-08-01  Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/dg.exp: Use -O2 for now.
+       * testsuite/libgomp.dg/omp_hello.c: Fix return code
+       * testsuite/libgomp.dg/omp_matvec.c: Likewise.
+       * testsuite/libgomp.dg/omp_orphan.c: Likewise
+       * testsuite/libgomp.dg/omp_reduction.c: Likewise
+       * testsuite/libgomp.dg/omp_workshare1.c: Likewise
+       * testsuite/libgomp.dg/omp_workshare2.c: Likewise
+       * testsuite/libgomp.dg/omp_workshare3.c: Likewise
+       * testsuite/libgomp.dg/omp_workshare4.c: Likewise
+
+2005-07-07  Eric Christopher  <echristo@redhat.com>
+           Diego Novillo  <dnovillo@redhat.com>
+
+       * testsuite/libgomp.dg/dg.exp: Add -fopenmp to DEFAULT_CFLAGS.
+       * testsuite/libgomp.dg/omp_hello.c: Add standard includes, fix
+       up code.
+       * testsuite/libgomp.dg/omp_matvec.c: Ditto.
+       * testsuite/libgomp.dg/omp_orphan.c: Ditto.
+       * testsuite/libgomp.dg/omp_reduction.c: Ditto.
+       * testsuite/libgomp.dg/omp_workshare1.c: Ditto.
+       * testsuite/libgomp.dg/omp_workshare2.c: Ditto.
+       * testsuite/libgomp.dg/omp_workshare3.c: Ditto.
+       * testsuite/libgomp.dg/omp_workshare4.c: Ditto.
+
+2005-06-13  Diego Novillo  <dnovillo@redhat.com>
+
+       * TOPLEVEL.patch: Remove.
+
+2005-05-16  Richard Henderson  <rth@redhat.com>
+
+       * configure.ac: Test for clock_gettime.
+       * config.h.in, configure: Rebuild.
+       * config/posix/time.c: Use recommended TIME_WITH_SYS_TIME pattern.
+       (omp_get_wtime): Use clock_gettime if available.
+       (omp_get_wtick): Use clock_getres if available.
+
+2005-05-11  Richard Henderson  <rth@redhat.com>
+
+       * config/linux/ia64/futex.h: New file.
+       * configure.tgt: Use it.
+
+       * team.c (gomp_barrier_init, gomp_barrier_destroy): Mark inline.
+
+2005-05-07  Richard Henderson  <rth@redhat.com>
+
+       * config/linux/powerpc/futex.h: New file.
+       * configure.tgt: Use it.
+
+       * config/linux/i486/futex.h: Merge ...
+       * config/linux/x86_64/futex.h: ... into ...
+       * config/linux/x86/futex.h: ... here.
+       * configure.tgt: Update to match.
+
+2005-05-06  Richard Henderson  <rth@redhat.com>
+
+       * config/linux/alpha/futex.h: Conditionally define SYS_futex.
+       * config/linux/i486/futex.h: Likewise.
+       * config/linux/x86_64/futex.h: Likewise.
+
+       * config/linux/lock.c: New file.
+       * config/linux/omp-lock.h: New file.
+
+       * critical.c, env.h: Don't include omp.h
+       * config/posix/lock.c: Include libgomp.h instead of omp.h.
+       * config/posix/time.c: Likewise.
+       * config/posix/omp-lock.h: New file.
+       * libgomp.h: Include omp-lock.h and omp.h.
+       * Makefile.am (nodist_include_HEADERS): New.
+       (omp.h): New rule.
+       * configure.ac (PERL): New.
+       * mkomp_h.pl: New file.
+       * omp.h.in: Rename from omp.h; replace omp_lock_t and omp_nest_lock_t
+       with templates.
+       * Makefile.in, configure, testsuite/Makefile.in: Rebuild.
+
+       * testsuite/lib/libgomp-dg.exp (libgomp_init): Add include into
+       build directory.  Re-add -march=i486 hack.
+
+       * testsuite/lib/libgomp-dg.exp (libgomp_compile_flags): Remove.
+       (libgomp_link_flags): Remove.
+       (libgomp_initialized): Remove.
+       (libgomp_init): Don't protect from reinitialization.  Copy code
+       from libstdc++ for getting the multilib set correctly.
+
+2005-05-05  Richard Henderson  <rth@redhat.com>
+
+       * config/linux/alpha/futex.h: New file.
+       * configure.tgt (alpha*-*-linux*): Use it.
+
+       * config/posix/mutex.c: New file.
+       * config/posix/sem.c: Use libgomp.h.
+
+       * configure.tgt (x86_64-linux): Also test CC for -m32.
+       * config/linux/x86_64/futex.h (futex_wait): Fix r10 usage.
+
+       * testsuite/lib/libgomp-dg.exp (libgomp_link_flags): Add /
+       after $gccpath.
+
+       * Makefile.am (SUBDIRS): New.
+       (libgomp_la_LDFLAGS): Add -lpthread.
+       * configure.ac (AM_INIT_AUTOMAKE): Enable dependencies.
+       * Makefile.in, aclocal.m4, config.h.in, configure: Rebuild.
+
+       * libgomp_g.h: New file.
+       * libgomp.h: Split out all public declarations to libgomp_g.h.
+       Use pragma GCC visibility instead of ATTRIBUTE_HIDDEN.
+       * config/linux/mutex.h: Remove ATTRIBUTE_HIDDEN.
+       * config/linux/sem.h: Likewise.
+       * config/posix/sem.h: Likewise.
+
+       * Makefile.am (AM_LDFLAGS): New.
+       (libgomp_version_script): Split out from ...
+       (libgomp_la_LDFLAGS): ... here.
+       (libgomp_version_info): New.
+       * acinclude.m4 (LIBGOMP_CHECK_TLS): Use LIBGOMP_ENABLE.
+       (LIBGOMP_ENABLE): New.
+       (LIBGOMP_CHECK_LINKER_FEATURES): New.
+       (LIBGOMP_ENABLE_SYMVERS): New.
+       * configure.ac (AC_INIT): Version 1.0.
+       (enable-version-specific-runtime-libs): Use LIBGOMP_ENABLE.
+       (enable-linux-futex): Likewise.  Rename from enable-futex.
+       (libtool_VERSION): New.
+       (LIBGOMP_ENABLE_SYMVERS): Use it.
+       * configure.tgt: Check with_gnu_ld wrt have_tls optimizations.
+       * Makefile.in, aclocal.m4, configure: Rebuild.
+
+       * config/linux/mutex.c: Include libgomp.h instead of mutex.h.
+       (gomp_mutex_unlock_slow): Fix typo.
+       * config/linux/sem.c: Similarly.
+       (gomp_sem_post_slow): Fix typo.
+       * config/linux/sem.h (gomp_sem_post_slow): Fix typo.
+       * config/linux/i486/futex.h: Remove USE_LINUX_SYSENTER code.
+       [__PIC__] (sys_futex0): Don't use tmp output in asm.
+
+       * Makefile.am (AM_CFLAGS): Expand with XCFLAGS.
+       (libgomp_la_LDFLAGS): Add top_srcdir to path.
+       * acinclude.m4: Copy libtool.m4 stuff from libgfortran.
+       * configure.ac: Check for getloadavg.  Substitute XCFLAGS and
+       XLDFLAGS.  Add XCFLAGS to CFLAGS around LIBGOMP_CHECK_SYNC_BUILTINS.
+       * configure.tgt: Set XCFLAGS and XLDFLAGS instead of CFLAGS and
+       LDFLAGS.  Pull enable_futex check to top-level.
+       * libgomp.h: Fix sem.h and mutex.h includes.  Define ATTRIBUTE_HIDDEN.
+       * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
+
+       First attempt at real configury.
+       * Makefile, config.h: Remove file.
+       * Makefile.am, Makefile.in: New file.
+       * acinclude.m4 aclocal.m4: New file.
+       * configure.ac, configure.tgt, configure: New file.
+
+       * config/posix/lock.c: Rename from sys-lock.c.
+       * config/posix/mutex.h: Rename from sys-mutex.h.
+       * config/posix/sem.c: Rename from sys-sem.c.
+       * config/posix/sem.h: Rename from sys-sem.h.
+       * config/posix/proc.c: Rename from sys-proc.c.
+       * config/posix/time.c: Rename from sys-proc.c.
+
+       * config/linux/mutex.c: New file.
+       * config/linux/mutex.h: New file.
+       * config/linux/sem.c: New file.
+       * config/linux/sem.h: New file.
+       * config/linux/i486/futex.h: New file.
+       * config/linux/x86_64/futex.h: New file.
+
+2005-05-04  Richard Henderson  <rth@redhat.com>
+
+       * iter.c (gomp_iter_dynamic_next, gomp_iter_guided_next): New.
+       * libgomp.h: Declare them.
+       * loop.c (gomp_loop_dynamic_start, gomp_loop_guided_start,
+       gomp_loop_dynamic_next, gomp_loop_guided_next): Use them.
+
+2005-05-04  Richard Henderson  <rth@redhat.com>
+
+       * libgomp-1 code drop
+
+2005-05-04  Richard Henderson  <rth@redhat.com>
+
+       * iter.c (gomp_iter_static_next): Return tri-state on 0.
+       * ordered.c (gomp_ordered_static_next): Remove not_last argument.
+       * libgomp.h (struct gomp_team_state): Make static_trip unsigned.
+       (gomp_iter_static_next): Update.
+       (gomp_ordered_static_next): Update.
+       * loop.c (gomp_loop_static_start): Update for gomp_iter_static_next.
+       (gomp_loop_ordered_static_start): Likewise.  Exit early for a
+       totally empty range.
+       (gomp_loop_ordered_static_next): Refine test for calling
+       gomp_ordered_static_next.
+       * testsuite/ordered-1.c: Add case for more threads than iterations.
+
+       * iter.c (gomp_iter_runtime_next_locked): Remove.
+       * loop.c (gomp_loop_static_start, gomp_loop_dynamic_start,
+       gomp_loop_guided_start, gomp_loop_ordered_static_start,
+       gomp_loop_ordered_dynamic_start, gomp_loop_ordered_guided_start,
+       gomp_loop_static_next, gomp_loop_dynamic_next, gomp_loop_guided_next,
+       gomp_loop_ordered_static_next, gomp_loop_ordered_dynamic_next,
+       gomp_loop_ordered_guided_next): Downcase name, make static, add
+       an external alias with the old name.
+       (GOMP_loop_runtime_start, GOMP_loop_ordered_runtime_start,
+       GOMP_loop_runtime_next, GOMP_loop_ordered_runtime_next): Use a
+       switch and call one of the above static functions.
+       * libgomp.h: Update.
+
+       * work.c (gomp_work_share_start): Lock the mutex for !first too.
+       * loop.c (GOMP_loop_static_start, GOMP_loop_dynamic_start,
+       GOMP_loop_guided_start, GOMP_loop_runtime_start,
+       GOMP_loop_ordered_static_start, GOMP_loop_ordered_dynamic_start,
+       GOMP_loop_ordered_guided_start): Update to match.
+       * sections.c (GOMP_sections_start): Likewise.
+       * single.c (GOMP_single_start, GOMP_single_copy_start): Likewise.
+
+       * ordered.c (gomp_ordered_first, gomp_ordered_last, gomp_ordered_next,
+       gomp_ordered_static_init, gomp_ordered_static_next): Rename s/_loop//.
+       Use bounds check instead of modulus.
+       (gomp_ordered_sync): Split out of GOMP_ordered_start.
+       (gomp_ordered_last): Don't sync with ordered_owner here.
+       (gomp_ordered_next): Likewise.
+       (gomp_ordered_static_loop_next): Likewise.
+       * loop.c, libgomp.h: Update to match.
+
+       * libgomp.h (GOMP_barrier): Declare.
+
+       * testsuite/barrier-1.c: New file.
+       * testsuite/critical-1.c: New file.
+       * testsuite/ordered-2.c: New file.
+       * testsuite/ordered-1.c: New file.
+       * testsuite/sections-1.c: New file.
+       * testsuite/single-1.c: New file.
+       * testsuite/Makefile (TESTS): Add them.
+
+2005-05-04  Richard Henderson  <rth@redhat.com>
+
+       * libgomp.h (struct gomp_work_share): Add ordered_owner.
+       * loop.c (GOMP_loop_static_start): If not the startup thread,
+       acquire the mutex to wait for initialization complete.
+       (GOMP_loop_ordered_static_start): Likewise.
+       (GOMP_loop_ordered_runtime_start): Likewise.
+       (GOMP_loop_ordered_static_first): Remove.
+       (GOMP_loop_ordered_dynamic_first): Remove.
+       (GOMP_loop_ordered_guided_first): Remove.
+       (GOMP_loop_ordered_runtime_first): Remove.
+       * ordered.c (gomp_ordered_loop_first): Post to own release when
+       we're the first thread.
+       (gomp_ordered_loop_last): Wait on release if not owner.
+       (gomp_ordered_loop_next): Likewise.
+       (gomp_ordered_static_loop_init): New.
+       (gomp_ordered_static_loop_next): Use ordered_owner.
+       (GOMP_ordered_start): Likewise.
+       * work.c (gomp_new_work_share): Initialize ordered_owner.
+
+2005-05-03  Richard Henderson  <rth@redhat.com>
+
+       * Makefile (OPT): New.
+       (CFLAGS): Use it.
+
+       * loop.c (GOMP_loop_end, GOMP_loop_end_nowait): New.
+       * sections.c (GOMP_sections_end, GOMP_sections_end_nowait): New.
+       * libgomp.h, libgomp.map, NOTES: Update to match.
+
+       * team.c (struct gomp_thread_start_data): Remove ts, fn, data.
+       Add initialized and thr members.
+       (gomp_thread_start): Pause when initially spawned to wait for
+       the whole team to be created.
+       (gomp_team_start): Release team members at the end.
+
+       * testsuite/loop-1.c (N): New.  Use it instead of hardcoded 100.
+       (f_foo_1): Use GOMP_loop_end.
+       (f_foo_2): Use GOMP_loop_end_nowait.
+
+       * testsuite/loop-2.c: New file.
+       * testsuite/Makefile (TESTS): Add it.
+
+2005-05-03  Richard Henderson  <rth@redhat.com>
+
+       * iter.c (gomp_iter_static_next): Fix overflow check typo.
+       (gomp_iter_dynamic_next_locked): Fix overflow check thinko.
+       * team.c (new_team): Initialize oldest_live_gen to 1 if no
+       initial work_share.
+
+       * testsuite/Makefile: New file.
+       * testsuite/loop-1.c: New file.
+
+2005-05-03  Richard Henderson  <rth@redhat.com>
+
+       Initial implementation and checkin.
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/ChangeLog.graphite b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/ChangeLog.graphite
new file mode 100644 (file)
index 0000000..74049a9
--- /dev/null
@@ -0,0 +1,18 @@
+2010-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+       * testsuite/libgomp.graphite/force-parallel-1.c: Adjust.
+       * testsuite/libgomp.graphite/force-parallel-2.c: Adjust.
+
+2010-02-07  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * testsuite/libgomp.graphite/force-parallel-5.c: Un-XFAILed.
+       * testsuite/libgomp.graphite/pr41118.c: Renamed from pr4118.
+
+2009-10-09  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * testsuite/libgomp.graphite/graphite.exp (PARALLEL_CFLAGS): Add
+       -fno-loop-block.
+
+2009-09-16  Alexander Monakov  <amonakov@ispras.ru>
+
+       * testsuite/libgomp.graphite/bounds.c: New.
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/Makefile.am b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/Makefile.am
new file mode 100644 (file)
index 0000000..2bc4986
--- /dev/null
@@ -0,0 +1,126 @@
+## Process this file with automake to produce Makefile.in
+
+ACLOCAL_AMFLAGS = -I .. -I ../config
+SUBDIRS = testsuite
+
+## May be used by toolexeclibdir.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
+config_path = @config_path@
+search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir)
+
+fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/finclude
+libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+
+vpath % $(strip $(search_path))
+
+AM_CPPFLAGS = $(addprefix -I, $(search_path))
+AM_CFLAGS = $(XCFLAGS)
+AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
+
+toolexeclib_LTLIBRARIES = libgomp.la
+nodist_toolexeclib_HEADERS = libgomp.spec
+
+if LIBGOMP_BUILD_VERSIONED_SHLIB
+# -Wc is only a libtool option.
+comma = ,
+PREPROCESS = $(subst -Wc$(comma), , $(COMPILE)) -E
+
+libgomp.ver: $(top_srcdir)/libgomp.map
+       $(EGREP) -v '#(#| |$$)' $< | \
+         $(PREPROCESS) -P -include config.h - > $@ || (rm -f $@ ; exit 1)
+
+if LIBGOMP_BUILD_VERSIONED_SHLIB_GNU
+libgomp_version_script = -Wl,--version-script,libgomp.ver
+libgomp_version_dep = libgomp.ver
+endif
+if LIBGOMP_BUILD_VERSIONED_SHLIB_SUN
+libgomp_version_script = -Wl,-M,libgomp.ver-sun
+libgomp_version_dep = libgomp.ver-sun
+libgomp.ver-sun : libgomp.ver \
+               $(top_srcdir)/../contrib/make_sunver.pl \
+               $(libgomp_la_OBJECTS) $(libgomp_la_LIBADD)
+       perl $(top_srcdir)/../contrib/make_sunver.pl \
+         libgomp.ver \
+         $(libgomp_la_OBJECTS:%.lo=.libs/%.o) \
+        `echo $(libgomp_la_LIBADD) | \
+           sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+        > $@ || (rm -f $@ ; exit 1)
+endif
+else
+libgomp_version_script =
+libgomp_version_dep =
+endif
+libgomp_version_info = -version-info $(libtool_VERSION)
+libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
+        $(lt_host_flags)
+libgomp_la_DEPENDENCIES = $(libgomp_version_dep)
+libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS)
+
+libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \
+       iter_ull.c loop.c loop_ull.c ordered.c parallel.c sections.c single.c \
+       task.c team.c work.c lock.c mutex.c proc.c sem.c bar.c ptrlock.c \
+       time.c fortran.c affinity.c
+
+nodist_noinst_HEADERS = libgomp_f.h
+nodist_libsubinclude_HEADERS = omp.h
+if USE_FORTRAN
+nodist_finclude_HEADERS = omp_lib.h omp_lib.f90 omp_lib.mod omp_lib_kinds.mod
+endif
+
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
+
+LINK = $(LIBTOOL) --tag CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+       $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LTLDFLAGS) -o $@
+
+omp_lib_kinds.mod: omp_lib.mod
+       :
+omp_lib.mod: omp_lib.f90
+       $(FC) $(FCFLAGS) -fsyntax-only omp_lib.f90
+fortran.lo: libgomp_f.h
+fortran.o: libgomp_f.h
+env.lo: libgomp_f.h
+env.o: libgomp_f.h
+
+
+# Automake Documentation:
+# If your package has Texinfo files in many directories, you can use the
+# variable TEXINFO_TEX to tell Automake where to find the canonical
+# `texinfo.tex' for your package. The value of this variable should be
+# the relative path from the current `Makefile.am' to `texinfo.tex'.
+TEXINFO_TEX   = ../gcc/doc/include/texinfo.tex
+
+# Defines info, dvi, pdf and html targets
+MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
+info_TEXINFOS = libgomp.texi
+
+# AM_CONDITIONAL on configure option --generated-files-in-srcdir
+if GENINSRC
+STAMP_GENINSRC = stamp-geninsrc
+else
+STAMP_GENINSRC =
+endif
+
+# AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO])
+if BUILD_INFO
+STAMP_BUILD_INFO = stamp-build-info
+else
+STAMP_BUILD_INFO =
+endif
+
+
+all-local: $(STAMP_GENINSRC)
+
+stamp-geninsrc: libgomp.info
+       cp -p $(top_builddir)/libgomp.info $(srcdir)/libgomp.info
+       @touch $@
+
+libgomp.info: $(STAMP_BUILD_INFO)
+
+stamp-build-info: libgomp.texi
+       $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -o libgomp.info $(srcdir)/libgomp.texi
+       @touch $@
+
+
+CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) libgomp.info
+MAINTAINERCLEANFILES = $(srcdir)/libgomp.info
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/Makefile.in b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/Makefile.in
new file mode 100644 (file)
index 0000000..ecc010e
--- /dev/null
@@ -0,0 +1,1108 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = .
+DIST_COMMON = ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+       $(top_srcdir)/configure $(am__configure_deps) \
+       $(srcdir)/config.h.in $(srcdir)/../mkinstalldirs \
+       $(srcdir)/omp.h.in $(srcdir)/omp_lib.h.in \
+       $(srcdir)/omp_lib.f90.in $(srcdir)/libgomp_f.h.in \
+       $(srcdir)/libgomp.spec.in $(srcdir)/../depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+       $(top_srcdir)/../config/depstand.m4 \
+       $(top_srcdir)/../config/enable.m4 \
+       $(top_srcdir)/../config/futex.m4 \
+       $(top_srcdir)/../config/lead-dot.m4 \
+       $(top_srcdir)/../config/lthostflags.m4 \
+       $(top_srcdir)/../config/multi.m4 \
+       $(top_srcdir)/../config/override.m4 \
+       $(top_srcdir)/../config/stdint.m4 \
+       $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../ltoptions.m4 \
+       $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
+       $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = omp.h omp_lib.h omp_lib.f90 libgomp_f.h \
+       libgomp.spec
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \
+       "$(DESTDIR)$(fincludedir)" "$(DESTDIR)$(libsubincludedir)" \
+       "$(DESTDIR)$(toolexeclibdir)"
+LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
+libgomp_la_LIBADD =
+am_libgomp_la_OBJECTS = alloc.lo barrier.lo critical.lo env.lo \
+       error.lo iter.lo iter_ull.lo loop.lo loop_ull.lo ordered.lo \
+       parallel.lo sections.lo single.lo task.lo team.lo work.lo \
+       lock.lo mutex.lo proc.lo sem.lo bar.lo ptrlock.lo time.lo \
+       fortran.lo affinity.lo
+libgomp_la_OBJECTS = $(am_libgomp_la_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/../depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+SOURCES = $(libgomp_la_SOURCES)
+MULTISRCTOP = 
+MULTIBUILDTOP = 
+MULTIDIRS = 
+MULTISUBDIR = 
+MULTIDO = true
+MULTICLEAN = true
+INFO_DEPS = libgomp.info
+am__TEXINFO_TEX_DIR = $(srcdir)/../gcc/doc/include
+DVIS = libgomp.dvi
+PDFS = libgomp.pdf
+PSS = libgomp.ps
+HTMLS = libgomp.html
+TEXINFOS = libgomp.texi
+TEXI2DVI = texi2dvi
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
+MAKEINFOHTML = $(MAKEINFO) --html
+AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
+DVIPS = dvips
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-dvi-recursive install-exec-recursive \
+       install-html-recursive install-info-recursive \
+       install-pdf-recursive install-ps-recursive install-recursive \
+       installcheck-recursive installdirs-recursive pdf-recursive \
+       ps-recursive uninstall-recursive
+HEADERS = $(nodist_finclude_HEADERS) $(nodist_libsubinclude_HEADERS) \
+       $(nodist_noinst_HEADERS) $(nodist_toolexeclib_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OMP_LOCK_25_ALIGN = @OMP_LOCK_25_ALIGN@
+OMP_LOCK_25_KIND = @OMP_LOCK_25_KIND@
+OMP_LOCK_25_SIZE = @OMP_LOCK_25_SIZE@
+OMP_LOCK_ALIGN = @OMP_LOCK_ALIGN@
+OMP_LOCK_KIND = @OMP_LOCK_KIND@
+OMP_LOCK_SIZE = @OMP_LOCK_SIZE@
+OMP_NEST_LOCK_25_ALIGN = @OMP_NEST_LOCK_25_ALIGN@
+OMP_NEST_LOCK_25_KIND = @OMP_NEST_LOCK_25_KIND@
+OMP_NEST_LOCK_25_SIZE = @OMP_NEST_LOCK_25_SIZE@
+OMP_NEST_LOCK_ALIGN = @OMP_NEST_LOCK_ALIGN@
+OMP_NEST_LOCK_KIND = @OMP_NEST_LOCK_KIND@
+OMP_NEST_LOCK_SIZE = @OMP_NEST_LOCK_SIZE@
+OPT_LDFLAGS = @OPT_LDFLAGS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+SECTION_LDFLAGS = @SECTION_LDFLAGS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XCFLAGS = @XCFLAGS@
+XLDFLAGS = @XLDFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+config_path = @config_path@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+enable_shared = @enable_shared@
+enable_static = @enable_static@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libtool_VERSION = @libtool_VERSION@
+link_gomp = @link_gomp@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_host_flags = @lt_host_flags@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+toolexecdir = @toolexecdir@
+toolexeclibdir = @toolexeclibdir@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ACLOCAL_AMFLAGS = -I .. -I ../config
+SUBDIRS = testsuite
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir)
+fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/finclude
+libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+AM_CPPFLAGS = $(addprefix -I, $(search_path))
+AM_CFLAGS = $(XCFLAGS)
+AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
+toolexeclib_LTLIBRARIES = libgomp.la
+nodist_toolexeclib_HEADERS = libgomp.spec
+
+# -Wc is only a libtool option.
+@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@comma = ,
+@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@PREPROCESS = $(subst -Wc$(comma), , $(COMPILE)) -E
+@LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE@libgomp_version_script = 
+@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,--version-script,libgomp.ver
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,-M,libgomp.ver-sun
+@LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE@libgomp_version_dep = 
+@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = libgomp.ver
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = libgomp.ver-sun
+libgomp_version_info = -version-info $(libtool_VERSION)
+libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
+        $(lt_host_flags)
+
+libgomp_la_DEPENDENCIES = $(libgomp_version_dep)
+libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS)
+libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \
+       iter_ull.c loop.c loop_ull.c ordered.c parallel.c sections.c single.c \
+       task.c team.c work.c lock.c mutex.c proc.c sem.c bar.c ptrlock.c \
+       time.c fortran.c affinity.c
+
+nodist_noinst_HEADERS = libgomp_f.h
+nodist_libsubinclude_HEADERS = omp.h
+@USE_FORTRAN_TRUE@nodist_finclude_HEADERS = omp_lib.h omp_lib.f90 omp_lib.mod omp_lib_kinds.mod
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
+LINK = $(LIBTOOL) --tag CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+       $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LTLDFLAGS) -o $@
+
+
+# Automake Documentation:
+# If your package has Texinfo files in many directories, you can use the
+# variable TEXINFO_TEX to tell Automake where to find the canonical
+# `texinfo.tex' for your package. The value of this variable should be
+# the relative path from the current `Makefile.am' to `texinfo.tex'.
+TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
+
+# Defines info, dvi, pdf and html targets
+MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
+info_TEXINFOS = libgomp.texi
+@GENINSRC_FALSE@STAMP_GENINSRC = 
+
+# AM_CONDITIONAL on configure option --generated-files-in-srcdir
+@GENINSRC_TRUE@STAMP_GENINSRC = stamp-geninsrc
+@BUILD_INFO_FALSE@STAMP_BUILD_INFO = 
+
+# AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO])
+@BUILD_INFO_TRUE@STAMP_BUILD_INFO = stamp-build-info
+CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) libgomp.info
+MAINTAINERCLEANFILES = $(srcdir)/libgomp.info
+all: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .dvi .lo .o .obj .ps
+am--refresh:
+       @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+       else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+       @rm -f stamp-h1
+       cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+       ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+       rm -f stamp-h1
+       touch $@
+
+distclean-hdr:
+       -rm -f config.h stamp-h1
+omp.h: $(top_builddir)/config.status $(srcdir)/omp.h.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+omp_lib.h: $(top_builddir)/config.status $(srcdir)/omp_lib.h.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+omp_lib.f90: $(top_builddir)/config.status $(srcdir)/omp_lib.f90.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+libgomp_f.h: $(top_builddir)/config.status $(srcdir)/libgomp_f.h.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+libgomp.spec: $(top_builddir)/config.status $(srcdir)/libgomp.spec.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)"
+       @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
+       list2=; for p in $$list; do \
+         if test -f $$p; then \
+           list2="$$list2 $$p"; \
+         else :; fi; \
+       done; \
+       test -z "$$list2" || { \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \
+       }
+
+uninstall-toolexeclibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(toolexeclibdir)/$$f'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(toolexeclibdir)/$$f"; \
+       done
+
+clean-toolexeclibLTLIBRARIES:
+       -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
+       @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libgomp.la: $(libgomp_la_OBJECTS) $(libgomp_la_DEPENDENCIES) 
+       $(libgomp_la_LINK) -rpath $(toolexeclibdir) $(libgomp_la_OBJECTS) $(libgomp_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/affinity.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bar.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/barrier.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/critical.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fortran.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iter_ull.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loop.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loop_ull.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mutex.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ordered.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parallel.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrlock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sections.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/single.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/team.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/work.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool config.lt
+
+# GNU Make needs to see an explicit $(MAKE) variable in the command it
+# runs to enable its job server during parallel builds.  Hence the
+# comments below.
+all-multi:
+       $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
+install-multi:
+       $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
+
+mostlyclean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
+clean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
+distclean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
+maintainer-clean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
+
+libgomp.dvi: libgomp.texi  
+       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+       $(TEXI2DVI) -o $@ `test -f 'libgomp.texi' || echo '$(srcdir)/'`libgomp.texi
+
+libgomp.pdf: libgomp.texi  
+       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+       $(TEXI2PDF) -o $@ `test -f 'libgomp.texi' || echo '$(srcdir)/'`libgomp.texi
+
+libgomp.html: libgomp.texi  
+       rm -rf $(@:.html=.htp)
+       if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+        -o $(@:.html=.htp) `test -f 'libgomp.texi' || echo '$(srcdir)/'`libgomp.texi; \
+       then \
+         rm -rf $@; \
+         if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
+           mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
+       else \
+         if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
+           rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
+         exit 1; \
+       fi
+.dvi.ps:
+       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+       $(DVIPS) -o $@ $<
+
+uninstall-dvi-am:
+       @$(NORMAL_UNINSTALL)
+       @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
+         rm -f "$(DESTDIR)$(dvidir)/$$f"; \
+       done
+
+uninstall-html-am:
+       @$(NORMAL_UNINSTALL)
+       @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
+         rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
+       done
+
+uninstall-info-am:
+       @$(PRE_UNINSTALL)
+       @if test -d '$(DESTDIR)$(infodir)' && \
+           (install-info --version && \
+            install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+         list='$(INFO_DEPS)'; \
+         for file in $$list; do \
+           relfile=`echo "$$file" | sed 's|^.*/||'`; \
+           echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
+           if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
+           then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
+         done; \
+       else :; fi
+       @$(NORMAL_UNINSTALL)
+       @list='$(INFO_DEPS)'; \
+       for file in $$list; do \
+         relfile=`echo "$$file" | sed 's|^.*/||'`; \
+         relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
+         (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
+            echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
+            rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
+          else :; fi); \
+       done
+
+uninstall-pdf-am:
+       @$(NORMAL_UNINSTALL)
+       @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
+       done
+
+uninstall-ps-am:
+       @$(NORMAL_UNINSTALL)
+       @list='$(PSS)'; test -n "$(psdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(psdir)/$$f"; \
+       done
+
+dist-info: $(INFO_DEPS)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       list='$(INFO_DEPS)'; \
+       for base in $$list; do \
+         case $$base in \
+           $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
+         esac; \
+         if test -f $$base; then d=.; else d=$(srcdir); fi; \
+         base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
+         for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
+           if test -f $$file; then \
+             relfile=`expr "$$file" : "$$d/\(.*\)"`; \
+             test -f "$(distdir)/$$relfile" || \
+               cp -p $$file "$(distdir)/$$relfile"; \
+           else :; fi; \
+         done; \
+       done
+
+mostlyclean-aminfo:
+       -rm -rf libgomp.aux libgomp.cp libgomp.cps libgomp.fn libgomp.fns \
+         libgomp.ky libgomp.kys libgomp.log libgomp.pg libgomp.pgs \
+         libgomp.tmp libgomp.toc libgomp.tp libgomp.tps libgomp.vr \
+         libgomp.vrs
+
+clean-aminfo:
+       -test -z "libgomp.dvi libgomp.pdf libgomp.ps libgomp.html" \
+       || rm -rf libgomp.dvi libgomp.pdf libgomp.ps libgomp.html
+
+maintainer-clean-aminfo:
+       @list='$(INFO_DEPS)'; for i in $$list; do \
+         i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
+         echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
+         rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
+       done
+install-nodist_fincludeHEADERS: $(nodist_finclude_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(fincludedir)" || $(MKDIR_P) "$(DESTDIR)$(fincludedir)"
+       @list='$(nodist_finclude_HEADERS)'; test -n "$(fincludedir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(fincludedir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(fincludedir)" || exit $$?; \
+       done
+
+uninstall-nodist_fincludeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(nodist_finclude_HEADERS)'; test -n "$(fincludedir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(fincludedir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(fincludedir)" && rm -f $$files
+install-nodist_libsubincludeHEADERS: $(nodist_libsubinclude_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(libsubincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)"
+       @list='$(nodist_libsubinclude_HEADERS)'; test -n "$(libsubincludedir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libsubincludedir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(libsubincludedir)" || exit $$?; \
+       done
+
+uninstall-nodist_libsubincludeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(nodist_libsubinclude_HEADERS)'; test -n "$(libsubincludedir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libsubincludedir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libsubincludedir)" && rm -f $$files
+install-nodist_toolexeclibHEADERS: $(nodist_toolexeclib_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)"
+       @list='$(nodist_toolexeclib_HEADERS)'; test -n "$(toolexeclibdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(toolexeclibdir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(toolexeclibdir)" || exit $$?; \
+       done
+
+uninstall-nodist_toolexeclibHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(nodist_toolexeclib_HEADERS)'; test -n "$(toolexeclibdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(toolexeclibdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(toolexeclibdir)" && rm -f $$files
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+       @fail= failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+       @fail= failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       rev=''; for subdir in $$list; do \
+         if test "$$subdir" = "."; then :; else \
+           rev="$$subdir $$rev"; \
+         fi; \
+       done; \
+       rev="$$rev ."; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+ctags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) all-multi $(HEADERS) \
+               config.h all-local
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(fincludedir)" "$(DESTDIR)$(libsubincludedir)" "$(DESTDIR)$(toolexeclibdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-multi clean-recursive
+
+clean-am: clean-aminfo clean-generic clean-libtool \
+       clean-toolexeclibLTLIBRARIES mostlyclean-am
+
+distclean: distclean-multi distclean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am: $(DVIS)
+
+html: html-recursive
+
+html-am: $(HTMLS)
+
+info: info-recursive
+
+info-am: $(INFO_DEPS)
+
+install-data-am: install-info-am install-nodist_fincludeHEADERS \
+       install-nodist_libsubincludeHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am: $(DVIS)
+       @$(NORMAL_INSTALL)
+       test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)"
+       @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
+       done
+install-exec-am: install-multi install-nodist_toolexeclibHEADERS \
+       install-toolexeclibLTLIBRARIES
+
+install-html: install-html-recursive
+
+install-html-am: $(HTMLS)
+       @$(NORMAL_INSTALL)
+       test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+       @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         $(am__strip_dir) \
+         if test -d "$$d$$p"; then \
+           echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
+           $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+           echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+           $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
+         else \
+           list2="$$list2 $$d$$p"; \
+         fi; \
+       done; \
+       test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+       done; }
+install-info: install-info-recursive
+
+install-info-am: $(INFO_DEPS)
+       @$(NORMAL_INSTALL)
+       test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
+       for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+         esac; \
+         if test -f $$file; then d=.; else d=$(srcdir); fi; \
+         file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
+         for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
+                      $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
+           if test -f $$ifile; then \
+             echo "$$ifile"; \
+           else : ; fi; \
+         done; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
+       @$(POST_INSTALL)
+       @if (install-info --version && \
+            install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+         list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
+         for file in $$list; do \
+           relfile=`echo "$$file" | sed 's|^.*/||'`; \
+           echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
+           install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
+         done; \
+       else : ; fi
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am: $(PDFS)
+       @$(NORMAL_INSTALL)
+       test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+       @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
+install-ps: install-ps-recursive
+
+install-ps-am: $(PSS)
+       @$(NORMAL_INSTALL)
+       test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)"
+       @list='$(PSS)'; test -n "$(psdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
+installcheck-am:
+
+maintainer-clean: maintainer-clean-multi maintainer-clean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-aminfo \
+       maintainer-clean-generic
+
+mostlyclean: mostlyclean-multi mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am: $(PDFS)
+
+ps: ps-recursive
+
+ps-am: $(PSS)
+
+uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
+       uninstall-nodist_fincludeHEADERS \
+       uninstall-nodist_libsubincludeHEADERS \
+       uninstall-nodist_toolexeclibHEADERS uninstall-pdf-am \
+       uninstall-ps-am uninstall-toolexeclibLTLIBRARIES
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all all-multi \
+       clean-multi ctags-recursive distclean-multi install-am \
+       install-multi install-strip maintainer-clean-multi \
+       mostlyclean-multi tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+       all all-am all-local all-multi am--refresh check check-am \
+       clean clean-aminfo clean-generic clean-libtool clean-multi \
+       clean-toolexeclibLTLIBRARIES ctags ctags-recursive dist-info \
+       distclean distclean-compile distclean-generic distclean-hdr \
+       distclean-libtool distclean-multi distclean-tags dvi dvi-am \
+       html html-am info info-am install install-am install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-man install-multi \
+       install-nodist_fincludeHEADERS \
+       install-nodist_libsubincludeHEADERS \
+       install-nodist_toolexeclibHEADERS install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip \
+       install-toolexeclibLTLIBRARIES installcheck installcheck-am \
+       installdirs installdirs-am maintainer-clean \
+       maintainer-clean-aminfo maintainer-clean-generic \
+       maintainer-clean-multi mostlyclean mostlyclean-aminfo \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       mostlyclean-multi pdf pdf-am ps ps-am tags tags-recursive \
+       uninstall uninstall-am uninstall-dvi-am uninstall-html-am \
+       uninstall-info-am uninstall-nodist_fincludeHEADERS \
+       uninstall-nodist_libsubincludeHEADERS \
+       uninstall-nodist_toolexeclibHEADERS uninstall-pdf-am \
+       uninstall-ps-am uninstall-toolexeclibLTLIBRARIES
+
+
+vpath % $(strip $(search_path))
+
+@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp.ver: $(top_srcdir)/libgomp.map
+@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@   $(EGREP) -v '#(#| |$$)' $< | \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@     $(PREPROCESS) -P -include config.h - > $@ || (rm -f $@ ; exit 1)
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp.ver-sun : libgomp.ver \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@           $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@           $(libgomp_la_OBJECTS) $(libgomp_la_LIBADD)
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@   perl $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@     libgomp.ver \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@     $(libgomp_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@    `echo $(libgomp_la_LIBADD) | \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@       sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@    > $@ || (rm -f $@ ; exit 1)
+
+omp_lib_kinds.mod: omp_lib.mod
+       :
+omp_lib.mod: omp_lib.f90
+       $(FC) $(FCFLAGS) -fsyntax-only omp_lib.f90
+fortran.lo: libgomp_f.h
+fortran.o: libgomp_f.h
+env.lo: libgomp_f.h
+env.o: libgomp_f.h
+
+all-local: $(STAMP_GENINSRC)
+
+stamp-geninsrc: libgomp.info
+       cp -p $(top_builddir)/libgomp.info $(srcdir)/libgomp.info
+       @touch $@
+
+libgomp.info: $(STAMP_BUILD_INFO)
+
+stamp-build-info: libgomp.texi
+       $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -o libgomp.info $(srcdir)/libgomp.texi
+       @touch $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/acinclude.m4 b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/acinclude.m4
new file mode 100644 (file)
index 0000000..d43aa88
--- /dev/null
@@ -0,0 +1,366 @@
+dnl ----------------------------------------------------------------------
+dnl This whole bit snagged from libgfortran.
+
+dnl Check whether the target supports __sync_*_compare_and_swap.
+AC_DEFUN([LIBGOMP_CHECK_SYNC_BUILTINS], [
+  AC_CACHE_CHECK([whether the target supports __sync_*_compare_and_swap],
+                libgomp_cv_have_sync_builtins, [
+  AC_TRY_LINK([], [int foo; __sync_val_compare_and_swap(&foo, 0, 1);],
+             libgomp_cv_have_sync_builtins=yes, libgomp_cv_have_sync_builtins=no)])
+  if test $libgomp_cv_have_sync_builtins = yes; then
+    AC_DEFINE(HAVE_SYNC_BUILTINS, 1,
+             [Define to 1 if the target supports __sync_*_compare_and_swap])
+  fi])
+
+dnl Check whether the target supports hidden visibility.
+AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY], [
+  AC_CACHE_CHECK([whether the target supports hidden visibility],
+                libgomp_cv_have_attribute_visibility, [
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Werror"
+  AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }],
+                [], libgomp_cv_have_attribute_visibility=yes,
+                libgomp_cv_have_attribute_visibility=no)
+  CFLAGS="$save_CFLAGS"])
+  if test $libgomp_cv_have_attribute_visibility = yes; then
+    AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1,
+      [Define to 1 if the target supports __attribute__((visibility(...))).])
+  fi])
+
+dnl Check whether the target supports dllexport
+AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT], [
+  AC_CACHE_CHECK([whether the target supports dllexport],
+                libgomp_cv_have_attribute_dllexport, [
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Werror"
+  AC_TRY_COMPILE([void __attribute__((dllexport)) foo(void) { }],
+                [], libgomp_cv_have_attribute_dllexport=yes,
+                libgomp_cv_have_attribute_dllexport=no)
+  CFLAGS="$save_CFLAGS"])
+  if test $libgomp_cv_have_attribute_dllexport = yes; then
+    AC_DEFINE(HAVE_ATTRIBUTE_DLLEXPORT, 1,
+      [Define to 1 if the target supports __attribute__((dllexport)).])
+  fi])
+
+dnl Check whether the target supports symbol aliases.
+AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_ALIAS], [
+  AC_CACHE_CHECK([whether the target supports symbol aliases],
+                libgomp_cv_have_attribute_alias, [
+  AC_TRY_LINK([
+void foo(void) { }
+extern void bar(void) __attribute__((alias("foo")));],
+    [bar();], libgomp_cv_have_attribute_alias=yes, libgomp_cv_have_attribute_alias=no)])
+  if test $libgomp_cv_have_attribute_alias = yes; then
+    AC_DEFINE(HAVE_ATTRIBUTE_ALIAS, 1,
+      [Define to 1 if the target supports __attribute__((alias(...))).])
+  fi])
+
+sinclude(../libtool.m4)
+dnl The lines below arrange for aclocal not to bring an installed
+dnl libtool.m4 into aclocal.m4, while still arranging for automake to
+dnl add a definition of LIBTOOL to Makefile.in.
+ifelse(,,,[AC_SUBST(LIBTOOL)
+AC_DEFUN([AM_PROG_LIBTOOL])
+AC_DEFUN([AC_LIBTOOL_DLOPEN])
+AC_DEFUN([AC_PROG_LD])
+])
+
+dnl ----------------------------------------------------------------------
+dnl This whole bit snagged from libstdc++-v3.
+
+dnl
+dnl LIBGOMP_ENABLE
+dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
+dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
+dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
+dnl
+dnl See docs/html/17_intro/configury.html#enable for documentation.
+dnl
+m4_define([LIBGOMP_ENABLE],[dnl
+m4_define([_g_switch],[--enable-$1])dnl
+m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
+ AC_ARG_ENABLE($1,_g_help,
+  m4_bmatch([$5],
+   [^permit ],
+     [[
+      case "$enableval" in
+       m4_bpatsubst([$5],[permit ])) ;;
+       *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
+          dnl Idea for future:  generate a URL pointing to
+          dnl "onlinedocs/configopts.html#whatever"
+      esac
+     ]],
+   [^$],
+     [[
+      case "$enableval" in
+       yes|no) ;;
+       *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
+      esac
+     ]],
+   [[$5]]),
+  [enable_]m4_bpatsubst([$1],-,_)[=][$2])
+m4_undefine([_g_switch])dnl
+m4_undefine([_g_help])dnl
+])
+
+
+dnl
+dnl If GNU ld is in use, check to see if tricky linker opts can be used.  If
+dnl the native linker is in use, all variables will be defined to something
+dnl safe (like an empty string).
+dnl
+dnl Defines:
+dnl  SECTION_LDFLAGS='-Wl,--gc-sections' if possible
+dnl  OPT_LDFLAGS='-Wl,-O1' if possible
+dnl  LD (as a side effect of testing)
+dnl Sets:
+dnl  with_gnu_ld
+dnl  libgomp_ld_is_gold (possibly)
+dnl  libgomp_gnu_ld_version (possibly)
+dnl
+dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
+dnl set libgomp_gnu_ld_version to 12345.  Zeros cause problems.
+dnl
+AC_DEFUN([LIBGOMP_CHECK_LINKER_FEATURES], [
+  # If we're not using GNU ld, then there's no point in even trying these
+  # tests.  Check for that first.  We should have already tested for gld
+  # by now (in libtool), but require it now just to be safe...
+  test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+  test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
+  AC_REQUIRE([AC_PROG_LD])
+  AC_REQUIRE([AC_PROG_AWK])
+
+  # The name set by libtool depends on the version of libtool.  Shame on us
+  # for depending on an impl detail, but c'est la vie.  Older versions used
+  # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
+  # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
+  # makes sense).  We'll test with_gnu_ld everywhere else, so if that isn't
+  # set (hence we're using an older libtool), then set it.
+  if test x${with_gnu_ld+set} != xset; then
+    if test x${ac_cv_prog_gnu_ld+set} != xset; then
+      # We got through "ac_require(ac_prog_ld)" and still not set?  Huh?
+      with_gnu_ld=no
+    else
+      with_gnu_ld=$ac_cv_prog_gnu_ld
+    fi
+  fi
+
+  # Start by getting the version number.  I think the libtool test already
+  # does some of this, but throws away the result.
+  libgomp_ld_is_gold=no
+  if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
+    libgomp_ld_is_gold=yes
+  fi
+  changequote(,)
+  ldver=`$LD --version 2>/dev/null |
+         sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
+  changequote([,])
+  libgomp_gnu_ld_version=`echo $ldver | \
+         $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
+
+  # Set --gc-sections.
+  if test "$with_gnu_ld" = "notbroken"; then
+    # GNU ld it is!  Joy and bunny rabbits!
+
+    # All these tests are for C++; save the language and the compiler flags.
+    # Need to do this so that g++ won't try to link in libstdc++
+    ac_test_CFLAGS="${CFLAGS+set}"
+    ac_save_CFLAGS="$CFLAGS"
+    CFLAGS='-x c++  -Wl,--gc-sections'
+
+    # Check for -Wl,--gc-sections
+    # XXX This test is broken at the moment, as symbols required for linking
+    # are now in libsupc++ (not built yet).  In addition, this test has
+    # cored on solaris in the past.  In addition, --gc-sections doesn't
+    # really work at the moment (keeps on discarding used sections, first
+    # .eh_frame and now some of the glibc sections for iconv).
+    # Bzzzzt.  Thanks for playing, maybe next time.
+    AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
+    AC_TRY_RUN([
+     int main(void)
+     {
+       try { throw 1; }
+       catch (...) { };
+       return 0;
+     }
+    ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
+    if test "$ac_test_CFLAGS" = set; then
+      CFLAGS="$ac_save_CFLAGS"
+    else
+      # this is the suspicious part
+      CFLAGS=''
+    fi
+    if test "$ac_sectionLDflags" = "yes"; then
+      SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
+    fi
+    AC_MSG_RESULT($ac_sectionLDflags)
+  fi
+
+  # Set linker optimization flags.
+  if test x"$with_gnu_ld" = x"yes"; then
+    OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+  fi
+
+  AC_SUBST(SECTION_LDFLAGS)
+  AC_SUBST(OPT_LDFLAGS)
+])
+
+
+dnl
+dnl Add version tags to symbols in shared library (or not), additionally
+dnl marking other symbols as private/local (or not).
+dnl
+dnl --enable-symvers=style adds a version script to the linker call when
+dnl       creating the shared library.  The choice of version script is
+dnl       controlled by 'style'.
+dnl --disable-symvers does not.
+dnl  +  Usage:  LIBGOMP_ENABLE_SYMVERS[(DEFAULT)]
+dnl       Where DEFAULT is either 'yes' or 'no'.  Passing `yes' tries to
+dnl       choose a default style based on linker characteristics.  Passing
+dnl       'no' disables versioning.
+dnl
+AC_DEFUN([LIBGOMP_ENABLE_SYMVERS], [
+
+LIBGOMP_ENABLE(symvers,yes,[=STYLE],
+  [enables symbol versioning of the shared library],
+  [permit yes|no|gnu*|sun])
+
+# If we never went through the LIBGOMP_CHECK_LINKER_FEATURES macro, then we
+# don't know enough about $LD to do tricks...
+AC_REQUIRE([LIBGOMP_CHECK_LINKER_FEATURES])
+
+# Turn a 'yes' into a suitable default.
+if test x$enable_symvers = xyes ; then
+  # FIXME  The following test is too strict, in theory.
+  if test $enable_shared = no || test "x$LD" = x; then
+    enable_symvers=no
+  else
+    if test $with_gnu_ld = yes ; then
+      enable_symvers=gnu
+    else
+      case ${target_os} in
+        # Sun symbol versioning exists since Solaris 2.5.
+        solaris2.[[5-9]]* | solaris2.1[[0-9]]*)
+          enable_symvers=sun ;;
+        *)
+          enable_symvers=no ;;
+      esac
+    fi
+  fi
+fi
+
+# Check if 'sun' was requested on non-Solaris 2 platforms.
+if test x$enable_symvers = xsun ; then
+  case ${target_os} in
+    solaris2*)
+      # All fine.
+      ;;
+    *)
+      # Unlikely to work.
+      AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
+      AC_MSG_WARN([=== you are not targetting Solaris 2.])
+      AC_MSG_WARN([=== Symbol versioning will be disabled.])
+      enable_symvers=no
+      ;;
+  esac
+fi
+
+# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
+if test $enable_symvers != no; then
+  AC_MSG_CHECKING([for shared libgcc])
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=' -lgcc_s'
+  AC_TRY_LINK(, [return 0;], libgomp_shared_libgcc=yes, libgomp_shared_libgcc=no)
+  CFLAGS="$ac_save_CFLAGS"
+  if test $libgomp_shared_libgcc = no; then
+    cat > conftest.c <<EOF
+int main (void) { return 0; }
+EOF
+changequote(,)dnl
+    libgomp_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
+                            -shared -shared-libgcc -o conftest.so \
+                            conftest.c -v 2>&1 >/dev/null \
+                            | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
+changequote([,])dnl
+    rm -f conftest.c conftest.so
+    if test x${libgomp_libgcc_s_suffix+set} = xset; then
+      CFLAGS=" -lgcc_s$libgomp_libgcc_s_suffix"
+      AC_TRY_LINK(, [return 0;], libgomp_shared_libgcc=yes)
+      CFLAGS="$ac_save_CFLAGS"
+    fi
+  fi
+  AC_MSG_RESULT($libgomp_shared_libgcc)
+fi
+
+# For GNU ld, we need at least this version.  The format is described in
+# LIBGOMP_CHECK_LINKER_FEATURES above.
+libgomp_min_gnu_ld_version=21400
+# XXXXXXXXXXX libgomp_gnu_ld_version=21390
+
+# Check to see if unspecified "yes" value can win, given results above.
+# Change "yes" into either "no" or a style name.
+if test $enable_symvers != no && test $libgomp_shared_libgcc = yes; then
+  if test $with_gnu_ld = yes; then
+    if test $libgomp_gnu_ld_version -ge $libgomp_min_gnu_ld_version ; then
+      enable_symvers=gnu
+    elif test $libgomp_ld_is_gold = yes ; then
+      enable_symvers=gnu
+    else
+      # The right tools, the right setup, but too old.  Fallbacks?
+      AC_MSG_WARN(=== Linker version $libgomp_gnu_ld_version is too old for)
+      AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
+      AC_MSG_WARN(=== You would need to upgrade your binutils to version)
+      AC_MSG_WARN(=== $libgomp_min_gnu_ld_version or later and rebuild GCC.)
+      if test $libgomp_gnu_ld_version -ge 21200 ; then
+        # Globbing fix is present, proper block support is not.
+        dnl AC_MSG_WARN([=== Dude, you are soooo close.  Maybe we can fake it.])
+        dnl enable_symvers=???
+        AC_MSG_WARN([=== Symbol versioning will be disabled.])
+        enable_symvers=no
+      else
+        # 2.11 or older.
+        AC_MSG_WARN([=== Symbol versioning will be disabled.])
+        enable_symvers=no
+      fi
+    fi
+  elif test $enable_symvers = sun; then
+    : All interesting versions of Sun ld support sun style symbol versioning.
+  else
+    # just fail for now
+    AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
+    AC_MSG_WARN([=== either you are not using a supported linker, or you are])
+    AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
+    AC_MSG_WARN([=== Symbol versioning will be disabled.])
+    enable_symvers=no
+  fi
+fi
+
+AC_CACHE_CHECK([whether the target supports .symver directive],
+              libgomp_cv_have_as_symver_directive, [
+  AC_TRY_COMPILE([void foo (void); __asm (".symver foo, bar@SYMVER");],
+                [], libgomp_cv_have_as_symver_directive=yes,
+                libgomp_cv_have_as_symver_directive=no)])
+if test $libgomp_cv_have_as_symver_directive = yes; then
+  AC_DEFINE(HAVE_AS_SYMVER_DIRECTIVE, 1,
+    [Define to 1 if the target assembler supports .symver directive.])
+fi
+
+AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
+AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB_GNU, test $enable_symvers = gnu)
+AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB_SUN, test $enable_symvers = sun)
+AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
+
+if test $enable_symvers != no ; then
+   case ${target_os} in
+     # The Solaris 2 runtime linker doesn't support the GNU extension of
+     # binding the same symbol to different versions
+     solaris2*)
+       ;;
+     # Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
+     *)
+       AC_DEFINE(HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT, 1,
+         [Define to 1 if the target runtime linker supports binding the same symbol to different versions.])
+       ;;
+    esac
+fi
+])
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/aclocal.m4 b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/aclocal.m4
new file mode 100644 (file)
index 0000000..6aff9fd
--- /dev/null
@@ -0,0 +1,985 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
+[m4_warning([this file was generated for autoconf 2.64.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+             [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                 [_AM_DEPENDENCIES(CC)],
+                 [define([AC_PROG_CC],
+                         defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                 [_AM_DEPENDENCIES(CXX)],
+                 [define([AC_PROG_CXX],
+                         defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST(install_sh)])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST([MAINT])dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([../config/acx.m4])
+m4_include([../config/depstand.m4])
+m4_include([../config/enable.m4])
+m4_include([../config/futex.m4])
+m4_include([../config/lead-dot.m4])
+m4_include([../config/lthostflags.m4])
+m4_include([../config/multi.m4])
+m4_include([../config/override.m4])
+m4_include([../config/stdint.m4])
+m4_include([../config/tls.m4])
+m4_include([../ltoptions.m4])
+m4_include([../ltsugar.m4])
+m4_include([../ltversion.m4])
+m4_include([../lt~obsolete.m4])
+m4_include([acinclude.m4])
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/alloc.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/alloc.c
new file mode 100644 (file)
index 0000000..3a0deb0
--- /dev/null
@@ -0,0 +1,58 @@
+/* Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains wrappers for the system allocation routines.  Most
+   places in the OpenMP API do not make any provision for failure, so in
+   general we cannot allow memory allocation to fail.  */
+
+#include "libgomp.h"
+#include <stdlib.h>
+
+
+void *
+gomp_malloc (size_t size)
+{
+  void *ret = malloc (size);
+  if (ret == NULL)
+    gomp_fatal ("Out of memory allocating %lu bytes", (unsigned long) size);
+  return ret;
+}
+
+void *
+gomp_malloc_cleared (size_t size)
+{
+  void *ret = calloc (1, size);
+  if (ret == NULL)
+    gomp_fatal ("Out of memory allocating %lu bytes", (unsigned long) size);
+  return ret;
+}
+
+void *
+gomp_realloc (void *old, size_t size)
+{
+  void *ret = realloc (old, size);
+  if (ret == NULL)
+    gomp_fatal ("Out of memory allocating %lu bytes", (unsigned long) size);
+  return ret;
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/barrier.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/barrier.c
new file mode 100644 (file)
index 0000000..8ed2298
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the BARRIER construct.  */
+
+#include "libgomp.h"
+
+
+void
+GOMP_barrier (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+
+  /* It is legal to have orphaned barriers.  */
+  if (team == NULL)
+    return;
+
+  gomp_team_barrier_wait (&team->barrier);
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config.h.in b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config.h.in
new file mode 100644 (file)
index 0000000..14c7e2a
--- /dev/null
@@ -0,0 +1,135 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if the target assembler supports .symver directive. */
+#undef HAVE_AS_SYMVER_DIRECTIVE
+
+/* Define to 1 if the target supports __attribute__((alias(...))). */
+#undef HAVE_ATTRIBUTE_ALIAS
+
+/* Define to 1 if the target supports __attribute__((dllexport)). */
+#undef HAVE_ATTRIBUTE_DLLEXPORT
+
+/* Define to 1 if the target supports __attribute__((visibility(...))). */
+#undef HAVE_ATTRIBUTE_VISIBILITY
+
+/* Define if the POSIX Semaphores do not work on your system. */
+#undef HAVE_BROKEN_POSIX_SEMAPHORES
+
+/* Define to 1 if the target assembler supports thread-local storage. */
+#undef HAVE_CC_TLS
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `getloadavg' function. */
+#undef HAVE_GETLOADAVG
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if pthread_{,attr_}{g,s}etaffinity_np is supported. */
+#undef HAVE_PTHREAD_AFFINITY_NP
+
+/* Define to 1 if you have the <semaphore.h> header file. */
+#undef HAVE_SEMAPHORE_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
+
+/* Define to 1 if the target runtime linker supports binding the same symbol
+   to different versions. */
+#undef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
+
+/* Define to 1 if the target supports __sync_*_compare_and_swap */
+#undef HAVE_SYNC_BUILTINS
+
+/* Define to 1 if you have the <sys/loadavg.h> header file. */
+#undef HAVE_SYS_LOADAVG_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if the target supports thread-local storage. */
+#undef HAVE_TLS
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if GNU symbol versioning is used for libgomp. */
+#undef LIBGOMP_GNU_SYMBOL_VERSIONING
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of `char', as computed by sizeof. */
+#undef SIZEOF_CHAR
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if you can safely include both <string.h> and <strings.h>. */
+#undef STRING_WITH_STRINGS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/bsd/proc.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/bsd/proc.c
new file mode 100644 (file)
index 0000000..ec16f2c
--- /dev/null
@@ -0,0 +1,114 @@
+/* Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains system specific routines related to counting
+   online processors and dynamic load balancing.  It is expected that
+   a system may well want to write special versions of each of these.
+
+   The following implementation uses a mix of POSIX and BSD routines.  */
+
+#include "libgomp.h"
+#include <unistd.h>
+#include <stdlib.h>
+#ifdef HAVE_GETLOADAVG
+# ifdef HAVE_SYS_LOADAVG_H
+#  include <sys/loadavg.h>
+# endif
+#endif
+#ifdef HAVE_SYS_SYSCTL_H
+# include <sys/sysctl.h>
+#endif
+
+static int
+get_num_procs (void)
+{
+#ifdef _SC_NPROCESSORS_ONLN
+  return sysconf (_SC_NPROCESSORS_ONLN);
+#elif defined HW_NCPU
+  int ncpus = 1;
+  size_t len = sizeof(ncpus);
+  sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0);
+  return ncpus;
+#else
+  return 0;
+#endif
+}
+
+/* At startup, determine the default number of threads.  It would seem
+   this should be related to the number of cpus online.  */
+
+void
+gomp_init_num_threads (void)
+{
+  int ncpus = get_num_procs ();
+
+  if (ncpus > 0)
+    gomp_global_icv.nthreads_var = ncpus;
+}
+
+/* When OMP_DYNAMIC is set, at thread launch determine the number of
+   threads we should spawn for this team.  */
+/* ??? I have no idea what best practice for this is.  Surely some
+   function of the number of processors that are *still* online and
+   the load average.  Here I use the number of processors online
+   minus the 15 minute load average.  */
+
+unsigned
+gomp_dynamic_max_threads (void)
+{
+  unsigned n_onln, loadavg;
+  unsigned nthreads_var = gomp_icv (false)->nthreads_var;
+
+  n_onln = get_num_procs ();
+  if (!n_onln || n_onln > nthreads_var)
+    n_onln = nthreads_var;
+
+  loadavg = 0;
+#ifdef HAVE_GETLOADAVG
+  {
+    double dloadavg[3];
+    if (getloadavg (dloadavg, 3) == 3)
+      {
+       /* Add 0.1 to get a kind of biased rounding.  */
+       loadavg = dloadavg[2] + 0.1;
+      }
+  }
+#endif
+
+  if (loadavg >= n_onln)
+    return 1;
+  else
+    return n_onln - loadavg;
+}
+
+int
+omp_get_num_procs (void)
+{
+  int ncpus = get_num_procs ();
+  if (ncpus <= 0)
+    ncpus = gomp_icv (false)->nthreads_var;
+  return ncpus;
+}
+
+ialias (omp_get_num_procs)
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/affinity.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/affinity.c
new file mode 100644 (file)
index 0000000..7a904df
--- /dev/null
@@ -0,0 +1,123 @@
+/* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a CPU affinity setting.  */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+#include "libgomp.h"
+#include "proc.h"
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+
+static unsigned int affinity_counter;
+
+void
+gomp_init_affinity (void)
+{
+  cpu_set_t cpuset, cpusetnew;
+  size_t idx, widx;
+  unsigned long cpus = 0;
+
+  if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset), &cpuset))
+    {
+      gomp_error ("could not get CPU affinity set");
+      free (gomp_cpu_affinity);
+      gomp_cpu_affinity = NULL;
+      gomp_cpu_affinity_len = 0;
+      return;
+    }
+
+  CPU_ZERO (&cpusetnew);
+  if (gomp_cpu_affinity_len == 0)
+    {
+      unsigned long count = gomp_cpuset_popcount (&cpuset);
+      if (count >= 65536)
+       count = 65536;
+      gomp_cpu_affinity = malloc (count * sizeof (unsigned short));
+      if (gomp_cpu_affinity == NULL)
+       {
+         gomp_error ("not enough memory to store CPU affinity list");
+         return;
+       }
+      for (widx = idx = 0; widx < count && idx < 65536; idx++)
+       if (CPU_ISSET (idx, &cpuset))
+         {
+           cpus++;
+           gomp_cpu_affinity[widx++] = idx;
+         }
+    }
+  else
+    for (widx = idx = 0; idx < gomp_cpu_affinity_len; idx++)
+      if (gomp_cpu_affinity[idx] < CPU_SETSIZE
+         && CPU_ISSET (gomp_cpu_affinity[idx], &cpuset))
+       {
+         if (! CPU_ISSET (gomp_cpu_affinity[idx], &cpusetnew))
+           {
+             cpus++;
+             CPU_SET (gomp_cpu_affinity[idx], &cpusetnew);
+           }
+         gomp_cpu_affinity[widx++] = gomp_cpu_affinity[idx];
+       }
+
+  if (widx == 0)
+    {
+      gomp_error ("no CPUs left for affinity setting");
+      free (gomp_cpu_affinity);
+      gomp_cpu_affinity = NULL;
+      gomp_cpu_affinity_len = 0;
+      return;
+    }
+
+  gomp_cpu_affinity_len = widx;
+  if (cpus < gomp_available_cpus)
+    gomp_available_cpus = cpus;
+  CPU_ZERO (&cpuset);
+  CPU_SET (gomp_cpu_affinity[0], &cpuset);
+  pthread_setaffinity_np (pthread_self (), sizeof (cpuset), &cpuset);
+  affinity_counter = 1;
+}
+
+void
+gomp_init_thread_affinity (pthread_attr_t *attr)
+{
+  unsigned int cpu;
+  cpu_set_t cpuset;
+
+  cpu = __atomic_fetch_add (&affinity_counter, 1, MEMMODEL_RELAXED);
+  cpu %= gomp_cpu_affinity_len;
+  CPU_ZERO (&cpuset);
+  CPU_SET (gomp_cpu_affinity[cpu], &cpuset);
+  pthread_attr_setaffinity_np (attr, sizeof (cpu_set_t), &cpuset);
+}
+
+#else
+
+#include "../posix/affinity.c"
+
+#endif
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/alpha/futex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/alpha/futex.h
new file mode 100644 (file)
index 0000000..c8076bd
--- /dev/null
@@ -0,0 +1,103 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+#ifndef SYS_futex
+#define SYS_futex               394
+#endif
+
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  register long sc_0 __asm__("$0");
+  register long sc_16 __asm__("$16");
+  register long sc_17 __asm__("$17");
+  register long sc_18 __asm__("$18");
+  register long sc_19 __asm__("$19");
+
+  sc_0 = SYS_futex;
+  sc_16 = (long) addr;
+  sc_17 = gomp_futex_wait;
+  sc_18 = val;
+  sc_19 = 0;
+  __asm volatile ("callsys"
+                 : "=r" (sc_0), "=r"(sc_19)
+                 : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18), "1"(sc_19)
+                 : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8",
+                   "$22", "$23", "$24", "$25", "$27", "$28", "memory");
+  if (__builtin_expect (sc_19, 0) && sc_0 == ENOSYS)
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sc_0 = SYS_futex;
+      sc_17 &= ~FUTEX_PRIVATE_FLAG;
+      sc_19 = 0;
+      __asm volatile ("callsys"
+                     : "=r" (sc_0), "=r"(sc_19)
+                     : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18),
+                       "1"(sc_19)
+                     : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8",
+                       "$22", "$23", "$24", "$25", "$27", "$28", "memory");
+    }
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  register long sc_0 __asm__("$0");
+  register long sc_16 __asm__("$16");
+  register long sc_17 __asm__("$17");
+  register long sc_18 __asm__("$18");
+  register long sc_19 __asm__("$19");
+
+  sc_0 = SYS_futex;
+  sc_16 = (long) addr;
+  sc_17 = gomp_futex_wake;
+  sc_18 = count;
+  __asm volatile ("callsys"
+                 : "=r" (sc_0), "=r"(sc_19)
+                 : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18)
+                 : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8",
+                   "$22", "$23", "$24", "$25", "$27", "$28", "memory");
+  if (__builtin_expect (sc_19, 0) && sc_0 == ENOSYS)
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sc_0 = SYS_futex;
+      sc_17 &= ~FUTEX_PRIVATE_FLAG;
+      __asm volatile ("callsys"
+                     : "=r" (sc_0), "=r"(sc_19)
+                     : "0"(sc_0), "r" (sc_16), "r"(sc_17), "r"(sc_18)
+                     : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8",
+                       "$22", "$23", "$24", "$25", "$27", "$28", "memory");
+    }
+}
+
+static inline void
+cpu_relax (void)
+{
+  __asm volatile ("" : : : "memory");
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/bar.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/bar.c
new file mode 100644 (file)
index 0000000..223a2ae
--- /dev/null
@@ -0,0 +1,124 @@
+/* Copyright (C) 2005, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a barrier synchronization
+   mechanism for libgomp.  This type is private to the library.  This 
+   implementation uses atomic instructions and the futex syscall.  */
+
+#include <limits.h>
+#include "wait.h"
+
+
+void
+gomp_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t state)
+{
+  if (__builtin_expect ((state & 1) != 0, 0))
+    {
+      /* Next time we'll be awaiting TOTAL threads again.  */
+      bar->awaited = bar->total;
+      __atomic_store_n (&bar->generation, bar->generation + 4,
+                       MEMMODEL_RELEASE);
+      futex_wake ((int *) &bar->generation, INT_MAX);
+    }
+  else
+    {
+      do
+       do_wait ((int *) &bar->generation, state);
+      while (__atomic_load_n (&bar->generation, MEMMODEL_ACQUIRE) == state);
+    }
+}
+
+void
+gomp_barrier_wait (gomp_barrier_t *bar)
+{
+  gomp_barrier_wait_end (bar, gomp_barrier_wait_start (bar));
+}
+
+/* Like gomp_barrier_wait, except that if the encountering thread
+   is not the last one to hit the barrier, it returns immediately.
+   The intended usage is that a thread which intends to gomp_barrier_destroy
+   this barrier calls gomp_barrier_wait, while all other threads
+   call gomp_barrier_wait_last.  When gomp_barrier_wait returns,
+   the barrier can be safely destroyed.  */
+
+void
+gomp_barrier_wait_last (gomp_barrier_t *bar)
+{
+  gomp_barrier_state_t state = gomp_barrier_wait_start (bar);
+  if (state & 1)
+    gomp_barrier_wait_end (bar, state);
+}
+
+void
+gomp_team_barrier_wake (gomp_barrier_t *bar, int count)
+{
+  futex_wake ((int *) &bar->generation, count == 0 ? INT_MAX : count);
+}
+
+void
+gomp_team_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t state)
+{
+  unsigned int generation, gen;
+
+  if (__builtin_expect ((state & 1) != 0, 0))
+    {
+      /* Next time we'll be awaiting TOTAL threads again.  */
+      struct gomp_thread *thr = gomp_thread ();
+      struct gomp_team *team = thr->ts.team;
+
+      bar->awaited = bar->total;
+      if (__builtin_expect (team->task_count, 0))
+       {
+         gomp_barrier_handle_tasks (state);
+         state &= ~1;
+       }
+      else
+       {
+         __atomic_store_n (&bar->generation, state + 3, MEMMODEL_RELEASE);
+         futex_wake ((int *) &bar->generation, INT_MAX);
+         return;
+       }
+    }
+
+  generation = state;
+  do
+    {
+      do_wait ((int *) &bar->generation, generation);
+      gen = __atomic_load_n (&bar->generation, MEMMODEL_ACQUIRE);
+      if (__builtin_expect (gen & 1, 0))
+       {
+         gomp_barrier_handle_tasks (state);
+         gen = __atomic_load_n (&bar->generation, MEMMODEL_ACQUIRE);
+       }
+      if ((gen & 2) != 0)
+       generation |= 2;
+    }
+  while (gen != state + 4);
+}
+
+void
+gomp_team_barrier_wait (gomp_barrier_t *bar)
+{
+  gomp_team_barrier_wait_end (bar, gomp_barrier_wait_start (bar));
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/bar.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/bar.h
new file mode 100644 (file)
index 0000000..58bd40d
--- /dev/null
@@ -0,0 +1,121 @@
+/* Copyright (C) 2005, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a barrier synchronization
+   mechanism for libgomp.  This type is private to the library.  This 
+   implementation uses atomic instructions and the futex syscall.  */
+
+#ifndef GOMP_BARRIER_H
+#define GOMP_BARRIER_H 1
+
+#include "mutex.h"
+
+typedef struct
+{
+  /* Make sure total/generation is in a mostly read cacheline, while
+     awaited in a separate cacheline.  */
+  unsigned total __attribute__((aligned (64)));
+  unsigned generation;
+  unsigned awaited __attribute__((aligned (64)));
+} gomp_barrier_t;
+typedef unsigned int gomp_barrier_state_t;
+
+static inline void gomp_barrier_init (gomp_barrier_t *bar, unsigned count)
+{
+  bar->total = count;
+  bar->awaited = count;
+  bar->generation = 0;
+}
+
+static inline void gomp_barrier_reinit (gomp_barrier_t *bar, unsigned count)
+{
+  __atomic_add_fetch (&bar->awaited, count - bar->total, MEMMODEL_ACQ_REL);
+  bar->total = count;
+}
+
+static inline void gomp_barrier_destroy (gomp_barrier_t *bar)
+{
+}
+
+extern void gomp_barrier_wait (gomp_barrier_t *);
+extern void gomp_barrier_wait_last (gomp_barrier_t *);
+extern void gomp_barrier_wait_end (gomp_barrier_t *, gomp_barrier_state_t);
+extern void gomp_team_barrier_wait (gomp_barrier_t *);
+extern void gomp_team_barrier_wait_end (gomp_barrier_t *,
+                                       gomp_barrier_state_t);
+extern void gomp_team_barrier_wake (gomp_barrier_t *, int);
+
+static inline gomp_barrier_state_t
+gomp_barrier_wait_start (gomp_barrier_t *bar)
+{
+  unsigned int ret = __atomic_load_n (&bar->generation, MEMMODEL_ACQUIRE) & ~3;
+  /* A memory barrier is needed before exiting from the various forms
+     of gomp_barrier_wait, to satisfy OpenMP API version 3.1 section
+     2.8.6 flush Construct, which says there is an implicit flush during
+     a barrier region.  This is a convenient place to add the barrier,
+     so we use MEMMODEL_ACQ_REL here rather than MEMMODEL_ACQUIRE.  */
+  ret += __atomic_add_fetch (&bar->awaited, -1, MEMMODEL_ACQ_REL) == 0;
+  return ret;
+}
+
+static inline bool
+gomp_barrier_last_thread (gomp_barrier_state_t state)
+{
+  return state & 1;
+}
+
+/* All the inlines below must be called with team->task_lock
+   held.  */
+
+static inline void
+gomp_team_barrier_set_task_pending (gomp_barrier_t *bar)
+{
+  bar->generation |= 1;
+}
+
+static inline void
+gomp_team_barrier_clear_task_pending (gomp_barrier_t *bar)
+{
+  bar->generation &= ~1;
+}
+
+static inline void
+gomp_team_barrier_set_waiting_for_tasks (gomp_barrier_t *bar)
+{
+  bar->generation |= 2;
+}
+
+static inline bool
+gomp_team_barrier_waiting_for_tasks (gomp_barrier_t *bar)
+{
+  return (bar->generation & 2) != 0;
+}
+
+static inline void
+gomp_team_barrier_done (gomp_barrier_t *bar, gomp_barrier_state_t state)
+{
+  bar->generation = (state & ~3) + 4;
+}
+
+#endif /* GOMP_BARRIER_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/futex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/futex.h
new file mode 100644 (file)
index 0000000..d0136f5
--- /dev/null
@@ -0,0 +1,69 @@
+/* Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+   Contributed by ARM Ltd.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+/* The include file hierachy above us (wait.h) has pushed visibility
+   hidden, this will be applied to prototypes with headers we include
+   with the effect that we cannot link against an external function
+   (syscall). The solution here is to push default visibility, include
+   our required headers then reinstante the original visibility.  */
+
+#pragma GCC visibility push(default)
+
+#define _GNU_SOURCE 
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#pragma GCC visibility pop
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  long err = syscall (SYS_futex, addr, gomp_futex_wait, val, NULL);
+  if (__builtin_expect (err == -ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      syscall (SYS_futex, addr, gomp_futex_wait, val, NULL);
+    }
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  long err = syscall (SYS_futex, addr, gomp_futex_wake, count);
+  if (__builtin_expect (err == -ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      syscall (SYS_futex, addr, gomp_futex_wake, count);
+    }
+}
+
+static inline void
+cpu_relax (void)
+{
+  __asm volatile ("" : : : "memory");
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/ia64/futex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/ia64/futex.h
new file mode 100644 (file)
index 0000000..85cd02f
--- /dev/null
@@ -0,0 +1,88 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+#include <sys/syscall.h>
+
+
+
+static inline long
+sys_futex0(int *addr, long op, int val)
+{
+  register long out0 asm ("out0") = (long) addr;
+  register long out1 asm ("out1") = op;
+  register long out2 asm ("out2") = val;
+  register long out3 asm ("out3") = 0;
+  register long r8 asm ("r8");
+  register long r10 asm ("r10");
+  register long r15 asm ("r15") = SYS_futex;
+
+  __asm __volatile ("break 0x100000"
+       : "=r"(r15), "=r"(out0), "=r"(out1), "=r"(out2), "=r"(out3),
+         "=r"(r8), "=r"(r10)
+       : "r"(r15), "r"(out0), "r"(out1), "r"(out2), "r"(out3)
+       : "memory", "out4", "out5", "out6", "out7",
+         /* Non-stacked integer registers, minus r8, r10, r15.  */
+         "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18",
+         "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27",
+         "r28", "r29", "r30", "r31",
+         /* Predicate registers.  */
+         "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15",
+         /* Non-rotating fp registers.  */
+         "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
+         /* Branch registers.  */
+         "b6");
+  return r8 & r10;
+}
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  long err = sys_futex0 (addr, gomp_futex_wait, val);
+  if (__builtin_expect (err == ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wait, val);
+    }
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  long err = sys_futex0 (addr, gomp_futex_wake, count);
+  if (__builtin_expect (err == ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wake, count);
+    }
+}
+
+static inline void
+cpu_relax (void)
+{
+  __asm volatile ("hint @pause" : : : "memory");
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/lock.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/lock.c
new file mode 100644 (file)
index 0000000..047d8cd
--- /dev/null
@@ -0,0 +1,264 @@
+/* Copyright (C) 2005, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of the public OpenMP locking
+   primitives.  This implementation uses atomic instructions and the futex
+   syscall.  */
+
+#include <string.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include "wait.h"
+
+
+/* The internal gomp_mutex_t and the external non-recursive omp_lock_t
+   have the same form.  Re-use it.  */
+
+void
+gomp_init_lock_30 (omp_lock_t *lock)
+{
+  gomp_mutex_init (lock);
+}
+
+void
+gomp_destroy_lock_30 (omp_lock_t *lock)
+{
+  gomp_mutex_destroy (lock);
+}
+
+void
+gomp_set_lock_30 (omp_lock_t *lock)
+{
+  gomp_mutex_lock (lock);
+}
+
+void
+gomp_unset_lock_30 (omp_lock_t *lock)
+{
+  gomp_mutex_unlock (lock);
+}
+
+int
+gomp_test_lock_30 (omp_lock_t *lock)
+{
+  int oldval = 0;
+
+  return __atomic_compare_exchange_n (lock, &oldval, 1, false,
+                                     MEMMODEL_ACQUIRE, MEMMODEL_RELAXED);
+}
+
+void
+gomp_init_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  memset (lock, '\0', sizeof (*lock));
+}
+
+void
+gomp_destroy_nest_lock_30 (omp_nest_lock_t *lock)
+{
+}
+
+void
+gomp_set_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  void *me = gomp_icv (true);
+
+  if (lock->owner != me)
+    {
+      gomp_mutex_lock (&lock->lock);
+      lock->owner = me;
+    }
+
+  lock->count++;
+}
+
+void
+gomp_unset_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  if (--lock->count == 0)
+    {
+      lock->owner = NULL;
+      gomp_mutex_unlock (&lock->lock);
+    }
+}
+
+int
+gomp_test_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  void *me = gomp_icv (true);
+  int oldval;
+
+  if (lock->owner == me)
+    return ++lock->count;
+
+  oldval = 0;
+  if (__atomic_compare_exchange_n (&lock->lock, &oldval, 1, false,
+                                  MEMMODEL_ACQUIRE, MEMMODEL_RELAXED))
+    {
+      lock->owner = me;
+      lock->count = 1;
+      return 1;
+    }
+
+  return 0;
+}
+
+#ifdef LIBGOMP_GNU_SYMBOL_VERSIONING
+/* gomp_mutex_* can be safely locked in one thread and
+   unlocked in another thread, so the OpenMP 2.5 and OpenMP 3.0
+   non-nested locks can be the same.  */
+strong_alias (gomp_init_lock_30, gomp_init_lock_25)
+strong_alias (gomp_destroy_lock_30, gomp_destroy_lock_25)
+strong_alias (gomp_set_lock_30, gomp_set_lock_25)
+strong_alias (gomp_unset_lock_30, gomp_unset_lock_25)
+strong_alias (gomp_test_lock_30, gomp_test_lock_25)
+
+/* The external recursive omp_nest_lock_25_t form requires additional work.  */
+
+/* We need an integer to uniquely identify this thread.  Most generally
+   this is the thread's TID, which ideally we'd get this straight from
+   the TLS block where glibc keeps it.  Unfortunately, we can't get at
+   that directly.
+
+   If we don't support (or have disabled) TLS, one function call is as
+   good (or bad) as any other.  Use the syscall all the time.
+
+   On an ILP32 system (defined here as not LP64), we can make do with
+   any thread-local pointer.  Ideally we'd use the TLS base address,
+   since that requires the least amount of arithmetic, but that's not
+   always available directly.  Make do with the gomp_thread pointer
+   since it's handy.  */
+
+# if !defined (HAVE_TLS)
+static inline int gomp_tid (void)
+{
+  return syscall (SYS_gettid);
+}
+# elif !defined(__LP64__)
+static inline int gomp_tid (void)
+{
+  return (int) gomp_thread ();
+}
+# else
+static __thread int tid_cache;
+static inline int gomp_tid (void)
+{
+  int tid = tid_cache;
+  if (__builtin_expect (tid == 0, 0))
+    tid_cache = tid = syscall (SYS_gettid);
+  return tid;
+}
+# endif
+
+
+void
+gomp_init_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+  memset (lock, 0, sizeof (*lock));
+}
+
+void
+gomp_destroy_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+}
+
+void
+gomp_set_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+  int otid, tid = gomp_tid ();
+
+  while (1)
+    {
+      otid = 0;
+      if (__atomic_compare_exchange_n (&lock->owner, &otid, tid, false,
+                                      MEMMODEL_ACQUIRE, MEMMODEL_RELAXED))
+       {
+         lock->count = 1;
+         return;
+       }
+      if (otid == tid)
+       {
+         lock->count++;
+         return;
+       }
+
+      do_wait (&lock->owner, otid);
+    }
+}
+
+void
+gomp_unset_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+  /* ??? Validate that we own the lock here.  */
+
+  if (--lock->count == 0)
+    {
+      __atomic_store_n (&lock->owner, 0, MEMMODEL_RELEASE);
+      futex_wake (&lock->owner, 1);
+    }
+}
+
+int
+gomp_test_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+  int otid, tid = gomp_tid ();
+
+  otid = 0;
+  if (__atomic_compare_exchange_n (&lock->owner, &otid, tid, false,
+                                  MEMMODEL_ACQUIRE, MEMMODEL_RELAXED))
+    {
+      lock->count = 1;
+      return 1;
+    }
+  if (otid == tid)
+    return ++lock->count;
+
+  return 0;
+}
+
+omp_lock_symver (omp_init_lock)
+omp_lock_symver (omp_destroy_lock)
+omp_lock_symver (omp_set_lock)
+omp_lock_symver (omp_unset_lock)
+omp_lock_symver (omp_test_lock)
+omp_lock_symver (omp_init_nest_lock)
+omp_lock_symver (omp_destroy_nest_lock)
+omp_lock_symver (omp_set_nest_lock)
+omp_lock_symver (omp_unset_nest_lock)
+omp_lock_symver (omp_test_nest_lock)
+
+#else
+
+ialias (omp_init_lock)
+ialias (omp_init_nest_lock)
+ialias (omp_destroy_lock)
+ialias (omp_destroy_nest_lock)
+ialias (omp_set_lock)
+ialias (omp_set_nest_lock)
+ialias (omp_unset_lock)
+ialias (omp_unset_nest_lock)
+ialias (omp_test_lock)
+ialias (omp_test_nest_lock)
+
+#endif
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/mips/futex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/mips/futex.h
new file mode 100644 (file)
index 0000000..93655d3
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Ilie Garbacea <ilie@mips.com>, Chao-ying Fu <fu@mips.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+#include <sys/syscall.h>
+#define FUTEX_WAIT 0
+#define FUTEX_WAKE 1
+
+static inline void
+sys_futex0 (int *addr, int op, int val)
+{
+  register unsigned long __v0 asm("$2") = (unsigned long) SYS_futex;
+  register unsigned long __a0 asm("$4") = (unsigned long) addr;
+  register unsigned long __a1 asm("$5") = (unsigned long) op;
+  register unsigned long __a2 asm("$6") = (unsigned long) val;
+  register unsigned long __a3 asm("$7") = 0;
+
+  __asm volatile ("syscall"
+                 /* returns $a3 (errno), $v0 (return value) */
+                 : "=r" (__v0), "=r" (__a3)
+                 /* arguments in v0 (syscall) a0-a3 */
+                 : "r" (__v0), "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a3)
+                 /* clobbers at, v1, t0-t9, memory */
+                 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", "$14",
+                   "$15", "$24", "$25", "memory");
+}
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  sys_futex0 (addr, FUTEX_WAIT, val);
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  sys_futex0 (addr, FUTEX_WAKE, count);
+}
+
+static inline void
+cpu_relax (void)
+{
+  __asm volatile ("" : : : "memory");
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/mutex.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/mutex.c
new file mode 100644 (file)
index 0000000..1b84ffb
--- /dev/null
@@ -0,0 +1,69 @@
+/* Copyright (C) 2005, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a mutex synchronization
+   mechanism for libgomp.  This type is private to the library.  This
+   implementation uses atomic instructions and the futex syscall.  */
+
+#include "wait.h"
+
+long int gomp_futex_wake = FUTEX_WAKE | FUTEX_PRIVATE_FLAG;
+long int gomp_futex_wait = FUTEX_WAIT | FUTEX_PRIVATE_FLAG;
+
+void
+gomp_mutex_lock_slow (gomp_mutex_t *mutex, int oldval)
+{
+  /* First loop spins a while.  */
+  while (oldval == 1)
+    {
+      if (do_spin (mutex, 1))
+       {
+         /* Spin timeout, nothing changed.  Set waiting flag.  */
+         oldval = __atomic_exchange_n (mutex, -1, MEMMODEL_ACQUIRE);
+         if (oldval == 0)
+           return;
+         futex_wait (mutex, -1);
+         break;
+       }
+      else
+       {
+         /* Something changed.  If now unlocked, we're good to go.  */
+         oldval = 0;
+         if (__atomic_compare_exchange_n (mutex, &oldval, 1, false,
+                                          MEMMODEL_ACQUIRE, MEMMODEL_RELAXED))
+           return;
+       }
+    }
+
+  /* Second loop waits until mutex is unlocked.  We always exit this
+     loop with wait flag set, so next unlock will awaken a thread.  */
+  while ((oldval = __atomic_exchange_n (mutex, -1, MEMMODEL_ACQUIRE)))
+    do_wait (mutex, -1);
+}
+
+void
+gomp_mutex_unlock_slow (gomp_mutex_t *mutex)
+{
+  futex_wake (mutex, 1);
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/mutex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/mutex.h
new file mode 100644 (file)
index 0000000..912152e
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright (C) 2005, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a mutex synchronization
+   mechanism for libgomp.  This type is private to the library.  This
+   implementation uses atomic instructions and the futex syscall.  */
+
+#ifndef GOMP_MUTEX_H
+#define GOMP_MUTEX_H 1
+
+typedef int gomp_mutex_t;
+
+#define GOMP_MUTEX_INIT_0 1
+
+extern void gomp_mutex_lock_slow (gomp_mutex_t *mutex, int);
+extern void gomp_mutex_unlock_slow (gomp_mutex_t *mutex);
+
+static inline void
+gomp_mutex_init (gomp_mutex_t *mutex)
+{
+  *mutex = 0;
+}
+
+static inline void
+gomp_mutex_destroy (gomp_mutex_t *mutex)
+{
+}
+
+static inline void
+gomp_mutex_lock (gomp_mutex_t *mutex)
+{
+  int oldval = 0;
+  if (!__atomic_compare_exchange_n (mutex, &oldval, 1, false,
+                                   MEMMODEL_ACQUIRE, MEMMODEL_RELAXED))
+    gomp_mutex_lock_slow (mutex, oldval);
+}
+
+static inline void
+gomp_mutex_unlock (gomp_mutex_t *mutex)
+{
+  int wait = __atomic_exchange_n (mutex, 0, MEMMODEL_RELEASE);
+  if (__builtin_expect (wait < 0, 0))
+    gomp_mutex_unlock_slow (mutex);
+}
+#endif /* GOMP_MUTEX_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/omp-lock.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/omp-lock.h
new file mode 100644 (file)
index 0000000..2ca7c5e
--- /dev/null
@@ -0,0 +1,12 @@
+/* This header is used during the build process to find the size and 
+   alignment of the public OpenMP locks, so that we can export data
+   structures without polluting the namespace.
+
+   When using the Linux futex primitive, non-recursive locks require
+   one int.  Recursive locks require we identify the owning task
+   and so require in addition one int and a pointer.  */
+
+typedef int omp_lock_t;
+typedef struct { int lock, count; void *owner; } omp_nest_lock_t;
+typedef int omp_lock_25_t;
+typedef struct { int owner, count; } omp_nest_lock_25_t;
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/powerpc/futex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/powerpc/futex.h
new file mode 100644 (file)
index 0000000..9d928e2
--- /dev/null
@@ -0,0 +1,86 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+#include <sys/syscall.h>
+
+static inline long
+sys_futex0 (int *addr, int op, int val)
+{
+  register long int r0  __asm__ ("r0");
+  register long int r3  __asm__ ("r3");
+  register long int r4  __asm__ ("r4");
+  register long int r5  __asm__ ("r5");
+  register long int r6  __asm__ ("r6");
+
+  r0 = SYS_futex;
+  r3 = (long) addr;
+  r4 = op;
+  r5 = val;
+  r6 = 0;
+
+  /* ??? The powerpc64 sysdep.h file clobbers ctr; the powerpc32 sysdep.h
+     doesn't.  It doesn't much matter for us.  In the interest of unity,
+     go ahead and clobber it always.  */
+
+  __asm volatile ("sc; mfcr %0"
+                 : "=r"(r0), "=r"(r3), "=r"(r4), "=r"(r5), "=r"(r6)
+                 : "r"(r0), "r"(r3), "r"(r4), "r"(r5), "r"(r6)
+                 : "r7", "r8", "r9", "r10", "r11", "r12",
+                   "cr0", "ctr", "memory");
+  if (__builtin_expect (r0 & (1 << 28), 0))
+    return r3;
+  return 0;
+}
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  long err = sys_futex0 (addr, gomp_futex_wait, val);
+  if (__builtin_expect (err == ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wait, val);
+    }
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  long err = sys_futex0 (addr, gomp_futex_wake, count);
+  if (__builtin_expect (err == ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wake, count);
+    }
+}
+
+static inline void
+cpu_relax (void)
+{
+  __asm volatile ("" : : : "memory");
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/proc.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/proc.c
new file mode 100644 (file)
index 0000000..8d9cfb5
--- /dev/null
@@ -0,0 +1,164 @@
+/* Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains system specific routines related to counting
+   online processors and dynamic load balancing.  */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+#include "libgomp.h"
+#include "proc.h"
+#include <stdlib.h>
+#include <unistd.h>
+#ifdef HAVE_GETLOADAVG
+# ifdef HAVE_SYS_LOADAVG_H
+#  include <sys/loadavg.h>
+# endif
+#endif
+
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+unsigned long
+gomp_cpuset_popcount (cpu_set_t *cpusetp)
+{
+#ifdef CPU_COUNT
+  /* glibc 2.6 and above provide a macro for this.  */
+  return CPU_COUNT (cpusetp);
+#else
+  size_t i;
+  unsigned long ret = 0;
+  extern int check[sizeof (cpusetp->__bits[0]) == sizeof (unsigned long int)];
+
+  (void) check;
+  for (i = 0; i < sizeof (*cpusetp) / sizeof (cpusetp->__bits[0]); i++)
+    {
+      unsigned long int mask = cpusetp->__bits[i];
+      if (mask == 0)
+       continue;
+      ret += __builtin_popcountl (mask);
+    }
+  return ret;
+#endif
+}
+#endif
+
+/* At startup, determine the default number of threads.  It would seem
+   this should be related to the number of cpus online.  */
+
+void
+gomp_init_num_threads (void)
+{
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+  cpu_set_t cpuset;
+
+  if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset), &cpuset) == 0)
+    {
+      /* Count only the CPUs this process can use.  */
+      gomp_global_icv.nthreads_var = gomp_cpuset_popcount (&cpuset);
+      if (gomp_global_icv.nthreads_var == 0)
+       gomp_global_icv.nthreads_var = 1;
+      return;
+    }
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+  gomp_global_icv.nthreads_var = sysconf (_SC_NPROCESSORS_ONLN);
+#endif
+}
+
+static int
+get_num_procs (void)
+{
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+  cpu_set_t cpuset;
+
+  if (gomp_cpu_affinity == NULL)
+    {
+      /* Count only the CPUs this process can use.  */
+      if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset),
+                                 &cpuset) == 0)
+       {
+         int ret = gomp_cpuset_popcount (&cpuset);
+         return ret != 0 ? ret : 1;
+       }
+    }
+  else
+    {
+      /* We can't use pthread_getaffinity_np in this case
+        (we have changed it ourselves, it binds to just one CPU).
+        Count instead the number of different CPUs we are
+        using.  gomp_init_affinity updated gomp_available_cpus to
+        the number of CPUs in the GOMP_AFFINITY mask that we are
+        allowed to use though.  */
+      return gomp_available_cpus;
+    }
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+  return sysconf (_SC_NPROCESSORS_ONLN);
+#else
+  return gomp_icv (false)->nthreads_var;
+#endif
+}
+
+/* When OMP_DYNAMIC is set, at thread launch determine the number of
+   threads we should spawn for this team.  */
+/* ??? I have no idea what best practice for this is.  Surely some
+   function of the number of processors that are *still* online and
+   the load average.  Here I use the number of processors online
+   minus the 15 minute load average.  */
+
+unsigned
+gomp_dynamic_max_threads (void)
+{
+  unsigned n_onln, loadavg, nthreads_var = gomp_icv (false)->nthreads_var;
+
+  n_onln = get_num_procs ();
+  if (n_onln > nthreads_var)
+    n_onln = nthreads_var;
+
+  loadavg = 0;
+#ifdef HAVE_GETLOADAVG
+  {
+    double dloadavg[3];
+    if (getloadavg (dloadavg, 3) == 3)
+      {
+       /* Add 0.1 to get a kind of biased rounding.  */
+       loadavg = dloadavg[2] + 0.1;
+      }
+  }
+#endif
+
+  if (loadavg >= n_onln)
+    return 1;
+  else
+    return n_onln - loadavg;
+}
+
+int
+omp_get_num_procs (void)
+{
+  return get_num_procs ();
+}
+
+ialias (omp_get_num_procs)
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/proc.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/proc.h
new file mode 100644 (file)
index 0000000..f9e3110
--- /dev/null
@@ -0,0 +1,34 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+   Contributed by Uros Bizjak <ubizjak@gmail.com>
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef GOMP_PROC_H
+#define GOMP_PROC_H 1
+
+#include <sched.h>
+
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+extern unsigned long gomp_cpuset_popcount (cpu_set_t *);
+#endif
+
+#endif /* GOMP_PROC_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/ptrlock.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/ptrlock.c
new file mode 100644 (file)
index 0000000..5896f42
--- /dev/null
@@ -0,0 +1,69 @@
+/* Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a mutex synchronization
+   mechanism for libgomp.  This type is private to the library.  This
+   implementation uses atomic instructions and the futex syscall.  */
+
+#include <endian.h>
+#include <limits.h>
+#include "wait.h"
+
+void *
+gomp_ptrlock_get_slow (gomp_ptrlock_t *ptrlock)
+{
+  int *intptr;
+  uintptr_t oldval = 1;
+
+  __atomic_compare_exchange_n (ptrlock, &oldval, 2, false,
+                              MEMMODEL_RELAXED, MEMMODEL_RELAXED);
+
+  /* futex works on ints, not pointers.
+     But a valid work share pointer will be at least
+     8 byte aligned, so it is safe to assume the low
+     32-bits of the pointer won't contain values 1 or 2.  */
+  __asm volatile ("" : "=r" (intptr) : "0" (ptrlock));
+#if __BYTE_ORDER == __BIG_ENDIAN
+  if (sizeof (*ptrlock) > sizeof (int))
+    intptr += (sizeof (*ptrlock) / sizeof (int)) - 1;
+#endif
+  do
+    do_wait (intptr, 2);
+  while (*intptr == 2);
+  __asm volatile ("" : : : "memory");
+  return *ptrlock;
+}
+
+void
+gomp_ptrlock_set_slow (gomp_ptrlock_t *ptrlock)
+{
+  int *intptr;
+
+  __asm volatile ("" : "=r" (intptr) : "0" (ptrlock));
+#if __BYTE_ORDER == __BIG_ENDIAN
+  if (sizeof (*ptrlock) > sizeof (int))
+    intptr += (sizeof (*ptrlock) / sizeof (int)) - 1;
+#endif
+  futex_wake (intptr, INT_MAX);
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/ptrlock.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/ptrlock.h
new file mode 100644 (file)
index 0000000..2f17e09
--- /dev/null
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a mutex synchronization
+   mechanism for libgomp.  This type is private to the library.  This
+   implementation uses atomic instructions and the futex syscall.
+
+   A ptrlock has four states:
+   0/NULL Initial
+   1      Owned by me, I get to write a pointer to ptrlock.
+   2      Some thread is waiting on the ptrlock.
+   >2     Ptrlock contains a valid pointer.
+   It is not valid to gain the ptrlock and then write a NULL to it.  */
+
+#ifndef GOMP_PTRLOCK_H
+#define GOMP_PTRLOCK_H 1
+
+typedef void *gomp_ptrlock_t;
+
+static inline void gomp_ptrlock_init (gomp_ptrlock_t *ptrlock, void *ptr)
+{
+  *ptrlock = ptr;
+}
+
+extern void *gomp_ptrlock_get_slow (gomp_ptrlock_t *ptrlock);
+static inline void *gomp_ptrlock_get (gomp_ptrlock_t *ptrlock)
+{
+  uintptr_t oldval;
+
+  if ((uintptr_t) *ptrlock > 2)
+    return *ptrlock;
+
+  oldval = 0;
+  if (__atomic_compare_exchange_n (ptrlock, &oldval, 1, false,
+                                  MEMMODEL_ACQUIRE, MEMMODEL_ACQUIRE))
+    return NULL;
+
+  return gomp_ptrlock_get_slow (ptrlock);
+}
+
+extern void gomp_ptrlock_set_slow (gomp_ptrlock_t *ptrlock);
+static inline void gomp_ptrlock_set (gomp_ptrlock_t *ptrlock, void *ptr)
+{
+  void *wait = __atomic_exchange_n (ptrlock, ptr, MEMMODEL_RELEASE);
+  if ((uintptr_t) wait != 1)
+    gomp_ptrlock_set_slow (ptrlock);
+}
+
+static inline void gomp_ptrlock_destroy (gomp_ptrlock_t *ptrlock)
+{
+}
+
+#endif /* GOMP_PTRLOCK_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/s390/futex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/s390/futex.h
new file mode 100644 (file)
index 0000000..e015c92
--- /dev/null
@@ -0,0 +1,78 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+#include <sys/syscall.h>
+
+static inline long
+sys_futex0 (int *addr, int op, int val)
+{
+  register long int gpr2  __asm__ ("2");
+  register long int gpr3  __asm__ ("3");
+  register long int gpr4  __asm__ ("4");
+  register long int gpr5  __asm__ ("5");
+
+  gpr2 = (long) addr;
+  gpr3 = op;
+  gpr4 = val;
+  gpr5 = 0;
+
+  __asm volatile ("svc %b1"
+                 : "=d" (gpr2)
+                 : "i" (SYS_futex),
+                   "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5)
+                 : "memory");
+  return gpr2;
+}
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  long err = sys_futex0 (addr, gomp_futex_wait, val);
+  if (__builtin_expect (err == -ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wait, val);
+    }
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  long err = sys_futex0 (addr, gomp_futex_wake, count);
+  if (__builtin_expect (err == -ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wake, count);
+    }
+}
+
+static inline void
+cpu_relax (void)
+{
+  __asm volatile ("" : : : "memory");
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/sem.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/sem.c
new file mode 100644 (file)
index 0000000..3f2fc99
--- /dev/null
@@ -0,0 +1,83 @@
+/* Copyright (C) 2005, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a semaphore synchronization
+   mechanism for libgomp.  This type is private to the library.  This 
+   implementation uses atomic instructions and the futex syscall.  */
+
+#include "wait.h"
+
+void
+gomp_sem_wait_slow (gomp_sem_t *sem, int count)
+{
+  /* First loop spins a while.  */
+  while (count == 0)
+    if (do_spin (sem, 0)
+       /* Spin timeout, nothing changed.  Set waiting flag.  */
+       && __atomic_compare_exchange_n (sem, &count, SEM_WAIT, false,
+                                       MEMMODEL_ACQUIRE, MEMMODEL_RELAXED))
+      {
+       futex_wait (sem, SEM_WAIT);
+       count = *sem;
+       break;
+      }
+  /* Something changed.  If it wasn't the wait flag, we're good to go.  */
+    else if (__builtin_expect (((count = *sem) & SEM_WAIT) == 0 && count != 0,
+                              1))
+      {
+       if (__atomic_compare_exchange_n (sem, &count, count - SEM_INC, false,
+                                        MEMMODEL_ACQUIRE, MEMMODEL_RELAXED))
+         return;
+      }
+
+  /* Second loop waits until semaphore is posted.  We always exit this
+     loop with wait flag set, so next post will awaken a thread.  */
+  while (1)
+    {
+      unsigned int wake = count & ~SEM_WAIT;
+      int newval = SEM_WAIT;
+
+      if (wake != 0)
+       newval |= wake - SEM_INC;
+      if (__atomic_compare_exchange_n (sem, &count, newval, false,
+                                      MEMMODEL_ACQUIRE, MEMMODEL_RELAXED))
+       {
+         if (wake != 0)
+           {
+             /* If we can wake more threads, do so now.  */
+             if (wake > SEM_INC)
+               gomp_sem_post_slow (sem);
+             break;
+           }
+         do_wait (sem, SEM_WAIT);
+         count = *sem;
+       }
+    }
+}
+
+void
+gomp_sem_post_slow (gomp_sem_t *sem)
+{
+  futex_wake (sem, 1);
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/sem.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/sem.h
new file mode 100644 (file)
index 0000000..9bf480d
--- /dev/null
@@ -0,0 +1,87 @@
+/* Copyright (C) 2005, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a semaphore synchronization
+   mechanism for libgomp.  This type is private to the library.  This 
+   counting semaphore implementation uses atomic instructions and the
+   futex syscall, and a single 32-bit int to store semaphore state.
+   The low 31 bits are the count, the top bit is a flag set when some
+   threads may be waiting.  */
+
+#ifndef GOMP_SEM_H
+#define GOMP_SEM_H 1
+
+#include <limits.h> /* For INT_MIN */
+
+typedef int gomp_sem_t;
+#define SEM_WAIT INT_MIN
+#define SEM_INC 1
+
+extern void gomp_sem_wait_slow (gomp_sem_t *, int);
+extern void gomp_sem_post_slow (gomp_sem_t *);
+
+static inline void
+gomp_sem_init (gomp_sem_t *sem, int value)
+{
+  *sem = value * SEM_INC;
+}
+
+static inline void
+gomp_sem_destroy (gomp_sem_t *sem)
+{
+}
+
+static inline void
+gomp_sem_wait (gomp_sem_t *sem)
+{
+  int count = *sem;
+
+  while ((count & ~SEM_WAIT) != 0)
+    if (__atomic_compare_exchange_n (sem, &count, count - SEM_INC, true,
+                                    MEMMODEL_ACQUIRE, MEMMODEL_RELAXED))
+      return;
+  gomp_sem_wait_slow (sem, count);
+}
+
+static inline void
+gomp_sem_post (gomp_sem_t *sem)
+{
+  int count = *sem;
+
+  /* Clear SEM_WAIT here so that if there are no more waiting threads
+     we transition back to the uncontended state that does not make
+     futex syscalls.  If there are waiting threads then when one is
+     awoken it will set SEM_WAIT again, so other waiting threads are
+     woken on a future gomp_sem_post.  Furthermore, the awoken thread
+     will wake other threads in case gomp_sem_post was called again
+     before it had time to set SEM_WAIT.  */
+  while (!__atomic_compare_exchange_n (sem, &count,
+                                      (count + SEM_INC) & ~SEM_WAIT, true,
+                                      MEMMODEL_RELEASE, MEMMODEL_RELAXED))
+    continue;
+
+  if (__builtin_expect (count & SEM_WAIT, 0))
+    gomp_sem_post_slow (sem);
+}
+#endif /* GOMP_SEM_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/sparc/futex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/sparc/futex.h
new file mode 100644 (file)
index 0000000..96e37b8
--- /dev/null
@@ -0,0 +1,94 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+#include <sys/syscall.h>
+
+static inline long
+sys_futex0 (int *addr, int op, int val)
+{
+  register long int g1  __asm__ ("g1");
+  register long int o0  __asm__ ("o0");
+  register long int o1  __asm__ ("o1");
+  register long int o2  __asm__ ("o2");
+  register long int o3  __asm__ ("o3");
+
+  g1 = SYS_futex;
+  o0 = (long) addr;
+  o1 = op;
+  o2 = val;
+  o3 = 0;
+
+#ifdef __arch64__
+# define SYSCALL_STRING "ta\t0x6d; bcs,a,pt %%xcc, 1f; sub %%g0, %%o0, %%o0; 1:"
+#else
+# define SYSCALL_STRING "ta\t0x10; bcs,a 1f; sub %%g0, %%o0, %%o0; 1:"
+#endif
+
+  __asm volatile (SYSCALL_STRING
+                 : "=r" (g1), "=r" (o0)
+                 : "0" (g1), "1" (o0), "r" (o1), "r" (o2), "r" (o3)
+                 : "g2", "g3", "g4", "g5", "g6",
+                   "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+                   "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
+                   "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
+                   "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
+#ifdef __arch64__
+                   "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46",
+                   "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62",
+#endif
+                   "cc", "memory");
+  return o0;
+}
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  long err = sys_futex0 (addr, gomp_futex_wait, val);
+  if (__builtin_expect (err == ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wait, val);
+    }
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  long err = sys_futex0 (addr, gomp_futex_wake, count);
+  if (__builtin_expect (err == ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wake, count);
+    }
+}
+
+static inline void
+cpu_relax (void)
+{
+  __asm volatile ("rd %%ccr, %%g0" : : : "memory");
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/tile/futex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/tile/futex.h
new file mode 100644 (file)
index 0000000..2e733a7
--- /dev/null
@@ -0,0 +1,73 @@
+/* Copyright (C) 2011, 2012
+   Free Software Foundation, Inc.
+   Contributed by Walter Lee (walt@tilera.com)
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+#include <sys/syscall.h>
+#include <linux/futex.h>
+
+static inline void
+sys_futex0 (int *addr, int op, int val)
+{
+  long _sys_result;
+  long _clobber_r2, _clobber_r3, _clobber_r4, _clobber_r5, _clobber_r10;
+  int err;
+
+  __asm__ __volatile__ (
+    "swint1"
+    : "=R00" (_sys_result), "=R01" (err), "=R02" (_clobber_r2),
+      "=R03" (_clobber_r3), "=R04" (_clobber_r4), "=R05" (_clobber_r5),
+      "=R10" (_clobber_r10)
+    : "R10" (SYS_futex), "R00" (addr), "R01" (op), "R02" (val),
+      "R03" (0)
+    :  "r6",  "r7",
+       "r8",  "r9",        "r11", "r12", "r13", "r14", "r15",
+      "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
+      "r24", "r25", "r26", "r27", "r28", "r29", "memory");
+}
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  sys_futex0 (addr, FUTEX_WAIT, val);
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  sys_futex0 (addr, FUTEX_WAKE, count);
+}
+
+static inline void
+cpu_relax (void)
+{
+  __asm volatile ("" : : : "memory");
+}
+
+static inline void
+atomic_write_barrier (void)
+{
+  __sync_synchronize ();
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/wait.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/wait.h
new file mode 100644 (file)
index 0000000..4f65985
--- /dev/null
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a mutex synchronization
+   mechanism for libgomp.  This type is private to the library.  This
+   implementation uses atomic instructions and the futex syscall.  */
+
+#ifndef GOMP_WAIT_H
+#define GOMP_WAIT_H 1
+
+#include "libgomp.h"
+#include <errno.h>
+
+#define FUTEX_WAIT     0
+#define FUTEX_WAKE     1
+#define FUTEX_PRIVATE_FLAG     128L
+
+#ifdef HAVE_ATTRIBUTE_VISIBILITY
+# pragma GCC visibility push(hidden)
+#endif
+
+extern long int gomp_futex_wait, gomp_futex_wake;
+
+#include <futex.h>
+
+static inline int do_spin (int *addr, int val)
+{
+  unsigned long long i, count = gomp_spin_count_var;
+
+  if (__builtin_expect (gomp_managed_threads > gomp_available_cpus, 0))
+    count = gomp_throttled_spin_count_var;
+  for (i = 0; i < count; i++)
+    if (__builtin_expect (*addr != val, 0))
+      return 0;
+    else
+      cpu_relax ();
+  return 1;
+}
+
+static inline void do_wait (int *addr, int val)
+{
+  if (do_spin (addr, val))
+    futex_wait (addr, val);
+}
+
+#ifdef HAVE_ATTRIBUTE_VISIBILITY
+# pragma GCC visibility pop
+#endif
+
+#endif /* GOMP_WAIT_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/x86/futex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/linux/x86/futex.h
new file mode 100644 (file)
index 0000000..f6d26dc
--- /dev/null
@@ -0,0 +1,147 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+#ifdef __x86_64__
+# ifndef SYS_futex
+#  define SYS_futex    202
+# endif
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  register long r10 __asm__("%r10");
+  long res;
+
+  r10 = 0;
+  __asm volatile ("syscall"
+                 : "=a" (res)
+                 : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wait),
+                   "d" (val), "r" (r10)
+                 : "r11", "rcx", "memory");
+  if (__builtin_expect (res == -ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      r10 = 0;
+      __asm volatile ("syscall"
+                     : "=a" (res)
+                     : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wait),
+                       "d" (val), "r" (r10)
+                     : "r11", "rcx", "memory");
+    }
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  long res;
+
+  __asm volatile ("syscall"
+                 : "=a" (res)
+                 : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wake),
+                   "d" (count)
+                 : "r11", "rcx", "memory");
+  if (__builtin_expect (res == -ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      __asm volatile ("syscall"
+                     : "=a" (res)
+                     : "0" (SYS_futex), "D" (addr), "S" (gomp_futex_wake),
+                       "d" (count)
+                     : "r11", "rcx", "memory");
+    }
+}
+#else
+# ifndef SYS_futex
+#  define SYS_futex    240
+# endif
+
+# ifdef __PIC__
+
+static inline long
+sys_futex0 (int *addr, int op, int val)
+{
+  long res;
+
+  __asm volatile ("xchgl\t%%ebx, %2\n\t"
+                 "int\t$0x80\n\t"
+                 "xchgl\t%%ebx, %2"
+                 : "=a" (res)
+                 : "0"(SYS_futex), "r" (addr), "c"(op),
+                   "d"(val), "S"(0)
+                 : "memory");
+  return res;
+}
+
+# else
+
+static inline long
+sys_futex0 (int *addr, int op, int val)
+{
+  long res;
+
+  __asm volatile ("int $0x80"
+                 : "=a" (res)
+                 : "0"(SYS_futex), "b" (addr), "c"(op),
+                   "d"(val), "S"(0)
+                 : "memory");
+  return res;
+}
+
+# endif /* __PIC__ */
+
+static inline void
+futex_wait (int *addr, int val)
+{
+  long res = sys_futex0 (addr, gomp_futex_wait, val);
+  if (__builtin_expect (res == -ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wait, val);
+    }
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+  long res = sys_futex0 (addr, gomp_futex_wake, count);
+  if (__builtin_expect (res == -ENOSYS, 0))
+    {
+      gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
+      gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
+      sys_futex0 (addr, gomp_futex_wake, count);
+    }
+}
+
+#endif /* __x86_64__ */
+
+static inline void
+cpu_relax (void)
+{
+  __asm volatile ("rep; nop" : : : "memory");
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/mingw32/proc.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/mingw32/proc.c
new file mode 100644 (file)
index 0000000..03d101a
--- /dev/null
@@ -0,0 +1,80 @@
+/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Contributed by Danny Smith <dannysmith@users.sourceforge.net>
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains system specific routines related to counting
+   online processors and dynamic load balancing.  It is expected that
+   a system may well want to write special versions of each of these.
+
+   The following implementation uses win32 API routines.  */
+
+#include "libgomp.h"
+#include <windows.h>
+
+/* Count the CPU's currently available to this process.  */
+static unsigned int
+count_avail_process_cpus ()
+{
+  DWORD_PTR process_cpus;
+  DWORD_PTR system_cpus;
+
+  if (GetProcessAffinityMask (GetCurrentProcess (),
+                             &process_cpus, &system_cpus))
+    {
+      unsigned int count;
+      for (count = 0; process_cpus != 0; process_cpus >>= 1)  
+       if (process_cpus & 1)
+         count++;
+      return count;
+    }
+  return 1;
+}
+
+/* At startup, determine the default number of threads.  It would seem
+   this should be related to the number of cpus available to the process.  */
+
+void
+gomp_init_num_threads (void)
+{
+  gomp_global_icv.nthreads_var = count_avail_process_cpus ();
+}
+
+/* When OMP_DYNAMIC is set, at thread launch determine the number of
+   threads we should spawn for this team.  FIXME:  How do we adjust for
+   load average on MS Windows?  */
+
+unsigned
+gomp_dynamic_max_threads (void)
+{
+  unsigned int n_onln = count_avail_process_cpus ();
+  unsigned int nthreads_var = gomp_icv (false)->nthreads_var;
+  return n_onln > nthreads_var ? nthreads_var : n_onln;
+}
+
+int
+omp_get_num_procs (void)
+{
+  return count_avail_process_cpus ();
+}
+
+ialias (omp_get_num_procs)
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/mingw32/time.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/mingw32/time.c
new file mode 100644 (file)
index 0000000..a898155
--- /dev/null
@@ -0,0 +1,46 @@
+/* Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+   Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains timer routines for mingw32.  */
+
+#include "libgomp.h"
+#include <unistd.h>
+#include <sys/timeb.h>
+
+double
+omp_get_wtime (void)
+{
+  struct _timeb timebuf;
+  _ftime (&timebuf);
+  return (timebuf.time + (long)(timebuf.millitm) / 1e3);
+}
+
+double
+omp_get_wtick (void)
+{
+  return 1e-3;
+}
+
+ialias (omp_get_wtime)
+ialias (omp_get_wtick)
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/osf/sem.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/osf/sem.h
new file mode 100644 (file)
index 0000000..7dcb542
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a variant of config/posix/sem.h for Tru64 UNIX.  The librt
+   sem_init implementation assumes int (4-byte) alignment for sem_t, while
+   the type only requires short (2-byte) alignment.  This mismatch causes
+   lots of unaligned access warnings from the kernel, so enforce that
+   alignment.  */
+
+#ifndef GOMP_SEM_H
+#define GOMP_SEM_H 1
+
+#include <semaphore.h>
+
+typedef sem_t gomp_sem_t __attribute__((aligned (__alignof__ (int))));
+
+static inline void gomp_sem_init (gomp_sem_t *sem, int value)
+{
+  sem_init (sem, 0, value);
+}
+
+extern void gomp_sem_wait (gomp_sem_t *sem);
+
+static inline void gomp_sem_post (gomp_sem_t *sem)
+{
+  sem_post (sem);
+}
+
+static inline void gomp_sem_destroy (gomp_sem_t *sem)
+{
+  sem_destroy (sem);
+}
+#endif /* GOMP_SEM_H  */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/affinity.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/affinity.c
new file mode 100644 (file)
index 0000000..25865fc
--- /dev/null
@@ -0,0 +1,38 @@
+/* Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a generic stub implementation of a CPU affinity setting.  */
+
+#include "libgomp.h"
+
+void
+gomp_init_affinity (void)
+{
+}
+
+void
+gomp_init_thread_affinity (pthread_attr_t *attr)
+{
+  (void) attr;
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/bar.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/bar.c
new file mode 100644 (file)
index 0000000..0101d1f
--- /dev/null
@@ -0,0 +1,178 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is the default implementation of a barrier synchronization mechanism
+   for libgomp.  This type is private to the library.  Note that we rely on
+   being able to adjust the barrier count while threads are blocked, so the
+   POSIX pthread_barrier_t won't work.  */
+
+#include "libgomp.h"
+
+
+void
+gomp_barrier_init (gomp_barrier_t *bar, unsigned count)
+{
+  gomp_mutex_init (&bar->mutex1);
+#ifndef HAVE_SYNC_BUILTINS
+  gomp_mutex_init (&bar->mutex2);
+#endif
+  gomp_sem_init (&bar->sem1, 0);
+  gomp_sem_init (&bar->sem2, 0);
+  bar->total = count;
+  bar->arrived = 0;
+  bar->generation = 0;
+}
+
+void
+gomp_barrier_destroy (gomp_barrier_t *bar)
+{
+  /* Before destroying, make sure all threads have left the barrier.  */
+  gomp_mutex_lock (&bar->mutex1);
+  gomp_mutex_unlock (&bar->mutex1);
+
+  gomp_mutex_destroy (&bar->mutex1);
+#ifndef HAVE_SYNC_BUILTINS
+  gomp_mutex_destroy (&bar->mutex2);
+#endif
+  gomp_sem_destroy (&bar->sem1);
+  gomp_sem_destroy (&bar->sem2);
+}
+
+void
+gomp_barrier_reinit (gomp_barrier_t *bar, unsigned count)
+{
+  gomp_mutex_lock (&bar->mutex1);
+  bar->total = count;
+  gomp_mutex_unlock (&bar->mutex1);
+}
+
+void
+gomp_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t state)
+{
+  unsigned int n;
+
+  if (state & 1)
+    {
+      n = --bar->arrived;
+      if (n > 0)
+       {
+         do
+           gomp_sem_post (&bar->sem1);
+         while (--n != 0);
+         gomp_sem_wait (&bar->sem2);
+       }
+      gomp_mutex_unlock (&bar->mutex1);
+    }
+  else
+    {
+      gomp_mutex_unlock (&bar->mutex1);
+      gomp_sem_wait (&bar->sem1);
+
+#ifdef HAVE_SYNC_BUILTINS
+      n = __sync_add_and_fetch (&bar->arrived, -1);
+#else
+      gomp_mutex_lock (&bar->mutex2);
+      n = --bar->arrived;
+      gomp_mutex_unlock (&bar->mutex2);
+#endif
+
+      if (n == 0)
+       gomp_sem_post (&bar->sem2);
+    }
+}
+
+void
+gomp_barrier_wait (gomp_barrier_t *barrier)
+{
+  gomp_barrier_wait_end (barrier, gomp_barrier_wait_start (barrier));
+}
+
+void
+gomp_team_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t state)
+{
+  unsigned int n;
+
+  if (state & 1)
+    {
+      n = --bar->arrived;
+      struct gomp_thread *thr = gomp_thread ();
+      struct gomp_team *team = thr->ts.team;
+
+      if (team->task_count)
+       {
+         gomp_barrier_handle_tasks (state);
+         if (n > 0)
+           gomp_sem_wait (&bar->sem2);
+         gomp_mutex_unlock (&bar->mutex1);
+         return;
+       }
+
+      bar->generation = state + 3;
+      if (n > 0)
+       {
+         do
+           gomp_sem_post (&bar->sem1);
+         while (--n != 0);
+         gomp_sem_wait (&bar->sem2);
+       }
+      gomp_mutex_unlock (&bar->mutex1);
+    }
+  else
+    {
+      gomp_mutex_unlock (&bar->mutex1);
+      do
+       {
+         gomp_sem_wait (&bar->sem1);
+         if (bar->generation & 1)
+           gomp_barrier_handle_tasks (state);
+       }
+      while (bar->generation != state + 4);
+
+#ifdef HAVE_SYNC_BUILTINS
+      n = __sync_add_and_fetch (&bar->arrived, -1);
+#else
+      gomp_mutex_lock (&bar->mutex2);
+      n = --bar->arrived;
+      gomp_mutex_unlock (&bar->mutex2);
+#endif
+
+      if (n == 0)
+       gomp_sem_post (&bar->sem2);
+    }
+}
+
+void
+gomp_team_barrier_wait (gomp_barrier_t *barrier)
+{
+  gomp_team_barrier_wait_end (barrier, gomp_barrier_wait_start (barrier));
+}
+
+void
+gomp_team_barrier_wake (gomp_barrier_t *bar, int count)
+{
+  if (count == 0)
+    count = bar->total - 1;
+  while (count-- > 0)
+    gomp_sem_post (&bar->sem1);
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/bar.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/bar.h
new file mode 100644 (file)
index 0000000..ac8ae6f
--- /dev/null
@@ -0,0 +1,115 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is the default implementation of a barrier synchronization mechanism
+   for libgomp.  This type is private to the library.  Note that we rely on
+   being able to adjust the barrier count while threads are blocked, so the
+   POSIX pthread_barrier_t won't work.  */
+
+#ifndef GOMP_BARRIER_H
+#define GOMP_BARRIER_H 1
+
+#include <pthread.h>
+
+typedef struct
+{
+  gomp_mutex_t mutex1;
+#ifndef HAVE_SYNC_BUILTINS
+  gomp_mutex_t mutex2;
+#endif
+  gomp_sem_t sem1;
+  gomp_sem_t sem2;
+  unsigned total;
+  unsigned arrived;
+  unsigned generation;
+} gomp_barrier_t;
+typedef unsigned int gomp_barrier_state_t;
+
+extern void gomp_barrier_init (gomp_barrier_t *, unsigned);
+extern void gomp_barrier_reinit (gomp_barrier_t *, unsigned);
+extern void gomp_barrier_destroy (gomp_barrier_t *);
+
+extern void gomp_barrier_wait (gomp_barrier_t *);
+extern void gomp_barrier_wait_end (gomp_barrier_t *, gomp_barrier_state_t);
+extern void gomp_team_barrier_wait (gomp_barrier_t *);
+extern void gomp_team_barrier_wait_end (gomp_barrier_t *,
+                                       gomp_barrier_state_t);
+extern void gomp_team_barrier_wake (gomp_barrier_t *, int);
+
+static inline gomp_barrier_state_t
+gomp_barrier_wait_start (gomp_barrier_t *bar)
+{
+  unsigned int ret;
+  gomp_mutex_lock (&bar->mutex1);
+  ret = bar->generation & ~3;
+  ret += ++bar->arrived == bar->total;
+  return ret;
+}
+
+static inline bool
+gomp_barrier_last_thread (gomp_barrier_state_t state)
+{
+  return state & 1;
+}
+
+static inline void
+gomp_barrier_wait_last (gomp_barrier_t *bar)
+{
+  gomp_barrier_wait (bar);
+}
+
+/* All the inlines below must be called with team->task_lock
+   held.  */
+
+static inline void
+gomp_team_barrier_set_task_pending (gomp_barrier_t *bar)
+{
+  bar->generation |= 1;
+}
+
+static inline void
+gomp_team_barrier_clear_task_pending (gomp_barrier_t *bar)
+{
+  bar->generation &= ~1;
+}
+
+static inline void
+gomp_team_barrier_set_waiting_for_tasks (gomp_barrier_t *bar)
+{
+  bar->generation |= 2;
+}
+
+static inline bool
+gomp_team_barrier_waiting_for_tasks (gomp_barrier_t *bar)
+{
+  return (bar->generation & 2) != 0;
+}
+
+static inline void
+gomp_team_barrier_done (gomp_barrier_t *bar, gomp_barrier_state_t state)
+{
+  bar->generation = (state & ~3) + 4;
+}
+
+#endif /* GOMP_BARRIER_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/lock.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/lock.c
new file mode 100644 (file)
index 0000000..8cd715e
--- /dev/null
@@ -0,0 +1,307 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is the default PTHREADS implementation of the public OpenMP
+   locking primitives.
+
+   Because OpenMP uses different entry points for normal and recursive
+   locks, and pthreads uses only one entry point, a system may be able
+   to do better and streamline the locking as well as reduce the size
+   of the types exported.  */
+
+/* We need Unix98 extensions to get recursive locks.  On Tru64 UNIX V4.0F,
+   the declarations are available without _XOPEN_SOURCE, which actually
+   breaks compilation.  */
+#ifndef __osf__
+#define _XOPEN_SOURCE 500
+#endif
+
+#include "libgomp.h"
+
+#ifdef HAVE_BROKEN_POSIX_SEMAPHORES
+void
+gomp_init_lock_30 (omp_lock_t *lock)
+{
+  pthread_mutex_init (lock, NULL);
+}
+
+void
+gomp_destroy_lock_30 (omp_lock_t *lock)
+{
+  pthread_mutex_destroy (lock);
+}
+
+void
+gomp_set_lock_30 (omp_lock_t *lock)
+{
+  pthread_mutex_lock (lock);
+}
+
+void
+gomp_unset_lock_30 (omp_lock_t *lock)
+{
+  pthread_mutex_unlock (lock);
+}
+
+int
+gomp_test_lock_30 (omp_lock_t *lock)
+{
+  return pthread_mutex_trylock (lock) == 0;
+}
+
+void
+gomp_init_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  pthread_mutex_init (&lock->lock, NULL);
+  lock->count = 0;
+  lock->owner = NULL;
+}
+
+void
+gomp_destroy_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  pthread_mutex_destroy (&lock->lock);
+}
+
+void
+gomp_set_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  void *me = gomp_icv (true);
+
+  if (lock->owner != me)
+    {
+      pthread_mutex_lock (&lock->lock);
+      lock->owner = me;
+    }
+  lock->count++;
+}
+
+void
+gomp_unset_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  if (--lock->count == 0)
+    {
+      lock->owner = NULL;
+      pthread_mutex_unlock (&lock->lock);
+    }
+}
+
+int
+gomp_test_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  void *me = gomp_icv (true);
+
+  if (lock->owner != me)
+    {
+      if (pthread_mutex_trylock (&lock->lock) != 0)
+       return 0;
+      lock->owner = me;
+    }
+
+  return ++lock->count;
+}
+
+#else
+
+void
+gomp_init_lock_30 (omp_lock_t *lock)
+{
+  sem_init (lock, 0, 1);
+}
+
+void
+gomp_destroy_lock_30 (omp_lock_t *lock)
+{
+  sem_destroy (lock);
+}
+
+void
+gomp_set_lock_30 (omp_lock_t *lock)
+{
+  while (sem_wait (lock) != 0)
+    ;
+}
+
+void
+gomp_unset_lock_30 (omp_lock_t *lock)
+{
+  sem_post (lock);
+}
+
+int
+gomp_test_lock_30 (omp_lock_t *lock)
+{
+  return sem_trywait (lock) == 0;
+}
+
+void
+gomp_init_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  sem_init (&lock->lock, 0, 1);
+  lock->count = 0;
+  lock->owner = NULL;
+}
+
+void
+gomp_destroy_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  sem_destroy (&lock->lock);
+}
+
+void
+gomp_set_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  void *me = gomp_icv (true);
+
+  if (lock->owner != me)
+    {
+      while (sem_wait (&lock->lock) != 0)
+       ;
+      lock->owner = me;
+    }
+  lock->count++;
+}
+
+void
+gomp_unset_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  if (--lock->count == 0)
+    {
+      lock->owner = NULL;
+      sem_post (&lock->lock);
+    }
+}
+
+int
+gomp_test_nest_lock_30 (omp_nest_lock_t *lock)
+{
+  void *me = gomp_icv (true);
+
+  if (lock->owner != me)
+    {
+      if (sem_trywait (&lock->lock) != 0)
+       return 0;
+      lock->owner = me;
+    }
+
+  return ++lock->count;
+}
+#endif
+
+#ifdef LIBGOMP_GNU_SYMBOL_VERSIONING
+void
+gomp_init_lock_25 (omp_lock_25_t *lock)
+{
+  pthread_mutex_init (lock, NULL);
+}
+
+void
+gomp_destroy_lock_25 (omp_lock_25_t *lock)
+{
+  pthread_mutex_destroy (lock);
+}
+
+void
+gomp_set_lock_25 (omp_lock_25_t *lock)
+{
+  pthread_mutex_lock (lock);
+}
+
+void
+gomp_unset_lock_25 (omp_lock_25_t *lock)
+{
+  pthread_mutex_unlock (lock);
+}
+
+int
+gomp_test_lock_25 (omp_lock_25_t *lock)
+{
+  return pthread_mutex_trylock (lock) == 0;
+}
+
+void
+gomp_init_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+  pthread_mutexattr_t attr;
+
+  pthread_mutexattr_init (&attr);
+  pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
+  pthread_mutex_init (&lock->lock, &attr);
+  lock->count = 0;
+  pthread_mutexattr_destroy (&attr);
+}
+
+void
+gomp_destroy_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+  pthread_mutex_destroy (&lock->lock);
+}
+
+void
+gomp_set_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+  pthread_mutex_lock (&lock->lock);
+  lock->count++;
+}
+
+void
+gomp_unset_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+  lock->count--;
+  pthread_mutex_unlock (&lock->lock);
+}
+
+int
+gomp_test_nest_lock_25 (omp_nest_lock_25_t *lock)
+{
+  if (pthread_mutex_trylock (&lock->lock) == 0)
+    return ++lock->count;
+  return 0;
+}
+
+omp_lock_symver (omp_init_lock)
+omp_lock_symver (omp_destroy_lock)
+omp_lock_symver (omp_set_lock)
+omp_lock_symver (omp_unset_lock)
+omp_lock_symver (omp_test_lock)
+omp_lock_symver (omp_init_nest_lock)
+omp_lock_symver (omp_destroy_nest_lock)
+omp_lock_symver (omp_set_nest_lock)
+omp_lock_symver (omp_unset_nest_lock)
+omp_lock_symver (omp_test_nest_lock)
+
+#else
+
+ialias (omp_init_lock)
+ialias (omp_init_nest_lock)
+ialias (omp_destroy_lock)
+ialias (omp_destroy_nest_lock)
+ialias (omp_set_lock)
+ialias (omp_set_nest_lock)
+ialias (omp_unset_lock)
+ialias (omp_unset_nest_lock)
+ialias (omp_test_lock)
+ialias (omp_test_nest_lock)
+
+#endif
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/mutex.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/mutex.c
new file mode 100644 (file)
index 0000000..39bb64d
--- /dev/null
@@ -0,0 +1 @@
+/* Everything is in the header.  */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/mutex.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/mutex.h
new file mode 100644 (file)
index 0000000..b6617a4
--- /dev/null
@@ -0,0 +1,57 @@
+/* Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is the default PTHREADS implementation of a mutex synchronization
+   mechanism for libgomp.  This type is private to the library.  */
+
+#ifndef GOMP_MUTEX_H
+#define GOMP_MUTEX_H 1
+
+#include <pthread.h>
+
+typedef pthread_mutex_t gomp_mutex_t;
+
+#define GOMP_MUTEX_INIT_0 0
+
+static inline void gomp_mutex_init (gomp_mutex_t *mutex)
+{
+  pthread_mutex_init (mutex, NULL);
+}
+
+static inline void gomp_mutex_lock (gomp_mutex_t *mutex)
+{
+  pthread_mutex_lock (mutex);
+}
+
+static inline void gomp_mutex_unlock (gomp_mutex_t *mutex)
+{
+   pthread_mutex_unlock (mutex);
+}
+
+static inline void gomp_mutex_destroy (gomp_mutex_t *mutex)
+{
+  pthread_mutex_destroy (mutex);
+}
+
+#endif /* GOMP_MUTEX_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/omp-lock.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/omp-lock.h
new file mode 100644 (file)
index 0000000..e51dc27
--- /dev/null
@@ -0,0 +1,23 @@
+/* This header is used during the build process to find the size and 
+   alignment of the public OpenMP locks, so that we can export data
+   structures without polluting the namespace.
+
+   In this default POSIX implementation, we used to map the two locks to the
+   same PTHREADS primitive, but for OpenMP 3.0 sem_t needs to be used
+   instead, as pthread_mutex_unlock should not be called by different
+   thread than the one that called pthread_mutex_lock.  */
+
+#include <pthread.h>
+#include <semaphore.h>
+
+typedef pthread_mutex_t omp_lock_25_t;
+typedef struct { pthread_mutex_t lock; int count; } omp_nest_lock_25_t;
+#ifdef HAVE_BROKEN_POSIX_SEMAPHORES
+/* If we don't have working semaphores, we'll make all explicit tasks
+   tied to the creating thread.  */
+typedef pthread_mutex_t omp_lock_t;
+typedef struct { pthread_mutex_t lock; int count; void *owner; } omp_nest_lock_t;
+#else
+typedef sem_t omp_lock_t;
+typedef struct { sem_t lock; int count; void *owner; } omp_nest_lock_t;
+#endif
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/proc.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/proc.c
new file mode 100644 (file)
index 0000000..aacf41e
--- /dev/null
@@ -0,0 +1,101 @@
+/* Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains system specific routines related to counting
+   online processors and dynamic load balancing.  It is expected that
+   a system may well want to write special versions of each of these.
+
+   The following implementation uses a mix of POSIX and BSD routines.  */
+
+#include "libgomp.h"
+#include <unistd.h>
+#include <stdlib.h>
+#ifdef HAVE_GETLOADAVG
+# ifdef HAVE_SYS_LOADAVG_H
+#  include <sys/loadavg.h>
+# endif
+#endif
+
+
+/* At startup, determine the default number of threads.  It would seem
+   this should be related to the number of cpus online.  */
+
+void
+gomp_init_num_threads (void)
+{
+#ifdef _SC_NPROCESSORS_ONLN
+  gomp_global_icv.nthreads_var = sysconf (_SC_NPROCESSORS_ONLN);
+#endif
+}
+
+/* When OMP_DYNAMIC is set, at thread launch determine the number of
+   threads we should spawn for this team.  */
+/* ??? I have no idea what best practice for this is.  Surely some
+   function of the number of processors that are *still* online and
+   the load average.  Here I use the number of processors online
+   minus the 15 minute load average.  */
+
+unsigned
+gomp_dynamic_max_threads (void)
+{
+  unsigned n_onln, loadavg;
+  unsigned nthreads_var = gomp_icv (false)->nthreads_var;
+
+#ifdef _SC_NPROCESSORS_ONLN
+  n_onln = sysconf (_SC_NPROCESSORS_ONLN);
+  if (n_onln > nthreads_var)
+    n_onln = nthreads_var;
+#else
+  n_onln = nthreads_var;
+#endif
+
+  loadavg = 0;
+#ifdef HAVE_GETLOADAVG
+  {
+    double dloadavg[3];
+    if (getloadavg (dloadavg, 3) == 3)
+      {
+       /* Add 0.1 to get a kind of biased rounding.  */
+       loadavg = dloadavg[2] + 0.1;
+      }
+  }
+#endif
+
+  if (loadavg >= n_onln)
+    return 1;
+  else
+    return n_onln - loadavg;
+}
+
+int
+omp_get_num_procs (void)
+{
+#ifdef _SC_NPROCESSORS_ONLN
+  return sysconf (_SC_NPROCESSORS_ONLN);
+#else
+  return gomp_icv (false)->nthreads_var;
+#endif
+}
+
+ialias (omp_get_num_procs)
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/ptrlock.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/ptrlock.c
new file mode 100644 (file)
index 0000000..39bb64d
--- /dev/null
@@ -0,0 +1 @@
+/* Everything is in the header.  */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/ptrlock.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/ptrlock.h
new file mode 100644 (file)
index 0000000..246e1ca
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Linux specific implementation of a mutex synchronization
+   mechanism for libgomp.  This type is private to the library.  This
+   implementation uses atomic instructions and the futex syscall.  */
+
+#ifndef GOMP_PTRLOCK_H
+#define GOMP_PTRLOCK_H 1
+
+typedef struct { void *ptr; gomp_mutex_t lock; } gomp_ptrlock_t;
+
+static inline void gomp_ptrlock_init (gomp_ptrlock_t *ptrlock, void *ptr)
+{
+  ptrlock->ptr = ptr;
+  gomp_mutex_init (&ptrlock->lock);
+}
+
+static inline void *gomp_ptrlock_get (gomp_ptrlock_t *ptrlock)
+{
+  if (ptrlock->ptr != NULL)
+    return ptrlock->ptr;
+
+  gomp_mutex_lock (&ptrlock->lock);
+  if (ptrlock->ptr != NULL)
+    {
+      gomp_mutex_unlock (&ptrlock->lock);
+      return ptrlock->ptr;
+    }
+
+  return NULL;
+}
+
+static inline void gomp_ptrlock_set (gomp_ptrlock_t *ptrlock, void *ptr)
+{
+  ptrlock->ptr = ptr;
+  gomp_mutex_unlock (&ptrlock->lock);
+}
+
+static inline void gomp_ptrlock_destroy (gomp_ptrlock_t *ptrlock)
+{
+  gomp_mutex_destroy (&ptrlock->lock);
+}
+
+#endif /* GOMP_PTRLOCK_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/sem.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/sem.c
new file mode 100644 (file)
index 0000000..e057675
--- /dev/null
@@ -0,0 +1,123 @@
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is the default POSIX 1003.1b implementation of a semaphore
+   synchronization mechanism for libgomp.  This type is private to
+   the library.
+
+   This is a bit heavy weight for what we need, in that we're not
+   interested in sem_wait as a cancelation point, but it's not too
+   bad for a default.  */
+
+#include "libgomp.h"
+
+#ifdef HAVE_BROKEN_POSIX_SEMAPHORES
+#include <stdlib.h>
+
+void gomp_sem_init (gomp_sem_t *sem, int value)
+{
+  int ret;
+
+  ret = pthread_mutex_init (&sem->mutex, NULL);
+  if (ret)
+    return;
+
+  ret = pthread_cond_init (&sem->cond, NULL);
+  if (ret)
+    return;
+
+  sem->value = value;
+}
+
+void gomp_sem_wait (gomp_sem_t *sem)
+{
+  int ret;
+
+  ret = pthread_mutex_lock (&sem->mutex);
+  if (ret)
+    return;
+
+  if (sem->value > 0)
+    {
+      sem->value--;
+      ret = pthread_mutex_unlock (&sem->mutex);
+      return;
+    }
+
+  while (sem->value <= 0)
+    {
+      ret = pthread_cond_wait (&sem->cond, &sem->mutex);
+      if (ret)
+       {
+         pthread_mutex_unlock (&sem->mutex);
+         return;
+       }
+    }
+
+  sem->value--;
+  ret = pthread_mutex_unlock (&sem->mutex);
+  return;
+}
+
+void gomp_sem_post (gomp_sem_t *sem)
+{
+  int ret;
+
+  ret = pthread_mutex_lock (&sem->mutex);
+  if (ret)
+    return;
+
+  sem->value++;
+
+  ret = pthread_mutex_unlock (&sem->mutex);
+  if (ret)
+    return;
+
+  ret = pthread_cond_signal (&sem->cond);
+
+  return;
+}
+
+void gomp_sem_destroy (gomp_sem_t *sem)
+{
+  int ret;
+
+  ret = pthread_mutex_destroy (&sem->mutex);
+  if (ret)
+    return;
+
+  ret = pthread_cond_destroy (&sem->cond);
+
+  return;
+}
+#else /* HAVE_BROKEN_POSIX_SEMAPHORES  */
+void
+gomp_sem_wait (gomp_sem_t *sem)
+{
+  /* With POSIX, the wait can be canceled by signals.  We don't want that.
+     It is expected that the return value here is -1 and errno is EINTR.  */
+  while (sem_wait (sem) != 0)
+    continue;
+}
+#endif
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/sem.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/sem.h
new file mode 100644 (file)
index 0000000..b68230d
--- /dev/null
@@ -0,0 +1,87 @@
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is the default POSIX 1003.1b implementation of a semaphore
+   synchronization mechanism for libgomp.  This type is private to
+   the library.
+
+   This is a bit heavy weight for what we need, in that we're not
+   interested in sem_wait as a cancelation point, but it's not too
+   bad for a default.  */
+
+#ifndef GOMP_SEM_H
+#define GOMP_SEM_H 1
+
+#ifdef HAVE_ATTRIBUTE_VISIBILITY
+# pragma GCC visibility push(default)
+#endif
+
+#include <semaphore.h>
+
+#ifdef HAVE_ATTRIBUTE_VISIBILITY
+# pragma GCC visibility pop
+#endif
+
+#ifdef HAVE_BROKEN_POSIX_SEMAPHORES
+#include <pthread.h>
+
+struct gomp_sem
+{
+  pthread_mutex_t      mutex;
+  pthread_cond_t       cond;
+  int                  value;
+};
+
+typedef struct gomp_sem gomp_sem_t;
+
+extern void gomp_sem_init (gomp_sem_t *sem, int value);
+
+extern void gomp_sem_wait (gomp_sem_t *sem);
+
+extern void gomp_sem_post (gomp_sem_t *sem);
+
+extern void gomp_sem_destroy (gomp_sem_t *sem);
+
+#else /* HAVE_BROKEN_POSIX_SEMAPHORES  */
+
+typedef sem_t gomp_sem_t;
+
+static inline void gomp_sem_init (gomp_sem_t *sem, int value)
+{
+  sem_init (sem, 0, value);
+}
+
+extern void gomp_sem_wait (gomp_sem_t *sem);
+
+static inline void gomp_sem_post (gomp_sem_t *sem)
+{
+  sem_post (sem);
+}
+
+static inline void gomp_sem_destroy (gomp_sem_t *sem)
+{
+  sem_destroy (sem);
+}
+#endif /* doesn't HAVE_BROKEN_POSIX_SEMAPHORES  */
+#endif /* GOMP_SEM_H  */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/time.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/config/posix/time.c
new file mode 100644 (file)
index 0000000..eb196f6
--- /dev/null
@@ -0,0 +1,78 @@
+/* Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains system specific timer routines.  It is expected that
+   a system may well want to write special versions of each of these.
+
+   The following implementation uses the most simple POSIX routines.
+   If present, POSIX 4 clocks should be used instead.  */
+
+#include "libgomp.h"
+#include <unistd.h>
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
+
+double
+omp_get_wtime (void)
+{
+#ifdef HAVE_CLOCK_GETTIME
+  struct timespec ts;
+# ifdef CLOCK_MONOTONIC
+  if (clock_gettime (CLOCK_MONOTONIC, &ts) < 0)
+# endif
+    clock_gettime (CLOCK_REALTIME, &ts);
+  return ts.tv_sec + ts.tv_nsec / 1e9;
+#else
+  struct timeval tv;
+  gettimeofday (&tv, NULL);
+  return tv.tv_sec + tv.tv_usec / 1e6;
+#endif
+}
+
+double
+omp_get_wtick (void)
+{
+#ifdef HAVE_CLOCK_GETTIME
+  struct timespec ts;
+# ifdef CLOCK_MONOTONIC
+  if (clock_getres (CLOCK_MONOTONIC, &ts) < 0)
+# endif
+    clock_getres (CLOCK_REALTIME, &ts);
+  return ts.tv_sec + ts.tv_nsec / 1e9;
+#else
+  return 1.0 / sysconf(_SC_CLK_TCK);
+#endif
+}
+
+ialias (omp_get_wtime)
+ialias (omp_get_wtick)
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/configure b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/configure
new file mode 100755 (executable)
index 0000000..8ed841a
--- /dev/null
@@ -0,0 +1,19304 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.64 for GNU OpenMP Runtime Library 1.0.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+# Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='GNU OpenMP Runtime Library'
+PACKAGE_TARNAME='libgomp'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='GNU OpenMP Runtime Library 1.0'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL='http://www.gnu.org/software/libgomp/'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+OMP_NEST_LOCK_25_KIND
+OMP_LOCK_25_KIND
+OMP_NEST_LOCK_25_ALIGN
+OMP_NEST_LOCK_25_SIZE
+OMP_LOCK_25_ALIGN
+OMP_LOCK_25_SIZE
+OMP_NEST_LOCK_KIND
+OMP_LOCK_KIND
+OMP_NEST_LOCK_ALIGN
+OMP_NEST_LOCK_SIZE
+OMP_LOCK_ALIGN
+OMP_LOCK_SIZE
+USE_FORTRAN_FALSE
+USE_FORTRAN_TRUE
+link_gomp
+XLDFLAGS
+XCFLAGS
+config_path
+LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE
+LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE
+LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_FALSE
+LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE
+LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE
+LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE
+OPT_LDFLAGS
+SECTION_LDFLAGS
+libtool_VERSION
+ac_ct_FC
+FCFLAGS
+FC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+enable_static
+enable_shared
+lt_host_flags
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+LIBTOOL
+BUILD_INFO_FALSE
+BUILD_INFO_TRUE
+PERL
+RANLIB
+AR
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+toolexeclibdir
+toolexecdir
+multi_basedir
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+GENINSRC_FALSE
+GENINSRC_TRUE
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_version_specific_runtime_libs
+enable_generated_files_in_srcdir
+enable_multilib
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+enable_maintainer_mode
+enable_linux_futex
+enable_tls
+enable_symvers
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CPP
+CPPFLAGS
+FC
+FCFLAGS
+LDFLAGS
+LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures GNU OpenMP Runtime Library 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/libgomp]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of GNU OpenMP Runtime Library 1.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-version-specific-runtime-libs
+                          Specify that runtime libraries should be installed
+                          in a compiler-specific directory [default=no]
+  --enable-generated-files-in-srcdir
+                          put copies of generated files in source dir intended
+                          for creating source tarballs for users without
+                          texinfo bison or flex. [default=no]
+  --enable-multilib       build many library versions (default)
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-maintainer-mode  enable make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer
+  --enable-linux-futex    use the Linux futex system call [default=default]
+  --enable-tls            Use thread-local storage [default=yes]
+  --enable-symvers=STYLE  enables symbol versioning of the shared library
+                          [default=yes]
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  FC          Fortran compiler command
+  FCFLAGS     Fortran compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+GNU OpenMP Runtime Library home page: <http://www.gnu.org/software/libgomp/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+GNU OpenMP Runtime Library configure 1.0
+generated by GNU Autoconf 2.64
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+
+# ac_fn_fc_try_compile LINENO
+# ---------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_fc_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_fc_try_compile
+
+# ac_fn_fc_try_link LINENO
+# ------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_fc_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_fc_try_link
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+        return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+           return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if test "$cross_compiling" = yes; then
+    # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid; break
+else
+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=$ac_mid; break
+else
+  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid
+else
+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (($2) < 0)
+    {
+      long int i = longval ();
+      if (i != ($2))
+       return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ($2))
+       return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+  ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+  fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_compute_int
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by GNU OpenMP Runtime Library $as_me 1.0, which was
+generated by GNU Autoconf 2.64.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+# -------
+# Options
+# -------
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-version-specific-runtime-libs" >&5
+$as_echo_n "checking for --enable-version-specific-runtime-libs... " >&6; }
+ # Check whether --enable-version-specific-runtime-libs was given.
+if test "${enable_version_specific_runtime_libs+set}" = set; then :
+  enableval=$enable_version_specific_runtime_libs;
+      case "$enableval" in
+       yes|no) ;;
+       *) as_fn_error "Unknown argument to enable/disable version-specific-runtime-libs" "$LINENO" 5 ;;
+                          esac
+
+else
+  enable_version_specific_runtime_libs=no
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_version_specific_runtime_libs" >&5
+$as_echo "$enable_version_specific_runtime_libs" >&6; }
+
+# We would like our source tree to be readonly. However when releases or
+# pre-releases are generated, the flex/bison generated files as well as the
+# various formats of manuals need to be included along with the rest of the
+# sources.  Therefore we have --enable-generated-files-in-srcdir to do
+# just that.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-generated-files-in-srcdir" >&5
+$as_echo_n "checking for --enable-generated-files-in-srcdir... " >&6; }
+ # Check whether --enable-generated-files-in-srcdir was given.
+if test "${enable_generated_files_in_srcdir+set}" = set; then :
+  enableval=$enable_generated_files_in_srcdir;
+      case "$enableval" in
+       yes|no) ;;
+       *) as_fn_error "Unknown argument to enable/disable generated-files-in-srcdir" "$LINENO" 5 ;;
+                          esac
+
+else
+  enable_generated_files_in_srcdir=no
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_generated_files_in_srcdir" >&5
+$as_echo "$enable_generated_files_in_srcdir" >&6; }
+ if test "$enable_generated_files_in_srcdir" = yes; then
+  GENINSRC_TRUE=
+  GENINSRC_FALSE='#'
+else
+  GENINSRC_TRUE='#'
+  GENINSRC_FALSE=
+fi
+
+
+
+# -------
+# -------
+
+# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
+#
+# You will slowly go insane if you do not grok the following fact:  when
+# building this library, the top-level /target/ becomes the library's /host/.
+#
+# configure then causes --target to default to --host, exactly like any
+# other package using autoconf.  Therefore, 'target' and 'host' will
+# always be the same.  This makes sense both for native and cross compilers
+# just think about it for a little while.  :-)
+#
+# Also, if this library is being configured as part of a cross compiler, the
+# top-level configure script will pass the "real" host as $with_cross_host.
+#
+# Do not delete or change the following two lines.  For why, see
+# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  for ac_t in install-sh install.sh shtool; do
+    if test -f "$ac_dir/$ac_t"; then
+      ac_aux_dir=$ac_dir
+      ac_install_sh="$ac_aux_dir/$ac_t -c"
+      break 2
+    fi
+  done
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+target_alias=${target_alias-$host_alias}
+
+# Sets up automake.  Must come after AC_CANONICAL_SYSTEM.  Each of the
+# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
+#  1.9.0:  minimum required version
+#  no-define:  PACKAGE and VERSION will not be #define'd in config.h (a bunch
+#              of other PACKAGE_* variables will, however, and there's nothing
+#              we can do about that; they come from AC_INIT).
+#  foreign:  we don't follow the normal rules for GNU packages (no COPYING
+#            file in the top srcdir, etc, etc), so stop complaining.
+#  no-dist:  we don't want 'dist' and related rules.
+#  -Wall:  turns on all automake warnings...
+#  -Wno-portability:  ...except this one, since GNU make is required.
+#  -Wno-override: ... and this one, since we do want this in testsuite.
+am__api_version='1.11'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      as_fn_error "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='libgomp'
+ VERSION='1.0'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+# Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+  enableval=$enable_multilib; case "$enableval" in
+  yes) multilib=yes ;;
+  no)  multilib=no ;;
+  *)   as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+  multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+  if test "$with_target_subdir" != "."; then
+    multi_basedir="$srcdir/$with_multisrctop../.."
+  else
+    multi_basedir="$srcdir/$with_multisrctop.."
+  fi
+else
+  multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+   && test "x${with_multisubdir}" != x ; then
+   cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${enable_version_specific_runtime_libs} in
+  yes)
+    # Need the gcc compiler version to know where to install libraries
+    # and header files if --enable-version-specific-runtime-libs option
+    # is selected.
+    toolexecdir='$(libdir)/gcc/$(target_alias)'
+    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+    ;;
+  no)
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      # Install a library built with a cross compiler in tooldir, not libdir.
+      toolexecdir='$(exec_prefix)/$(target_alias)'
+      toolexeclibdir='$(toolexecdir)/lib'
+    else
+      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+      toolexeclibdir='$(libdir)'
+    fi
+    multi_os_directory=`$CC -print-multi-os-directory`
+    case $multi_os_directory in
+      .) ;; # Avoid trailing /.
+      *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+    esac
+    ;;
+esac
+
+
+
+# Check the compiler.
+# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+# We must force CC to /not/ be precious variables; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    rm -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then :
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+fi
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+
+
+
+
+# In order to override CFLAGS_FOR_TARGET, all of our special flags go
+# in XCFLAGS.  But we need them in CFLAGS during configury.  So put them
+# in both places for now and restore CFLAGS at the end of config.
+save_CFLAGS="$CFLAGS"
+
+# Add -Wall -Werror if we are using GCC.
+if test "x$GCC" = "xyes"; then
+  XCFLAGS="$XCFLAGS -Wall -Werror"
+fi
+
+# Find other programs we need.
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB="ranlib-not-found-in-path-error"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PERL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PERL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="perl-not-found-in-path-error"
+  ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+
+# See if makeinfo has been installed and is modern enough
+# that we can use it.
+
+  # Extract the first word of "makeinfo", so it can be a program name with args.
+set dummy makeinfo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_MAKEINFO+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$MAKEINFO"; then
+  ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_MAKEINFO="makeinfo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+MAKEINFO=$ac_cv_prog_MAKEINFO
+if test -n "$MAKEINFO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINFO" >&5
+$as_echo "$MAKEINFO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  if test -n "$MAKEINFO"; then
+    # Found it, now check the version.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for modern makeinfo" >&5
+$as_echo_n "checking for modern makeinfo... " >&6; }
+if test "${gcc_cv_prog_makeinfo_modern+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_prog_version=`eval $MAKEINFO --version 2>&1 |
+                                     sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
+
+                    case $ac_prog_version in
+                      '')  gcc_cv_prog_makeinfo_modern=no;;
+                      4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*)  gcc_cv_prog_makeinfo_modern=yes;;
+                      *)   gcc_cv_prog_makeinfo_modern=no;;
+                    esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_makeinfo_modern" >&5
+$as_echo "$gcc_cv_prog_makeinfo_modern" >&6; }
+  else
+    gcc_cv_prog_makeinfo_modern=no
+  fi
+  if test $gcc_cv_prog_makeinfo_modern = no; then
+    MAKEINFO="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing makeinfo"
+  fi
+
+ if test $gcc_cv_prog_makeinfo_modern = "yes"; then
+  BUILD_INFO_TRUE=
+  BUILD_INFO_FALSE='#'
+else
+  BUILD_INFO_TRUE='#'
+  BUILD_INFO_FALSE=
+fi
+
+
+
+# Configure libtool
+case `pwd` in
+  *\ * | *\    *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.2.7a'
+macro_revision='1.3134'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_i386"
+           ;;
+         ppc64-*linux*|powerpc64-*linux*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         ppc*-*linux*|powerpc*-*linux*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+         LD="${LD-ld} -64"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+         lt_cv_apple_cc_single_mod=yes
+       else
+         cat conftest.err >&5
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if test "${lt_cv_ld_force_load+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+       lt_cv_ld_force_load=yes
+      else
+       cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[012]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+        enable_dlopen=no
+
+
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      lt_prog_compiler_pic='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      else
+       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='--shared'
+       lt_prog_compiler_static='--static'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fpic'
+       lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-qpic'
+       lt_prog_compiler_static='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ F* | *Sun*Fortran*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl=''
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # 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.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         whole_archive_flag_spec=
+         tmp_sharedflag='--shared' ;;
+       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+         hardcode_libdir_flag_spec=
+         hardcode_libdir_flag_spec_ld='-rpath $libdir'
+         archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+         if test "x$supports_anon_versioning" = xyes; then
+           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&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.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           ld_shlibs=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         hardcode_direct=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L=yes
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_libdir_separator=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag="-z nodefs"
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag=' ${wl}-bernotok'
+         allow_undefined_flag=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           whole_archive_flag_spec='$convenience'
+         fi
+         archive_cmds_need_lc=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_from_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec=''
+  fi
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_flag_spec_ld='+b $libdir'
+       hardcode_libdir_separator=:
+       hardcode_direct=yes
+       hardcode_direct_absolute=yes
+       export_dynamic_flag_spec='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if test "${lt_cv_prog_compiler__b+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       *)
+         hardcode_direct=yes
+         hardcode_direct_absolute=yes
+         export_dynamic_flag_spec='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo(void) {}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LDFLAGS="$save_LDFLAGS"
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+       hardcode_direct_absolute=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+         export_dynamic_flag_spec='${wl}-E'
+       else
+         case $host_os in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            hardcode_libdir_flag_spec='-R$libdir'
+            ;;
+          *)
+            archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds='$CC -r -o $output$reload_objs'
+         hardcode_direct=no
+        ;;
+       motorola)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       export_dynamic_flag_spec='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if test "${lt_cv_archive_cmds_need_lc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl
+         pic_flag=$lt_prog_compiler_pic
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag
+         allow_undefined_flag=
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+         then
+           lt_cv_archive_cmds_need_lc=no
+         else
+           lt_cv_archive_cmds_need_lc=yes
+         fi
+         allow_undefined_flag=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = x""yes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 11083 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 11189 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+
+case $host in
+  *-cygwin* | *-mingw*)
+    # 'host' will be top-level target in the case of a target lib,
+    # we must compare to with_cross_host to decide if this is a native
+    # or cross-compiler and select where to install dlls appropriately.
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      lt_host_flags='-no-undefined -bindir "$(toolexeclibdir)"';
+    else
+      lt_host_flags='-no-undefined -bindir "$(bindir)"';
+    fi
+    ;;
+  *)
+    lt_host_flags=
+    ;;
+esac
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+# Create a spec file, so that compile/link tests don't fail
+test -f libgfortran.spec || touch libgfortran.spec
+FCFLAGS="$FCFLAGS -L."
+
+# We need gfortran to compile parts of the library
+# We can't use AC_PROG_FC because it expects a fully working gfortran.
+#AC_PROG_FC(gfortran)
+case `echo $GFORTRAN` in
+  -* | no* )
+    FC=no ;;
+  *)
+    set dummy $GFORTRAN; ac_word=$2
+    if test -x "$ac_word"; then
+      FC="$GFORTRAN"
+    else
+      FC=no
+    fi ;;
+esac
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in gfortran
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$FC"; then
+  ac_cv_prog_FC="$FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+FC=$ac_cv_prog_FC
+if test -n "$FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5
+$as_echo "$FC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$FC" && break
+  done
+fi
+if test -z "$FC"; then
+  ac_ct_FC=$FC
+  for ac_prog in gfortran
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_FC"; then
+  ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_FC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_FC=$ac_cv_prog_ac_ct_FC
+if test -n "$ac_ct_FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5
+$as_echo "$ac_ct_FC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_FC" && break
+done
+
+  if test "x$ac_ct_FC" = x; then
+    FC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    FC=$ac_ct_FC
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    rm -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; }
+if test "${ac_cv_fc_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_fc_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5
+$as_echo "$ac_cv_fc_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FCFLAGS=${FCFLAGS+set}
+ac_save_FCFLAGS=$FCFLAGS
+FCFLAGS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5
+$as_echo_n "checking whether $FC accepts -g... " >&6; }
+if test "${ac_cv_prog_fc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  FCFLAGS=-g
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  ac_cv_prog_fc_g=yes
+else
+  ac_cv_prog_fc_g=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5
+$as_echo "$ac_cv_prog_fc_g" >&6; }
+if test "$ac_test_FCFLAGS" = set; then
+  FCFLAGS=$ac_save_FCFLAGS
+elif test $ac_cv_prog_fc_g = yes; then
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-g -O2"
+  else
+    FCFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-O2"
+  else
+    FCFLAGS=
+  fi
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+      ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+archive_cmds_need_lc_FC=no
+allow_undefined_flag_FC=
+always_export_symbols_FC=no
+archive_expsym_cmds_FC=
+export_dynamic_flag_spec_FC=
+hardcode_direct_FC=no
+hardcode_direct_absolute_FC=no
+hardcode_libdir_flag_spec_FC=
+hardcode_libdir_flag_spec_ld_FC=
+hardcode_libdir_separator_FC=
+hardcode_minus_L_FC=no
+hardcode_automatic_FC=no
+inherit_rpath_FC=no
+module_cmds_FC=
+module_expsym_cmds_FC=
+link_all_deplibs_FC=unknown
+old_archive_cmds_FC=$old_archive_cmds
+reload_flag_FC=$reload_flag
+reload_cmds_FC=$reload_cmds
+no_undefined_flag_FC=
+whole_archive_flag_spec_FC=
+enable_shared_with_static_runtimes_FC=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+objext_FC=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${FC-"f95"}
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  compiler_FC=$CC
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+  if test -n "$compiler"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[4-9]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+    GCC_FC="$ac_cv_fc_compiler_gnu"
+    LD_FC="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_FC=
+postdep_objects_FC=
+predeps_FC=
+postdeps_FC=
+compiler_lib_search_path_FC=
+
+cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+        prev=$p
+        continue
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$compiler_lib_search_path_FC"; then
+            compiler_lib_search_path_FC="${prev}${p}"
+          else
+            compiler_lib_search_path_FC="${compiler_lib_search_path_FC} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$postdeps_FC"; then
+          postdeps_FC="${prev}${p}"
+        else
+          postdeps_FC="${postdeps_FC} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$predep_objects_FC"; then
+          predep_objects_FC="$p"
+        else
+          predep_objects_FC="$predep_objects_FC $p"
+        fi
+       else
+        if test -z "$postdep_objects_FC"; then
+          postdep_objects_FC="$p"
+        else
+          postdep_objects_FC="$postdep_objects_FC $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling FC test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+
+
+case " $postdeps_FC " in
+*" -lc "*) archive_cmds_need_lc_FC=no ;;
+esac
+ compiler_lib_search_dirs_FC=
+if test -n "${compiler_lib_search_path_FC}"; then
+ compiler_lib_search_dirs_FC=`echo " ${compiler_lib_search_path_FC}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_FC=
+lt_prog_compiler_pic_FC=
+lt_prog_compiler_static_FC=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_FC='-Wl,'
+    lt_prog_compiler_static_FC='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_FC='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_FC='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic_FC='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_FC='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_FC=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_FC='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_FC=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_FC='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_FC=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic_FC='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl_FC='-Xlinker '
+      lt_prog_compiler_pic_FC='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_FC='-Bstatic'
+      else
+       lt_prog_compiler_static_FC='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_FC='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_FC='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='-KPIC'
+       lt_prog_compiler_static_FC='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='-fPIC'
+       lt_prog_compiler_static_FC='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='--shared'
+       lt_prog_compiler_static_FC='--static'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='-fpic'
+       lt_prog_compiler_static_FC='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_FC='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_FC='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       lt_prog_compiler_wl_FC='-Wl,'
+       lt_prog_compiler_pic_FC='-qpic'
+       lt_prog_compiler_static_FC='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ F* | *Sun*Fortran*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         lt_prog_compiler_pic_FC='-KPIC'
+         lt_prog_compiler_static_FC='-Bstatic'
+         lt_prog_compiler_wl_FC=''
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         lt_prog_compiler_pic_FC='-KPIC'
+         lt_prog_compiler_static_FC='-Bstatic'
+         lt_prog_compiler_wl_FC='-Wl,'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_FC='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl_FC='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl_FC='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_FC='-Qoption ld '
+      lt_prog_compiler_pic_FC='-PIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic_FC='-Kconform_pic'
+       lt_prog_compiler_static_FC='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_can_build_shared_FC=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_FC='-pic'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_FC=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_FC=
+    ;;
+  *)
+    lt_prog_compiler_pic_FC="$lt_prog_compiler_pic_FC"
+    ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_FC" >&5
+$as_echo "$lt_prog_compiler_pic_FC" >&6; }
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_FC works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_FC works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_FC=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_FC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_FC=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_FC" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_FC" = xyes; then
+    case $lt_prog_compiler_pic_FC in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_FC=" $lt_prog_compiler_pic_FC" ;;
+     esac
+else
+    lt_prog_compiler_pic_FC=
+     lt_prog_compiler_can_build_shared_FC=no
+fi
+
+fi
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_FC eval lt_tmp_static_flag=\"$lt_prog_compiler_static_FC\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_FC=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_FC=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_FC=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_FC" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_FC" = xyes; then
+    :
+else
+    lt_prog_compiler_static_FC=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_FC=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_FC=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_FC=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_FC=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_FC" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag_FC=
+  always_export_symbols_FC=no
+  archive_cmds_FC=
+  archive_expsym_cmds_FC=
+  compiler_needs_object_FC=no
+  enable_shared_with_static_runtimes_FC=no
+  export_dynamic_flag_spec_FC=
+  export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic_FC=no
+  hardcode_direct_FC=no
+  hardcode_direct_absolute_FC=no
+  hardcode_libdir_flag_spec_FC=
+  hardcode_libdir_flag_spec_ld_FC=
+  hardcode_libdir_separator_FC=
+  hardcode_minus_L_FC=no
+  hardcode_shlibpath_var_FC=unsupported
+  inherit_rpath_FC=no
+  link_all_deplibs_FC=unknown
+  module_cmds_FC=
+  module_expsym_cmds_FC=
+  old_archive_from_new_cmds_FC=
+  old_archive_from_expsyms_cmds_FC=
+  thread_safe_flag_spec_FC=
+  whole_archive_flag_spec_FC=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_FC=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_FC='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # 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.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_FC=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec_FC='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_FC="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_FC=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs_FC=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds_FC=''
+        ;;
+      m68k)
+            archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_FC='-L$libdir'
+            hardcode_minus_L_FC=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag_FC=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds_FC='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, FC) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      export_dynamic_flag_spec_FC='${wl}--export-all-symbols'
+      allow_undefined_flag_FC=unsupported
+      always_export_symbols_FC=no
+      enable_shared_with_static_runtimes_FC=yes
+      export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs_FC=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct_FC=no
+      hardcode_shlibpath_var_FC=no
+      hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_FC='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_FC='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         whole_archive_flag_spec_FC=
+         tmp_sharedflag='--shared' ;;
+       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object_FC=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         whole_archive_flag_spec_FC='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object_FC=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       archive_cmds_FC='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         whole_archive_flag_spec_FC='--whole-archive$convenience --no-whole-archive'
+         hardcode_libdir_flag_spec_FC=
+         hardcode_libdir_flag_spec_ld_FC='-rpath $libdir'
+         archive_cmds_FC='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+         if test "x$supports_anon_versioning" = xyes; then
+           archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        ld_shlibs_FC=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds_FC='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       ld_shlibs_FC=no
+       cat <<_LT_EOF 1>&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.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs_FC=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+           archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           ld_shlibs_FC=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_FC='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_FC" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_FC=
+      export_dynamic_flag_spec_FC=
+      whole_archive_flag_spec_FC=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_FC=unsupported
+      always_export_symbols_FC=yes
+      archive_expsym_cmds_FC='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_FC=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct_FC=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_FC=''
+      hardcode_direct_FC=yes
+      hardcode_direct_absolute_FC=yes
+      hardcode_libdir_separator_FC=':'
+      link_all_deplibs_FC=yes
+      file_list_spec_FC='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         hardcode_direct_FC=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_FC=yes
+         hardcode_libdir_flag_spec_FC='-L$libdir'
+         hardcode_libdir_separator_FC=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      export_dynamic_flag_spec_FC='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_FC=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag_FC='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds_FC='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec_FC='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag_FC="-z nodefs"
+         archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag_FC=' ${wl}-bernotok'
+         allow_undefined_flag_FC=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           whole_archive_flag_spec_FC='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           whole_archive_flag_spec_FC='$convenience'
+         fi
+         archive_cmds_need_lc_FC=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds_FC=''
+        ;;
+      m68k)
+            archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_FC='-L$libdir'
+            hardcode_minus_L_FC=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_FC=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_FC=' '
+      allow_undefined_flag_FC=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_FC='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_from_new_cmds_FC='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_FC='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_FC='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_FC=yes
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_FC=no
+  hardcode_direct_FC=no
+  hardcode_automatic_FC=yes
+  hardcode_shlibpath_var_FC=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_FC='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec_FC=''
+  fi
+  link_all_deplibs_FC=yes
+  allow_undefined_flag_FC="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_FC="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds_FC="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds_FC="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds_FC="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs_FC=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_FC=yes
+      hardcode_minus_L_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds_FC='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds_FC='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds_FC='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      hardcode_direct_FC=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_FC=yes
+      export_dynamic_flag_spec_FC='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       archive_cmds_FC='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_FC='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+       hardcode_libdir_flag_spec_ld_FC='+b $libdir'
+       hardcode_libdir_separator_FC=:
+       hardcode_direct_FC=yes
+       hardcode_direct_absolute_FC=yes
+       export_dynamic_flag_spec_FC='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L_FC=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds_FC='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds_FC='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_FC='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+       archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator_FC=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_direct_FC=no
+         hardcode_shlibpath_var_FC=no
+         ;;
+       *)
+         hardcode_direct_FC=yes
+         hardcode_direct_absolute_FC=yes
+         export_dynamic_flag_spec_FC='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_FC=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        cat > conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+  archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LDFLAGS="$save_LDFLAGS"
+      else
+       archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      inherit_rpath_FC=yes
+      link_all_deplibs_FC=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds_FC='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    newsos6)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_FC=yes
+      hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       hardcode_direct_FC=yes
+       hardcode_shlibpath_var_FC=no
+       hardcode_direct_absolute_FC=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+         export_dynamic_flag_spec_FC='${wl}-E'
+       else
+         case $host_os in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            hardcode_libdir_flag_spec_FC='-R$libdir'
+            ;;
+          *)
+            archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       ld_shlibs_FC=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_minus_L_FC=yes
+      allow_undefined_flag_FC=unsupported
+      archive_cmds_FC='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds_FC='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag_FC=' -expect_unresolved \*'
+       archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag_FC=' -expect_unresolved \*'
+       archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_FC='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec_FC='-rpath $libdir'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_separator_FC=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_FC=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds_FC='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         archive_cmds_FC='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         archive_cmds_FC='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_shlibpath_var_FC=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         whole_archive_flag_spec_FC='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         whole_archive_flag_spec_FC='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      link_all_deplibs_FC=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds_FC='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_FC='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_direct_FC=yes
+      hardcode_minus_L_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_FC=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds_FC='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds_FC='$CC -r -o $output$reload_objs'
+         hardcode_direct_FC=no
+        ;;
+       motorola)
+         archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_FC=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_FC=no
+      export_dynamic_flag_spec_FC='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var_FC=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs_FC=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_FC='${wl}-z,text'
+      archive_cmds_need_lc_FC=no
+      hardcode_shlibpath_var_FC=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_FC='${wl}-z,text'
+      allow_undefined_flag_FC='${wl}-z,nodefs'
+      archive_cmds_need_lc_FC=no
+      hardcode_shlibpath_var_FC=no
+      hardcode_libdir_flag_spec_FC='${wl}-R,$libdir'
+      hardcode_libdir_separator_FC=':'
+      link_all_deplibs_FC=yes
+      export_dynamic_flag_spec_FC='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *)
+      ld_shlibs_FC=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       export_dynamic_flag_spec_FC='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_FC" >&5
+$as_echo "$ld_shlibs_FC" >&6; }
+test "$ld_shlibs_FC" = no && can_build_shared=no
+
+with_gnu_ld_FC=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_FC" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_FC=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_FC in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if test "${lt_cv_archive_cmds_need_lc_FC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl_FC
+         pic_flag=$lt_prog_compiler_pic_FC
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag_FC
+         allow_undefined_flag_FC=
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+         then
+           lt_cv_archive_cmds_need_lc_FC=no
+         else
+           lt_cv_archive_cmds_need_lc_FC=yes
+         fi
+         allow_undefined_flag_FC=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_FC" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_FC" >&6; }
+      archive_cmds_need_lc_FC=$lt_cv_archive_cmds_need_lc_FC
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_FC\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_FC\""
+    cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_FC=
+if test -n "$hardcode_libdir_flag_spec_FC" ||
+   test -n "$runpath_var_FC" ||
+   test "X$hardcode_automatic_FC" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_FC" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" != no &&
+     test "$hardcode_minus_L_FC" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_FC=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_FC=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_FC=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_FC" >&5
+$as_echo "$hardcode_action_FC" >&6; }
+
+if test "$hardcode_action_FC" = relink ||
+   test "$inherit_rpath_FC" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+FCFLAGS="$FCFLAGS -Wall -L../libgfortran"
+
+# For libtool versioning info, format is CURRENT:REVISION:AGE
+libtool_VERSION=1:0:0
+
+
+# Check header files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if test "${ac_cv_header_time+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_time=yes
+else
+  ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether string.h and strings.h may both be included" >&5
+$as_echo_n "checking whether string.h and strings.h may both be included... " >&6; }
+if test "${gcc_cv_header_string+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+#include <strings.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gcc_cv_header_string=yes
+else
+  gcc_cv_header_string=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_header_string" >&5
+$as_echo "$gcc_cv_header_string" >&6; }
+if test $gcc_cv_header_string = yes; then
+
+$as_echo "#define STRING_WITH_STRINGS 1" >>confdefs.h
+
+fi
+
+for ac_header in unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+inttype_headers=`echo inttypes.h sys/inttypes.h  | sed -e 's/,/ /g'`
+
+acx_cv_header_stdint=stddef.h
+acx_cv_header_stdint_kind="(already complete)"
+for i in stdint.h $inttype_headers; do
+  unset ac_cv_type_uintptr_t
+  unset ac_cv_type_uintmax_t
+  unset ac_cv_type_int_least32_t
+  unset ac_cv_type_int_fast32_t
+  unset ac_cv_type_uint64_t
+  $as_echo_n "looking for a compliant stdint.h in $i, " >&6
+  ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uintmax_t" = x""yes; then :
+  acx_cv_header_stdint=$i
+else
+  continue
+fi
+
+  ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uintptr_t" = x""yes; then :
+
+else
+  acx_cv_header_stdint_kind="(mostly complete)"
+fi
+
+  ac_fn_c_check_type "$LINENO" "int_least32_t" "ac_cv_type_int_least32_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_int_least32_t" = x""yes; then :
+
+else
+  acx_cv_header_stdint_kind="(mostly complete)"
+fi
+
+  ac_fn_c_check_type "$LINENO" "int_fast32_t" "ac_cv_type_int_fast32_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_int_fast32_t" = x""yes; then :
+
+else
+  acx_cv_header_stdint_kind="(mostly complete)"
+fi
+
+  ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uint64_t" = x""yes; then :
+
+else
+  acx_cv_header_stdint_kind="(lacks uint64_t)"
+fi
+
+  break
+done
+if test "$acx_cv_header_stdint" = stddef.h; then
+  acx_cv_header_stdint_kind="(lacks uintmax_t)"
+  for i in stdint.h $inttype_headers; do
+    unset ac_cv_type_uintptr_t
+    unset ac_cv_type_uint32_t
+    unset ac_cv_type_uint64_t
+    $as_echo_n "looking for an incomplete stdint.h in $i, " >&6
+    ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uint32_t" = x""yes; then :
+  acx_cv_header_stdint=$i
+else
+  continue
+fi
+
+    ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uint64_t" = x""yes; then :
+
+fi
+
+    ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_uintptr_t" = x""yes; then :
+
+fi
+
+    break
+  done
+fi
+if test "$acx_cv_header_stdint" = stddef.h; then
+  acx_cv_header_stdint_kind="(u_intXX_t style)"
+  for i in sys/types.h $inttype_headers; do
+    unset ac_cv_type_u_int32_t
+    unset ac_cv_type_u_int64_t
+    $as_echo_n "looking for u_intXX_t types in $i, " >&6
+    ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_u_int32_t" = x""yes; then :
+  acx_cv_header_stdint=$i
+else
+  continue
+fi
+
+    ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "#include <sys/types.h>
+#include <$i>
+"
+if test "x$ac_cv_type_u_int64_t" = x""yes; then :
+
+fi
+
+    break
+  done
+fi
+if test "$acx_cv_header_stdint" = stddef.h; then
+  acx_cv_header_stdint_kind="(using manual detection)"
+fi
+
+test -z "$ac_cv_type_uintptr_t" && ac_cv_type_uintptr_t=no
+test -z "$ac_cv_type_uint64_t" && ac_cv_type_uint64_t=no
+test -z "$ac_cv_type_u_int64_t" && ac_cv_type_u_int64_t=no
+test -z "$ac_cv_type_int_least32_t" && ac_cv_type_int_least32_t=no
+test -z "$ac_cv_type_int_fast32_t" && ac_cv_type_int_fast32_t=no
+
+# ----------------- Summarize what we found so far
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what to include in gstdint.h" >&5
+$as_echo_n "checking what to include in gstdint.h... " >&6; }
+
+case `$as_basename -- gstdint.h ||
+$as_expr X/gstdint.h : '.*/\([^/][^/]*\)/*$' \| \
+        Xgstdint.h : 'X\(//\)$' \| \
+        Xgstdint.h : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/gstdint.h |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'` in
+  stdint.h) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: are you sure you want it there?" >&5
+$as_echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;;
+  inttypes.h) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: are you sure you want it there?" >&5
+$as_echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;;
+  *) ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_header_stdint $acx_cv_header_stdint_kind" >&5
+$as_echo "$acx_cv_header_stdint $acx_cv_header_stdint_kind" >&6; }
+
+# ----------------- done included file, check C basic types --------
+
+# Lacking an uintptr_t?  Test size of void *
+case "$acx_cv_header_stdint:$ac_cv_type_uintptr_t" in
+  stddef.h:* | *:no) # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if test "${ac_cv_sizeof_void_p+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_void_p" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (void *)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_void_p=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+ ;;
+esac
+
+# Lacking an uint64_t?  Test size of long
+case "$acx_cv_header_stdint:$ac_cv_type_uint64_t:$ac_cv_type_u_int64_t" in
+  stddef.h:*:* | *:no:no) # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_long" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (long)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_long=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+ ;;
+esac
+
+if test $acx_cv_header_stdint = stddef.h; then
+  # Lacking a good header?  Test size of everything and deduce all types.
+  # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (int)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+  # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if test "${ac_cv_sizeof_short+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_short" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (short)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_short=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+  # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
+$as_echo_n "checking size of char... " >&6; }
+if test "${ac_cv_sizeof_char+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_char" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (char)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_char=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
+$as_echo "$ac_cv_sizeof_char" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_CHAR $ac_cv_sizeof_char
+_ACEOF
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to int8_t" >&5
+$as_echo_n "checking for type equivalent to int8_t... " >&6; }
+  case "$ac_cv_sizeof_char" in
+    1) acx_cv_type_int8_t=char ;;
+    *) as_fn_error "no 8-bit type, please report a bug" "$LINENO" 5
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_type_int8_t" >&5
+$as_echo "$acx_cv_type_int8_t" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to int16_t" >&5
+$as_echo_n "checking for type equivalent to int16_t... " >&6; }
+  case "$ac_cv_sizeof_int:$ac_cv_sizeof_short" in
+    2:*) acx_cv_type_int16_t=int ;;
+    *:2) acx_cv_type_int16_t=short ;;
+    *) as_fn_error "no 16-bit type, please report a bug" "$LINENO" 5
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_type_int16_t" >&5
+$as_echo "$acx_cv_type_int16_t" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to int32_t" >&5
+$as_echo_n "checking for type equivalent to int32_t... " >&6; }
+  case "$ac_cv_sizeof_int:$ac_cv_sizeof_long" in
+    4:*) acx_cv_type_int32_t=int ;;
+    *:4) acx_cv_type_int32_t=long ;;
+    *) as_fn_error "no 32-bit type, please report a bug" "$LINENO" 5
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_type_int32_t" >&5
+$as_echo "$acx_cv_type_int32_t" >&6; }
+fi
+
+# These tests are here to make the output prettier
+
+if test "$ac_cv_type_uint64_t" != yes && test "$ac_cv_type_u_int64_t" != yes; then
+  case "$ac_cv_sizeof_long" in
+    8) acx_cv_type_int64_t=long ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to int64_t" >&5
+$as_echo_n "checking for type equivalent to int64_t... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${acx_cv_type_int64_t-'using preprocessor symbols'}" >&5
+$as_echo "${acx_cv_type_int64_t-'using preprocessor symbols'}" >&6; }
+fi
+
+# Now we can use the above types
+
+if test "$ac_cv_type_uintptr_t" != yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type equivalent to intptr_t" >&5
+$as_echo_n "checking for type equivalent to intptr_t... " >&6; }
+  case $ac_cv_sizeof_void_p in
+    2) acx_cv_type_intptr_t=int16_t ;;
+    4) acx_cv_type_intptr_t=int32_t ;;
+    8) acx_cv_type_intptr_t=int64_t ;;
+    *) as_fn_error "no equivalent for intptr_t, please report a bug" "$LINENO" 5
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_type_intptr_t" >&5
+$as_echo "$acx_cv_type_intptr_t" >&6; }
+fi
+
+# ----------------- done all checks, emit header -------------
+ac_config_commands="$ac_config_commands gstdint.h"
+
+
+
+
+# Check to see if -pthread or -lpthread is needed.  Prefer the former.
+# In case the pthread.h system header is not found, this test will fail.
+XPCFLAGS=""
+CFLAGS="$CFLAGS -pthread"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+   void *g(void *d) { return NULL; }
+int
+main ()
+{
+pthread_t t; pthread_create(&t,NULL,g,NULL);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  XPCFLAGS=" -Wc,-pthread"
+else
+  CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+     void *g(void *d) { return NULL; }
+int
+main ()
+{
+pthread_t t; pthread_create(&t,NULL,g,NULL);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+  as_fn_error "Pthreads are required to build libgomp" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+# Check for functions needed.
+for ac_func in getloadavg clock_gettime strtoull
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+eval as_val=\$$as_ac_var
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# Check for broken semaphore implementation on darwin.
+# sem_init returns: sem_init error: Function not implemented.
+case "$host" in
+  *-darwin*)
+
+$as_echo "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h
+
+    ;;
+esac
+
+ # Check whether --enable-linux-futex was given.
+if test "${enable_linux_futex+set}" = set; then :
+  enableval=$enable_linux_futex;
+      case "$enableval" in
+       yes|no|default) ;;
+       *) as_fn_error "Unknown argument to enable/disable linux-futex" "$LINENO" 5 ;;
+                          esac
+
+else
+  enable_linux_futex=default
+fi
+
+
+case "$target" in
+  *-linux*)
+    case "$enable_linux_futex" in
+      default)
+       # If headers don't have gettid/futex syscalls definition, then
+       # default to no, otherwise there will be compile time failures.
+       # Otherwise, default to yes.  If we don't detect we are
+       # compiled/linked against NPTL and not cross-compiling, check
+       # if programs are run by default against NPTL and if not, issue
+       # a warning.
+       enable_linux_futex=no
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/syscall.h>
+          int lk;
+int
+main ()
+{
+syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  save_LIBS="$LIBS"
+          LIBS="-lpthread $LIBS"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef _GNU_SOURCE
+            #define _GNU_SOURCE 1
+            #endif
+            #include <pthread.h>
+            pthread_t th; void *status;
+int
+main ()
+{
+pthread_tryjoin_np (th, &status);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  enable_linux_futex=yes
+else
+  if test x$cross_compiling = xno; then
+              if getconf GNU_LIBPTHREAD_VERSION 2>/dev/null \
+                 | LC_ALL=C grep -i NPTL > /dev/null 2>/dev/null; then :; else
+                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The kernel might not support futex or gettid syscalls.
+If so, please configure with --disable-linux-futex" >&5
+$as_echo "$as_me: WARNING: The kernel might not support futex or gettid syscalls.
+If so, please configure with --disable-linux-futex" >&2;}
+              fi
+            fi
+            enable_linux_futex=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+          LIBS="$save_LIBS"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       ;;
+      yes)
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/syscall.h>
+          int lk;
+int
+main ()
+{
+syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+  as_fn_error "SYS_gettid and SYS_futex required for --enable-linux-futex" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       ;;
+    esac
+    ;;
+  *)
+    enable_linux_futex=no
+    ;;
+esac
+if test x$enable_linux_futex = xyes; then
+  :
+fi
+
+
+# Check for pthread_{,attr_}[sg]etaffinity_np.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _GNU_SOURCE
+   #include <pthread.h>
+int
+main ()
+{
+cpu_set_t cpuset;
+   pthread_attr_t attr;
+   pthread_getaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset);
+   if (CPU_ISSET (0, &cpuset))
+     CPU_SET (1, &cpuset);
+   else
+     CPU_ZERO (&cpuset);
+   pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset);
+   pthread_attr_init (&attr);
+   pthread_attr_getaffinity_np (&attr, sizeof (cpu_set_t), &cpuset);
+   pthread_attr_setaffinity_np (&attr, sizeof (cpu_set_t), &cpuset);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+$as_echo "#define HAVE_PTHREAD_AFFINITY_NP 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+# At least for glibc, clock_gettime is in librt.  But don't pull that
+# in if it still doesn't give us the function we want.
+if test $ac_cv_func_clock_gettime = no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_rt_clock_gettime=yes
+else
+  ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
+  LIBS="-lrt $LIBS"
+
+$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
+fi
+
+fi
+
+# See if we support thread-local storage.
+
+
+   # Check whether --enable-tls was given.
+if test "${enable_tls+set}" = set; then :
+  enableval=$enable_tls;
+      case "$enableval" in
+       yes|no) ;;
+       *) as_fn_error "Argument to enable/disable tls must be yes or no" "$LINENO" 5 ;;
+      esac
+
+else
+  enable_tls=yes
+fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports thread-local storage" >&5
+$as_echo_n "checking whether the target supports thread-local storage... " >&6; }
+if test "${gcc_cv_have_tls+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test "$cross_compiling" = yes; then :
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  chktls_save_LDFLAGS="$LDFLAGS"
+                         case $host in
+           *-*-linux*)
+             LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
+             ;;
+         esac
+         chktls_save_CFLAGS="$CFLAGS"
+         CFLAGS="-fPIC $CFLAGS"
+                 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int f() { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+__thread int a; int b; int f() { return a = b; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_have_tls=yes
+else
+  gcc_cv_have_tls=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+else
+  gcc_cv_have_tls=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+         CFLAGS="$chktls_save_CFLAGS"
+         LDFLAGS="$chktls_save_LDFLAGS"
+else
+  gcc_cv_have_tls=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+                      chktls_save_LDFLAGS="$LDFLAGS"
+      LDFLAGS="-static $LDFLAGS"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main() { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run test program while cross compiling
+See \`config.log' for more details." "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gcc_cv_have_tls=yes
+else
+  gcc_cv_have_tls=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+else
+  gcc_cv_have_tls=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+      LDFLAGS="$chktls_save_LDFLAGS"
+      if test $gcc_cv_have_tls = yes; then
+                                               chktls_save_CFLAGS="$CFLAGS"
+       thread_CFLAGS=failed
+       for flag in '' '-pthread' '-lpthread'; do
+         CFLAGS="$flag $chktls_save_CFLAGS"
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+               void *g(void *d) { return NULL; }
+int
+main ()
+{
+pthread_t t; pthread_create(&t,NULL,g,NULL);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  thread_CFLAGS="$flag"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+         if test "X$thread_CFLAGS" != Xfailed; then
+           break
+         fi
+       done
+       CFLAGS="$chktls_save_CFLAGS"
+       if test "X$thread_CFLAGS" != Xfailed; then
+         CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
+                                                 if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run test program while cross compiling
+See \`config.log' for more details." "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+               __thread int a;
+               static int *volatile a_in_other_thread;
+               static void *
+               thread_func (void *arg)
+               {
+                 a_in_other_thread = &a;
+                 return (void *)0;
+               }
+int
+main ()
+{
+pthread_t thread;
+               void *thread_retval;
+               int *volatile a_in_main_thread;
+               a_in_main_thread = &a;
+               if (pthread_create (&thread, (pthread_attr_t *)0,
+                                   thread_func, (void *)0))
+                 return 0;
+               if (pthread_join (thread, &thread_retval))
+                 return 0;
+               return (a_in_other_thread == a_in_main_thread);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gcc_cv_have_tls=yes
+else
+  gcc_cv_have_tls=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+         CFLAGS="$chktls_save_CFLAGS"
+       fi
+      fi
+else
+  gcc_cv_have_tls=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_tls" >&5
+$as_echo "$gcc_cv_have_tls" >&6; }
+  if test "$enable_tls $gcc_cv_have_tls" = "yes yes"; then
+
+$as_echo "#define HAVE_TLS 1" >>confdefs.h
+
+  fi
+
+# See what sort of export controls are availible.
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports hidden visibility" >&5
+$as_echo_n "checking whether the target supports hidden visibility... " >&6; }
+if test "${libgomp_cv_have_attribute_visibility+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Werror"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+void __attribute__((visibility("hidden"))) foo(void) { }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libgomp_cv_have_attribute_visibility=yes
+else
+  libgomp_cv_have_attribute_visibility=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$save_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgomp_cv_have_attribute_visibility" >&5
+$as_echo "$libgomp_cv_have_attribute_visibility" >&6; }
+  if test $libgomp_cv_have_attribute_visibility = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_VISIBILITY 1" >>confdefs.h
+
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports dllexport" >&5
+$as_echo_n "checking whether the target supports dllexport... " >&6; }
+if test "${libgomp_cv_have_attribute_dllexport+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Werror"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+void __attribute__((dllexport)) foo(void) { }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libgomp_cv_have_attribute_dllexport=yes
+else
+  libgomp_cv_have_attribute_dllexport=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$save_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgomp_cv_have_attribute_dllexport" >&5
+$as_echo "$libgomp_cv_have_attribute_dllexport" >&6; }
+  if test $libgomp_cv_have_attribute_dllexport = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_DLLEXPORT 1" >>confdefs.h
+
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports symbol aliases" >&5
+$as_echo_n "checking whether the target supports symbol aliases... " >&6; }
+if test "${libgomp_cv_have_attribute_alias+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+void foo(void) { }
+extern void bar(void) __attribute__((alias("foo")));
+int
+main ()
+{
+bar();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libgomp_cv_have_attribute_alias=yes
+else
+  libgomp_cv_have_attribute_alias=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgomp_cv_have_attribute_alias" >&5
+$as_echo "$libgomp_cv_have_attribute_alias" >&6; }
+  if test $libgomp_cv_have_attribute_alias = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_ALIAS 1" >>confdefs.h
+
+  fi
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+  # If we're not using GNU ld, then there's no point in even trying these
+  # tests.  Check for that first.  We should have already tested for gld
+  # by now (in libtool), but require it now just to be safe...
+  test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+  test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
+
+
+
+  # The name set by libtool depends on the version of libtool.  Shame on us
+  # for depending on an impl detail, but c'est la vie.  Older versions used
+  # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
+  # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
+  # makes sense).  We'll test with_gnu_ld everywhere else, so if that isn't
+  # set (hence we're using an older libtool), then set it.
+  if test x${with_gnu_ld+set} != xset; then
+    if test x${ac_cv_prog_gnu_ld+set} != xset; then
+      # We got through "ac_require(ac_prog_ld)" and still not set?  Huh?
+      with_gnu_ld=no
+    else
+      with_gnu_ld=$ac_cv_prog_gnu_ld
+    fi
+  fi
+
+  # Start by getting the version number.  I think the libtool test already
+  # does some of this, but throws away the result.
+  libgomp_ld_is_gold=no
+  if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
+    libgomp_ld_is_gold=yes
+  fi
+
+  ldver=`$LD --version 2>/dev/null |
+         sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
+
+  libgomp_gnu_ld_version=`echo $ldver | \
+         $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
+
+  # Set --gc-sections.
+  if test "$with_gnu_ld" = "notbroken"; then
+    # GNU ld it is!  Joy and bunny rabbits!
+
+    # All these tests are for C++; save the language and the compiler flags.
+    # Need to do this so that g++ won't try to link in libstdc++
+    ac_test_CFLAGS="${CFLAGS+set}"
+    ac_save_CFLAGS="$CFLAGS"
+    CFLAGS='-x c++  -Wl,--gc-sections'
+
+    # Check for -Wl,--gc-sections
+    # XXX This test is broken at the moment, as symbols required for linking
+    # are now in libsupc++ (not built yet).  In addition, this test has
+    # cored on solaris in the past.  In addition, --gc-sections doesn't
+    # really work at the moment (keeps on discarding used sections, first
+    # .eh_frame and now some of the glibc sections for iconv).
+    # Bzzzzt.  Thanks for playing, maybe next time.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,--gc-sections" >&5
+$as_echo_n "checking for ld that supports -Wl,--gc-sections... " >&6; }
+    if test "$cross_compiling" = yes; then :
+  ac_sectionLDflags=yes
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+     int main(void)
+     {
+       try { throw 1; }
+       catch (...) { };
+       return 0;
+     }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_sectionLDflags=yes
+else
+  ac_sectionLDflags=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    if test "$ac_test_CFLAGS" = set; then
+      CFLAGS="$ac_save_CFLAGS"
+    else
+      # this is the suspicious part
+      CFLAGS=''
+    fi
+    if test "$ac_sectionLDflags" = "yes"; then
+      SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_sectionLDflags" >&5
+$as_echo "$ac_sectionLDflags" >&6; }
+  fi
+
+  # Set linker optimization flags.
+  if test x"$with_gnu_ld" = x"yes"; then
+    OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+  fi
+
+
+
+
+
+
+ # Check whether --enable-symvers was given.
+if test "${enable_symvers+set}" = set; then :
+  enableval=$enable_symvers;
+      case "$enableval" in
+       yes|no|gnu*|sun) ;;
+       *) as_fn_error "Unknown argument to enable/disable symvers" "$LINENO" 5 ;;
+                          esac
+
+else
+  enable_symvers=yes
+fi
+
+
+
+# If we never went through the LIBGOMP_CHECK_LINKER_FEATURES macro, then we
+# don't know enough about $LD to do tricks...
+
+
+# Turn a 'yes' into a suitable default.
+if test x$enable_symvers = xyes ; then
+  # FIXME  The following test is too strict, in theory.
+  if test $enable_shared = no || test "x$LD" = x; then
+    enable_symvers=no
+  else
+    if test $with_gnu_ld = yes ; then
+      enable_symvers=gnu
+    else
+      case ${target_os} in
+        # Sun symbol versioning exists since Solaris 2.5.
+        solaris2.[5-9]* | solaris2.1[0-9]*)
+          enable_symvers=sun ;;
+        *)
+          enable_symvers=no ;;
+      esac
+    fi
+  fi
+fi
+
+# Check if 'sun' was requested on non-Solaris 2 platforms.
+if test x$enable_symvers = xsun ; then
+  case ${target_os} in
+    solaris2*)
+      # All fine.
+      ;;
+    *)
+      # Unlikely to work.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested Sun symbol versioning, but" >&5
+$as_echo "$as_me: WARNING: === You have requested Sun symbol versioning, but" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === you are not targetting Solaris 2." >&5
+$as_echo "$as_me: WARNING: === you are not targetting Solaris 2." >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
+$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+      enable_symvers=no
+      ;;
+  esac
+fi
+
+# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
+if test $enable_symvers != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared libgcc" >&5
+$as_echo_n "checking for shared libgcc... " >&6; }
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=' -lgcc_s'
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libgomp_shared_libgcc=yes
+else
+  libgomp_shared_libgcc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  CFLAGS="$ac_save_CFLAGS"
+  if test $libgomp_shared_libgcc = no; then
+    cat > conftest.c <<EOF
+int main (void) { return 0; }
+EOF
+    libgomp_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
+                            -shared -shared-libgcc -o conftest.so \
+                            conftest.c -v 2>&1 >/dev/null \
+                            | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
+    rm -f conftest.c conftest.so
+    if test x${libgomp_libgcc_s_suffix+set} = xset; then
+      CFLAGS=" -lgcc_s$libgomp_libgcc_s_suffix"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libgomp_shared_libgcc=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+      CFLAGS="$ac_save_CFLAGS"
+    fi
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgomp_shared_libgcc" >&5
+$as_echo "$libgomp_shared_libgcc" >&6; }
+fi
+
+# For GNU ld, we need at least this version.  The format is described in
+# LIBGOMP_CHECK_LINKER_FEATURES above.
+libgomp_min_gnu_ld_version=21400
+# XXXXXXXXXXX libgomp_gnu_ld_version=21390
+
+# Check to see if unspecified "yes" value can win, given results above.
+# Change "yes" into either "no" or a style name.
+if test $enable_symvers != no && test $libgomp_shared_libgcc = yes; then
+  if test $with_gnu_ld = yes; then
+    if test $libgomp_gnu_ld_version -ge $libgomp_min_gnu_ld_version ; then
+      enable_symvers=gnu
+    elif test $libgomp_ld_is_gold = yes ; then
+      enable_symvers=gnu
+    else
+      # The right tools, the right setup, but too old.  Fallbacks?
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Linker version $libgomp_gnu_ld_version is too old for" >&5
+$as_echo "$as_me: WARNING: === Linker version $libgomp_gnu_ld_version is too old for" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === full symbol versioning support in this release of GCC." >&5
+$as_echo "$as_me: WARNING: === full symbol versioning support in this release of GCC." >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You would need to upgrade your binutils to version" >&5
+$as_echo "$as_me: WARNING: === You would need to upgrade your binutils to version" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === $libgomp_min_gnu_ld_version or later and rebuild GCC." >&5
+$as_echo "$as_me: WARNING: === $libgomp_min_gnu_ld_version or later and rebuild GCC." >&2;}
+      if test $libgomp_gnu_ld_version -ge 21200 ; then
+        # Globbing fix is present, proper block support is not.
+                        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
+$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+        enable_symvers=no
+      else
+        # 2.11 or older.
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
+$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+        enable_symvers=no
+      fi
+    fi
+  elif test $enable_symvers = sun; then
+    : All interesting versions of Sun ld support sun style symbol versioning.
+  else
+    # just fail for now
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested some kind of symbol versioning, but" >&5
+$as_echo "$as_me: WARNING: === You have requested some kind of symbol versioning, but" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === either you are not using a supported linker, or you are" >&5
+$as_echo "$as_me: WARNING: === either you are not using a supported linker, or you are" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === not building a shared libgcc_s (which is required)." >&5
+$as_echo "$as_me: WARNING: === not building a shared libgcc_s (which is required)." >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
+$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+    enable_symvers=no
+  fi
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports .symver directive" >&5
+$as_echo_n "checking whether the target supports .symver directive... " >&6; }
+if test "${libgomp_cv_have_as_symver_directive+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+void foo (void); __asm (".symver foo, bar@SYMVER");
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libgomp_cv_have_as_symver_directive=yes
+else
+  libgomp_cv_have_as_symver_directive=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgomp_cv_have_as_symver_directive" >&5
+$as_echo "$libgomp_cv_have_as_symver_directive" >&6; }
+if test $libgomp_cv_have_as_symver_directive = yes; then
+
+$as_echo "#define HAVE_AS_SYMVER_DIRECTIVE 1" >>confdefs.h
+
+fi
+
+ if test $enable_symvers != no; then
+  LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE=
+  LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE='#'
+else
+  LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE='#'
+  LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE=
+fi
+
+ if test $enable_symvers = gnu; then
+  LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE=
+  LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_FALSE='#'
+else
+  LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE='#'
+  LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_FALSE=
+fi
+
+ if test $enable_symvers = sun; then
+  LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE=
+  LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE='#'
+else
+  LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE='#'
+  LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE=
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: versioning on shared library symbols is $enable_symvers" >&5
+$as_echo "$as_me: versioning on shared library symbols is $enable_symvers" >&6;}
+
+if test $enable_symvers != no ; then
+   case ${target_os} in
+     # The Solaris 2 runtime linker doesn't support the GNU extension of
+     # binding the same symbol to different versions
+     solaris2*)
+       ;;
+     # Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
+     *)
+
+$as_echo "#define HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1" >>confdefs.h
+
+       ;;
+    esac
+fi
+
+
+if test $enable_symvers = gnu; then
+
+$as_echo "#define LIBGOMP_GNU_SYMBOL_VERSIONING 1" >>confdefs.h
+
+fi
+
+# Get target configury.
+. ${srcdir}/configure.tgt
+CFLAGS="$save_CFLAGS $XCFLAGS"
+
+# Check for __sync_val_compare_and_swap, but only after the target has
+# had a chance to set XCFLAGS.
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports __sync_*_compare_and_swap" >&5
+$as_echo_n "checking whether the target supports __sync_*_compare_and_swap... " >&6; }
+if test "${libgomp_cv_have_sync_builtins+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+int foo; __sync_val_compare_and_swap(&foo, 0, 1);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libgomp_cv_have_sync_builtins=yes
+else
+  libgomp_cv_have_sync_builtins=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgomp_cv_have_sync_builtins" >&5
+$as_echo "$libgomp_cv_have_sync_builtins" >&6; }
+  if test $libgomp_cv_have_sync_builtins = yes; then
+
+$as_echo "#define HAVE_SYNC_BUILTINS 1" >>confdefs.h
+
+  fi
+
+XCFLAGS="$XCFLAGS$XPCFLAGS"
+
+
+
+
+
+# Cleanup and exit.
+CFLAGS="$save_CFLAGS"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+if test ${multilib} = yes; then
+  multilib_arg="--enable-multilib"
+else
+  multilib_arg=
+fi
+
+# Set up the set of libraries that we need to link against for libgomp.
+# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp,
+# which will force linkage against -lpthread (or equivalent for the system).
+# That's not 100% ideal, but about the best we can do easily.
+if test $enable_shared = yes; then
+  link_gomp="-lgomp %{static: $LIBS}"
+else
+  link_gomp="-lgomp $LIBS"
+fi
+
+
+ if test "$ac_cv_fc_compiler_gnu" = yes; then
+  USE_FORTRAN_TRUE=
+  USE_FORTRAN_FALSE='#'
+else
+  USE_FORTRAN_TRUE='#'
+  USE_FORTRAN_FALSE=
+fi
+
+
+# ??? 2006-01-24: Paulo committed to asking autoconf folk to document
+# and export AC_COMPUTE_INT.  If that happens, then we'll need to remove
+# the underscore here and update the PREREQ.  If it doesn't, then we'll
+# need to copy this macro to our acinclude.m4.
+save_CFLAGS="$CFLAGS"
+for i in $config_path; do
+  if test -f $srcdir/config/$i/omp-lock.h; then
+    CFLAGS="$CFLAGS -include confdefs.h -include $srcdir/config/$i/omp-lock.h"
+    break
+  fi
+done
+
+if ac_fn_c_compute_int "$LINENO" "sizeof (omp_lock_t)" "OMP_LOCK_SIZE"        ""; then :
+
+else
+  as_fn_error "unsupported system, cannot find sizeof (omp_lock_t)" "$LINENO" 5
+fi
+
+
+if ac_fn_c_compute_int "$LINENO" "__alignof (omp_lock_t)" "OMP_LOCK_ALIGN"        ""; then :
+
+fi
+
+
+if ac_fn_c_compute_int "$LINENO" "sizeof (omp_nest_lock_t)" "OMP_NEST_LOCK_SIZE"        ""; then :
+
+fi
+
+
+if ac_fn_c_compute_int "$LINENO" "__alignof (omp_nest_lock_t)" "OMP_NEST_LOCK_ALIGN"        ""; then :
+
+fi
+
+
+if ac_fn_c_compute_int "$LINENO" "sizeof (omp_lock_25_t)" "OMP_LOCK_25_SIZE"        ""; then :
+
+else
+  as_fn_error "unsupported system, cannot find sizeof (omp_lock_25_t)" "$LINENO" 5
+fi
+
+
+if ac_fn_c_compute_int "$LINENO" "__alignof (omp_lock_25_t)" "OMP_LOCK_25_ALIGN"        ""; then :
+
+fi
+
+
+if ac_fn_c_compute_int "$LINENO" "sizeof (omp_nest_lock_25_t)" "OMP_NEST_LOCK_25_SIZE"        ""; then :
+
+fi
+
+
+if ac_fn_c_compute_int "$LINENO" "__alignof (omp_nest_lock_25_t)" "OMP_NEST_LOCK_25_ALIGN"        ""; then :
+
+fi
+
+
+
+# If the lock fits in an integer, then arrange for Fortran to use that
+# integer.  If it doesn't, then arrange for Fortran to use a pointer.
+# Except that we don't have a way at present to multi-lib the installed
+# Fortran modules, so we assume 8 bytes for pointers, regardless of the
+# actual target.
+OMP_LOCK_KIND=$OMP_LOCK_SIZE
+OMP_NEST_LOCK_KIND=$OMP_NEST_LOCK_SIZE
+if test $OMP_LOCK_SIZE -gt 8 || test $OMP_LOCK_ALIGN -gt $OMP_LOCK_SIZE; then
+  OMP_LOCK_KIND=8
+fi
+if test $OMP_NEST_LOCK_SIZE -gt 8 || test $OMP_NEST_LOCK_ALIGN -gt $OMP_NEST_LOCK_SIZE; then
+  OMP_NEST_LOCK_KIND=8
+fi
+OMP_LOCK_25_KIND=$OMP_LOCK_25_SIZE
+OMP_NEST_LOCK_25_KIND=$OMP_NEST_LOCK_25_SIZE
+if test $OMP_LOCK_25_SIZE -gt 8 || test $OMP_LOCK_25_ALIGN -gt $OMP_LOCK_25_SIZE; then
+  OMP_LOCK_25_KIND=8
+fi
+if test $OMP_NEST_LOCK_25_SIZE -gt 8 || test $OMP_NEST_LOCK_25_ALIGN -gt $OMP_NEST_LOCK_25_SIZE; then
+  OMP_NEST_LOCK_25_KIND=8
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+CFLAGS="$save_CFLAGS"
+
+ac_config_files="$ac_config_files omp.h omp_lib.h omp_lib.f90 libgomp_f.h"
+
+ac_config_files="$ac_config_files Makefile testsuite/Makefile libgomp.spec"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${GENINSRC_TRUE}" && test -z "${GENINSRC_FALSE}"; then
+  as_fn_error "conditional \"GENINSRC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_INFO_TRUE}" && test -z "${BUILD_INFO_FALSE}"; then
+  as_fn_error "conditional \"BUILD_INFO\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE}" && test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE}"; then
+  as_fn_error "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE}" && test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_FALSE}"; then
+  as_fn_error "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE}" && test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE}"; then
+  as_fn_error "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_FORTRAN_TRUE}" && test -z "${USE_FORTRAN_FALSE}"; then
+  as_fn_error "conditional \"USE_FORTRAN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by GNU OpenMP Runtime Library $as_me 1.0, which was
+generated by GNU Autoconf 2.64.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider.
+GNU OpenMP Runtime Library home page: <http://www.gnu.org/software/libgomp/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+GNU OpenMP Runtime Library config.status 1.0
+configured by $0, generated by GNU Autoconf 2.64,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"
+CXX="$CXX"
+GFORTRAN="$GFORTRAN"
+GCJ="$GCJ"
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_FC='`$ECHO "$LD_FC" | $SED "$delay_single_quote_subst"`'
+reload_flag_FC='`$ECHO "$reload_flag_FC" | $SED "$delay_single_quote_subst"`'
+reload_cmds_FC='`$ECHO "$reload_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_FC='`$ECHO "$old_archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+compiler_FC='`$ECHO "$compiler_FC" | $SED "$delay_single_quote_subst"`'
+GCC_FC='`$ECHO "$GCC_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_FC='`$ECHO "$lt_prog_compiler_no_builtin_flag_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_FC='`$ECHO "$lt_prog_compiler_wl_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_FC='`$ECHO "$lt_prog_compiler_pic_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_FC='`$ECHO "$lt_prog_compiler_static_FC" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_FC='`$ECHO "$lt_cv_prog_compiler_c_o_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_FC='`$ECHO "$archive_cmds_need_lc_FC" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_FC='`$ECHO "$enable_shared_with_static_runtimes_FC" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_FC='`$ECHO "$export_dynamic_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_FC='`$ECHO "$whole_archive_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_FC='`$ECHO "$compiler_needs_object_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_FC='`$ECHO "$old_archive_from_new_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_FC='`$ECHO "$old_archive_from_expsyms_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_FC='`$ECHO "$archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_FC='`$ECHO "$archive_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_cmds_FC='`$ECHO "$module_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_FC='`$ECHO "$module_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_FC='`$ECHO "$with_gnu_ld_FC" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_FC='`$ECHO "$allow_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_FC='`$ECHO "$no_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_FC='`$ECHO "$hardcode_libdir_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_FC='`$ECHO "$hardcode_libdir_flag_spec_ld_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_FC='`$ECHO "$hardcode_libdir_separator_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_FC='`$ECHO "$hardcode_direct_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_FC='`$ECHO "$hardcode_direct_absolute_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_FC='`$ECHO "$hardcode_minus_L_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_FC='`$ECHO "$hardcode_shlibpath_var_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_FC='`$ECHO "$hardcode_automatic_FC" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_FC='`$ECHO "$inherit_rpath_FC" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_FC='`$ECHO "$link_all_deplibs_FC" | $SED "$delay_single_quote_subst"`'
+fix_srcfile_path_FC='`$ECHO "$fix_srcfile_path_FC" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_FC='`$ECHO "$always_export_symbols_FC" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_FC='`$ECHO "$export_symbols_cmds_FC" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_FC='`$ECHO "$exclude_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+include_expsyms_FC='`$ECHO "$include_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_FC='`$ECHO "$prelink_cmds_FC" | $SED "$delay_single_quote_subst"`'
+file_list_spec_FC='`$ECHO "$file_list_spec_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_action_FC='`$ECHO "$hardcode_action_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_FC='`$ECHO "$compiler_lib_search_dirs_FC" | $SED "$delay_single_quote_subst"`'
+predep_objects_FC='`$ECHO "$predep_objects_FC" | $SED "$delay_single_quote_subst"`'
+postdep_objects_FC='`$ECHO "$postdep_objects_FC" | $SED "$delay_single_quote_subst"`'
+predeps_FC='`$ECHO "$predeps_FC" | $SED "$delay_single_quote_subst"`'
+postdeps_FC='`$ECHO "$postdeps_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_FC='`$ECHO "$compiler_lib_search_path_FC" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_FC \
+reload_flag_FC \
+compiler_FC \
+lt_prog_compiler_no_builtin_flag_FC \
+lt_prog_compiler_wl_FC \
+lt_prog_compiler_pic_FC \
+lt_prog_compiler_static_FC \
+lt_cv_prog_compiler_c_o_FC \
+export_dynamic_flag_spec_FC \
+whole_archive_flag_spec_FC \
+compiler_needs_object_FC \
+with_gnu_ld_FC \
+allow_undefined_flag_FC \
+no_undefined_flag_FC \
+hardcode_libdir_flag_spec_FC \
+hardcode_libdir_flag_spec_ld_FC \
+hardcode_libdir_separator_FC \
+fix_srcfile_path_FC \
+exclude_expsyms_FC \
+include_expsyms_FC \
+file_list_spec_FC \
+compiler_lib_search_dirs_FC \
+predep_objects_FC \
+postdep_objects_FC \
+predeps_FC \
+postdeps_FC \
+compiler_lib_search_path_FC; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_FC \
+old_archive_cmds_FC \
+old_archive_from_new_cmds_FC \
+old_archive_from_expsyms_cmds_FC \
+archive_cmds_FC \
+archive_expsym_cmds_FC \
+module_cmds_FC \
+module_expsym_cmds_FC \
+export_symbols_cmds_FC \
+prelink_cmds_FC; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+
+
+GCC="$GCC"
+CC="$CC"
+acx_cv_header_stdint="$acx_cv_header_stdint"
+acx_cv_type_int8_t="$acx_cv_type_int8_t"
+acx_cv_type_int16_t="$acx_cv_type_int16_t"
+acx_cv_type_int32_t="$acx_cv_type_int32_t"
+acx_cv_type_int64_t="$acx_cv_type_int64_t"
+acx_cv_type_intptr_t="$acx_cv_type_intptr_t"
+ac_cv_type_uintmax_t="$ac_cv_type_uintmax_t"
+ac_cv_type_uintptr_t="$ac_cv_type_uintptr_t"
+ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
+ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
+ac_cv_type_u_int32_t="$ac_cv_type_u_int32_t"
+ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
+ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
+ac_cv_sizeof_void_p="$ac_cv_sizeof_void_p"
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "gstdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;;
+    "omp.h") CONFIG_FILES="$CONFIG_FILES omp.h" ;;
+    "omp_lib.h") CONFIG_FILES="$CONFIG_FILES omp_lib.h" ;;
+    "omp_lib.f90") CONFIG_FILES="$CONFIG_FILES omp_lib.f90" ;;
+    "libgomp_f.h") CONFIG_FILES="$CONFIG_FILES libgomp_f.h" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
+    "libgomp.spec") CONFIG_FILES="$CONFIG_FILES libgomp.spec" ;;
+
+  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[    ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || as_fn_error "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+   ac_file=Makefile . ${multi_basedir}/config-ml.in
+   ;;
+esac ;;
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="FC "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1+=\$2"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+    ;;
+  esac
+
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: FC
+
+# The linker used to build libraries.
+LD=$lt_LD_FC
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_FC
+reload_cmds=$lt_reload_cmds_FC
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_FC
+
+# A language specific compiler.
+CC=$lt_compiler_FC
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_FC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_FC
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_FC
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_FC
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_FC
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_FC
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_FC
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_FC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_FC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_FC
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_FC
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_FC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_FC
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_FC
+archive_expsym_cmds=$lt_archive_expsym_cmds_FC
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_FC
+module_expsym_cmds=$lt_module_expsym_cmds_FC
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_FC
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_FC
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_FC
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_FC
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_FC
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_FC
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_FC
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_FC
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_FC
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_FC
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_FC
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_FC
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_FC
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path_FC
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_FC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_FC
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_FC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_FC
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_FC
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_FC
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_FC
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_FC
+postdep_objects=$lt_postdep_objects_FC
+predeps=$lt_predeps_FC
+postdeps=$lt_postdeps_FC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_FC
+
+# ### END LIBTOOL TAG CONFIG: FC
+_LT_EOF
+
+ ;;
+    "gstdint.h":C)
+if test "$GCC" = yes; then
+  echo "/* generated for " `$CC --version | sed 1q` "*/" > tmp-stdint.h
+else
+  echo "/* generated for $CC */" > tmp-stdint.h
+fi
+
+sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+  #ifndef GCC_GENERATED_STDINT_H
+  #define GCC_GENERATED_STDINT_H 1
+
+  #include <sys/types.h>
+EOF
+
+if test "$acx_cv_header_stdint" != stdint.h; then
+  echo "#include <stddef.h>" >> tmp-stdint.h
+fi
+if test "$acx_cv_header_stdint" != stddef.h; then
+  echo "#include <$acx_cv_header_stdint>" >> tmp-stdint.h
+fi
+
+sed 's/^ *//' >> tmp-stdint.h <<EOF
+  /* glibc uses these symbols as guards to prevent redefinitions.  */
+  #ifdef __int8_t_defined
+  #define _INT8_T
+  #define _INT16_T
+  #define _INT32_T
+  #endif
+  #ifdef __uint32_t_defined
+  #define _UINT32_T
+  #endif
+
+EOF
+
+# ----------------- done header, emit basic int types -------------
+if test "$acx_cv_header_stdint" = stddef.h; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    #ifndef _UINT8_T
+    #define _UINT8_T
+    #ifndef __uint8_t_defined
+    #define __uint8_t_defined
+    #ifndef uint8_t
+    typedef unsigned $acx_cv_type_int8_t uint8_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _UINT16_T
+    #define _UINT16_T
+    #ifndef __uint16_t_defined
+    #define __uint16_t_defined
+    #ifndef uint16_t
+    typedef unsigned $acx_cv_type_int16_t uint16_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _UINT32_T
+    #define _UINT32_T
+    #ifndef __uint32_t_defined
+    #define __uint32_t_defined
+    #ifndef uint32_t
+    typedef unsigned $acx_cv_type_int32_t uint32_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _INT8_T
+    #define _INT8_T
+    #ifndef __int8_t_defined
+    #define __int8_t_defined
+    #ifndef int8_t
+    typedef $acx_cv_type_int8_t int8_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _INT16_T
+    #define _INT16_T
+    #ifndef __int16_t_defined
+    #define __int16_t_defined
+    #ifndef int16_t
+    typedef $acx_cv_type_int16_t int16_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _INT32_T
+    #define _INT32_T
+    #ifndef __int32_t_defined
+    #define __int32_t_defined
+    #ifndef int32_t
+    typedef $acx_cv_type_int32_t int32_t;
+    #endif
+    #endif
+    #endif
+EOF
+elif test "$ac_cv_type_u_int32_t" = yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* int8_t int16_t int32_t defined by inet code, we do the u_intXX types */
+    #ifndef _INT8_T
+    #define _INT8_T
+    #endif
+    #ifndef _INT16_T
+    #define _INT16_T
+    #endif
+    #ifndef _INT32_T
+    #define _INT32_T
+    #endif
+
+    #ifndef _UINT8_T
+    #define _UINT8_T
+    #ifndef __uint8_t_defined
+    #define __uint8_t_defined
+    #ifndef uint8_t
+    typedef u_int8_t uint8_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _UINT16_T
+    #define _UINT16_T
+    #ifndef __uint16_t_defined
+    #define __uint16_t_defined
+    #ifndef uint16_t
+    typedef u_int16_t uint16_t;
+    #endif
+    #endif
+    #endif
+
+    #ifndef _UINT32_T
+    #define _UINT32_T
+    #ifndef __uint32_t_defined
+    #define __uint32_t_defined
+    #ifndef uint32_t
+    typedef u_int32_t uint32_t;
+    #endif
+    #endif
+    #endif
+EOF
+else
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Some systems have guard macros to prevent redefinitions, define them.  */
+    #ifndef _INT8_T
+    #define _INT8_T
+    #endif
+    #ifndef _INT16_T
+    #define _INT16_T
+    #endif
+    #ifndef _INT32_T
+    #define _INT32_T
+    #endif
+    #ifndef _UINT8_T
+    #define _UINT8_T
+    #endif
+    #ifndef _UINT16_T
+    #define _UINT16_T
+    #endif
+    #ifndef _UINT32_T
+    #define _UINT32_T
+    #endif
+EOF
+fi
+
+# ------------- done basic int types, emit int64_t types ------------
+if test "$ac_cv_type_uint64_t" = yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* system headers have good uint64_t and int64_t */
+    #ifndef _INT64_T
+    #define _INT64_T
+    #endif
+    #ifndef _UINT64_T
+    #define _UINT64_T
+    #endif
+EOF
+elif test "$ac_cv_type_u_int64_t" = yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* system headers have an u_int64_t (and int64_t) */
+    #ifndef _INT64_T
+    #define _INT64_T
+    #endif
+    #ifndef _UINT64_T
+    #define _UINT64_T
+    #ifndef __uint64_t_defined
+    #define __uint64_t_defined
+    #ifndef uint64_t
+    typedef u_int64_t uint64_t;
+    #endif
+    #endif
+    #endif
+EOF
+elif test -n "$acx_cv_type_int64_t"; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* architecture has a 64-bit type, $acx_cv_type_int64_t */
+    #ifndef _INT64_T
+    #define _INT64_T
+    #ifndef int64_t
+    typedef $acx_cv_type_int64_t int64_t;
+    #endif
+    #endif
+    #ifndef _UINT64_T
+    #define _UINT64_T
+    #ifndef __uint64_t_defined
+    #define __uint64_t_defined
+    #ifndef uint64_t
+    typedef unsigned $acx_cv_type_int64_t uint64_t;
+    #endif
+    #endif
+    #endif
+EOF
+else
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* some common heuristics for int64_t, using compiler-specific tests */
+    #if defined __STDC_VERSION__ && (__STDC_VERSION__-0) >= 199901L
+    #ifndef _INT64_T
+    #define _INT64_T
+    #ifndef __int64_t_defined
+    #ifndef int64_t
+    typedef long long int64_t;
+    #endif
+    #endif
+    #endif
+    #ifndef _UINT64_T
+    #define _UINT64_T
+    #ifndef uint64_t
+    typedef unsigned long long uint64_t;
+    #endif
+    #endif
+
+    #elif defined __GNUC__ && defined (__STDC__) && __STDC__-0
+    /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
+       does not implement __extension__.  But that compiler doesn't define
+       __GNUC_MINOR__.  */
+    # if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
+    # define __extension__
+    # endif
+
+    # ifndef _INT64_T
+    # define _INT64_T
+    # ifndef int64_t
+    __extension__ typedef long long int64_t;
+    # endif
+    # endif
+    # ifndef _UINT64_T
+    # define _UINT64_T
+    # ifndef uint64_t
+    __extension__ typedef unsigned long long uint64_t;
+    # endif
+    # endif
+
+    #elif !defined __STRICT_ANSI__
+    # if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
+
+    #  ifndef _INT64_T
+    #  define _INT64_T
+    #  ifndef int64_t
+    typedef __int64 int64_t;
+    #  endif
+    #  endif
+    #  ifndef _UINT64_T
+    #  define _UINT64_T
+    #  ifndef uint64_t
+    typedef unsigned __int64 uint64_t;
+    #  endif
+    #  endif
+    # endif /* compiler */
+
+    #endif /* ANSI version */
+EOF
+fi
+
+# ------------- done int64_t types, emit intptr types ------------
+if test "$ac_cv_type_uintptr_t" != yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Define intptr_t based on sizeof(void*) = $ac_cv_sizeof_void_p */
+    #ifndef __uintptr_t_defined
+    #ifndef uintptr_t
+    typedef u$acx_cv_type_intptr_t uintptr_t;
+    #endif
+    #endif
+    #ifndef __intptr_t_defined
+    #ifndef intptr_t
+    typedef $acx_cv_type_intptr_t  intptr_t;
+    #endif
+    #endif
+EOF
+fi
+
+# ------------- done intptr types, emit int_least types ------------
+if test "$ac_cv_type_int_least32_t" != yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Define int_least types */
+    typedef int8_t     int_least8_t;
+    typedef int16_t    int_least16_t;
+    typedef int32_t    int_least32_t;
+    #ifdef _INT64_T
+    typedef int64_t    int_least64_t;
+    #endif
+
+    typedef uint8_t    uint_least8_t;
+    typedef uint16_t   uint_least16_t;
+    typedef uint32_t   uint_least32_t;
+    #ifdef _UINT64_T
+    typedef uint64_t   uint_least64_t;
+    #endif
+EOF
+fi
+
+# ------------- done intptr types, emit int_fast types ------------
+if test "$ac_cv_type_int_fast32_t" != yes; then
+      sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Define int_fast types.  short is often slow */
+    typedef int8_t       int_fast8_t;
+    typedef int          int_fast16_t;
+    typedef int32_t      int_fast32_t;
+    #ifdef _INT64_T
+    typedef int64_t      int_fast64_t;
+    #endif
+
+    typedef uint8_t      uint_fast8_t;
+    typedef unsigned int uint_fast16_t;
+    typedef uint32_t     uint_fast32_t;
+    #ifdef _UINT64_T
+    typedef uint64_t     uint_fast64_t;
+    #endif
+EOF
+fi
+
+if test "$ac_cv_type_uintmax_t" != yes; then
+  sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+    /* Define intmax based on what we found */
+    #ifndef intmax_t
+    #ifdef _INT64_T
+    typedef int64_t       intmax_t;
+    #else
+    typedef long          intmax_t;
+    #endif
+    #endif
+    #ifndef uintmax_t
+    #ifdef _UINT64_T
+    typedef uint64_t      uintmax_t;
+    #else
+    typedef unsigned long uintmax_t;
+    #endif
+    #endif
+EOF
+fi
+
+sed 's/^ *//' >> tmp-stdint.h <<EOF
+
+  #endif /* GCC_GENERATED_STDINT_H */
+EOF
+
+if test -r gstdint.h && cmp -s tmp-stdint.h gstdint.h; then
+  rm -f tmp-stdint.h
+else
+  mv -f tmp-stdint.h gstdint.h
+fi
+
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/configure.ac b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/configure.ac
new file mode 100644 (file)
index 0000000..d87ed29
--- /dev/null
@@ -0,0 +1,350 @@
+# Process this file with autoconf to produce a configure script, like so:
+# aclocal -I ../config && autoconf && autoheader && automake
+
+AC_PREREQ(2.64)
+AC_INIT([GNU OpenMP Runtime Library], 1.0,,[libgomp])
+AC_CONFIG_HEADER(config.h)
+
+# -------
+# Options
+# -------
+
+AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
+LIBGOMP_ENABLE(version-specific-runtime-libs, no, ,
+   [Specify that runtime libraries should be installed in a compiler-specific directory],
+   permit yes|no)
+AC_MSG_RESULT($enable_version_specific_runtime_libs)
+
+# We would like our source tree to be readonly. However when releases or
+# pre-releases are generated, the flex/bison generated files as well as the
+# various formats of manuals need to be included along with the rest of the
+# sources.  Therefore we have --enable-generated-files-in-srcdir to do 
+# just that.
+AC_MSG_CHECKING([for --enable-generated-files-in-srcdir])
+LIBGOMP_ENABLE(generated-files-in-srcdir, no, ,
+   [put copies of generated files in source dir intended for creating source 
+    tarballs for users without texinfo bison or flex.],
+   permit yes|no)
+AC_MSG_RESULT($enable_generated_files_in_srcdir)
+AM_CONDITIONAL(GENINSRC, test "$enable_generated_files_in_srcdir" = yes)
+
+
+# -------
+# -------
+
+# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
+#
+# You will slowly go insane if you do not grok the following fact:  when
+# building this library, the top-level /target/ becomes the library's /host/.
+#
+# configure then causes --target to default to --host, exactly like any
+# other package using autoconf.  Therefore, 'target' and 'host' will
+# always be the same.  This makes sense both for native and cross compilers
+# just think about it for a little while.  :-)
+#
+# Also, if this library is being configured as part of a cross compiler, the
+# top-level configure script will pass the "real" host as $with_cross_host.
+#
+# Do not delete or change the following two lines.  For why, see
+# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
+AC_CANONICAL_SYSTEM
+target_alias=${target_alias-$host_alias}
+
+# Sets up automake.  Must come after AC_CANONICAL_SYSTEM.  Each of the
+# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
+#  1.9.0:  minimum required version
+#  no-define:  PACKAGE and VERSION will not be #define'd in config.h (a bunch
+#              of other PACKAGE_* variables will, however, and there's nothing
+#              we can do about that; they come from AC_INIT).
+#  foreign:  we don't follow the normal rules for GNU packages (no COPYING
+#            file in the top srcdir, etc, etc), so stop complaining.
+#  no-dist:  we don't want 'dist' and related rules.
+#  -Wall:  turns on all automake warnings...
+#  -Wno-portability:  ...except this one, since GNU make is required.
+#  -Wno-override: ... and this one, since we do want this in testsuite.
+AM_INIT_AUTOMAKE([1.9.0 foreign no-dist -Wall -Wno-portability -Wno-override])
+AM_ENABLE_MULTILIB(, ..)
+
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${enable_version_specific_runtime_libs} in
+  yes)
+    # Need the gcc compiler version to know where to install libraries
+    # and header files if --enable-version-specific-runtime-libs option
+    # is selected.
+    toolexecdir='$(libdir)/gcc/$(target_alias)'
+    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+    ;;
+  no)
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      # Install a library built with a cross compiler in tooldir, not libdir.
+      toolexecdir='$(exec_prefix)/$(target_alias)'
+      toolexeclibdir='$(toolexecdir)/lib'
+    else
+      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+      toolexeclibdir='$(libdir)'
+    fi
+    multi_os_directory=`$CC -print-multi-os-directory`
+    case $multi_os_directory in
+      .) ;; # Avoid trailing /.
+      *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+    esac
+    ;;
+esac
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexeclibdir)
+
+# Check the compiler.
+# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+# We must force CC to /not/ be precious variables; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+m4_define([_AC_ARG_VAR_PRECIOUS],[])
+AC_PROG_CC
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+
+AC_SUBST(CFLAGS)
+
+# In order to override CFLAGS_FOR_TARGET, all of our special flags go
+# in XCFLAGS.  But we need them in CFLAGS during configury.  So put them
+# in both places for now and restore CFLAGS at the end of config.
+save_CFLAGS="$CFLAGS"
+
+# Add -Wall -Werror if we are using GCC.
+if test "x$GCC" = "xyes"; then
+  XCFLAGS="$XCFLAGS -Wall -Werror"
+fi
+
+# Find other programs we need.
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
+AC_PATH_PROG(PERL, perl, perl-not-found-in-path-error)
+AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+
+# See if makeinfo has been installed and is modern enough
+# that we can use it.
+ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version],
+                   [GNU texinfo.* \([0-9][0-9.]*\)],
+                   [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
+AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes")
+
+
+# Configure libtool
+AM_PROG_LIBTOOL
+ACX_LT_HOST_FLAGS
+AC_SUBST(enable_shared)
+AC_SUBST(enable_static)
+
+AM_MAINTAINER_MODE
+
+# Create a spec file, so that compile/link tests don't fail
+test -f libgfortran.spec || touch libgfortran.spec
+FCFLAGS="$FCFLAGS -L."
+
+# We need gfortran to compile parts of the library
+# We can't use AC_PROG_FC because it expects a fully working gfortran.
+#AC_PROG_FC(gfortran)
+case `echo $GFORTRAN` in
+  -* | no* )
+    FC=no ;;
+  *)
+    set dummy $GFORTRAN; ac_word=$2
+    if test -x "$ac_word"; then
+      FC="$GFORTRAN"
+    else
+      FC=no
+    fi ;;
+esac
+AC_PROG_FC(gfortran)
+FCFLAGS="$FCFLAGS -Wall -L../libgfortran"
+
+# For libtool versioning info, format is CURRENT:REVISION:AGE
+libtool_VERSION=1:0:0
+AC_SUBST(libtool_VERSION)
+
+# Check header files.
+AC_STDC_HEADERS
+AC_HEADER_TIME
+ACX_HEADER_STRING
+AC_CHECK_HEADERS(unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h)
+
+GCC_HEADER_STDINT(gstdint.h)
+
+# Check to see if -pthread or -lpthread is needed.  Prefer the former.
+# In case the pthread.h system header is not found, this test will fail.
+XPCFLAGS=""
+CFLAGS="$CFLAGS -pthread"
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+  [#include <pthread.h>
+   void *g(void *d) { return NULL; }],
+  [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
+ [XPCFLAGS=" -Wc,-pthread"],
+ [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
+  AC_LINK_IFELSE(
+   [AC_LANG_PROGRAM(
+    [#include <pthread.h>
+     void *g(void *d) { return NULL; }],
+    [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
+   [],
+   [AC_MSG_ERROR([Pthreads are required to build libgomp])])])
+
+# Check for functions needed.
+AC_CHECK_FUNCS(getloadavg clock_gettime strtoull)
+
+# Check for broken semaphore implementation on darwin.
+# sem_init returns: sem_init error: Function not implemented.
+case "$host" in
+  *-darwin*)
+    AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
+       Define if the POSIX Semaphores do not work on your system.)
+    ;;
+esac
+
+GCC_LINUX_FUTEX(:)
+
+# Check for pthread_{,attr_}[sg]etaffinity_np.
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+  [#define _GNU_SOURCE
+   #include <pthread.h>],
+  [cpu_set_t cpuset;
+   pthread_attr_t attr;
+   pthread_getaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset);
+   if (CPU_ISSET (0, &cpuset))
+     CPU_SET (1, &cpuset);
+   else
+     CPU_ZERO (&cpuset);
+   pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset);
+   pthread_attr_init (&attr);
+   pthread_attr_getaffinity_np (&attr, sizeof (cpu_set_t), &cpuset);
+   pthread_attr_setaffinity_np (&attr, sizeof (cpu_set_t), &cpuset);])],
+  AC_DEFINE(HAVE_PTHREAD_AFFINITY_NP, 1,
+[      Define if pthread_{,attr_}{g,s}etaffinity_np is supported.]))
+
+# At least for glibc, clock_gettime is in librt.  But don't pull that
+# in if it still doesn't give us the function we want.
+if test $ac_cv_func_clock_gettime = no; then
+  AC_CHECK_LIB(rt, clock_gettime,
+    [LIBS="-lrt $LIBS"
+     AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
+              [Define to 1 if you have the `clock_gettime' function.])])
+fi
+
+# See if we support thread-local storage.
+GCC_CHECK_TLS
+
+# See what sort of export controls are availible.
+LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY
+LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT
+LIBGOMP_CHECK_ATTRIBUTE_ALIAS
+LIBGOMP_ENABLE_SYMVERS
+
+if test $enable_symvers = gnu; then
+  AC_DEFINE(LIBGOMP_GNU_SYMBOL_VERSIONING, 1,
+           [Define to 1 if GNU symbol versioning is used for libgomp.])
+fi
+
+# Get target configury.
+. ${srcdir}/configure.tgt
+CFLAGS="$save_CFLAGS $XCFLAGS"
+
+# Check for __sync_val_compare_and_swap, but only after the target has
+# had a chance to set XCFLAGS.
+LIBGOMP_CHECK_SYNC_BUILTINS
+
+XCFLAGS="$XCFLAGS$XPCFLAGS"
+
+AC_SUBST(config_path)
+AC_SUBST(XCFLAGS)
+AC_SUBST(XLDFLAGS)
+
+# Cleanup and exit.
+CFLAGS="$save_CFLAGS"
+AC_CACHE_SAVE
+
+if test ${multilib} = yes; then
+  multilib_arg="--enable-multilib"
+else
+  multilib_arg=
+fi
+
+# Set up the set of libraries that we need to link against for libgomp.
+# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp,
+# which will force linkage against -lpthread (or equivalent for the system).
+# That's not 100% ideal, but about the best we can do easily.
+if test $enable_shared = yes; then
+  link_gomp="-lgomp %{static: $LIBS}"
+else
+  link_gomp="-lgomp $LIBS"
+fi
+AC_SUBST(link_gomp)
+
+AM_CONDITIONAL([USE_FORTRAN], [test "$ac_cv_fc_compiler_gnu" = yes])
+
+# ??? 2006-01-24: Paulo committed to asking autoconf folk to document
+# and export AC_COMPUTE_INT.  If that happens, then we'll need to remove
+# the underscore here and update the PREREQ.  If it doesn't, then we'll
+# need to copy this macro to our acinclude.m4.
+save_CFLAGS="$CFLAGS"
+for i in $config_path; do
+  if test -f $srcdir/config/$i/omp-lock.h; then
+    CFLAGS="$CFLAGS -include confdefs.h -include $srcdir/config/$i/omp-lock.h"
+    break
+  fi
+done
+
+_AC_COMPUTE_INT([sizeof (omp_lock_t)], [OMP_LOCK_SIZE],,
+  [AC_MSG_ERROR([unsupported system, cannot find sizeof (omp_lock_t)])])
+_AC_COMPUTE_INT([__alignof (omp_lock_t)], [OMP_LOCK_ALIGN])
+_AC_COMPUTE_INT([sizeof (omp_nest_lock_t)], [OMP_NEST_LOCK_SIZE])
+_AC_COMPUTE_INT([__alignof (omp_nest_lock_t)], [OMP_NEST_LOCK_ALIGN])
+_AC_COMPUTE_INT([sizeof (omp_lock_25_t)], [OMP_LOCK_25_SIZE],,
+  [AC_MSG_ERROR([unsupported system, cannot find sizeof (omp_lock_25_t)])])
+_AC_COMPUTE_INT([__alignof (omp_lock_25_t)], [OMP_LOCK_25_ALIGN])
+_AC_COMPUTE_INT([sizeof (omp_nest_lock_25_t)], [OMP_NEST_LOCK_25_SIZE])
+_AC_COMPUTE_INT([__alignof (omp_nest_lock_25_t)], [OMP_NEST_LOCK_25_ALIGN])
+
+# If the lock fits in an integer, then arrange for Fortran to use that
+# integer.  If it doesn't, then arrange for Fortran to use a pointer.
+# Except that we don't have a way at present to multi-lib the installed
+# Fortran modules, so we assume 8 bytes for pointers, regardless of the
+# actual target.
+OMP_LOCK_KIND=$OMP_LOCK_SIZE
+OMP_NEST_LOCK_KIND=$OMP_NEST_LOCK_SIZE
+if test $OMP_LOCK_SIZE -gt 8 || test $OMP_LOCK_ALIGN -gt $OMP_LOCK_SIZE; then
+  OMP_LOCK_KIND=8
+fi
+if test $OMP_NEST_LOCK_SIZE -gt 8 || test $OMP_NEST_LOCK_ALIGN -gt $OMP_NEST_LOCK_SIZE; then
+  OMP_NEST_LOCK_KIND=8
+fi
+OMP_LOCK_25_KIND=$OMP_LOCK_25_SIZE
+OMP_NEST_LOCK_25_KIND=$OMP_NEST_LOCK_25_SIZE
+if test $OMP_LOCK_25_SIZE -gt 8 || test $OMP_LOCK_25_ALIGN -gt $OMP_LOCK_25_SIZE; then
+  OMP_LOCK_25_KIND=8
+fi
+if test $OMP_NEST_LOCK_25_SIZE -gt 8 || test $OMP_NEST_LOCK_25_ALIGN -gt $OMP_NEST_LOCK_25_SIZE; then
+  OMP_NEST_LOCK_25_KIND=8
+fi
+
+AC_SUBST(OMP_LOCK_SIZE)
+AC_SUBST(OMP_LOCK_ALIGN)
+AC_SUBST(OMP_NEST_LOCK_SIZE)
+AC_SUBST(OMP_NEST_LOCK_ALIGN)
+AC_SUBST(OMP_LOCK_KIND)
+AC_SUBST(OMP_NEST_LOCK_KIND)
+AC_SUBST(OMP_LOCK_25_SIZE)
+AC_SUBST(OMP_LOCK_25_ALIGN)
+AC_SUBST(OMP_NEST_LOCK_25_SIZE)
+AC_SUBST(OMP_NEST_LOCK_25_ALIGN)
+AC_SUBST(OMP_LOCK_25_KIND)
+AC_SUBST(OMP_NEST_LOCK_25_KIND)
+CFLAGS="$save_CFLAGS"
+
+AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)
+AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec)
+AC_OUTPUT
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/configure.tgt b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/configure.tgt
new file mode 100644 (file)
index 0000000..210dd5d
--- /dev/null
@@ -0,0 +1,148 @@
+# This is the target specific configuration file.  This is invoked by the
+# autoconf generated configure script.  Putting it in a separate shell file
+# lets us skip running autoconf when modifying target specific information.
+
+# This file switches on the shell variable ${target}, and sets the
+# following shell variables:
+#  config_path         An ordered list of directories to search for
+#                      sources and headers.  This is relative to the
+#                      config subdirectory of the source tree.
+#  XCFLAGS             Add extra compile flags to use.
+#  XLDFLAGS            Add extra link flags to use.
+
+# Optimize TLS usage by avoiding the overhead of dynamic allocation.
+if test $gcc_cv_have_tls = yes ; then
+  case "${target}" in
+
+    *-*-linux*)
+       XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
+       ;;
+  esac
+fi
+
+# Since we require POSIX threads, assume a POSIX system by default.
+config_path="posix"
+
+# Check for futex enabled all at once.
+if test $enable_linux_futex = yes; then
+  case "${target}" in
+
+    alpha*-*-linux*)
+       config_path="linux/alpha linux posix"
+       ;;
+
+    arm*-*-linux*)
+       config_path="linux posix"
+       ;;
+
+    ia64*-*-linux*)
+       config_path="linux/ia64 linux posix"
+       ;;
+
+    mips*-*-linux*)
+       config_path="linux/mips linux posix"
+       ;;
+
+    powerpc*-*-linux*)
+       config_path="linux/powerpc linux posix"
+       ;;
+
+    s390*-*-linux*)
+       config_path="linux/s390 linux posix"
+       ;;
+
+    tile*-*-linux*)
+       config_path="linux/tile linux posix"
+       ;;
+
+    # Note that bare i386 is not included here.  We need cmpxchg.
+    i[456]86-*-linux*)
+       config_path="linux/x86 linux posix"
+       case " ${CC} ${CFLAGS} " in
+         *" -m64 "*)
+           ;;
+         *)
+           if test -z "$with_arch"; then
+             XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
+           fi
+       esac
+       ;;
+
+    # Similar jiggery-pokery for x86_64 multilibs, except here we
+    # can't rely on the --with-arch configure option, since that
+    # applies to the 64-bit side.
+    x86_64-*-linux*)
+       config_path="linux/x86 linux posix"
+       case " ${CC} ${CFLAGS} " in
+         *" -m32 "*)
+           XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
+           ;;
+       esac
+       ;;
+
+    # Note that sparcv7 and sparcv8 is not included here.  We need cas.
+    sparcv9-*-linux* | sparc64-*-linux*)
+       echo "int i;" > conftestx.c
+       if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
+         config_path="linux/sparc linux posix"
+         case "`/usr/bin/file conftestx.o`" in
+           *32-bit*)
+             case " ${CC} ${CFLAGS}" in
+               *" -mcpu=ultrasparc"*)
+                 ;;
+               *)
+                 XCFLAGS="${XCFLAGS} -mcpu=v9"
+                 ;;
+             esac
+             ;;
+         esac
+       fi
+       rm -f conftestx.c conftestx.o
+       ;;
+  esac
+fi
+
+# Other system configury
+case "${target}" in
+
+  *-*-hpux*)
+       case "${target}" in
+         *-*-hpux11*)
+            # HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
+            XLDFLAGS="${XLDFLAGS} -lrt"
+            ;;
+       esac
+       case "${target}" in
+         hppa[12]*-*-hpux*)
+           # PA 32 HP-UX needs -frandom-seed for bootstrap compare.
+           XCFLAGS="${XCFLAGS} -frandom-seed=fixed-seed"
+           ;;
+       esac
+       ;;
+
+  *-*-mingw32*)
+       config_path="mingw32 posix"
+       ;;
+
+  *-*-darwin*)
+       config_path="bsd posix"
+       ;;
+
+  *-*-freebsd*)
+       # Need to link with -lpthread so libgomp.so is self-contained.
+       XLDFLAGS="${XLDFLAGS} -lpthread"
+       ;;
+
+  alpha*-dec-osf*)
+       # Use Tru64 UNIX-specific sem.h version.
+       config_path="osf posix"
+       ;;
+
+  mips-sgi-irix6*)
+       # Need to link with -lpthread so libgomp.so is self-contained.
+       XLDFLAGS="${XLDFLAGS} -lpthread"
+       ;;
+  *)
+       ;;
+
+esac
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/critical.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/critical.c
new file mode 100644 (file)
index 0000000..414c422
--- /dev/null
@@ -0,0 +1,148 @@
+/* Copyright (C) 2005, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the CRITICAL construct.  */
+
+#include "libgomp.h"
+#include <stdlib.h>
+
+
+static gomp_mutex_t default_lock;
+
+void
+GOMP_critical_start (void)
+{
+  /* There is an implicit flush on entry to a critical region. */
+  __atomic_thread_fence (MEMMODEL_RELEASE);
+  gomp_mutex_lock (&default_lock);
+}
+
+void
+GOMP_critical_end (void)
+{
+  gomp_mutex_unlock (&default_lock);
+}
+
+#ifndef HAVE_SYNC_BUILTINS
+static gomp_mutex_t create_lock_lock;
+#endif
+
+void
+GOMP_critical_name_start (void **pptr)
+{
+  gomp_mutex_t *plock;
+
+  /* If a mutex fits within the space for a pointer, and is zero initialized,
+     then use the pointer space directly.  */
+  if (GOMP_MUTEX_INIT_0
+      && sizeof (gomp_mutex_t) <= sizeof (void *)
+      && __alignof (gomp_mutex_t) <= sizeof (void *))
+    plock = (gomp_mutex_t *)pptr;
+
+  /* Otherwise we have to be prepared to malloc storage.  */
+  else
+    {
+      plock = *pptr;
+
+      if (plock == NULL)
+       {
+#ifdef HAVE_SYNC_BUILTINS
+         gomp_mutex_t *nlock = gomp_malloc (sizeof (gomp_mutex_t));
+         gomp_mutex_init (nlock);
+
+         plock = __sync_val_compare_and_swap (pptr, NULL, nlock);
+         if (plock != NULL)
+           {
+             gomp_mutex_destroy (nlock);
+             free (nlock);
+           }
+         else
+           plock = nlock;
+#else
+         gomp_mutex_lock (&create_lock_lock);
+         plock = *pptr;
+         if (plock == NULL)
+           {
+             plock = gomp_malloc (sizeof (gomp_mutex_t));
+             gomp_mutex_init (plock);
+             __sync_synchronize ();
+             *pptr = plock;
+           }
+         gomp_mutex_unlock (&create_lock_lock);
+#endif
+       }
+    }
+
+  gomp_mutex_lock (plock);
+}
+
+void
+GOMP_critical_name_end (void **pptr)
+{
+  gomp_mutex_t *plock;
+
+  /* If a mutex fits within the space for a pointer, and is zero initialized,
+     then use the pointer space directly.  */
+  if (GOMP_MUTEX_INIT_0
+      && sizeof (gomp_mutex_t) <= sizeof (void *)
+      && __alignof (gomp_mutex_t) <= sizeof (void *))
+    plock = (gomp_mutex_t *)pptr;
+  else
+    plock = *pptr;
+
+  gomp_mutex_unlock (plock);
+}
+
+/* This mutex is used when atomic operations don't exist for the target
+   in the mode requested.  The result is not globally atomic, but works so
+   long as all parallel references are within #pragma omp atomic directives.
+   According to responses received from omp@openmp.org, appears to be within
+   spec.  Which makes sense, since that's how several other compilers 
+   handle this situation as well.  */
+
+static gomp_mutex_t atomic_lock;
+
+void
+GOMP_atomic_start (void)
+{
+  gomp_mutex_lock (&atomic_lock);
+}
+
+void
+GOMP_atomic_end (void)
+{
+  gomp_mutex_unlock (&atomic_lock);
+}
+
+#if !GOMP_MUTEX_INIT_0
+static void __attribute__((constructor))
+initialize_critical (void)
+{
+  gomp_mutex_init (&default_lock);
+  gomp_mutex_init (&atomic_lock);
+#ifndef HAVE_SYNC_BUILTINS
+  gomp_mutex_init (&create_lock_lock);
+#endif
+}
+#endif
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/env.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/env.c
new file mode 100644 (file)
index 0000000..aff7490
--- /dev/null
@@ -0,0 +1,758 @@
+/* Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file defines the OpenMP internal control variables, and arranges
+   for them to be initialized from environment variables at startup.  */
+
+#include "libgomp.h"
+#include "libgomp_f.h"
+#include <ctype.h>
+#include <stdlib.h>
+#ifdef STRING_WITH_STRINGS
+# include <string.h>
+# include <strings.h>
+#else
+# ifdef HAVE_STRING_H
+#  include <string.h>
+# else
+#  ifdef HAVE_STRINGS_H
+#   include <strings.h>
+#  endif
+# endif
+#endif
+#include <limits.h>
+#include <errno.h>
+
+#ifndef HAVE_STRTOULL
+# define strtoull(ptr, eptr, base) strtoul (ptr, eptr, base)
+#endif
+
+struct gomp_task_icv gomp_global_icv = {
+  .nthreads_var = 1,
+  .run_sched_var = GFS_DYNAMIC,
+  .run_sched_modifier = 1,
+  .dyn_var = false,
+  .nest_var = false
+};
+
+unsigned short *gomp_cpu_affinity;
+size_t gomp_cpu_affinity_len;
+unsigned long gomp_max_active_levels_var = INT_MAX;
+unsigned long gomp_thread_limit_var = ULONG_MAX;
+unsigned long gomp_remaining_threads_count;
+#ifndef HAVE_SYNC_BUILTINS
+gomp_mutex_t gomp_remaining_threads_lock;
+#endif
+unsigned long gomp_available_cpus = 1, gomp_managed_threads = 1;
+unsigned long long gomp_spin_count_var, gomp_throttled_spin_count_var;
+unsigned long *gomp_nthreads_var_list, gomp_nthreads_var_list_len;
+
+/* Parse the OMP_SCHEDULE environment variable.  */
+
+static void
+parse_schedule (void)
+{
+  char *env, *end;
+  unsigned long value;
+
+  env = getenv ("OMP_SCHEDULE");
+  if (env == NULL)
+    return;
+
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (strncasecmp (env, "static", 6) == 0)
+    {
+      gomp_global_icv.run_sched_var = GFS_STATIC;
+      env += 6;
+    }
+  else if (strncasecmp (env, "dynamic", 7) == 0)
+    {
+      gomp_global_icv.run_sched_var = GFS_DYNAMIC;
+      env += 7;
+    }
+  else if (strncasecmp (env, "guided", 6) == 0)
+    {
+      gomp_global_icv.run_sched_var = GFS_GUIDED;
+      env += 6;
+    }
+  else if (strncasecmp (env, "auto", 4) == 0)
+    {
+      gomp_global_icv.run_sched_var = GFS_AUTO;
+      env += 4;
+    }
+  else
+    goto unknown;
+
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (*env == '\0')
+    {
+      gomp_global_icv.run_sched_modifier
+       = gomp_global_icv.run_sched_var != GFS_STATIC;
+      return;
+    }
+  if (*env++ != ',')
+    goto unknown;
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (*env == '\0')
+    goto invalid;
+
+  errno = 0;
+  value = strtoul (env, &end, 10);
+  if (errno)
+    goto invalid;
+
+  while (isspace ((unsigned char) *end))
+    ++end;
+  if (*end != '\0')
+    goto invalid;
+
+  if ((int)value != value)
+    goto invalid;
+
+  if (value == 0 && gomp_global_icv.run_sched_var != GFS_STATIC)
+    value = 1;
+  gomp_global_icv.run_sched_modifier = value;
+  return;
+
+ unknown:
+  gomp_error ("Unknown value for environment variable OMP_SCHEDULE");
+  return;
+
+ invalid:
+  gomp_error ("Invalid value for chunk size in "
+             "environment variable OMP_SCHEDULE");
+  return;
+}
+
+/* Parse an unsigned long environment variable.  Return true if one was
+   present and it was successfully parsed.  */
+
+static bool
+parse_unsigned_long (const char *name, unsigned long *pvalue, bool allow_zero)
+{
+  char *env, *end;
+  unsigned long value;
+
+  env = getenv (name);
+  if (env == NULL)
+    return false;
+
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (*env == '\0')
+    goto invalid;
+
+  errno = 0;
+  value = strtoul (env, &end, 10);
+  if (errno || (long) value <= 0 - allow_zero)
+    goto invalid;
+
+  while (isspace ((unsigned char) *end))
+    ++end;
+  if (*end != '\0')
+    goto invalid;
+
+  *pvalue = value;
+  return true;
+
+ invalid:
+  gomp_error ("Invalid value for environment variable %s", name);
+  return false;
+}
+
+/* Parse an unsigned long list environment variable.  Return true if one was
+   present and it was successfully parsed.  */
+
+static bool
+parse_unsigned_long_list (const char *name, unsigned long *p1stvalue,
+                         unsigned long **pvalues,
+                         unsigned long *pnvalues)
+{
+  char *env, *end;
+  unsigned long value, *values = NULL;
+
+  env = getenv (name);
+  if (env == NULL)
+    return false;
+
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (*env == '\0')
+    goto invalid;
+
+  errno = 0;
+  value = strtoul (env, &end, 10);
+  if (errno || (long) value <= 0)
+    goto invalid;
+
+  while (isspace ((unsigned char) *end))
+    ++end;
+  if (*end != '\0')
+    {
+      if (*end == ',')
+       {
+         unsigned long nvalues = 0, nalloced = 0;
+
+         do
+           {
+             env = end + 1;
+             if (nvalues == nalloced)
+               {
+                 unsigned long *n;
+                 nalloced = nalloced ? nalloced * 2 : 16;
+                 n = realloc (values, nalloced * sizeof (unsigned long));
+                 if (n == NULL)
+                   {
+                     free (values);
+                     gomp_error ("Out of memory while trying to parse"
+                                 " environment variable %s", name);
+                     return false;
+                   }
+                 values = n;
+                 if (nvalues == 0)
+                   values[nvalues++] = value;
+               }
+
+             while (isspace ((unsigned char) *env))
+               ++env;
+             if (*env == '\0')
+               goto invalid;
+
+             errno = 0;
+             value = strtoul (env, &end, 10);
+             if (errno || (long) value <= 0)
+               goto invalid;
+
+             values[nvalues++] = value;
+             while (isspace ((unsigned char) *end))
+               ++end;
+             if (*end == '\0')
+               break;
+             if (*end != ',')
+               goto invalid;
+           }
+         while (1);
+         *p1stvalue = values[0];
+         *pvalues = values;
+         *pnvalues = nvalues;
+         return true;
+       }
+      goto invalid;
+    }
+
+  *p1stvalue = value;
+  return true;
+
+ invalid:
+  free (values);
+  gomp_error ("Invalid value for environment variable %s", name);
+  return false;
+}
+
+/* Parse the OMP_STACKSIZE environment varible.  Return true if one was
+   present and it was successfully parsed.  */
+
+static bool
+parse_stacksize (const char *name, unsigned long *pvalue)
+{
+  char *env, *end;
+  unsigned long value, shift = 10;
+
+  env = getenv (name);
+  if (env == NULL)
+    return false;
+
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (*env == '\0')
+    goto invalid;
+
+  errno = 0;
+  value = strtoul (env, &end, 10);
+  if (errno)
+    goto invalid;
+
+  while (isspace ((unsigned char) *end))
+    ++end;
+  if (*end != '\0')
+    {
+      switch (tolower ((unsigned char) *end))
+       {
+       case 'b':
+         shift = 0;
+         break;
+       case 'k':
+         break;
+       case 'm':
+         shift = 20;
+         break;
+       case 'g':
+         shift = 30;
+         break;
+       default:
+         goto invalid;
+       }
+      ++end;
+      while (isspace ((unsigned char) *end))
+       ++end;
+      if (*end != '\0')
+       goto invalid;
+    }
+
+  if (((value << shift) >> shift) != value)
+    goto invalid;
+
+  *pvalue = value << shift;
+  return true;
+
+ invalid:
+  gomp_error ("Invalid value for environment variable %s", name);
+  return false;
+}
+
+/* Parse the GOMP_SPINCOUNT environment varible.  Return true if one was
+   present and it was successfully parsed.  */
+
+static bool
+parse_spincount (const char *name, unsigned long long *pvalue)
+{
+  char *env, *end;
+  unsigned long long value, mult = 1;
+
+  env = getenv (name);
+  if (env == NULL)
+    return false;
+
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (*env == '\0')
+    goto invalid;
+
+  if (strncasecmp (env, "infinite", 8) == 0
+      || strncasecmp (env, "infinity", 8) == 0)
+    {
+      value = ~0ULL;
+      end = env + 8;
+      goto check_tail;
+    }
+
+  errno = 0;
+  value = strtoull (env, &end, 10);
+  if (errno)
+    goto invalid;
+
+  while (isspace ((unsigned char) *end))
+    ++end;
+  if (*end != '\0')
+    {
+      switch (tolower ((unsigned char) *end))
+       {
+       case 'k':
+         mult = 1000LL;
+         break;
+       case 'm':
+         mult = 1000LL * 1000LL;
+         break;
+       case 'g':
+         mult = 1000LL * 1000LL * 1000LL;
+         break;
+       case 't':
+         mult = 1000LL * 1000LL * 1000LL * 1000LL;
+         break;
+       default:
+         goto invalid;
+       }
+      ++end;
+     check_tail:
+      while (isspace ((unsigned char) *end))
+       ++end;
+      if (*end != '\0')
+       goto invalid;
+    }
+
+  if (value > ~0ULL / mult)
+    value = ~0ULL;
+  else
+    value *= mult;
+
+  *pvalue = value;
+  return true;
+
+ invalid:
+  gomp_error ("Invalid value for environment variable %s", name);
+  return false;
+}
+
+/* Parse a boolean value for environment variable NAME and store the
+   result in VALUE.  */
+
+static void
+parse_boolean (const char *name, bool *value)
+{
+  const char *env;
+
+  env = getenv (name);
+  if (env == NULL)
+    return;
+
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (strncasecmp (env, "true", 4) == 0)
+    {
+      *value = true;
+      env += 4;
+    }
+  else if (strncasecmp (env, "false", 5) == 0)
+    {
+      *value = false;
+      env += 5;
+    }
+  else
+    env = "X";
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (*env != '\0')
+    gomp_error ("Invalid value for environment variable %s", name);
+}
+
+/* Parse the OMP_WAIT_POLICY environment variable and store the
+   result in gomp_active_wait_policy.  */
+
+static int
+parse_wait_policy (void)
+{
+  const char *env;
+  int ret = -1;
+
+  env = getenv ("OMP_WAIT_POLICY");
+  if (env == NULL)
+    return -1;
+
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (strncasecmp (env, "active", 6) == 0)
+    {
+      ret = 1;
+      env += 6;
+    }
+  else if (strncasecmp (env, "passive", 7) == 0)
+    {
+      ret = 0;
+      env += 7;
+    }
+  else
+    env = "X";
+  while (isspace ((unsigned char) *env))
+    ++env;
+  if (*env == '\0')
+    return ret;
+  gomp_error ("Invalid value for environment variable OMP_WAIT_POLICY");
+  return -1;
+}
+
+/* Parse the GOMP_CPU_AFFINITY environment varible.  Return true if one was
+   present and it was successfully parsed.  */
+
+static bool
+parse_affinity (void)
+{
+  char *env, *end;
+  unsigned long cpu_beg, cpu_end, cpu_stride;
+  unsigned short *cpus = NULL;
+  size_t allocated = 0, used = 0, needed;
+
+  env = getenv ("GOMP_CPU_AFFINITY");
+  if (env == NULL)
+    return false;
+
+  do
+    {
+      while (*env == ' ' || *env == '\t')
+       env++;
+
+      cpu_beg = strtoul (env, &end, 0);
+      cpu_end = cpu_beg;
+      cpu_stride = 1;
+      if (env == end || cpu_beg >= 65536)
+       goto invalid;
+
+      env = end;
+      if (*env == '-')
+       {
+         cpu_end = strtoul (++env, &end, 0);
+         if (env == end || cpu_end >= 65536 || cpu_end < cpu_beg)
+           goto invalid;
+
+         env = end;
+         if (*env == ':')
+           {
+             cpu_stride = strtoul (++env, &end, 0);
+             if (env == end || cpu_stride == 0 || cpu_stride >= 65536)
+               goto invalid;
+
+             env = end;
+           }
+       }
+
+      needed = (cpu_end - cpu_beg) / cpu_stride + 1;
+      if (used + needed >= allocated)
+       {
+         unsigned short *new_cpus;
+
+         if (allocated < 64)
+           allocated = 64;
+         if (allocated > needed)
+           allocated <<= 1;
+         else
+           allocated += 2 * needed;
+         new_cpus = realloc (cpus, allocated * sizeof (unsigned short));
+         if (new_cpus == NULL)
+           {
+             free (cpus);
+             gomp_error ("not enough memory to store GOMP_CPU_AFFINITY list");
+             return false;
+           }
+
+         cpus = new_cpus;
+       }
+
+      while (needed--)
+       {
+         cpus[used++] = cpu_beg;
+         cpu_beg += cpu_stride;
+       }
+
+      while (*env == ' ' || *env == '\t')
+       env++;
+
+      if (*env == ',')
+       env++;
+      else if (*env == '\0')
+       break;
+    }
+  while (1);
+
+  gomp_cpu_affinity = cpus;
+  gomp_cpu_affinity_len = used;
+  return true;
+
+ invalid:
+  gomp_error ("Invalid value for enviroment variable GOMP_CPU_AFFINITY");
+  return false;
+}
+
+static void __attribute__((constructor))
+initialize_env (void)
+{
+  unsigned long stacksize;
+  int wait_policy;
+  bool bind_var = false;
+
+  /* Do a compile time check that mkomp_h.pl did good job.  */
+  omp_check_defines ();
+
+  parse_schedule ();
+  parse_boolean ("OMP_DYNAMIC", &gomp_global_icv.dyn_var);
+  parse_boolean ("OMP_NESTED", &gomp_global_icv.nest_var);
+  parse_boolean ("OMP_PROC_BIND", &bind_var);
+  parse_unsigned_long ("OMP_MAX_ACTIVE_LEVELS", &gomp_max_active_levels_var,
+                      true);
+  parse_unsigned_long ("OMP_THREAD_LIMIT", &gomp_thread_limit_var, false);
+  if (gomp_thread_limit_var != ULONG_MAX)
+    gomp_remaining_threads_count = gomp_thread_limit_var - 1;
+#ifndef HAVE_SYNC_BUILTINS
+  gomp_mutex_init (&gomp_remaining_threads_lock);
+#endif
+  gomp_init_num_threads ();
+  gomp_available_cpus = gomp_global_icv.nthreads_var;
+  if (!parse_unsigned_long_list ("OMP_NUM_THREADS",
+                                &gomp_global_icv.nthreads_var,
+                                &gomp_nthreads_var_list,
+                                &gomp_nthreads_var_list_len))
+    gomp_global_icv.nthreads_var = gomp_available_cpus;
+  if (parse_affinity () || bind_var)
+    gomp_init_affinity ();
+  wait_policy = parse_wait_policy ();
+  if (!parse_spincount ("GOMP_SPINCOUNT", &gomp_spin_count_var))
+    {
+      /* Using a rough estimation of 100000 spins per msec,
+        use 5 min blocking for OMP_WAIT_POLICY=active,
+        3 msec blocking when OMP_WAIT_POLICY is not specificed
+        and 0 when OMP_WAIT_POLICY=passive.
+        Depending on the CPU speed, this can be e.g. 5 times longer
+        or 5 times shorter.  */
+      if (wait_policy > 0)
+       gomp_spin_count_var = 30000000000LL;
+      else if (wait_policy < 0)
+       gomp_spin_count_var = 300000LL;
+    }
+  /* gomp_throttled_spin_count_var is used when there are more libgomp
+     managed threads than available CPUs.  Use very short spinning.  */
+  if (wait_policy > 0)
+    gomp_throttled_spin_count_var = 1000LL;
+  else if (wait_policy < 0)
+    gomp_throttled_spin_count_var = 100LL;
+  if (gomp_throttled_spin_count_var > gomp_spin_count_var)
+    gomp_throttled_spin_count_var = gomp_spin_count_var;
+
+  /* Not strictly environment related, but ordering constructors is tricky.  */
+  pthread_attr_init (&gomp_thread_attr);
+  pthread_attr_setdetachstate (&gomp_thread_attr, PTHREAD_CREATE_DETACHED);
+
+  if (parse_stacksize ("OMP_STACKSIZE", &stacksize)
+      || parse_stacksize ("GOMP_STACKSIZE", &stacksize))
+    {
+      int err;
+
+      err = pthread_attr_setstacksize (&gomp_thread_attr, stacksize);
+
+#ifdef PTHREAD_STACK_MIN
+      if (err == EINVAL)
+       {
+         if (stacksize < PTHREAD_STACK_MIN)
+           gomp_error ("Stack size less than minimum of %luk",
+                       PTHREAD_STACK_MIN / 1024ul
+                       + (PTHREAD_STACK_MIN % 1024 != 0));
+         else
+           gomp_error ("Stack size larger than system limit");
+       }
+      else
+#endif
+      if (err != 0)
+       gomp_error ("Stack size change failed: %s", strerror (err));
+    }
+}
+
+\f
+/* The public OpenMP API routines that access these variables.  */
+
+void
+omp_set_num_threads (int n)
+{
+  struct gomp_task_icv *icv = gomp_icv (true);
+  icv->nthreads_var = (n > 0 ? n : 1);
+}
+
+void
+omp_set_dynamic (int val)
+{
+  struct gomp_task_icv *icv = gomp_icv (true);
+  icv->dyn_var = val;
+}
+
+int
+omp_get_dynamic (void)
+{
+  struct gomp_task_icv *icv = gomp_icv (false);
+  return icv->dyn_var;
+}
+
+void
+omp_set_nested (int val)
+{
+  struct gomp_task_icv *icv = gomp_icv (true);
+  icv->nest_var = val;
+}
+
+int
+omp_get_nested (void)
+{
+  struct gomp_task_icv *icv = gomp_icv (false);
+  return icv->nest_var;
+}
+
+void
+omp_set_schedule (omp_sched_t kind, int modifier)
+{
+  struct gomp_task_icv *icv = gomp_icv (true);
+  switch (kind)
+    {
+    case omp_sched_static:
+      if (modifier < 1)
+       modifier = 0;
+      icv->run_sched_modifier = modifier;
+      break;
+    case omp_sched_dynamic:
+    case omp_sched_guided:
+      if (modifier < 1)
+       modifier = 1;
+      icv->run_sched_modifier = modifier;
+      break;
+    case omp_sched_auto:
+      break;
+    default:
+      return;
+    }
+  icv->run_sched_var = kind;
+}
+
+void
+omp_get_schedule (omp_sched_t *kind, int *modifier)
+{
+  struct gomp_task_icv *icv = gomp_icv (false);
+  *kind = icv->run_sched_var;
+  *modifier = icv->run_sched_modifier;
+}
+
+int
+omp_get_max_threads (void)
+{
+  struct gomp_task_icv *icv = gomp_icv (false);
+  return icv->nthreads_var;
+}
+
+int
+omp_get_thread_limit (void)
+{
+  return gomp_thread_limit_var > INT_MAX ? INT_MAX : gomp_thread_limit_var;
+}
+
+void
+omp_set_max_active_levels (int max_levels)
+{
+  if (max_levels >= 0)
+    gomp_max_active_levels_var = max_levels;
+}
+
+int
+omp_get_max_active_levels (void)
+{
+  return gomp_max_active_levels_var;
+}
+
+ialias (omp_set_dynamic)
+ialias (omp_set_nested)
+ialias (omp_set_num_threads)
+ialias (omp_get_dynamic)
+ialias (omp_get_nested)
+ialias (omp_set_schedule)
+ialias (omp_get_schedule)
+ialias (omp_get_max_threads)
+ialias (omp_get_thread_limit)
+ialias (omp_set_max_active_levels)
+ialias (omp_get_max_active_levels)
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/error.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/error.c
new file mode 100644 (file)
index 0000000..ad829b6
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains routines used to signal errors.  Most places in the
+   OpenMP API do not make any provision for failure, so we can't just
+   defer the decision on reporting the problem to the user; we must do it
+   ourselves or not at all.  */
+/* ??? Is this about what other implementations do?  Assume stderr hasn't
+   been pointed somewhere unsafe?  */
+
+#include "libgomp.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+static void
+gomp_verror (const char *fmt, va_list list)
+{
+  fputs ("\nlibgomp: ", stderr);
+  vfprintf (stderr, fmt, list);
+  fputc ('\n', stderr);
+}
+
+void
+gomp_error (const char *fmt, ...)
+{
+  va_list list;
+
+  va_start (list, fmt);
+  gomp_verror (fmt, list);
+  va_end (list);
+}
+
+void
+gomp_fatal (const char *fmt, ...)
+{
+  va_list list;
+
+  va_start (list, fmt);
+  gomp_verror (fmt, list);
+  va_end (list);
+
+  exit (EXIT_FAILURE);
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/fortran.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/fortran.c
new file mode 100644 (file)
index 0000000..de806f8
--- /dev/null
@@ -0,0 +1,437 @@
+/* Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains Fortran wrapper routines.  */
+
+#include "libgomp.h"
+#include "libgomp_f.h"
+#include <stdlib.h>
+#include <limits.h>
+
+#ifdef HAVE_ATTRIBUTE_ALIAS
+/* Use internal aliases if possible.  */
+# define ULP           STR1(__USER_LABEL_PREFIX__)
+# define STR1(x)       STR2(x)
+# define STR2(x)       #x
+# define ialias_redirect(fn) \
+  extern __typeof (fn) fn __asm__ (ULP "gomp_ialias_" #fn) attribute_hidden;
+# ifndef LIBGOMP_GNU_SYMBOL_VERSIONING
+ialias_redirect (omp_init_lock)
+ialias_redirect (omp_init_nest_lock)
+ialias_redirect (omp_destroy_lock)
+ialias_redirect (omp_destroy_nest_lock)
+ialias_redirect (omp_set_lock)
+ialias_redirect (omp_set_nest_lock)
+ialias_redirect (omp_unset_lock)
+ialias_redirect (omp_unset_nest_lock)
+ialias_redirect (omp_test_lock)
+ialias_redirect (omp_test_nest_lock)
+# endif
+ialias_redirect (omp_set_dynamic)
+ialias_redirect (omp_set_nested)
+ialias_redirect (omp_set_num_threads)
+ialias_redirect (omp_get_dynamic)
+ialias_redirect (omp_get_nested)
+ialias_redirect (omp_in_parallel)
+ialias_redirect (omp_get_max_threads)
+ialias_redirect (omp_get_num_procs)
+ialias_redirect (omp_get_num_threads)
+ialias_redirect (omp_get_thread_num)
+ialias_redirect (omp_get_wtick)
+ialias_redirect (omp_get_wtime)
+ialias_redirect (omp_set_schedule)
+ialias_redirect (omp_get_schedule)
+ialias_redirect (omp_get_thread_limit)
+ialias_redirect (omp_set_max_active_levels)
+ialias_redirect (omp_get_max_active_levels)
+ialias_redirect (omp_get_level)
+ialias_redirect (omp_get_ancestor_thread_num)
+ialias_redirect (omp_get_team_size)
+ialias_redirect (omp_get_active_level)
+ialias_redirect (omp_in_final)
+#endif
+
+#ifndef LIBGOMP_GNU_SYMBOL_VERSIONING
+# define gomp_init_lock__30 omp_init_lock_
+# define gomp_destroy_lock__30 omp_destroy_lock_
+# define gomp_set_lock__30 omp_set_lock_
+# define gomp_unset_lock__30 omp_unset_lock_
+# define gomp_test_lock__30 omp_test_lock_
+# define gomp_init_nest_lock__30 omp_init_nest_lock_
+# define gomp_destroy_nest_lock__30 omp_destroy_nest_lock_
+# define gomp_set_nest_lock__30 omp_set_nest_lock_
+# define gomp_unset_nest_lock__30 omp_unset_nest_lock_
+# define gomp_test_nest_lock__30 omp_test_nest_lock_
+#endif
+
+void
+gomp_init_lock__30 (omp_lock_arg_t lock)
+{
+#ifndef OMP_LOCK_DIRECT
+  omp_lock_arg (lock) = malloc (sizeof (omp_lock_t));
+#endif
+  gomp_init_lock_30 (omp_lock_arg (lock));
+}
+
+void
+gomp_init_nest_lock__30 (omp_nest_lock_arg_t lock)
+{
+#ifndef OMP_NEST_LOCK_DIRECT
+  omp_nest_lock_arg (lock) = malloc (sizeof (omp_nest_lock_t));
+#endif
+  gomp_init_nest_lock_30 (omp_nest_lock_arg (lock));
+}
+
+void
+gomp_destroy_lock__30 (omp_lock_arg_t lock)
+{
+  gomp_destroy_lock_30 (omp_lock_arg (lock));
+#ifndef OMP_LOCK_DIRECT
+  free (omp_lock_arg (lock));
+  omp_lock_arg (lock) = NULL;
+#endif
+}
+
+void
+gomp_destroy_nest_lock__30 (omp_nest_lock_arg_t lock)
+{
+  gomp_destroy_nest_lock_30 (omp_nest_lock_arg (lock));
+#ifndef OMP_NEST_LOCK_DIRECT
+  free (omp_nest_lock_arg (lock));
+  omp_nest_lock_arg (lock) = NULL;
+#endif
+}
+
+void
+gomp_set_lock__30 (omp_lock_arg_t lock)
+{
+  gomp_set_lock_30 (omp_lock_arg (lock));
+}
+
+void
+gomp_set_nest_lock__30 (omp_nest_lock_arg_t lock)
+{
+  gomp_set_nest_lock_30 (omp_nest_lock_arg (lock));
+}
+
+void
+gomp_unset_lock__30 (omp_lock_arg_t lock)
+{
+  gomp_unset_lock_30 (omp_lock_arg (lock));
+}
+
+void
+gomp_unset_nest_lock__30 (omp_nest_lock_arg_t lock)
+{
+  gomp_unset_nest_lock_30 (omp_nest_lock_arg (lock));
+}
+
+int32_t
+gomp_test_lock__30 (omp_lock_arg_t lock)
+{
+  return gomp_test_lock_30 (omp_lock_arg (lock));
+}
+
+int32_t
+gomp_test_nest_lock__30 (omp_nest_lock_arg_t lock)
+{
+  return gomp_test_nest_lock_30 (omp_nest_lock_arg (lock));
+}
+
+#ifdef LIBGOMP_GNU_SYMBOL_VERSIONING
+void
+gomp_init_lock__25 (omp_lock_25_arg_t lock)
+{
+#ifndef OMP_LOCK_25_DIRECT
+  omp_lock_25_arg (lock) = malloc (sizeof (omp_lock_25_t));
+#endif
+  gomp_init_lock_25 (omp_lock_25_arg (lock));
+}
+
+void
+gomp_init_nest_lock__25 (omp_nest_lock_25_arg_t lock)
+{
+#ifndef OMP_NEST_LOCK_25_DIRECT
+  omp_nest_lock_25_arg (lock) = malloc (sizeof (omp_nest_lock_25_t));
+#endif
+  gomp_init_nest_lock_25 (omp_nest_lock_25_arg (lock));
+}
+
+void
+gomp_destroy_lock__25 (omp_lock_25_arg_t lock)
+{
+  gomp_destroy_lock_25 (omp_lock_25_arg (lock));
+#ifndef OMP_LOCK_25_DIRECT
+  free (omp_lock_25_arg (lock));
+  omp_lock_25_arg (lock) = NULL;
+#endif
+}
+
+void
+gomp_destroy_nest_lock__25 (omp_nest_lock_25_arg_t lock)
+{
+  gomp_destroy_nest_lock_25 (omp_nest_lock_25_arg (lock));
+#ifndef OMP_NEST_LOCK_25_DIRECT
+  free (omp_nest_lock_25_arg (lock));
+  omp_nest_lock_25_arg (lock) = NULL;
+#endif
+}
+
+void
+gomp_set_lock__25 (omp_lock_25_arg_t lock)
+{
+  gomp_set_lock_25 (omp_lock_25_arg (lock));
+}
+
+void
+gomp_set_nest_lock__25 (omp_nest_lock_25_arg_t lock)
+{
+  gomp_set_nest_lock_25 (omp_nest_lock_25_arg (lock));
+}
+
+void
+gomp_unset_lock__25 (omp_lock_25_arg_t lock)
+{
+  gomp_unset_lock_25 (omp_lock_25_arg (lock));
+}
+
+void
+gomp_unset_nest_lock__25 (omp_nest_lock_25_arg_t lock)
+{
+  gomp_unset_nest_lock_25 (omp_nest_lock_25_arg (lock));
+}
+
+int32_t
+gomp_test_lock__25 (omp_lock_25_arg_t lock)
+{
+  return gomp_test_lock_25 (omp_lock_25_arg (lock));
+}
+
+int32_t
+gomp_test_nest_lock__25 (omp_nest_lock_25_arg_t lock)
+{
+  return gomp_test_nest_lock_25 (omp_nest_lock_25_arg (lock));
+}
+
+omp_lock_symver (omp_init_lock_)
+omp_lock_symver (omp_destroy_lock_)
+omp_lock_symver (omp_set_lock_)
+omp_lock_symver (omp_unset_lock_)
+omp_lock_symver (omp_test_lock_)
+omp_lock_symver (omp_init_nest_lock_)
+omp_lock_symver (omp_destroy_nest_lock_)
+omp_lock_symver (omp_set_nest_lock_)
+omp_lock_symver (omp_unset_nest_lock_)
+omp_lock_symver (omp_test_nest_lock_)
+#endif
+
+#define TO_INT(x) ((x) > INT_MIN ? (x) < INT_MAX ? (x) : INT_MAX : INT_MIN)
+
+void
+omp_set_dynamic_ (const int32_t *set)
+{
+  omp_set_dynamic (*set);
+}
+
+void
+omp_set_dynamic_8_ (const int64_t *set)
+{
+  omp_set_dynamic (!!*set);
+}
+
+void
+omp_set_nested_ (const int32_t *set)
+{
+  omp_set_nested (*set);
+}
+
+void
+omp_set_nested_8_ (const int64_t *set)
+{
+  omp_set_nested (!!*set);
+}
+
+void
+omp_set_num_threads_ (const int32_t *set)
+{
+  omp_set_num_threads (*set);
+}
+
+void
+omp_set_num_threads_8_ (const int64_t *set)
+{
+  omp_set_num_threads (TO_INT (*set));
+}
+
+int32_t
+omp_get_dynamic_ (void)
+{
+  return omp_get_dynamic ();
+}
+
+int32_t
+omp_get_nested_ (void)
+{
+  return omp_get_nested ();
+}
+
+int32_t
+omp_in_parallel_ (void)
+{
+  return omp_in_parallel ();
+}
+
+int32_t
+omp_get_max_threads_ (void)
+{
+  return omp_get_max_threads ();
+}
+
+int32_t
+omp_get_num_procs_ (void)
+{
+  return omp_get_num_procs ();
+}
+
+int32_t
+omp_get_num_threads_ (void)
+{
+  return omp_get_num_threads ();
+}
+
+int32_t
+omp_get_thread_num_ (void)
+{
+  return omp_get_thread_num ();
+}
+
+double
+omp_get_wtick_ (void)
+{
+  return omp_get_wtick ();
+}
+
+double
+omp_get_wtime_ (void)
+{
+  return omp_get_wtime ();
+}
+
+void
+omp_set_schedule_ (const int32_t *kind, const int32_t *modifier)
+{
+  omp_set_schedule (*kind, *modifier);
+}
+
+void
+omp_set_schedule_8_ (const int32_t *kind, const int64_t *modifier)
+{
+  omp_set_schedule (*kind, TO_INT (*modifier));
+}
+
+void
+omp_get_schedule_ (int32_t *kind, int32_t *modifier)
+{
+  omp_sched_t k;
+  int m;
+  omp_get_schedule (&k, &m);
+  *kind = k;
+  *modifier = m;
+}
+
+void
+omp_get_schedule_8_ (int32_t *kind, int64_t *modifier)
+{
+  omp_sched_t k;
+  int m;
+  omp_get_schedule (&k, &m);
+  *kind = k;
+  *modifier = m;
+}
+
+int32_t
+omp_get_thread_limit_ (void)
+{
+  return omp_get_thread_limit ();
+}
+
+void
+omp_set_max_active_levels_ (const int32_t *levels)
+{
+  omp_set_max_active_levels (*levels);
+}
+
+void
+omp_set_max_active_levels_8_ (const int64_t *levels)
+{
+  omp_set_max_active_levels (TO_INT (*levels));
+}
+
+int32_t
+omp_get_max_active_levels_ (void)
+{
+  return omp_get_max_active_levels ();
+}
+
+int32_t
+omp_get_level_ (void)
+{
+  return omp_get_level ();
+}
+
+int32_t
+omp_get_ancestor_thread_num_ (const int32_t *level)
+{
+  return omp_get_ancestor_thread_num (*level);
+}
+
+int32_t
+omp_get_ancestor_thread_num_8_ (const int64_t *level)
+{
+  return omp_get_ancestor_thread_num (TO_INT (*level));
+}
+
+int32_t
+omp_get_team_size_ (const int32_t *level)
+{
+  return omp_get_team_size (*level);
+}
+
+int32_t
+omp_get_team_size_8_ (const int64_t *level)
+{
+  return omp_get_team_size (TO_INT (*level));
+}
+
+int32_t
+omp_get_active_level_ (void)
+{
+  return omp_get_active_level ();
+}
+
+int32_t
+omp_in_final_ (void)
+{
+  return omp_in_final ();
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/iter.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/iter.c
new file mode 100644 (file)
index 0000000..cd9484a
--- /dev/null
@@ -0,0 +1,337 @@
+/* Copyright (C) 2005, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains routines for managing work-share iteration, both
+   for loops and sections.  */
+
+#include "libgomp.h"
+#include <stdlib.h>
+
+
+/* This function implements the STATIC scheduling method.  The caller should
+   iterate *pstart <= x < *pend.  Return zero if there are more iterations
+   to perform; nonzero if not.  Return less than 0 if this thread had
+   received the absolutely last iteration.  */
+
+int
+gomp_iter_static_next (long *pstart, long *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_work_share *ws = thr->ts.work_share;
+  unsigned long nthreads = team ? team->nthreads : 1;
+
+  if (thr->ts.static_trip == -1)
+    return -1;
+
+  /* Quick test for degenerate teams and orphaned constructs.  */
+  if (nthreads == 1)
+    {
+      *pstart = ws->next;
+      *pend = ws->end;
+      thr->ts.static_trip = -1;
+      return ws->next == ws->end;
+    }
+
+  /* We interpret chunk_size zero as "unspecified", which means that we
+     should break up the iterations such that each thread makes only one
+     trip through the outer loop.  */
+  if (ws->chunk_size == 0)
+    {
+      unsigned long n, q, i, t;
+      unsigned long s0, e0;
+      long s, e;
+
+      if (thr->ts.static_trip > 0)
+       return 1;
+
+      /* Compute the total number of iterations.  */
+      s = ws->incr + (ws->incr > 0 ? -1 : 1);
+      n = (ws->end - ws->next + s) / ws->incr;
+      i = thr->ts.team_id;
+
+      /* Compute the "zero-based" start and end points.  That is, as
+         if the loop began at zero and incremented by one.  */
+      q = n / nthreads;
+      t = n % nthreads;
+      if (i < t)
+       {
+         t = 0;
+         q++;
+       }
+      s0 = q * i + t;
+      e0 = s0 + q;
+
+      /* Notice when no iterations allocated for this thread.  */
+      if (s0 >= e0)
+       {
+         thr->ts.static_trip = 1;
+         return 1;
+       }
+
+      /* Transform these to the actual start and end numbers.  */
+      s = (long)s0 * ws->incr + ws->next;
+      e = (long)e0 * ws->incr + ws->next;
+
+      *pstart = s;
+      *pend = e;
+      thr->ts.static_trip = (e0 == n ? -1 : 1);
+      return 0;
+    }
+  else
+    {
+      unsigned long n, s0, e0, i, c;
+      long s, e;
+
+      /* Otherwise, each thread gets exactly chunk_size iterations
+        (if available) each time through the loop.  */
+
+      s = ws->incr + (ws->incr > 0 ? -1 : 1);
+      n = (ws->end - ws->next + s) / ws->incr;
+      i = thr->ts.team_id;
+      c = ws->chunk_size;
+
+      /* Initial guess is a C sized chunk positioned nthreads iterations
+        in, offset by our thread number.  */
+      s0 = (thr->ts.static_trip * nthreads + i) * c;
+      e0 = s0 + c;
+
+      /* Detect overflow.  */
+      if (s0 >= n)
+       return 1;
+      if (e0 > n)
+       e0 = n;
+
+      /* Transform these to the actual start and end numbers.  */
+      s = (long)s0 * ws->incr + ws->next;
+      e = (long)e0 * ws->incr + ws->next;
+
+      *pstart = s;
+      *pend = e;
+
+      if (e0 == n)
+       thr->ts.static_trip = -1;
+      else
+       thr->ts.static_trip++;
+      return 0;
+    }
+}
+
+
+/* This function implements the DYNAMIC scheduling method.  Arguments are
+   as for gomp_iter_static_next.  This function must be called with ws->lock
+   held.  */
+
+bool
+gomp_iter_dynamic_next_locked (long *pstart, long *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_work_share *ws = thr->ts.work_share;
+  long start, end, chunk, left;
+
+  start = ws->next;
+  if (start == ws->end)
+    return false;
+
+  chunk = ws->chunk_size;
+  left = ws->end - start;
+  if (ws->incr < 0)
+    {
+      if (chunk < left)
+       chunk = left;
+    }
+  else
+    {
+      if (chunk > left)
+       chunk = left;
+    }
+  end = start + chunk;
+
+  ws->next = end;
+  *pstart = start;
+  *pend = end;
+  return true;
+}
+
+
+#ifdef HAVE_SYNC_BUILTINS
+/* Similar, but doesn't require the lock held, and uses compare-and-swap
+   instead.  Note that the only memory value that changes is ws->next.  */
+
+bool
+gomp_iter_dynamic_next (long *pstart, long *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_work_share *ws = thr->ts.work_share;
+  long start, end, nend, chunk, incr;
+
+  end = ws->end;
+  incr = ws->incr;
+  chunk = ws->chunk_size;
+
+  if (__builtin_expect (ws->mode, 1))
+    {
+      long tmp = __sync_fetch_and_add (&ws->next, chunk);
+      if (incr > 0)
+       {
+         if (tmp >= end)
+           return false;
+         nend = tmp + chunk;
+         if (nend > end)
+           nend = end;
+         *pstart = tmp;
+         *pend = nend;
+         return true;
+       }
+      else
+       {
+         if (tmp <= end)
+           return false;
+         nend = tmp + chunk;
+         if (nend < end)
+           nend = end;
+         *pstart = tmp;
+         *pend = nend;
+         return true;
+       }
+    }
+
+  start = ws->next;
+  while (1)
+    {
+      long left = end - start;
+      long tmp;
+
+      if (start == end)
+       return false;
+
+      if (incr < 0)
+       {
+         if (chunk < left)
+           chunk = left;
+       }
+      else
+       {
+         if (chunk > left)
+           chunk = left;
+       }
+      nend = start + chunk;
+
+      tmp = __sync_val_compare_and_swap (&ws->next, start, nend);
+      if (__builtin_expect (tmp == start, 1))
+       break;
+
+      start = tmp;
+    }
+
+  *pstart = start;
+  *pend = nend;
+  return true;
+}
+#endif /* HAVE_SYNC_BUILTINS */
+
+
+/* This function implements the GUIDED scheduling method.  Arguments are
+   as for gomp_iter_static_next.  This function must be called with the
+   work share lock held.  */
+
+bool
+gomp_iter_guided_next_locked (long *pstart, long *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_work_share *ws = thr->ts.work_share;
+  struct gomp_team *team = thr->ts.team;
+  unsigned long nthreads = team ? team->nthreads : 1;
+  unsigned long n, q;
+  long start, end;
+
+  if (ws->next == ws->end)
+    return false;
+
+  start = ws->next;
+  n = (ws->end - start) / ws->incr;
+  q = (n + nthreads - 1) / nthreads;
+
+  if (q < ws->chunk_size)
+    q = ws->chunk_size;
+  if (q <= n)
+    end = start + q * ws->incr;
+  else
+    end = ws->end;
+
+  ws->next = end;
+  *pstart = start;
+  *pend = end;
+  return true;
+}
+
+#ifdef HAVE_SYNC_BUILTINS
+/* Similar, but doesn't require the lock held, and uses compare-and-swap
+   instead.  Note that the only memory value that changes is ws->next.  */
+
+bool
+gomp_iter_guided_next (long *pstart, long *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_work_share *ws = thr->ts.work_share;
+  struct gomp_team *team = thr->ts.team;
+  unsigned long nthreads = team ? team->nthreads : 1;
+  long start, end, nend, incr;
+  unsigned long chunk_size;
+
+  start = ws->next;
+  end = ws->end;
+  incr = ws->incr;
+  chunk_size = ws->chunk_size;
+
+  while (1)
+    {
+      unsigned long n, q;
+      long tmp;
+
+      if (start == end)
+       return false;
+
+      n = (end - start) / incr;
+      q = (n + nthreads - 1) / nthreads;
+
+      if (q < chunk_size)
+       q = chunk_size;
+      if (__builtin_expect (q <= n, 1))
+       nend = start + q * incr;
+      else
+       nend = end;
+
+      tmp = __sync_val_compare_and_swap (&ws->next, start, nend);
+      if (__builtin_expect (tmp == start, 1))
+       break;
+
+      start = tmp;
+    }
+
+  *pstart = start;
+  *pend = nend;
+  return true;
+}
+#endif /* HAVE_SYNC_BUILTINS */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/iter_ull.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/iter_ull.c
new file mode 100644 (file)
index 0000000..a393920
--- /dev/null
@@ -0,0 +1,344 @@
+/* Copyright (C) 2005, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains routines for managing work-share iteration, both
+   for loops and sections.  */
+
+#include "libgomp.h"
+#include <stdlib.h>
+
+typedef unsigned long long gomp_ull;
+
+/* This function implements the STATIC scheduling method.  The caller should
+   iterate *pstart <= x < *pend.  Return zero if there are more iterations
+   to perform; nonzero if not.  Return less than 0 if this thread had
+   received the absolutely last iteration.  */
+
+int
+gomp_iter_ull_static_next (gomp_ull *pstart, gomp_ull *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_work_share *ws = thr->ts.work_share;
+  unsigned long nthreads = team ? team->nthreads : 1;
+
+  if (thr->ts.static_trip == -1)
+    return -1;
+
+  /* Quick test for degenerate teams and orphaned constructs.  */
+  if (nthreads == 1)
+    {
+      *pstart = ws->next_ull;
+      *pend = ws->end_ull;
+      thr->ts.static_trip = -1;
+      return ws->next_ull == ws->end_ull;
+    }
+
+  /* We interpret chunk_size zero as "unspecified", which means that we
+     should break up the iterations such that each thread makes only one
+     trip through the outer loop.  */
+  if (ws->chunk_size_ull == 0)
+    {
+      gomp_ull n, q, i, t, s0, e0, s, e;
+
+      if (thr->ts.static_trip > 0)
+       return 1;
+
+      /* Compute the total number of iterations.  */
+      if (__builtin_expect (ws->mode, 0) == 0)
+       n = (ws->end_ull - ws->next_ull + ws->incr_ull - 1) / ws->incr_ull;
+      else
+       n = (ws->next_ull - ws->end_ull - ws->incr_ull - 1) / -ws->incr_ull;
+      i = thr->ts.team_id;
+
+      /* Compute the "zero-based" start and end points.  That is, as
+        if the loop began at zero and incremented by one.  */
+      q = n / nthreads;
+      t = n % nthreads;
+      if (i < t)
+       {
+         t = 0;
+         q++;
+       }
+      s0 = q * i + t;
+      e0 = s0 + q;
+
+      /* Notice when no iterations allocated for this thread.  */
+      if (s0 >= e0)
+       {
+         thr->ts.static_trip = 1;
+         return 1;
+       }
+
+      /* Transform these to the actual start and end numbers.  */
+      s = s0 * ws->incr_ull + ws->next_ull;
+      e = e0 * ws->incr_ull + ws->next_ull;
+
+      *pstart = s;
+      *pend = e;
+      thr->ts.static_trip = (e0 == n ? -1 : 1);
+      return 0;
+    }
+  else
+    {
+      gomp_ull n, s0, e0, i, c, s, e;
+
+      /* Otherwise, each thread gets exactly chunk_size iterations
+        (if available) each time through the loop.  */
+
+      if (__builtin_expect (ws->mode, 0) == 0)
+       n = (ws->end_ull - ws->next_ull + ws->incr_ull - 1) / ws->incr_ull;
+      else
+       n = (ws->next_ull - ws->end_ull - ws->incr_ull - 1) / -ws->incr_ull;
+      i = thr->ts.team_id;
+      c = ws->chunk_size_ull;
+
+      /* Initial guess is a C sized chunk positioned nthreads iterations
+        in, offset by our thread number.  */
+      s0 = (thr->ts.static_trip * (gomp_ull) nthreads + i) * c;
+      e0 = s0 + c;
+
+      /* Detect overflow.  */
+      if (s0 >= n)
+       return 1;
+      if (e0 > n)
+       e0 = n;
+
+      /* Transform these to the actual start and end numbers.  */
+      s = s0 * ws->incr_ull + ws->next_ull;
+      e = e0 * ws->incr_ull + ws->next_ull;
+
+      *pstart = s;
+      *pend = e;
+
+      if (e0 == n)
+       thr->ts.static_trip = -1;
+      else
+       thr->ts.static_trip++;
+      return 0;
+    }
+}
+
+
+/* This function implements the DYNAMIC scheduling method.  Arguments are
+   as for gomp_iter_ull_static_next.  This function must be called with
+   ws->lock held.  */
+
+bool
+gomp_iter_ull_dynamic_next_locked (gomp_ull *pstart, gomp_ull *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_work_share *ws = thr->ts.work_share;
+  gomp_ull start, end, chunk, left;
+
+  start = ws->next_ull;
+  if (start == ws->end_ull)
+    return false;
+
+  chunk = ws->chunk_size_ull;
+  left = ws->end_ull - start;
+  if (__builtin_expect (ws->mode & 2, 0))
+    {
+      if (chunk < left)
+       chunk = left;
+    }
+  else
+    {
+      if (chunk > left)
+       chunk = left;
+    }
+  end = start + chunk;
+
+  ws->next_ull = end;
+  *pstart = start;
+  *pend = end;
+  return true;
+}
+
+
+#if defined HAVE_SYNC_BUILTINS && defined __LP64__
+/* Similar, but doesn't require the lock held, and uses compare-and-swap
+   instead.  Note that the only memory value that changes is ws->next_ull.  */
+
+bool
+gomp_iter_ull_dynamic_next (gomp_ull *pstart, gomp_ull *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_work_share *ws = thr->ts.work_share;
+  gomp_ull start, end, nend, chunk;
+
+  end = ws->end_ull;
+  chunk = ws->chunk_size_ull;
+
+  if (__builtin_expect (ws->mode & 1, 1))
+    {
+      gomp_ull tmp = __sync_fetch_and_add (&ws->next_ull, chunk);
+      if (__builtin_expect (ws->mode & 2, 0) == 0)
+       {
+         if (tmp >= end)
+           return false;
+         nend = tmp + chunk;
+         if (nend > end)
+           nend = end;
+         *pstart = tmp;
+         *pend = nend;
+         return true;
+       }
+      else
+       {
+         if (tmp <= end)
+           return false;
+         nend = tmp + chunk;
+         if (nend < end)
+           nend = end;
+         *pstart = tmp;
+         *pend = nend;
+         return true;
+       }
+    }
+
+  start = ws->next_ull;
+  while (1)
+    {
+      gomp_ull left = end - start;
+      gomp_ull tmp;
+
+      if (start == end)
+       return false;
+
+      if (__builtin_expect (ws->mode & 2, 0))
+       {
+         if (chunk < left)
+           chunk = left;
+       }
+      else
+       {
+         if (chunk > left)
+           chunk = left;
+       }
+      nend = start + chunk;
+
+      tmp = __sync_val_compare_and_swap (&ws->next_ull, start, nend);
+      if (__builtin_expect (tmp == start, 1))
+       break;
+
+      start = tmp;
+    }
+
+  *pstart = start;
+  *pend = nend;
+  return true;
+}
+#endif /* HAVE_SYNC_BUILTINS */
+
+
+/* This function implements the GUIDED scheduling method.  Arguments are
+   as for gomp_iter_ull_static_next.  This function must be called with the
+   work share lock held.  */
+
+bool
+gomp_iter_ull_guided_next_locked (gomp_ull *pstart, gomp_ull *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_work_share *ws = thr->ts.work_share;
+  struct gomp_team *team = thr->ts.team;
+  gomp_ull nthreads = team ? team->nthreads : 1;
+  gomp_ull n, q;
+  gomp_ull start, end;
+
+  if (ws->next_ull == ws->end_ull)
+    return false;
+
+  start = ws->next_ull;
+  if (__builtin_expect (ws->mode, 0) == 0)
+    n = (ws->end_ull - start) / ws->incr_ull;
+  else
+    n = (start - ws->end_ull) / -ws->incr_ull;
+  q = (n + nthreads - 1) / nthreads;
+
+  if (q < ws->chunk_size_ull)
+    q = ws->chunk_size_ull;
+  if (q <= n)
+    end = start + q * ws->incr_ull;
+  else
+    end = ws->end_ull;
+
+  ws->next_ull = end;
+  *pstart = start;
+  *pend = end;
+  return true;
+}
+
+#if defined HAVE_SYNC_BUILTINS && defined __LP64__
+/* Similar, but doesn't require the lock held, and uses compare-and-swap
+   instead.  Note that the only memory value that changes is ws->next_ull.  */
+
+bool
+gomp_iter_ull_guided_next (gomp_ull *pstart, gomp_ull *pend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_work_share *ws = thr->ts.work_share;
+  struct gomp_team *team = thr->ts.team;
+  gomp_ull nthreads = team ? team->nthreads : 1;
+  gomp_ull start, end, nend, incr;
+  gomp_ull chunk_size;
+
+  start = ws->next_ull;
+  end = ws->end_ull;
+  incr = ws->incr_ull;
+  chunk_size = ws->chunk_size_ull;
+
+  while (1)
+    {
+      gomp_ull n, q;
+      gomp_ull tmp;
+
+      if (start == end)
+       return false;
+
+      if (__builtin_expect (ws->mode, 0) == 0)
+       n = (end - start) / incr;
+      else
+       n = (start - end) / -incr;
+      q = (n + nthreads - 1) / nthreads;
+
+      if (q < chunk_size)
+       q = chunk_size;
+      if (__builtin_expect (q <= n, 1))
+       nend = start + q * incr;
+      else
+       nend = end;
+
+      tmp = __sync_val_compare_and_swap (&ws->next_ull, start, nend);
+      if (__builtin_expect (tmp == start, 1))
+       break;
+
+      start = tmp;
+    }
+
+  *pstart = start;
+  *pend = nend;
+  return true;
+}
+#endif /* HAVE_SYNC_BUILTINS */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.h
new file mode 100644 (file)
index 0000000..2c9c071
--- /dev/null
@@ -0,0 +1,591 @@
+/* Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains data types and function declarations that are not
+   part of the official OpenMP user interface.  There are declarations
+   in here that are part of the GNU OpenMP ABI, in that the compiler is
+   required to know about them and use them.
+
+   The convention is that the all caps prefix "GOMP" is used group items
+   that are part of the external ABI, and the lower case prefix "gomp"
+   is used group items that are completely private to the library.  */
+
+#ifndef LIBGOMP_H 
+#define LIBGOMP_H 1
+
+#include "config.h"
+#include "gstdint.h"
+
+#include <pthread.h>
+#include <stdbool.h>
+
+#ifdef HAVE_ATTRIBUTE_VISIBILITY
+# pragma GCC visibility push(hidden)
+#endif
+
+/* If we were a C++ library, we'd get this from <std/atomic>.  */
+enum memmodel
+{
+  MEMMODEL_RELAXED = 0,
+  MEMMODEL_CONSUME = 1,
+  MEMMODEL_ACQUIRE = 2,
+  MEMMODEL_RELEASE = 3,
+  MEMMODEL_ACQ_REL = 4,
+  MEMMODEL_SEQ_CST = 5
+};
+
+#include "sem.h"
+#include "mutex.h"
+#include "bar.h"
+#include "ptrlock.h"
+
+
+/* This structure contains the data to control one work-sharing construct,
+   either a LOOP (FOR/DO) or a SECTIONS.  */
+
+enum gomp_schedule_type
+{
+  GFS_RUNTIME,
+  GFS_STATIC,
+  GFS_DYNAMIC,
+  GFS_GUIDED,
+  GFS_AUTO
+};
+
+struct gomp_work_share
+{
+  /* This member records the SCHEDULE clause to be used for this construct.
+     The user specification of "runtime" will already have been resolved.
+     If this is a SECTIONS construct, this value will always be DYNAMIC.  */
+  enum gomp_schedule_type sched;
+
+  int mode;
+
+  union {
+    struct {
+      /* This is the chunk_size argument to the SCHEDULE clause.  */
+      long chunk_size;
+
+      /* This is the iteration end point.  If this is a SECTIONS construct,
+        this is the number of contained sections.  */
+      long end;
+
+      /* This is the iteration step.  If this is a SECTIONS construct, this
+        is always 1.  */
+      long incr;
+    };
+
+    struct {
+      /* The same as above, but for the unsigned long long loop variants.  */
+      unsigned long long chunk_size_ull;
+      unsigned long long end_ull;
+      unsigned long long incr_ull;
+    };
+  };
+
+  /* This is a circular queue that details which threads will be allowed
+     into the ordered region and in which order.  When a thread allocates
+     iterations on which it is going to work, it also registers itself at
+     the end of the array.  When a thread reaches the ordered region, it
+     checks to see if it is the one at the head of the queue.  If not, it
+     blocks on its RELEASE semaphore.  */
+  unsigned *ordered_team_ids;
+
+  /* This is the number of threads that have registered themselves in
+     the circular queue ordered_team_ids.  */
+  unsigned ordered_num_used;
+
+  /* This is the team_id of the currently acknowledged owner of the ordered
+     section, or -1u if the ordered section has not been acknowledged by
+     any thread.  This is distinguished from the thread that is *allowed*
+     to take the section next.  */
+  unsigned ordered_owner;
+
+  /* This is the index into the circular queue ordered_team_ids of the
+     current thread that's allowed into the ordered reason.  */
+  unsigned ordered_cur;
+
+  /* This is a chain of allocated gomp_work_share blocks, valid only
+     in the first gomp_work_share struct in the block.  */
+  struct gomp_work_share *next_alloc;
+
+  /* The above fields are written once during workshare initialization,
+     or related to ordered worksharing.  Make sure the following fields
+     are in a different cache line.  */
+
+  /* This lock protects the update of the following members.  */
+  gomp_mutex_t lock __attribute__((aligned (64)));
+
+  /* This is the count of the number of threads that have exited the work
+     share construct.  If the construct was marked nowait, they have moved on
+     to other work; otherwise they're blocked on a barrier.  The last member
+     of the team to exit the work share construct must deallocate it.  */
+  unsigned threads_completed;
+
+  union {
+    /* This is the next iteration value to be allocated.  In the case of
+       GFS_STATIC loops, this the iteration start point and never changes.  */
+    long next;
+
+    /* The same, but with unsigned long long type.  */
+    unsigned long long next_ull;
+
+    /* This is the returned data structure for SINGLE COPYPRIVATE.  */
+    void *copyprivate;
+  };
+
+  union {
+    /* Link to gomp_work_share struct for next work sharing construct
+       encountered after this one.  */
+    gomp_ptrlock_t next_ws;
+
+    /* gomp_work_share structs are chained in the free work share cache
+       through this.  */
+    struct gomp_work_share *next_free;
+  };
+
+  /* If only few threads are in the team, ordered_team_ids can point
+     to this array which fills the padding at the end of this struct.  */
+  unsigned inline_ordered_team_ids[0];
+};
+
+/* This structure contains all of the thread-local data associated with 
+   a thread team.  This is the data that must be saved when a thread
+   encounters a nested PARALLEL construct.  */
+
+struct gomp_team_state
+{
+  /* This is the team of which the thread is currently a member.  */
+  struct gomp_team *team;
+
+  /* This is the work share construct which this thread is currently
+     processing.  Recall that with NOWAIT, not all threads may be 
+     processing the same construct.  */
+  struct gomp_work_share *work_share;
+
+  /* This is the previous work share construct or NULL if there wasn't any.
+     When all threads are done with the current work sharing construct,
+     the previous one can be freed.  The current one can't, as its
+     next_ws field is used.  */
+  struct gomp_work_share *last_work_share;
+
+  /* This is the ID of this thread within the team.  This value is
+     guaranteed to be between 0 and N-1, where N is the number of
+     threads in the team.  */
+  unsigned team_id;
+
+  /* Nesting level.  */
+  unsigned level;
+
+  /* Active nesting level.  Only active parallel regions are counted.  */
+  unsigned active_level;
+
+#ifdef HAVE_SYNC_BUILTINS
+  /* Number of single stmts encountered.  */
+  unsigned long single_count;
+#endif
+
+  /* For GFS_RUNTIME loops that resolved to GFS_STATIC, this is the
+     trip number through the loop.  So first time a particular loop
+     is encountered this number is 0, the second time through the loop
+     is 1, etc.  This is unused when the compiler knows in advance that
+     the loop is statically scheduled.  */
+  unsigned long static_trip;
+};
+
+/* These are the OpenMP 3.0 Internal Control Variables described in
+   section 2.3.1.  Those described as having one copy per task are
+   stored within the structure; those described as having one copy
+   for the whole program are (naturally) global variables.  */
+
+struct gomp_task_icv
+{
+  unsigned long nthreads_var;
+  enum gomp_schedule_type run_sched_var;
+  int run_sched_modifier;
+  bool dyn_var;
+  bool nest_var;
+};
+
+extern struct gomp_task_icv gomp_global_icv;
+extern unsigned long gomp_thread_limit_var;
+extern unsigned long gomp_remaining_threads_count;
+#ifndef HAVE_SYNC_BUILTINS
+extern gomp_mutex_t gomp_remaining_threads_lock;
+#endif
+extern unsigned long gomp_max_active_levels_var;
+extern unsigned long long gomp_spin_count_var, gomp_throttled_spin_count_var;
+extern unsigned long gomp_available_cpus, gomp_managed_threads;
+extern unsigned long *gomp_nthreads_var_list, gomp_nthreads_var_list_len;
+
+enum gomp_task_kind
+{
+  GOMP_TASK_IMPLICIT,
+  GOMP_TASK_IFFALSE,
+  GOMP_TASK_WAITING,
+  GOMP_TASK_TIED
+};
+
+/* This structure describes a "task" to be run by a thread.  */
+
+struct gomp_task
+{
+  struct gomp_task *parent;
+  struct gomp_task *children;
+  struct gomp_task *next_child;
+  struct gomp_task *prev_child;
+  struct gomp_task *next_queue;
+  struct gomp_task *prev_queue;
+  struct gomp_task_icv icv;
+  void (*fn) (void *);
+  void *fn_data;
+  enum gomp_task_kind kind;
+  bool in_taskwait;
+  bool in_tied_task;
+  bool final_task;
+  gomp_sem_t taskwait_sem;
+};
+
+/* This structure describes a "team" of threads.  These are the threads
+   that are spawned by a PARALLEL constructs, as well as the work sharing
+   constructs that the team encounters.  */
+
+struct gomp_team
+{
+  /* This is the number of threads in the current team.  */
+  unsigned nthreads;
+
+  /* This is number of gomp_work_share structs that have been allocated
+     as a block last time.  */
+  unsigned work_share_chunk;
+
+  /* This is the saved team state that applied to a master thread before
+     the current thread was created.  */
+  struct gomp_team_state prev_ts;
+
+  /* This semaphore should be used by the master thread instead of its
+     "native" semaphore in the thread structure.  Required for nested
+     parallels, as the master is a member of two teams.  */
+  gomp_sem_t master_release;
+
+  /* This points to an array with pointers to the release semaphore
+     of the threads in the team.  */
+  gomp_sem_t **ordered_release;
+
+  /* List of gomp_work_share structs chained through next_free fields.
+     This is populated and taken off only by the first thread in the
+     team encountering a new work sharing construct, in a critical
+     section.  */
+  struct gomp_work_share *work_share_list_alloc;
+
+  /* List of gomp_work_share structs freed by free_work_share.  New
+     entries are atomically added to the start of the list, and
+     alloc_work_share can safely only move all but the first entry
+     to work_share_list alloc, as free_work_share can happen concurrently
+     with alloc_work_share.  */
+  struct gomp_work_share *work_share_list_free;
+
+#ifdef HAVE_SYNC_BUILTINS
+  /* Number of simple single regions encountered by threads in this
+     team.  */
+  unsigned long single_count;
+#else
+  /* Mutex protecting addition of workshares to work_share_list_free.  */
+  gomp_mutex_t work_share_list_free_lock;
+#endif
+
+  /* This barrier is used for most synchronization of the team.  */
+  gomp_barrier_t barrier;
+
+  /* Initial work shares, to avoid allocating any gomp_work_share
+     structs in the common case.  */
+  struct gomp_work_share work_shares[8];
+
+  gomp_mutex_t task_lock;
+  struct gomp_task *task_queue;
+  int task_count;
+  int task_running_count;
+
+  /* This array contains structures for implicit tasks.  */
+  struct gomp_task implicit_task[];
+};
+
+/* This structure contains all data that is private to libgomp and is
+   allocated per thread.  */
+
+struct gomp_thread
+{
+  /* This is the function that the thread should run upon launch.  */
+  void (*fn) (void *data);
+  void *data;
+
+  /* This is the current team state for this thread.  The ts.team member
+     is NULL only if the thread is idle.  */
+  struct gomp_team_state ts;
+
+  /* This is the task that the thread is currently executing.  */
+  struct gomp_task *task;
+
+  /* This semaphore is used for ordered loops.  */
+  gomp_sem_t release;
+
+  /* user pthread thread pool */
+  struct gomp_thread_pool *thread_pool;
+};
+
+
+struct gomp_thread_pool
+{
+  /* This array manages threads spawned from the top level, which will
+     return to the idle loop once the current PARALLEL construct ends.  */
+  struct gomp_thread **threads;
+  unsigned threads_size;
+  unsigned threads_used;
+  struct gomp_team *last_team;
+
+  /* This barrier holds and releases threads waiting in threads.  */
+  gomp_barrier_t threads_dock;
+};
+
+/* ... and here is that TLS data.  */
+
+#ifdef HAVE_TLS
+extern __thread struct gomp_thread gomp_tls_data;
+static inline struct gomp_thread *gomp_thread (void)
+{
+  return &gomp_tls_data;
+}
+#else
+extern pthread_key_t gomp_tls_key;
+static inline struct gomp_thread *gomp_thread (void)
+{
+  return pthread_getspecific (gomp_tls_key);
+}
+#endif
+
+extern struct gomp_task_icv *gomp_new_icv (void);
+
+/* Here's how to access the current copy of the ICVs.  */
+
+static inline struct gomp_task_icv *gomp_icv (bool write)
+{
+  struct gomp_task *task = gomp_thread ()->task;
+  if (task)
+    return &task->icv;
+  else if (write)
+    return gomp_new_icv ();
+  else
+    return &gomp_global_icv;
+}
+
+/* The attributes to be used during thread creation.  */
+extern pthread_attr_t gomp_thread_attr;
+
+/* Other variables.  */
+
+extern unsigned short *gomp_cpu_affinity;
+extern size_t gomp_cpu_affinity_len;
+
+/* Function prototypes.  */
+
+/* affinity.c */
+
+extern void gomp_init_affinity (void);
+extern void gomp_init_thread_affinity (pthread_attr_t *);
+
+/* alloc.c */
+
+extern void *gomp_malloc (size_t) __attribute__((malloc));
+extern void *gomp_malloc_cleared (size_t) __attribute__((malloc));
+extern void *gomp_realloc (void *, size_t);
+
+/* Avoid conflicting prototypes of alloca() in system headers by using
+   GCC's builtin alloca().  */
+#define gomp_alloca(x)  __builtin_alloca(x)
+
+/* error.c */
+
+extern void gomp_error (const char *, ...)
+       __attribute__((format (printf, 1, 2)));
+extern void gomp_fatal (const char *, ...)
+       __attribute__((noreturn, format (printf, 1, 2)));
+
+/* iter.c */
+
+extern int gomp_iter_static_next (long *, long *);
+extern bool gomp_iter_dynamic_next_locked (long *, long *);
+extern bool gomp_iter_guided_next_locked (long *, long *);
+
+#ifdef HAVE_SYNC_BUILTINS
+extern bool gomp_iter_dynamic_next (long *, long *);
+extern bool gomp_iter_guided_next (long *, long *);
+#endif
+
+/* iter_ull.c */
+
+extern int gomp_iter_ull_static_next (unsigned long long *,
+                                     unsigned long long *);
+extern bool gomp_iter_ull_dynamic_next_locked (unsigned long long *,
+                                              unsigned long long *);
+extern bool gomp_iter_ull_guided_next_locked (unsigned long long *,
+                                             unsigned long long *);
+
+#if defined HAVE_SYNC_BUILTINS && defined __LP64__
+extern bool gomp_iter_ull_dynamic_next (unsigned long long *,
+                                       unsigned long long *);
+extern bool gomp_iter_ull_guided_next (unsigned long long *,
+                                      unsigned long long *);
+#endif
+
+/* ordered.c */
+
+extern void gomp_ordered_first (void);
+extern void gomp_ordered_last (void);
+extern void gomp_ordered_next (void);
+extern void gomp_ordered_static_init (void);
+extern void gomp_ordered_static_next (void);
+extern void gomp_ordered_sync (void);
+
+/* parallel.c */
+
+extern unsigned gomp_resolve_num_threads (unsigned, unsigned);
+
+/* proc.c (in config/) */
+
+extern void gomp_init_num_threads (void);
+extern unsigned gomp_dynamic_max_threads (void);
+
+/* task.c */
+
+extern void gomp_init_task (struct gomp_task *, struct gomp_task *,
+                           struct gomp_task_icv *);
+extern void gomp_end_task (void);
+extern void gomp_barrier_handle_tasks (gomp_barrier_state_t);
+
+static void inline
+gomp_finish_task (struct gomp_task *task)
+{
+  gomp_sem_destroy (&task->taskwait_sem);
+}
+
+/* team.c */
+
+extern struct gomp_team *gomp_new_team (unsigned);
+extern void gomp_team_start (void (*) (void *), void *, unsigned,
+                            struct gomp_team *);
+extern void gomp_team_end (void);
+
+/* work.c */
+
+extern void gomp_init_work_share (struct gomp_work_share *, bool, unsigned);
+extern void gomp_fini_work_share (struct gomp_work_share *);
+extern bool gomp_work_share_start (bool);
+extern void gomp_work_share_end (void);
+extern void gomp_work_share_end_nowait (void);
+
+static inline void
+gomp_work_share_init_done (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  if (__builtin_expect (thr->ts.last_work_share != NULL, 1))
+    gomp_ptrlock_set (&thr->ts.last_work_share->next_ws, thr->ts.work_share);
+}
+
+#ifdef HAVE_ATTRIBUTE_VISIBILITY
+# pragma GCC visibility pop
+#endif
+
+/* Now that we're back to default visibility, include the globals.  */
+#include "libgomp_g.h"
+
+/* Include omp.h by parts.  */
+#include "omp-lock.h"
+#define _LIBGOMP_OMP_LOCK_DEFINED 1
+#include "omp.h.in"
+
+#if !defined (HAVE_ATTRIBUTE_VISIBILITY) \
+    || !defined (HAVE_ATTRIBUTE_ALIAS) \
+    || !defined (HAVE_AS_SYMVER_DIRECTIVE) \
+    || !defined (PIC) \
+    || !defined (HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
+# undef LIBGOMP_GNU_SYMBOL_VERSIONING
+#endif
+
+#ifdef LIBGOMP_GNU_SYMBOL_VERSIONING
+extern void gomp_init_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
+extern void gomp_destroy_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
+extern void gomp_set_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
+extern void gomp_unset_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
+extern int gomp_test_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
+extern void gomp_init_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void gomp_destroy_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void gomp_set_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void gomp_unset_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern int gomp_test_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
+
+extern void gomp_init_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
+extern void gomp_destroy_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
+extern void gomp_set_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
+extern void gomp_unset_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
+extern int gomp_test_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
+extern void gomp_init_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
+extern void gomp_destroy_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
+extern void gomp_set_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
+extern void gomp_unset_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
+extern int gomp_test_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
+
+# define strong_alias(fn, al) \
+  extern __typeof (fn) al __attribute__ ((alias (#fn)));
+# define omp_lock_symver(fn) \
+  __asm (".symver g" #fn "_30, " #fn "@@OMP_3.0"); \
+  __asm (".symver g" #fn "_25, " #fn "@OMP_1.0");
+#else
+# define gomp_init_lock_30 omp_init_lock
+# define gomp_destroy_lock_30 omp_destroy_lock
+# define gomp_set_lock_30 omp_set_lock
+# define gomp_unset_lock_30 omp_unset_lock
+# define gomp_test_lock_30 omp_test_lock
+# define gomp_init_nest_lock_30 omp_init_nest_lock
+# define gomp_destroy_nest_lock_30 omp_destroy_nest_lock
+# define gomp_set_nest_lock_30 omp_set_nest_lock
+# define gomp_unset_nest_lock_30 omp_unset_nest_lock
+# define gomp_test_nest_lock_30 omp_test_nest_lock
+#endif
+
+#ifdef HAVE_ATTRIBUTE_VISIBILITY
+# define attribute_hidden __attribute__ ((visibility ("hidden")))
+#else
+# define attribute_hidden
+#endif
+
+#ifdef HAVE_ATTRIBUTE_ALIAS
+# define ialias(fn) \
+  extern __typeof (fn) gomp_ialias_##fn \
+    __attribute__ ((alias (#fn))) attribute_hidden;
+#else
+# define ialias(fn)
+#endif
+
+#endif /* LIBGOMP_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.map b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.map
new file mode 100644 (file)
index 0000000..7b051f9
--- /dev/null
@@ -0,0 +1,186 @@
+OMP_1.0 {
+  global:
+       omp_set_num_threads;
+       omp_get_num_threads;
+       omp_get_max_threads;
+       omp_get_thread_num;
+       omp_get_num_procs;
+       omp_in_parallel;
+       omp_set_dynamic;
+       omp_get_dynamic;
+       omp_set_nested;
+       omp_get_nested;
+#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
+        # If the assembler used lacks the .symver directive or the linker
+       # doesn't support GNU symbol versioning, we have the same symbol in
+       # two versions, which Sun ld chokes on. 
+       omp_init_lock;
+       omp_init_nest_lock;
+       omp_destroy_lock;
+       omp_destroy_nest_lock;
+       omp_set_lock;
+       omp_set_nest_lock;
+       omp_unset_lock;
+       omp_unset_nest_lock;
+       omp_test_lock;
+       omp_test_nest_lock;
+       omp_destroy_lock_;
+       omp_destroy_nest_lock_;
+       omp_init_lock_;
+       omp_init_nest_lock_;
+       omp_set_lock_;
+       omp_set_nest_lock_;
+       omp_test_lock_;
+       omp_test_nest_lock_;
+       omp_unset_lock_;
+       omp_unset_nest_lock_;
+#endif
+       omp_get_dynamic_;
+       omp_get_max_threads_;
+       omp_get_nested_;
+       omp_get_num_procs_;
+       omp_get_num_threads_;
+       omp_get_thread_num_;
+       omp_in_parallel_;
+       omp_set_dynamic_;
+       omp_set_dynamic_8_;
+       omp_set_nested_;
+       omp_set_nested_8_;
+       omp_set_num_threads_;
+       omp_set_num_threads_8_;
+  local:
+       *;
+};
+
+OMP_2.0 {
+  global:
+       omp_get_wtick;
+       omp_get_wtime;
+       omp_get_wtick_;
+       omp_get_wtime_;
+} OMP_1.0;
+
+OMP_3.0 {
+  global:
+       omp_set_schedule;
+       omp_set_schedule_;
+       omp_set_schedule_8_;
+       omp_get_schedule;
+       omp_get_schedule_;
+       omp_get_schedule_8_;
+       omp_get_thread_limit;
+       omp_get_thread_limit_;
+       omp_set_max_active_levels;
+       omp_set_max_active_levels_;
+       omp_set_max_active_levels_8_;
+       omp_get_max_active_levels;
+       omp_get_max_active_levels_;
+       omp_get_level;
+       omp_get_level_;
+       omp_get_ancestor_thread_num;
+       omp_get_ancestor_thread_num_;
+       omp_get_ancestor_thread_num_8_;
+       omp_get_team_size;
+       omp_get_team_size_;
+       omp_get_team_size_8_;
+       omp_get_active_level;
+       omp_get_active_level_;
+       omp_init_lock;
+       omp_init_nest_lock;
+       omp_destroy_lock;
+       omp_destroy_nest_lock;
+       omp_set_lock;
+       omp_set_nest_lock;
+       omp_unset_lock;
+       omp_unset_nest_lock;
+       omp_test_lock;
+       omp_test_nest_lock;
+       omp_destroy_lock_;
+       omp_destroy_nest_lock_;
+       omp_init_lock_;
+       omp_init_nest_lock_;
+       omp_set_lock_;
+       omp_set_nest_lock_;
+       omp_test_lock_;
+       omp_test_nest_lock_;
+       omp_unset_lock_;
+       omp_unset_nest_lock_;
+} OMP_2.0;
+
+OMP_3.1 {
+  global:
+       omp_in_final;
+       omp_in_final_;
+} OMP_3.0;
+
+GOMP_1.0 {
+  global:
+       GOMP_atomic_end;
+       GOMP_atomic_start;
+       GOMP_barrier;
+       GOMP_critical_end;
+       GOMP_critical_name_end;
+       GOMP_critical_name_start;
+       GOMP_critical_start;
+       GOMP_loop_dynamic_next;
+       GOMP_loop_dynamic_start;
+       GOMP_loop_end;
+       GOMP_loop_end_nowait;
+       GOMP_loop_guided_next;
+       GOMP_loop_guided_start;
+       GOMP_loop_ordered_dynamic_next;
+       GOMP_loop_ordered_dynamic_start;
+       GOMP_loop_ordered_guided_next;
+       GOMP_loop_ordered_guided_start;
+       GOMP_loop_ordered_runtime_next;
+       GOMP_loop_ordered_runtime_start;
+       GOMP_loop_ordered_static_next;
+       GOMP_loop_ordered_static_start;
+       GOMP_loop_runtime_next;
+       GOMP_loop_runtime_start;
+       GOMP_loop_static_next;
+       GOMP_loop_static_start;
+       GOMP_ordered_end;
+       GOMP_ordered_start;
+       GOMP_parallel_end;
+       GOMP_parallel_loop_dynamic_start;
+       GOMP_parallel_loop_guided_start;
+       GOMP_parallel_loop_runtime_start;
+       GOMP_parallel_loop_static_start;
+       GOMP_parallel_sections_start;
+       GOMP_parallel_start;
+       GOMP_sections_end;
+       GOMP_sections_end_nowait;
+       GOMP_sections_next;
+       GOMP_sections_start;
+       GOMP_single_copy_end;
+       GOMP_single_copy_start;
+       GOMP_single_start;
+};
+
+GOMP_2.0 {
+  global:
+       GOMP_task;
+       GOMP_taskwait;
+       GOMP_loop_ull_dynamic_next;
+       GOMP_loop_ull_dynamic_start;
+       GOMP_loop_ull_guided_next;
+       GOMP_loop_ull_guided_start;
+       GOMP_loop_ull_ordered_dynamic_next;
+       GOMP_loop_ull_ordered_dynamic_start;
+       GOMP_loop_ull_ordered_guided_next;
+       GOMP_loop_ull_ordered_guided_start;
+       GOMP_loop_ull_ordered_runtime_next;
+       GOMP_loop_ull_ordered_runtime_start;
+       GOMP_loop_ull_ordered_static_next;
+       GOMP_loop_ull_ordered_static_start;
+       GOMP_loop_ull_runtime_next;
+       GOMP_loop_ull_runtime_start;
+       GOMP_loop_ull_static_next;
+       GOMP_loop_ull_static_start;
+} GOMP_1.0;
+
+GOMP_3.0 {
+  global:
+       GOMP_taskyield;
+} GOMP_2.0;
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.spec.in b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.spec.in
new file mode 100644 (file)
index 0000000..b7319f3
--- /dev/null
@@ -0,0 +1,3 @@
+# This spec file is read by gcc when linking.  It is used to specify the
+# standard libraries we need in order to link with -fopenmp.
+*link_gomp: @link_gomp@
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.texi b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp.texi
new file mode 100644 (file)
index 0000000..29c078b
--- /dev/null
@@ -0,0 +1,1767 @@
+\input texinfo @c -*-texinfo-*-
+
+@c %**start of header
+@setfilename libgomp.info
+@settitle GNU libgomp
+@c %**end of header
+
+
+@copying
+Copyright @copyright{} 2006, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below).  A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+     A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+     You have freedom to copy and modify this GNU Manual, like GNU
+     software.  Copies published by the Free Software Foundation raise
+     funds for GNU development.
+@end copying
+
+@ifinfo
+@dircategory GNU Libraries
+@direntry
+* libgomp: (libgomp).                    GNU OpenMP runtime library
+@end direntry
+
+This manual documents the GNU implementation of the OpenMP API for 
+multi-platform shared-memory parallel programming in C/C++ and Fortran.
+
+Published by the Free Software Foundation
+51 Franklin Street, Fifth Floor
+Boston, MA 02110-1301 USA
+
+@insertcopying
+@end ifinfo
+
+
+@setchapternewpage odd
+
+@titlepage
+@title The GNU OpenMP Implementation
+@page
+@vskip 0pt plus 1filll
+@comment For the @value{version-GCC} Version*
+@sp 1
+Published by the Free Software Foundation @*
+51 Franklin Street, Fifth Floor@*
+Boston, MA 02110-1301, USA@*
+@sp 1
+@insertcopying
+@end titlepage
+
+@summarycontents
+@contents
+@page
+
+
+@node Top
+@top Introduction
+@cindex Introduction
+
+This manual documents the usage of libgomp, the GNU implementation of the 
+@uref{http://www.openmp.org, OpenMP} Application Programming Interface (API)
+for multi-platform shared-memory parallel programming in C/C++ and Fortran.
+
+
+
+@comment
+@comment  When you add a new menu item, please keep the right hand
+@comment  aligned to the same column.  Do not use tabs.  This provides
+@comment  better formatting.
+@comment
+@menu
+* Enabling OpenMP::            How to enable OpenMP for your applications.
+* Runtime Library Routines::   The OpenMP runtime application programming 
+                               interface.
+* Environment Variables::      Influencing runtime behavior with environment 
+                               variables.
+* The libgomp ABI::            Notes on the external ABI presented by libgomp.
+* Reporting Bugs::             How to report bugs in GNU OpenMP.
+* Copying::                    GNU general public license says
+                               how you can copy and share libgomp.
+* GNU Free Documentation License::
+                               How you can copy and share this manual.
+* Funding::                    How to help assure continued work for free 
+                               software.
+* Index::                      Index of this documentation.
+@end menu
+
+
+@c ---------------------------------------------------------------------
+@c Enabling OpenMP
+@c ---------------------------------------------------------------------
+
+@node Enabling OpenMP
+@chapter Enabling OpenMP
+
+To activate the OpenMP extensions for C/C++ and Fortran, the compile-time 
+flag @command{-fopenmp} must be specified. This enables the OpenMP directive
+@code{#pragma omp} in C/C++ and @code{!$omp} directives in free form, 
+@code{c$omp}, @code{*$omp} and @code{!$omp} directives in fixed form, 
+@code{!$} conditional compilation sentinels in free form and @code{c$},
+@code{*$} and @code{!$} sentinels in fixed form, for Fortran. The flag also
+arranges for automatic linking of the OpenMP runtime library 
+(@ref{Runtime Library Routines}).
+
+A complete description of all OpenMP directives accepted may be found in 
+the @uref{http://www.openmp.org, OpenMP Application Program Interface} manual,
+version 3.1.
+
+
+@c ---------------------------------------------------------------------
+@c Runtime Library Routines
+@c ---------------------------------------------------------------------
+
+@node Runtime Library Routines
+@chapter Runtime Library Routines
+
+The runtime routines described here are defined by section 3 of the OpenMP 
+specifications in version 3.1. The routines are structured in following
+three parts:
+
+Control threads, processors and the parallel environment.
+
+@menu
+* omp_get_active_level::        Number of active parallel regions
+* omp_get_ancestor_thread_num:: Ancestor thread ID
+* omp_get_dynamic::             Dynamic teams setting
+* omp_get_level::               Number of parallel regions
+* omp_get_max_active_levels::   Maximum number of active regions
+* omp_get_max_threads::         Maximum number of threads of parallel region
+* omp_get_nested::              Nested parallel regions
+* omp_get_num_procs::           Number of processors online
+* omp_get_num_threads::         Size of the active team
+* omp_get_schedule::            Obtain the runtime scheduling method
+* omp_get_team_size::           Number of threads in a team
+* omp_get_thread_limit::        Maximum number of threads
+* omp_get_thread_num::          Current thread ID
+* omp_in_parallel::             Whether a parallel region is active
+* omp_in_final::                Whether in final or included task region
+* omp_set_dynamic::             Enable/disable dynamic teams
+* omp_set_max_active_levels::   Limits the number of active parallel regions
+* omp_set_nested::              Enable/disable nested parallel regions
+* omp_set_num_threads::         Set upper team size limit
+* omp_set_schedule::            Set the runtime scheduling method
+@end menu
+
+Initialize, set, test, unset and destroy simple and nested locks.
+
+@menu
+* omp_init_lock::            Initialize simple lock
+* omp_set_lock::             Wait for and set simple lock
+* omp_test_lock::            Test and set simple lock if available
+* omp_unset_lock::           Unset simple lock
+* omp_destroy_lock::         Destroy simple lock
+* omp_init_nest_lock::       Initialize nested lock
+* omp_set_nest_lock::        Wait for and set simple lock
+* omp_test_nest_lock::       Test and set nested lock if available
+* omp_unset_nest_lock::      Unset nested lock
+* omp_destroy_nest_lock::    Destroy nested lock
+@end menu
+
+Portable, thread-based, wall clock timer.
+
+@menu
+* omp_get_wtick::            Get timer precision.
+* omp_get_wtime::            Elapsed wall clock time.
+@end menu
+
+
+
+@node omp_get_active_level
+@section @code{omp_get_active_level} -- Number of parallel regions
+@table @asis
+@item @emph{Description}:
+This function returns the nesting level for the active parallel blocks,
+which enclose the calling call.
+
+@item @emph{C/C++}
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_active_level(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_get_active_level()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_level}, @ref{omp_get_max_active_levels}, @ref{omp_set_max_active_levels}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.19.
+@end table
+
+
+
+@node omp_get_ancestor_thread_num
+@section @code{omp_get_ancestor_thread_num} -- Ancestor thread ID
+@table @asis
+@item @emph{Description}:
+This function returns the thread identification number for the given
+nesting level of the current thread. For values of @var{level} outside
+zero to @code{omp_get_level} -1 is returned; if @var{level} is
+@code{omp_get_level} the result is identical to @code{omp_get_thread_num}.
+
+@item @emph{C/C++}
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_ancestor_thread_num(int level);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_get_ancestor_thread_num(level)}
+@item                   @tab @code{integer level}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_level}, @ref{omp_get_thread_num}, @ref{omp_get_team_size}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.17.
+@end table
+
+
+
+@node omp_get_dynamic
+@section @code{omp_get_dynamic} -- Dynamic teams setting
+@table @asis
+@item @emph{Description}:
+This function returns @code{true} if enabled, @code{false} otherwise. 
+Here, @code{true} and @code{false} represent their language-specific 
+counterparts.
+
+The dynamic team setting may be initialized at startup by the 
+@code{OMP_DYNAMIC} environment variable or at runtime using 
+@code{omp_set_dynamic}. If undefined, dynamic adjustment is 
+disabled by default.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_dynamic(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{logical function omp_get_dynamic()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_set_dynamic}, @ref{OMP_DYNAMIC}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.8.
+@end table
+
+
+
+@node omp_get_level
+@section @code{omp_get_level} -- Obtain the current nesting level
+@table @asis
+@item @emph{Description}:
+This function returns the nesting level for the parallel blocks,
+which enclose the calling call.
+
+@item @emph{C/C++}
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_level(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_level()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_active_level}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.16.
+@end table
+
+
+
+@node omp_get_max_active_levels
+@section @code{omp_get_max_active_levels} -- Maximum number of active regions
+@table @asis
+@item @emph{Description}:
+This function obtains the maximum allowed number of nested, active parallel regions.
+
+@item @emph{C/C++}
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_max_active_levels(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_get_max_active_levels()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_set_max_active_levels}, @ref{omp_get_active_level}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.15.
+@end table
+
+
+
+@node omp_get_max_threads
+@section @code{omp_get_max_threads} -- Maximum number of threads of parallel region
+@table @asis
+@item @emph{Description}:
+Return the maximum number of threads used for the current parallel region
+that does not use the clause @code{num_threads}.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_max_threads(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_get_max_threads()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_set_num_threads}, @ref{omp_set_dynamic}, @ref{omp_get_thread_limit}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.3.
+@end table
+
+
+
+@node omp_get_nested
+@section @code{omp_get_nested} -- Nested parallel regions
+@table @asis
+@item @emph{Description}:
+This function returns @code{true} if nested parallel regions are
+enabled, @code{false} otherwise. Here, @code{true} and @code{false} 
+represent their language-specific counterparts.
+
+Nested parallel regions may be initialized at startup by the 
+@code{OMP_NESTED} environment variable or at runtime using 
+@code{omp_set_nested}. If undefined, nested parallel regions are
+disabled by default.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_nested(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{logical function omp_get_nested()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_set_nested}, @ref{OMP_NESTED}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.10.
+@end table
+
+
+
+@node omp_get_num_procs
+@section @code{omp_get_num_procs} -- Number of processors online
+@table @asis
+@item @emph{Description}:
+Returns the number of processors online.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_num_procs(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_get_num_procs()}
+@end multitable
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.5.
+@end table
+
+
+
+@node omp_get_num_threads
+@section @code{omp_get_num_threads} -- Size of the active team
+@table @asis
+@item @emph{Description}:
+Returns the number of threads in the current team. In a sequential section of 
+the program @code{omp_get_num_threads} returns 1.
+
+The default team size may be initialized at startup by the 
+@code{OMP_NUM_THREADS} environment variable. At runtime, the size 
+of the current team may be set either by the @code{NUM_THREADS}
+clause or by @code{omp_set_num_threads}. If none of the above were 
+used to define a specific value and @code{OMP_DYNAMIC} is disabled,
+one thread per CPU online is used.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_num_threads(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_get_num_threads()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_max_threads}, @ref{omp_set_num_threads}, @ref{OMP_NUM_THREADS}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.2.
+@end table
+
+
+
+@node omp_get_schedule
+@section @code{omp_get_schedule} -- Obtain the runtime scheduling method
+@table @asis
+@item @emph{Description}:
+Obtain the runtime scheduling method. The @var{kind} argument will be
+set to the value @code{omp_sched_static}, @code{omp_sched_dynamic},
+@code{omp_sched_guided} or @code{omp_sched_auto}. The second argument,
+@var{modifier}, is set to the chunk size.
+
+@item @emph{C/C++}
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_schedule(omp_sched_t *kind, int *modifier);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_schedule(kind, modifier)}
+@item                   @tab @code{integer(kind=omp_sched_kind) kind}
+@item                   @tab @code{integer modifier}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_set_schedule}, @ref{OMP_SCHEDULE}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.12.
+@end table
+
+
+
+@node omp_get_team_size
+@section @code{omp_get_team_size} -- Number of threads in a team
+@table @asis
+@item @emph{Description}:
+This function returns the number of threads in a thread team to which
+either the current thread or its ancestor belongs. For values of @var{level}
+outside zero to @code{omp_get_level}, -1 is returned; if @var{level} is zero,
+1 is returned, and for @code{omp_get_level}, the result is identical
+to @code{omp_get_num_threads}.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_team_size(int level);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_get_team_size(level)}
+@item                   @tab @code{integer level}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_num_threads}, @ref{omp_get_level}, @ref{omp_get_ancestor_thread_num}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.18.
+@end table
+
+
+
+@node omp_get_thread_limit
+@section @code{omp_get_thread_limit} -- Maximum number of threads
+@table @asis
+@item @emph{Description}:
+Return the maximum number of threads of the program.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_thread_limit(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_get_thread_limit()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_max_threads}, @ref{OMP_THREAD_LIMIT}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.13.
+@end table
+
+
+
+@node omp_get_thread_num 
+@section @code{omp_get_thread_num} -- Current thread ID
+@table @asis
+@item @emph{Description}:
+Returns a unique thread identification number within the current team.
+In a sequential parts of the program, @code{omp_get_thread_num}
+always returns 0. In parallel regions the return value varies
+from 0 to @code{omp_get_num_threads}-1 inclusive. The return 
+value of the master thread of a team is always 0.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_get_thread_num(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{integer function omp_get_thread_num()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_num_threads}, @ref{omp_get_ancestor_thread_num}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.4.
+@end table
+
+
+
+@node omp_in_parallel
+@section @code{omp_in_parallel} -- Whether a parallel region is active
+@table @asis
+@item @emph{Description}:
+This function returns @code{true} if currently running in parallel, 
+@code{false} otherwise. Here, @code{true} and @code{false} represent 
+their language-specific counterparts.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_in_parallel(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{logical function omp_in_parallel()}
+@end multitable
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.6.
+@end table
+
+
+@node omp_in_final
+@section @code{omp_in_final} -- Whether in final or included task region
+@table @asis
+@item @emph{Description}:
+This function returns @code{true} if currently running in a final
+or included task region, @code{false} otherwise. Here, @code{true}
+and @code{false} represent their language-specific counterparts.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_in_final(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{logical function omp_in_final()}
+@end multitable
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.20.
+@end table
+
+
+@node omp_set_dynamic
+@section @code{omp_set_dynamic} -- Enable/disable dynamic teams
+@table @asis
+@item @emph{Description}:
+Enable or disable the dynamic adjustment of the number of threads 
+within a team. The function takes the language-specific equivalent
+of @code{true} and @code{false}, where @code{true} enables dynamic 
+adjustment of team sizes and @code{false} disables it.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_set_dynamic(int set);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_set_dynamic(set)}
+@item                   @tab @code{logical, intent(in) :: set}
+@end multitable
+
+@item @emph{See also}:
+@ref{OMP_DYNAMIC}, @ref{omp_get_dynamic}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.7.
+@end table
+
+
+
+@node omp_set_max_active_levels
+@section @code{omp_set_max_active_levels} -- Limits the number of active parallel regions
+@table @asis
+@item @emph{Description}:
+This function limits the maximum allowed number of nested, active
+parallel regions.
+
+@item @emph{C/C++}
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_set_max_active_levels(int max_levels);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_set_max_active_levels(max_levels)}
+@item                   @tab @code{integer max_levels}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_max_active_levels}, @ref{omp_get_active_level}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.14.
+@end table
+
+
+
+@node omp_set_nested
+@section @code{omp_set_nested} -- Enable/disable nested parallel regions
+@table @asis
+@item @emph{Description}:
+Enable or disable nested parallel regions, i.e., whether team members
+are allowed to create new teams. The function takes the language-specific 
+equivalent of @code{true} and @code{false}, where @code{true} enables 
+dynamic adjustment of team sizes and @code{false} disables it.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_set_nested(int set);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_set_nested(set)}
+@item                   @tab @code{logical, intent(in) :: set}
+@end multitable
+
+@item @emph{See also}:
+@ref{OMP_NESTED}, @ref{omp_get_nested}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.9.
+@end table
+
+
+
+@node omp_set_num_threads
+@section @code{omp_set_num_threads} -- Set upper team size limit
+@table @asis
+@item @emph{Description}:
+Specifies the number of threads used by default in subsequent parallel 
+sections, if those do not specify a @code{num_threads} clause. The 
+argument of @code{omp_set_num_threads} shall be a positive integer. 
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_set_num_threads(int n);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_set_num_threads(n)}
+@item                   @tab @code{integer, intent(in) :: n}
+@end multitable
+
+@item @emph{See also}:
+@ref{OMP_NUM_THREADS}, @ref{omp_get_num_threads}, @ref{omp_get_max_threads}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.1.
+@end table
+
+
+
+@node omp_set_schedule
+@section @code{omp_set_schedule} -- Set the runtime scheduling method
+@table @asis
+@item @emph{Description}:
+Sets the runtime scheduling method. The @var{kind} argument can have the
+value @code{omp_sched_static}, @code{omp_sched_dynamic},
+@code{omp_sched_guided} or @code{omp_sched_auto}. Except for
+@code{omp_sched_auto}, the chunk size is set to the value of
+@var{modifier} if positive, or to the default value if zero or negative.
+For @code{omp_sched_auto} the @var{modifier} argument is ignored.
+
+@item @emph{C/C++}
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_set_schedule(omp_sched_t *kind, int *modifier);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_set_schedule(kind, modifier)}
+@item                   @tab @code{integer(kind=omp_sched_kind) kind}
+@item                   @tab @code{integer modifier}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_schedule}
+@ref{OMP_SCHEDULE}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.2.11.
+@end table
+
+
+
+@node omp_init_lock
+@section @code{omp_init_lock} -- Initialize simple lock
+@table @asis
+@item @emph{Description}:
+Initialize a simple lock.  After initialization, the lock is in 
+an unlocked state.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_init_lock(omp_lock_t *lock);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_init_lock(lock)}
+@item                   @tab @code{integer(omp_lock_kind), intent(out) :: lock}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_destroy_lock}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.1.
+@end table
+
+
+
+@node omp_set_lock
+@section @code{omp_set_lock} -- Wait for and set simple lock
+@table @asis
+@item @emph{Description}:
+Before setting a simple lock, the lock variable must be initialized by 
+@code{omp_init_lock}. The calling thread is blocked until the lock 
+is available. If the lock is already held by the current thread, 
+a deadlock occurs.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_set_lock(omp_lock_t *lock);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_set_lock(lock)}
+@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: lock}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_init_lock}, @ref{omp_test_lock}, @ref{omp_unset_lock}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.3.
+@end table
+
+
+
+@node omp_test_lock
+@section @code{omp_test_lock} -- Test and set simple lock if available
+@table @asis
+@item @emph{Description}:
+Before setting a simple lock, the lock variable must be initialized by 
+@code{omp_init_lock}. Contrary to @code{omp_set_lock}, @code{omp_test_lock} 
+does not block if the lock is not available. This function returns 
+@code{true} upon success, @code{false} otherwise. Here, @code{true} and 
+@code{false} represent their language-specific counterparts.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_test_lock(omp_lock_t *lock);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{logical function omp_test_lock(lock)}
+@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: lock}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_init_lock}, @ref{omp_set_lock}, @ref{omp_set_lock}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.5.
+@end table
+
+
+
+@node omp_unset_lock
+@section @code{omp_unset_lock} -- Unset simple lock
+@table @asis
+@item @emph{Description}:
+A simple lock about to be unset must have been locked by @code{omp_set_lock}
+or @code{omp_test_lock} before. In addition, the lock must be held by the 
+thread calling @code{omp_unset_lock}. Then, the lock becomes unlocked. If one 
+or more threads attempted to set the lock before, one of them is chosen to, 
+again, set the lock to itself.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_unset_lock(omp_lock_t *lock);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_unset_lock(lock)}
+@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: lock}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_set_lock}, @ref{omp_test_lock}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.4.
+@end table
+
+
+
+@node omp_destroy_lock
+@section @code{omp_destroy_lock} -- Destroy simple lock
+@table @asis
+@item @emph{Description}:
+Destroy a simple lock. In order to be destroyed, a simple lock must be 
+in the unlocked state. 
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_destroy_lock(omp_lock_t *lock);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_destroy_lock(lock)}
+@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: lock}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_init_lock}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.2.
+@end table
+
+
+
+@node omp_init_nest_lock
+@section @code{omp_init_nest_lock} -- Initialize nested lock
+@table @asis
+@item @emph{Description}:
+Initialize a nested lock.  After initialization, the lock is in 
+an unlocked state and the nesting count is set to zero.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_init_nest_lock(omp_nest_lock_t *lock);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_init_nest_lock(lock)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(out) :: lock}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_destroy_nest_lock}
+
+@item @emph{Reference}:
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.1.
+@end table
+
+
+@node omp_set_nest_lock
+@section @code{omp_set_nest_lock} -- Wait for and set nested lock
+@table @asis
+@item @emph{Description}:
+Before setting a nested lock, the lock variable must be initialized by 
+@code{omp_init_nest_lock}. The calling thread is blocked until the lock 
+is available. If the lock is already held by the current thread, the 
+nesting count for the lock is incremented.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_set_nest_lock(omp_nest_lock_t *lock);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_set_nest_lock(lock)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: lock}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_init_nest_lock}, @ref{omp_unset_nest_lock}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.3.
+@end table
+
+
+
+@node omp_test_nest_lock
+@section @code{omp_test_nest_lock} -- Test and set nested lock if available
+@table @asis
+@item @emph{Description}:
+Before setting a nested lock, the lock variable must be initialized by 
+@code{omp_init_nest_lock}. Contrary to @code{omp_set_nest_lock}, 
+@code{omp_test_nest_lock} does not block if the lock is not available. 
+If the lock is already held by the current thread, the new nesting count 
+is returned. Otherwise, the return value equals zero.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{int omp_test_nest_lock(omp_nest_lock_t *lock);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{logical function omp_test_nest_lock(lock)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: lock}
+@end multitable
+
+
+@item @emph{See also}:
+@ref{omp_init_lock}, @ref{omp_set_lock}, @ref{omp_set_lock}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.5.
+@end table
+
+
+
+@node omp_unset_nest_lock
+@section @code{omp_unset_nest_lock} -- Unset nested lock
+@table @asis
+@item @emph{Description}:
+A nested lock about to be unset must have been locked by @code{omp_set_nested_lock}
+or @code{omp_test_nested_lock} before. In addition, the lock must be held by the 
+thread calling @code{omp_unset_nested_lock}. If the nesting count drops to zero, the 
+lock becomes unlocked. If one ore more threads attempted to set the lock before, 
+one of them is chosen to, again, set the lock to itself.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_unset_nest_lock(omp_nest_lock_t *lock);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_unset_nest_lock(lock)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: lock}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_set_nest_lock}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.4.
+@end table
+
+
+
+@node omp_destroy_nest_lock
+@section @code{omp_destroy_nest_lock} -- Destroy nested lock
+@table @asis
+@item @emph{Description}:
+Destroy a nested lock. In order to be destroyed, a nested lock must be 
+in the unlocked state and its nesting count must equal zero.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{void omp_destroy_nest_lock(omp_nest_lock_t *);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{subroutine omp_destroy_nest_lock(lock)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: lock}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_init_lock}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.3.2.
+@end table
+
+
+
+@node omp_get_wtick
+@section @code{omp_get_wtick} -- Get timer precision
+@table @asis
+@item @emph{Description}:
+Gets the timer precision, i.e., the number of seconds between two 
+successive clock ticks.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{double omp_get_wtick(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{double precision function omp_get_wtick()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_wtime}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.4.2.
+@end table
+
+
+
+@node omp_get_wtime
+@section @code{omp_get_wtime} -- Elapsed wall clock time
+@table @asis
+@item @emph{Description}:
+Elapsed wall clock time in seconds. The time is measured per thread, no 
+guarantee can be made that two distinct threads measure the same time.
+Time is measured from some "time in the past", which is an arbitrary time
+guaranteed not to change during the execution of the program.
+
+@item @emph{C/C++}:
+@multitable @columnfractions .20 .80
+@item @emph{Prototype}: @tab @code{double omp_get_wtime(void);}
+@end multitable
+
+@item @emph{Fortran}:
+@multitable @columnfractions .20 .80
+@item @emph{Interface}: @tab @code{double precision function omp_get_wtime()}
+@end multitable
+
+@item @emph{See also}:
+@ref{omp_get_wtick}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 3.4.1.
+@end table
+
+
+
+@c ---------------------------------------------------------------------
+@c Environment Variables
+@c ---------------------------------------------------------------------
+
+@node Environment Variables
+@chapter Environment Variables
+
+The variables @env{OMP_DYNAMIC}, @env{OMP_MAX_ACTIVE_LEVELS},
+@env{OMP_NESTED}, @env{OMP_NUM_THREADS}, @env{OMP_SCHEDULE},
+@env{OMP_STACKSIZE},@env{OMP_THREAD_LIMIT} and @env{OMP_WAIT_POLICY}
+are defined by section 4 of the OpenMP specifications in version 3.1,
+while @env{GOMP_CPU_AFFINITY} and @env{GOMP_STACKSIZE} are GNU 
+extensions.
+
+@menu
+* OMP_DYNAMIC::           Dynamic adjustment of threads
+* OMP_MAX_ACTIVE_LEVELS:: Set the maximum number of nested parallel regions
+* OMP_NESTED::            Nested parallel regions
+* OMP_NUM_THREADS::       Specifies the number of threads to use
+* OMP_STACKSIZE::         Set default thread stack size
+* OMP_SCHEDULE::          How threads are scheduled
+* OMP_THREAD_LIMIT::      Set the maximum number of threads
+* OMP_WAIT_POLICY::       How waiting threads are handled
+* OMP_PROC_BIND::         Whether theads may be moved between CPUs
+* GOMP_CPU_AFFINITY::     Bind threads to specific CPUs
+* GOMP_STACKSIZE::        Set default thread stack size
+@end menu
+
+
+@node OMP_DYNAMIC
+@section @env{OMP_DYNAMIC} -- Dynamic adjustment of threads
+@cindex Environment Variable
+@table @asis
+@item @emph{Description}:
+Enable or disable the dynamic adjustment of the number of threads 
+within a team. The value of this environment variable shall be 
+@code{TRUE} or @code{FALSE}. If undefined, dynamic adjustment is
+disabled by default.
+
+@item @emph{See also}:
+@ref{omp_set_dynamic}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 4.3
+@end table
+
+
+
+@node OMP_MAX_ACTIVE_LEVELS
+@section @env{OMP_MAX_ACTIVE_LEVELS} -- Set the maximum number of nested parallel regions
+@cindex Environment Variable
+@table @asis
+@item @emph{Description}:
+Specifies the initial value for the maximum number of nested parallel
+regions. The value of this variable shall be a positive integer.
+If undefined, the number of active levels is unlimited.
+
+@item @emph{See also}:
+@ref{omp_set_max_active_levels}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 4.8
+@end table
+
+
+
+@node OMP_NESTED
+@section @env{OMP_NESTED} -- Nested parallel regions
+@cindex Environment Variable
+@cindex Implementation specific setting
+@table @asis
+@item @emph{Description}:
+Enable or disable nested parallel regions, i.e., whether team members
+are allowed to create new teams. The value of this environment variable 
+shall be @code{TRUE} or @code{FALSE}. If undefined, nested parallel 
+regions are disabled by default.
+
+@item @emph{See also}:
+@ref{omp_set_nested}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 4.5
+@end table
+
+
+
+@node OMP_NUM_THREADS
+@section @env{OMP_NUM_THREADS} -- Specifies the number of threads to use
+@cindex Environment Variable
+@cindex Implementation specific setting
+@table @asis
+@item @emph{Description}:
+Specifies the default number of threads to use in parallel regions. The 
+value of this variable shall be a comma-separated list of positive integers;
+the value specified the number of threads to use for the corresponding nested
+level. If undefined one thread per CPU is used.
+
+@item @emph{See also}:
+@ref{omp_set_num_threads}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 4.2
+@end table
+
+
+
+@node OMP_SCHEDULE
+@section @env{OMP_SCHEDULE} -- How threads are scheduled
+@cindex Environment Variable
+@cindex Implementation specific setting
+@table @asis
+@item @emph{Description}:
+Allows to specify @code{schedule type} and @code{chunk size}. 
+The value of the variable shall have the form: @code{type[,chunk]} where
+@code{type} is one of @code{static}, @code{dynamic}, @code{guided} or @code{auto}
+The optional @code{chunk} size shall be a positive integer. If undefined,
+dynamic scheduling and a chunk size of 1 is used.
+
+@item @emph{See also}:
+@ref{omp_set_schedule}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, sections 2.5.1 and 4.1
+@end table
+
+
+
+@node OMP_STACKSIZE
+@section @env{OMP_STACKSIZE} -- Set default thread stack size
+@cindex Environment Variable
+@table @asis
+@item @emph{Description}:
+Set the default thread stack size in kilobytes, unless the number
+is suffixed by @code{B}, @code{K}, @code{M} or @code{G}, in which
+case the size is, respectively, in bytes, kilobytes, megabytes
+or gigabytes. This is different from @code{pthread_attr_setstacksize}
+which gets the number of bytes as an argument. If the stack size cannot
+be set due to system constraints, an error is reported and the initial
+stack size is left unchanged. If undefined, the stack size is system
+dependent.
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, sections 4.6
+@end table
+
+
+
+@node OMP_THREAD_LIMIT
+@section @env{OMP_THREAD_LIMIT} -- Set the maximum number of threads
+@cindex Environment Variable
+@table @asis
+@item @emph{Description}:
+Specifies the number of threads to use for the whole program. The
+value of this variable shall be a positive integer. If undefined,
+the number of threads is not limited.
+
+@item @emph{See also}:
+@ref{OMP_NUM_THREADS}
+@ref{omp_get_thread_limit}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, section 4.9
+@end table
+
+
+
+@node OMP_WAIT_POLICY
+@section @env{OMP_WAIT_POLICY} -- How waiting threads are handled
+@cindex Environment Variable
+@table @asis
+@item @emph{Description}:
+Specifies whether waiting threads should be active or passive. If
+the value is @code{PASSIVE}, waiting threads should not consume CPU
+power while waiting; while the value is @code{ACTIVE} specifies that
+they should.
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, sections 4.7
+@end table
+
+
+
+@node OMP_PROC_BIND
+@section @env{OMP_PROC_BIND} -- Whether theads may be moved between CPUs
+@cindex Environment Variable
+@table @asis
+@item @emph{Description}:
+Specifies whether threads may be moved between processors. If set to
+@code{true}, OpenMP theads should not be moved, if set to @code{false}
+they may be moved.
+
+@item @emph{See also}:
+@ref{GOMP_CPU_AFFINITY}
+
+@item @emph{Reference}: 
+@uref{http://www.openmp.org/, OpenMP specifications v3.1}, sections 4.4
+@end table
+
+
+
+@node GOMP_CPU_AFFINITY
+@section @env{GOMP_CPU_AFFINITY} -- Bind threads to specific CPUs
+@cindex Environment Variable
+@table @asis
+@item @emph{Description}:
+Binds threads to specific CPUs. The variable should contain a space-separated
+or comma-separated list of CPUs. This list may contain different kinds of 
+entries: either single CPU numbers in any order, a range of CPUs (M-N) 
+or a range with some stride (M-N:S).  CPU numbers are zero based. For example,
+@code{GOMP_CPU_AFFINITY="0 3 1-2 4-15:2"} will bind the initial thread
+to CPU 0, the second to CPU 3, the third to CPU 1, the fourth to 
+CPU 2, the fifth to CPU 4, the sixth through tenth to CPUs 6, 8, 10, 12,
+and 14 respectively and then start assigning back from the beginning of
+the list.  @code{GOMP_CPU_AFFINITY=0} binds all threads to CPU 0.
+
+There is no GNU OpenMP library routine to determine whether a CPU affinity 
+specification is in effect. As a workaround, language-specific library 
+functions, e.g., @code{getenv} in C or @code{GET_ENVIRONMENT_VARIABLE} in 
+Fortran, may be used to query the setting of the @code{GOMP_CPU_AFFINITY} 
+environment variable. A defined CPU affinity on startup cannot be changed 
+or disabled during the runtime of the application.
+
+If this environment variable is omitted, the host system will handle the 
+assignment of threads to CPUs. 
+
+@item @emph{See also}:
+@ref{OMP_PROC_BIND}
+@end table
+
+
+
+@node GOMP_STACKSIZE
+@section @env{GOMP_STACKSIZE} -- Set default thread stack size
+@cindex Environment Variable
+@cindex Implementation specific setting
+@table @asis
+@item @emph{Description}:
+Set the default thread stack size in kilobytes. This is different from
+@code{pthread_attr_setstacksize} which gets the number of bytes as an 
+argument. If the stack size cannot be set due to system constraints, an 
+error is reported and the initial stack size is left unchanged. If undefined,
+the stack size is system dependent.
+
+@item @emph{See also}:
+@ref{OMP_STACKSIZE}
+
+@item @emph{Reference}: 
+@uref{http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00493.html, 
+GCC Patches Mailinglist}, 
+@uref{http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00496.html,
+GCC Patches Mailinglist}
+@end table
+
+
+
+@c ---------------------------------------------------------------------
+@c The libgomp ABI
+@c ---------------------------------------------------------------------
+
+@node The libgomp ABI
+@chapter The libgomp ABI
+
+The following sections present notes on the external ABI as 
+presented by libgomp.  Only maintainers should need them.
+
+@menu
+* Implementing MASTER construct::
+* Implementing CRITICAL construct::
+* Implementing ATOMIC construct::
+* Implementing FLUSH construct::
+* Implementing BARRIER construct::
+* Implementing THREADPRIVATE construct::
+* Implementing PRIVATE clause::
+* Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses::
+* Implementing REDUCTION clause::
+* Implementing PARALLEL construct::
+* Implementing FOR construct::
+* Implementing ORDERED construct::
+* Implementing SECTIONS construct::
+* Implementing SINGLE construct::
+@end menu
+
+
+@node Implementing MASTER construct
+@section Implementing MASTER construct
+
+@smallexample
+if (omp_get_thread_num () == 0)
+  block
+@end smallexample
+
+Alternately, we generate two copies of the parallel subfunction
+and only include this in the version run by the master thread.
+Surely this is not worthwhile though...
+
+
+
+@node Implementing CRITICAL construct
+@section Implementing CRITICAL construct
+
+Without a specified name,
+
+@smallexample
+  void GOMP_critical_start (void);
+  void GOMP_critical_end (void);
+@end smallexample
+
+so that we don't get COPY relocations from libgomp to the main
+application.
+
+With a specified name, use omp_set_lock and omp_unset_lock with
+name being transformed into a variable declared like
+
+@smallexample
+  omp_lock_t gomp_critical_user_<name> __attribute__((common))
+@end smallexample
+
+Ideally the ABI would specify that all zero is a valid unlocked
+state, and so we wouldn't need to initialize this at
+startup.
+
+
+
+@node Implementing ATOMIC construct
+@section Implementing ATOMIC construct
+
+The target should implement the @code{__sync} builtins.
+
+Failing that we could add
+
+@smallexample
+  void GOMP_atomic_enter (void)
+  void GOMP_atomic_exit (void)
+@end smallexample
+
+which reuses the regular lock code, but with yet another lock
+object private to the library.
+
+
+
+@node Implementing FLUSH construct
+@section Implementing FLUSH construct
+
+Expands to the @code{__sync_synchronize} builtin.
+
+
+
+@node Implementing BARRIER construct
+@section Implementing BARRIER construct
+
+@smallexample
+  void GOMP_barrier (void)
+@end smallexample
+
+
+@node Implementing THREADPRIVATE construct
+@section Implementing THREADPRIVATE construct
+
+In _most_ cases we can map this directly to @code{__thread}.  Except
+that OMP allows constructors for C++ objects.  We can either
+refuse to support this (how often is it used?) or we can 
+implement something akin to .ctors.
+
+Even more ideally, this ctor feature is handled by extensions
+to the main pthreads library.  Failing that, we can have a set
+of entry points to register ctor functions to be called.
+
+
+
+@node Implementing PRIVATE clause
+@section Implementing PRIVATE clause
+
+In association with a PARALLEL, or within the lexical extent
+of a PARALLEL block, the variable becomes a local variable in
+the parallel subfunction.
+
+In association with FOR or SECTIONS blocks, create a new
+automatic variable within the current function.  This preserves
+the semantic of new variable creation.
+
+
+
+@node Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses
+@section Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses
+
+This seems simple enough for PARALLEL blocks.  Create a private 
+struct for communicating between the parent and subfunction.
+In the parent, copy in values for scalar and "small" structs;
+copy in addresses for others TREE_ADDRESSABLE types.  In the 
+subfunction, copy the value into the local variable.
+
+It is not clear what to do with bare FOR or SECTION blocks.
+The only thing I can figure is that we do something like:
+
+@smallexample
+#pragma omp for firstprivate(x) lastprivate(y)
+for (int i = 0; i < n; ++i)
+  body;
+@end smallexample
+
+which becomes
+
+@smallexample
+@{
+  int x = x, y;
+
+  // for stuff
+
+  if (i == n)
+    y = y;
+@}
+@end smallexample
+
+where the "x=x" and "y=y" assignments actually have different
+uids for the two variables, i.e. not something you could write
+directly in C.  Presumably this only makes sense if the "outer"
+x and y are global variables.
+
+COPYPRIVATE would work the same way, except the structure 
+broadcast would have to happen via SINGLE machinery instead.
+
+
+
+@node Implementing REDUCTION clause
+@section Implementing REDUCTION clause
+
+The private struct mentioned in the previous section should have 
+a pointer to an array of the type of the variable, indexed by the 
+thread's @var{team_id}.  The thread stores its final value into the 
+array, and after the barrier, the master thread iterates over the
+array to collect the values.
+
+
+@node Implementing PARALLEL construct
+@section Implementing PARALLEL construct
+
+@smallexample
+  #pragma omp parallel
+  @{
+    body;
+  @}
+@end smallexample
+
+becomes
+
+@smallexample
+  void subfunction (void *data)
+  @{
+    use data;
+    body;
+  @}
+
+  setup data;
+  GOMP_parallel_start (subfunction, &data, num_threads);
+  subfunction (&data);
+  GOMP_parallel_end ();
+@end smallexample
+
+@smallexample
+  void GOMP_parallel_start (void (*fn)(void *), void *data, unsigned num_threads)
+@end smallexample
+
+The @var{FN} argument is the subfunction to be run in parallel.
+
+The @var{DATA} argument is a pointer to a structure used to 
+communicate data in and out of the subfunction, as discussed
+above with respect to FIRSTPRIVATE et al.
+
+The @var{NUM_THREADS} argument is 1 if an IF clause is present
+and false, or the value of the NUM_THREADS clause, if
+present, or 0.
+
+The function needs to create the appropriate number of
+threads and/or launch them from the dock.  It needs to
+create the team structure and assign team ids.
+
+@smallexample
+  void GOMP_parallel_end (void)
+@end smallexample
+
+Tears down the team and returns us to the previous @code{omp_in_parallel()} state.
+
+
+
+@node Implementing FOR construct
+@section Implementing FOR construct
+
+@smallexample
+  #pragma omp parallel for
+  for (i = lb; i <= ub; i++)
+    body;
+@end smallexample
+
+becomes
+
+@smallexample
+  void subfunction (void *data)
+  @{
+    long _s0, _e0;
+    while (GOMP_loop_static_next (&_s0, &_e0))
+    @{
+      long _e1 = _e0, i;
+      for (i = _s0; i < _e1; i++)
+        body;
+    @}
+    GOMP_loop_end_nowait ();
+  @}
+
+  GOMP_parallel_loop_static (subfunction, NULL, 0, lb, ub+1, 1, 0);
+  subfunction (NULL);
+  GOMP_parallel_end ();
+@end smallexample
+
+@smallexample
+  #pragma omp for schedule(runtime)
+  for (i = 0; i < n; i++)
+    body;
+@end smallexample
+
+becomes
+
+@smallexample
+  @{
+    long i, _s0, _e0;
+    if (GOMP_loop_runtime_start (0, n, 1, &_s0, &_e0))
+      do @{
+        long _e1 = _e0;
+        for (i = _s0, i < _e0; i++)
+          body;
+      @} while (GOMP_loop_runtime_next (&_s0, _&e0));
+    GOMP_loop_end ();
+  @}
+@end smallexample
+
+Note that while it looks like there is trickiness to propagating
+a non-constant STEP, there isn't really.  We're explicitly allowed
+to evaluate it as many times as we want, and any variables involved
+should automatically be handled as PRIVATE or SHARED like any other
+variables.  So the expression should remain evaluable in the 
+subfunction.  We can also pull it into a local variable if we like,
+but since its supposed to remain unchanged, we can also not if we like.
+
+If we have SCHEDULE(STATIC), and no ORDERED, then we ought to be
+able to get away with no work-sharing context at all, since we can
+simply perform the arithmetic directly in each thread to divide up
+the iterations.  Which would mean that we wouldn't need to call any
+of these routines.
+
+There are separate routines for handling loops with an ORDERED
+clause.  Bookkeeping for that is non-trivial...
+
+
+
+@node Implementing ORDERED construct
+@section Implementing ORDERED construct
+
+@smallexample
+  void GOMP_ordered_start (void)
+  void GOMP_ordered_end (void)
+@end smallexample
+
+
+
+@node Implementing SECTIONS construct
+@section Implementing SECTIONS construct
+
+A block as 
+
+@smallexample
+  #pragma omp sections
+  @{
+    #pragma omp section
+    stmt1;
+    #pragma omp section
+    stmt2;
+    #pragma omp section
+    stmt3;
+  @}
+@end smallexample
+
+becomes
+
+@smallexample
+  for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ())
+    switch (i)
+      @{
+      case 1:
+        stmt1;
+        break;
+      case 2:
+        stmt2;
+        break;
+      case 3:
+        stmt3;
+        break;
+      @}
+  GOMP_barrier ();
+@end smallexample
+
+
+@node Implementing SINGLE construct
+@section Implementing SINGLE construct
+
+A block like 
+
+@smallexample
+  #pragma omp single
+  @{
+    body;
+  @}
+@end smallexample
+
+becomes
+
+@smallexample
+  if (GOMP_single_start ())
+    body;
+  GOMP_barrier ();
+@end smallexample
+
+while 
+
+@smallexample
+  #pragma omp single copyprivate(x)
+    body;
+@end smallexample
+
+becomes
+
+@smallexample
+  datap = GOMP_single_copy_start ();
+  if (datap == NULL)
+    @{
+      body;
+      data.x = x;
+      GOMP_single_copy_end (&data);
+    @}
+  else
+    x = datap->x;
+  GOMP_barrier ();
+@end smallexample
+
+
+
+@c ---------------------------------------------------------------------
+@c 
+@c ---------------------------------------------------------------------
+
+@node Reporting Bugs
+@chapter Reporting Bugs
+
+Bugs in the GNU OpenMP implementation should be reported via 
+@uref{http://gcc.gnu.org/bugzilla/, bugzilla}.  For all cases, please add 
+"openmp" to the keywords field in the bug report.
+
+
+
+@c ---------------------------------------------------------------------
+@c GNU General Public License
+@c ---------------------------------------------------------------------
+
+@include gpl.texi
+
+
+
+@c ---------------------------------------------------------------------
+@c GNU Free Documentation License
+@c ---------------------------------------------------------------------
+
+@include fdl.texi
+
+
+
+@c ---------------------------------------------------------------------
+@c Funding Free Software
+@c ---------------------------------------------------------------------
+
+@include funding.texi
+
+@c ---------------------------------------------------------------------
+@c Index
+@c ---------------------------------------------------------------------
+
+@node Index
+@unnumbered Index
+
+@printindex cp
+
+@bye
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp_f.h.in b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp_f.h.in
new file mode 100644 (file)
index 0000000..ccb7e83
--- /dev/null
@@ -0,0 +1,93 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_F_H
+#define LIBGOMP_F_H 1
+
+#include "libgomp.h"
+
+#if (@OMP_LOCK_SIZE@ == @OMP_LOCK_KIND@) \
+    && (@OMP_LOCK_ALIGN@ <= @OMP_LOCK_SIZE@)
+# define OMP_LOCK_DIRECT
+typedef omp_lock_t *omp_lock_arg_t;
+# define omp_lock_arg(arg) (arg)
+#else
+typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
+# define omp_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (@OMP_NEST_LOCK_SIZE@ == @OMP_NEST_LOCK_KIND@) \
+    && (@OMP_NEST_LOCK_ALIGN@ <= @OMP_NEST_LOCK_SIZE@)
+# define OMP_NEST_LOCK_DIRECT
+typedef omp_nest_lock_t *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
+# define omp_nest_lock_arg(arg) ((arg)->lock)
+# endif
+
+#if (@OMP_LOCK_25_SIZE@ == @OMP_LOCK_25_KIND@) \
+    && (@OMP_LOCK_25_ALIGN@ <= @OMP_LOCK_25_SIZE@)
+# define OMP_LOCK_25_DIRECT
+typedef omp_lock_25_t *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_lock_25_t *lock; uint64_t u; } *omp_lock_25_arg_t;
+# define omp_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+#if (@OMP_NEST_LOCK_25_SIZE@ == @OMP_NEST_LOCK_25_KIND@) \
+    && (@OMP_NEST_LOCK_25_ALIGN@ <= @OMP_NEST_LOCK_25_SIZE@)
+# define OMP_NEST_LOCK_25_DIRECT
+typedef omp_nest_lock_25_t *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) (arg)
+#else
+typedef union { omp_nest_lock_25_t *lock; uint64_t u; } *omp_nest_lock_25_arg_t;
+# define omp_nest_lock_25_arg(arg) ((arg)->lock)
+# endif
+
+static inline void
+omp_check_defines (void)
+{
+  char test[(@OMP_LOCK_SIZE@ != sizeof (omp_lock_t)
+            || @OMP_LOCK_ALIGN@ != __alignof (omp_lock_t)
+            || @OMP_NEST_LOCK_SIZE@ != sizeof (omp_nest_lock_t)
+            || @OMP_NEST_LOCK_ALIGN@ != __alignof (omp_nest_lock_t)
+            || @OMP_LOCK_KIND@ != sizeof (*(omp_lock_arg_t) 0)
+            || @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+  char test2[(@OMP_LOCK_25_SIZE@ != sizeof (omp_lock_25_t)
+            || @OMP_LOCK_25_ALIGN@ != __alignof (omp_lock_25_t)
+            || @OMP_NEST_LOCK_25_SIZE@ != sizeof (omp_nest_lock_25_t)
+            || @OMP_NEST_LOCK_25_ALIGN@ != __alignof (omp_nest_lock_25_t)
+            || @OMP_LOCK_25_KIND@ != sizeof (*(omp_lock_25_arg_t) 0)
+            || @OMP_NEST_LOCK_25_KIND@
+               != sizeof (*(omp_nest_lock_25_arg_t) 0))
+           ? -1 : 1] __attribute__ ((__unused__));
+}
+
+#endif /* LIBGOMP_F_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp_g.h b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/libgomp_g.h
new file mode 100644 (file)
index 0000000..8a7c31f
--- /dev/null
@@ -0,0 +1,183 @@
+/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains prototypes of functions in the external ABI.
+   This file is included by files in the testsuite.  */
+
+#ifndef LIBGOMP_G_H 
+#define LIBGOMP_G_H 1
+
+#include <stdbool.h>
+
+/* barrier.c */
+
+extern void GOMP_barrier (void);
+
+/* critical.c */
+
+extern void GOMP_critical_start (void);
+extern void GOMP_critical_end (void);
+extern void GOMP_critical_name_start (void **);
+extern void GOMP_critical_name_end (void **);
+extern void GOMP_atomic_start (void);
+extern void GOMP_atomic_end (void);
+
+/* loop.c */
+
+extern bool GOMP_loop_static_start (long, long, long, long, long *, long *);
+extern bool GOMP_loop_dynamic_start (long, long, long, long, long *, long *);
+extern bool GOMP_loop_guided_start (long, long, long, long, long *, long *);
+extern bool GOMP_loop_runtime_start (long, long, long, long *, long *);
+
+extern bool GOMP_loop_ordered_static_start (long, long, long, long,
+                                           long *, long *);
+extern bool GOMP_loop_ordered_dynamic_start (long, long, long, long,
+                                            long *, long *);
+extern bool GOMP_loop_ordered_guided_start (long, long, long, long,
+                                           long *, long *);
+extern bool GOMP_loop_ordered_runtime_start (long, long, long, long *, long *);
+
+extern bool GOMP_loop_static_next (long *, long *);
+extern bool GOMP_loop_dynamic_next (long *, long *);
+extern bool GOMP_loop_guided_next (long *, long *);
+extern bool GOMP_loop_runtime_next (long *, long *);
+
+extern bool GOMP_loop_ordered_static_next (long *, long *);
+extern bool GOMP_loop_ordered_dynamic_next (long *, long *);
+extern bool GOMP_loop_ordered_guided_next (long *, long *);
+extern bool GOMP_loop_ordered_runtime_next (long *, long *);
+
+extern void GOMP_parallel_loop_static_start (void (*)(void *), void *,
+                                            unsigned, long, long, long, long);
+extern void GOMP_parallel_loop_dynamic_start (void (*)(void *), void *,
+                                            unsigned, long, long, long, long);
+extern void GOMP_parallel_loop_guided_start (void (*)(void *), void *,
+                                            unsigned, long, long, long, long);
+extern void GOMP_parallel_loop_runtime_start (void (*)(void *), void *,
+                                             unsigned, long, long, long);
+
+extern void GOMP_loop_end (void);
+extern void GOMP_loop_end_nowait (void);
+
+/* loop_ull.c */
+
+extern bool GOMP_loop_ull_static_start (bool, unsigned long long,
+                                       unsigned long long,
+                                       unsigned long long,
+                                       unsigned long long,
+                                       unsigned long long *,
+                                       unsigned long long *);
+extern bool GOMP_loop_ull_dynamic_start (bool, unsigned long long,
+                                        unsigned long long,
+                                        unsigned long long,
+                                        unsigned long long,
+                                        unsigned long long *,
+                                        unsigned long long *);
+extern bool GOMP_loop_ull_guided_start (bool, unsigned long long,
+                                       unsigned long long,
+                                       unsigned long long,
+                                       unsigned long long,
+                                       unsigned long long *,
+                                       unsigned long long *);
+extern bool GOMP_loop_ull_runtime_start (bool, unsigned long long,
+                                        unsigned long long,
+                                        unsigned long long,
+                                        unsigned long long *,
+                                        unsigned long long *);
+
+extern bool GOMP_loop_ull_ordered_static_start (bool, unsigned long long,
+                                               unsigned long long,
+                                               unsigned long long,
+                                               unsigned long long,
+                                               unsigned long long *,
+                                               unsigned long long *);
+extern bool GOMP_loop_ull_ordered_dynamic_start (bool, unsigned long long,
+                                                unsigned long long,
+                                                unsigned long long,
+                                                unsigned long long,
+                                                unsigned long long *,
+                                                unsigned long long *);
+extern bool GOMP_loop_ull_ordered_guided_start (bool, unsigned long long,
+                                               unsigned long long,
+                                               unsigned long long,
+                                               unsigned long long,
+                                               unsigned long long *,
+                                               unsigned long long *);
+extern bool GOMP_loop_ull_ordered_runtime_start (bool, unsigned long long,
+                                                unsigned long long,
+                                                unsigned long long,
+                                                unsigned long long *,
+                                                unsigned long long *);
+
+extern bool GOMP_loop_ull_static_next (unsigned long long *,
+                                      unsigned long long *);
+extern bool GOMP_loop_ull_dynamic_next (unsigned long long *,
+                                       unsigned long long *);
+extern bool GOMP_loop_ull_guided_next (unsigned long long *,
+                                      unsigned long long *);
+extern bool GOMP_loop_ull_runtime_next (unsigned long long *,
+                                       unsigned long long *);
+
+extern bool GOMP_loop_ull_ordered_static_next (unsigned long long *,
+                                              unsigned long long *);
+extern bool GOMP_loop_ull_ordered_dynamic_next (unsigned long long *,
+                                               unsigned long long *);
+extern bool GOMP_loop_ull_ordered_guided_next (unsigned long long *,
+                                              unsigned long long *);
+extern bool GOMP_loop_ull_ordered_runtime_next (unsigned long long *,
+                                               unsigned long long *);
+
+/* ordered.c */
+
+extern void GOMP_ordered_start (void);
+extern void GOMP_ordered_end (void);
+
+/* parallel.c */
+
+extern void GOMP_parallel_start (void (*) (void *), void *, unsigned);
+extern void GOMP_parallel_end (void);
+
+/* task.c */
+
+extern void GOMP_task (void (*) (void *), void *, void (*) (void *, void *),
+                      long, long, bool, unsigned);
+extern void GOMP_taskwait (void);
+extern void GOMP_taskyield (void);
+
+/* sections.c */
+
+extern unsigned GOMP_sections_start (unsigned);
+extern unsigned GOMP_sections_next (void);
+extern void GOMP_parallel_sections_start (void (*) (void *), void *,
+                                         unsigned, unsigned);
+extern void GOMP_sections_end (void);
+extern void GOMP_sections_end_nowait (void);
+
+/* single.c */
+
+extern bool GOMP_single_start (void);
+extern void *GOMP_single_copy_start (void);
+extern void GOMP_single_copy_end (void *);
+
+#endif /* LIBGOMP_G_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/loop.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/loop.c
new file mode 100644 (file)
index 0000000..ca38921
--- /dev/null
@@ -0,0 +1,620 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the LOOP (FOR/DO) construct.  */
+
+#include <limits.h>
+#include <stdlib.h>
+#include "libgomp.h"
+
+
+/* Initialize the given work share construct from the given arguments.  */
+
+static inline void
+gomp_loop_init (struct gomp_work_share *ws, long start, long end, long incr,
+               enum gomp_schedule_type sched, long chunk_size)
+{
+  ws->sched = sched;
+  ws->chunk_size = chunk_size;
+  /* Canonicalize loops that have zero iterations to ->next == ->end.  */
+  ws->end = ((incr > 0 && start > end) || (incr < 0 && start < end))
+           ? start : end;
+  ws->incr = incr;
+  ws->next = start;
+  if (sched == GFS_DYNAMIC)
+    {
+      ws->chunk_size *= incr;
+
+#ifdef HAVE_SYNC_BUILTINS
+      {
+       /* For dynamic scheduling prepare things to make each iteration
+          faster.  */
+       struct gomp_thread *thr = gomp_thread ();
+       struct gomp_team *team = thr->ts.team;
+       long nthreads = team ? team->nthreads : 1;
+
+       if (__builtin_expect (incr > 0, 1))
+         {
+           /* Cheap overflow protection.  */
+           if (__builtin_expect ((nthreads | ws->chunk_size)
+                                 >= 1UL << (sizeof (long)
+                                            * __CHAR_BIT__ / 2 - 1), 0))
+             ws->mode = 0;
+           else
+             ws->mode = ws->end < (LONG_MAX
+                                   - (nthreads + 1) * ws->chunk_size);
+         }
+       /* Cheap overflow protection.  */
+       else if (__builtin_expect ((nthreads | -ws->chunk_size)
+                                  >= 1UL << (sizeof (long)
+                                             * __CHAR_BIT__ / 2 - 1), 0))
+         ws->mode = 0;
+       else
+         ws->mode = ws->end > (nthreads + 1) * -ws->chunk_size - LONG_MAX;
+      }
+#endif
+    }
+}
+
+/* The *_start routines are called when first encountering a loop construct
+   that is not bound directly to a parallel construct.  The first thread 
+   that arrives will create the work-share construct; subsequent threads
+   will see the construct exists and allocate work from it.
+
+   START, END, INCR are the bounds of the loop; due to the restrictions of
+   OpenMP, these values must be the same in every thread.  This is not 
+   verified (nor is it entirely verifiable, since START is not necessarily
+   retained intact in the work-share data structure).  CHUNK_SIZE is the
+   scheduling parameter; again this must be identical in all threads.
+
+   Returns true if there's any work for this thread to perform.  If so,
+   *ISTART and *IEND are filled with the bounds of the iteration block
+   allocated to this thread.  Returns false if all work was assigned to
+   other threads prior to this thread's arrival.  */
+
+static bool
+gomp_loop_static_start (long start, long end, long incr, long chunk_size,
+                       long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+
+  thr->ts.static_trip = 0;
+  if (gomp_work_share_start (false))
+    {
+      gomp_loop_init (thr->ts.work_share, start, end, incr,
+                     GFS_STATIC, chunk_size);
+      gomp_work_share_init_done ();
+    }
+
+  return !gomp_iter_static_next (istart, iend);
+}
+
+static bool
+gomp_loop_dynamic_start (long start, long end, long incr, long chunk_size,
+                        long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  if (gomp_work_share_start (false))
+    {
+      gomp_loop_init (thr->ts.work_share, start, end, incr,
+                     GFS_DYNAMIC, chunk_size);
+      gomp_work_share_init_done ();
+    }
+
+#ifdef HAVE_SYNC_BUILTINS
+  ret = gomp_iter_dynamic_next (istart, iend);
+#else
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_dynamic_next_locked (istart, iend);
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+static bool
+gomp_loop_guided_start (long start, long end, long incr, long chunk_size,
+                       long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  if (gomp_work_share_start (false))
+    {
+      gomp_loop_init (thr->ts.work_share, start, end, incr,
+                     GFS_GUIDED, chunk_size);
+      gomp_work_share_init_done ();
+    }
+
+#ifdef HAVE_SYNC_BUILTINS
+  ret = gomp_iter_guided_next (istart, iend);
+#else
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_guided_next_locked (istart, iend);
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+bool
+GOMP_loop_runtime_start (long start, long end, long incr,
+                        long *istart, long *iend)
+{
+  struct gomp_task_icv *icv = gomp_icv (false);
+  switch (icv->run_sched_var)
+    {
+    case GFS_STATIC:
+      return gomp_loop_static_start (start, end, incr, icv->run_sched_modifier,
+                                    istart, iend);
+    case GFS_DYNAMIC:
+      return gomp_loop_dynamic_start (start, end, incr, icv->run_sched_modifier,
+                                     istart, iend);
+    case GFS_GUIDED:
+      return gomp_loop_guided_start (start, end, incr, icv->run_sched_modifier,
+                                    istart, iend);
+    case GFS_AUTO:
+      /* For now map to schedule(static), later on we could play with feedback
+        driven choice.  */
+      return gomp_loop_static_start (start, end, incr, 0, istart, iend);
+    default:
+      abort ();
+    }
+}
+
+/* The *_ordered_*_start routines are similar.  The only difference is that
+   this work-share construct is initialized to expect an ORDERED section.  */
+
+static bool
+gomp_loop_ordered_static_start (long start, long end, long incr,
+                               long chunk_size, long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+
+  thr->ts.static_trip = 0;
+  if (gomp_work_share_start (true))
+    {
+      gomp_loop_init (thr->ts.work_share, start, end, incr,
+                     GFS_STATIC, chunk_size);
+      gomp_ordered_static_init ();
+      gomp_work_share_init_done ();
+    }
+
+  return !gomp_iter_static_next (istart, iend);
+}
+
+static bool
+gomp_loop_ordered_dynamic_start (long start, long end, long incr,
+                                long chunk_size, long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  if (gomp_work_share_start (true))
+    {
+      gomp_loop_init (thr->ts.work_share, start, end, incr,
+                     GFS_DYNAMIC, chunk_size);
+      gomp_mutex_lock (&thr->ts.work_share->lock);
+      gomp_work_share_init_done ();
+    }
+  else
+    gomp_mutex_lock (&thr->ts.work_share->lock);
+
+  ret = gomp_iter_dynamic_next_locked (istart, iend);
+  if (ret)
+    gomp_ordered_first ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return ret;
+}
+
+static bool
+gomp_loop_ordered_guided_start (long start, long end, long incr,
+                               long chunk_size, long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  if (gomp_work_share_start (true))
+    {
+      gomp_loop_init (thr->ts.work_share, start, end, incr,
+                     GFS_GUIDED, chunk_size);
+      gomp_mutex_lock (&thr->ts.work_share->lock);
+      gomp_work_share_init_done ();
+    }
+  else
+    gomp_mutex_lock (&thr->ts.work_share->lock);
+
+  ret = gomp_iter_guided_next_locked (istart, iend);
+  if (ret)
+    gomp_ordered_first ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return ret;
+}
+
+bool
+GOMP_loop_ordered_runtime_start (long start, long end, long incr,
+                                long *istart, long *iend)
+{
+  struct gomp_task_icv *icv = gomp_icv (false);
+  switch (icv->run_sched_var)
+    {
+    case GFS_STATIC:
+      return gomp_loop_ordered_static_start (start, end, incr,
+                                            icv->run_sched_modifier,
+                                            istart, iend);
+    case GFS_DYNAMIC:
+      return gomp_loop_ordered_dynamic_start (start, end, incr,
+                                             icv->run_sched_modifier,
+                                             istart, iend);
+    case GFS_GUIDED:
+      return gomp_loop_ordered_guided_start (start, end, incr,
+                                            icv->run_sched_modifier,
+                                            istart, iend);
+    case GFS_AUTO:
+      /* For now map to schedule(static), later on we could play with feedback
+        driven choice.  */
+      return gomp_loop_ordered_static_start (start, end, incr,
+                                            0, istart, iend);
+    default:
+      abort ();
+    }
+}
+
+/* The *_next routines are called when the thread completes processing of 
+   the iteration block currently assigned to it.  If the work-share 
+   construct is bound directly to a parallel construct, then the iteration
+   bounds may have been set up before the parallel.  In which case, this
+   may be the first iteration for the thread.
+
+   Returns true if there is work remaining to be performed; *ISTART and
+   *IEND are filled with a new iteration block.  Returns false if all work
+   has been assigned.  */
+
+static bool
+gomp_loop_static_next (long *istart, long *iend)
+{
+  return !gomp_iter_static_next (istart, iend);
+}
+
+static bool
+gomp_loop_dynamic_next (long *istart, long *iend)
+{
+  bool ret;
+
+#ifdef HAVE_SYNC_BUILTINS
+  ret = gomp_iter_dynamic_next (istart, iend);
+#else
+  struct gomp_thread *thr = gomp_thread ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_dynamic_next_locked (istart, iend);
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+static bool
+gomp_loop_guided_next (long *istart, long *iend)
+{
+  bool ret;
+
+#ifdef HAVE_SYNC_BUILTINS
+  ret = gomp_iter_guided_next (istart, iend);
+#else
+  struct gomp_thread *thr = gomp_thread ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_guided_next_locked (istart, iend);
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+bool
+GOMP_loop_runtime_next (long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  
+  switch (thr->ts.work_share->sched)
+    {
+    case GFS_STATIC:
+    case GFS_AUTO:
+      return gomp_loop_static_next (istart, iend);
+    case GFS_DYNAMIC:
+      return gomp_loop_dynamic_next (istart, iend);
+    case GFS_GUIDED:
+      return gomp_loop_guided_next (istart, iend);
+    default:
+      abort ();
+    }
+}
+
+/* The *_ordered_*_next routines are called when the thread completes
+   processing of the iteration block currently assigned to it.
+
+   Returns true if there is work remaining to be performed; *ISTART and
+   *IEND are filled with a new iteration block.  Returns false if all work
+   has been assigned.  */
+
+static bool
+gomp_loop_ordered_static_next (long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  int test;
+
+  gomp_ordered_sync ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  test = gomp_iter_static_next (istart, iend);
+  if (test >= 0)
+    gomp_ordered_static_next ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return test == 0;
+}
+
+static bool
+gomp_loop_ordered_dynamic_next (long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  gomp_ordered_sync ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_dynamic_next_locked (istart, iend);
+  if (ret)
+    gomp_ordered_next ();
+  else
+    gomp_ordered_last ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return ret;
+}
+
+static bool
+gomp_loop_ordered_guided_next (long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  gomp_ordered_sync ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_guided_next_locked (istart, iend);
+  if (ret)
+    gomp_ordered_next ();
+  else
+    gomp_ordered_last ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return ret;
+}
+
+bool
+GOMP_loop_ordered_runtime_next (long *istart, long *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  
+  switch (thr->ts.work_share->sched)
+    {
+    case GFS_STATIC:
+    case GFS_AUTO:
+      return gomp_loop_ordered_static_next (istart, iend);
+    case GFS_DYNAMIC:
+      return gomp_loop_ordered_dynamic_next (istart, iend);
+    case GFS_GUIDED:
+      return gomp_loop_ordered_guided_next (istart, iend);
+    default:
+      abort ();
+    }
+}
+
+/* The GOMP_parallel_loop_* routines pre-initialize a work-share construct
+   to avoid one synchronization once we get into the loop.  */
+
+static void
+gomp_parallel_loop_start (void (*fn) (void *), void *data,
+                         unsigned num_threads, long start, long end,
+                         long incr, enum gomp_schedule_type sched,
+                         long chunk_size)
+{
+  struct gomp_team *team;
+
+  num_threads = gomp_resolve_num_threads (num_threads, 0);
+  team = gomp_new_team (num_threads);
+  gomp_loop_init (&team->work_shares[0], start, end, incr, sched, chunk_size);
+  gomp_team_start (fn, data, num_threads, team);
+}
+
+void
+GOMP_parallel_loop_static_start (void (*fn) (void *), void *data,
+                                unsigned num_threads, long start, long end,
+                                long incr, long chunk_size)
+{
+  gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
+                           GFS_STATIC, chunk_size);
+}
+
+void
+GOMP_parallel_loop_dynamic_start (void (*fn) (void *), void *data,
+                                 unsigned num_threads, long start, long end,
+                                 long incr, long chunk_size)
+{
+  gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
+                           GFS_DYNAMIC, chunk_size);
+}
+
+void
+GOMP_parallel_loop_guided_start (void (*fn) (void *), void *data,
+                                unsigned num_threads, long start, long end,
+                                long incr, long chunk_size)
+{
+  gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
+                           GFS_GUIDED, chunk_size);
+}
+
+void
+GOMP_parallel_loop_runtime_start (void (*fn) (void *), void *data,
+                                 unsigned num_threads, long start, long end,
+                                 long incr)
+{
+  struct gomp_task_icv *icv = gomp_icv (false);
+  gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
+                           icv->run_sched_var, icv->run_sched_modifier);
+}
+
+/* The GOMP_loop_end* routines are called after the thread is told that
+   all loop iterations are complete.  This first version synchronizes
+   all threads; the nowait version does not.  */
+
+void
+GOMP_loop_end (void)
+{
+  gomp_work_share_end ();
+}
+
+void
+GOMP_loop_end_nowait (void)
+{
+  gomp_work_share_end_nowait ();
+}
+
+
+/* We use static functions above so that we're sure that the "runtime"
+   function can defer to the proper routine without interposition.  We
+   export the static function with a strong alias when possible, or with
+   a wrapper function otherwise.  */
+
+#ifdef HAVE_ATTRIBUTE_ALIAS
+extern __typeof(gomp_loop_static_start) GOMP_loop_static_start
+       __attribute__((alias ("gomp_loop_static_start")));
+extern __typeof(gomp_loop_dynamic_start) GOMP_loop_dynamic_start
+       __attribute__((alias ("gomp_loop_dynamic_start")));
+extern __typeof(gomp_loop_guided_start) GOMP_loop_guided_start
+       __attribute__((alias ("gomp_loop_guided_start")));
+
+extern __typeof(gomp_loop_ordered_static_start) GOMP_loop_ordered_static_start
+       __attribute__((alias ("gomp_loop_ordered_static_start")));
+extern __typeof(gomp_loop_ordered_dynamic_start) GOMP_loop_ordered_dynamic_start
+       __attribute__((alias ("gomp_loop_ordered_dynamic_start")));
+extern __typeof(gomp_loop_ordered_guided_start) GOMP_loop_ordered_guided_start
+       __attribute__((alias ("gomp_loop_ordered_guided_start")));
+
+extern __typeof(gomp_loop_static_next) GOMP_loop_static_next
+       __attribute__((alias ("gomp_loop_static_next")));
+extern __typeof(gomp_loop_dynamic_next) GOMP_loop_dynamic_next
+       __attribute__((alias ("gomp_loop_dynamic_next")));
+extern __typeof(gomp_loop_guided_next) GOMP_loop_guided_next
+       __attribute__((alias ("gomp_loop_guided_next")));
+
+extern __typeof(gomp_loop_ordered_static_next) GOMP_loop_ordered_static_next
+       __attribute__((alias ("gomp_loop_ordered_static_next")));
+extern __typeof(gomp_loop_ordered_dynamic_next) GOMP_loop_ordered_dynamic_next
+       __attribute__((alias ("gomp_loop_ordered_dynamic_next")));
+extern __typeof(gomp_loop_ordered_guided_next) GOMP_loop_ordered_guided_next
+       __attribute__((alias ("gomp_loop_ordered_guided_next")));
+#else
+bool
+GOMP_loop_static_start (long start, long end, long incr, long chunk_size,
+                       long *istart, long *iend)
+{
+  return gomp_loop_static_start (start, end, incr, chunk_size, istart, iend);
+}
+
+bool
+GOMP_loop_dynamic_start (long start, long end, long incr, long chunk_size,
+                        long *istart, long *iend)
+{
+  return gomp_loop_dynamic_start (start, end, incr, chunk_size, istart, iend);
+}
+
+bool
+GOMP_loop_guided_start (long start, long end, long incr, long chunk_size,
+                       long *istart, long *iend)
+{
+  return gomp_loop_guided_start (start, end, incr, chunk_size, istart, iend);
+}
+
+bool
+GOMP_loop_ordered_static_start (long start, long end, long incr,
+                               long chunk_size, long *istart, long *iend)
+{
+  return gomp_loop_ordered_static_start (start, end, incr, chunk_size,
+                                        istart, iend);
+}
+
+bool
+GOMP_loop_ordered_dynamic_start (long start, long end, long incr,
+                                long chunk_size, long *istart, long *iend)
+{
+  return gomp_loop_ordered_dynamic_start (start, end, incr, chunk_size,
+                                         istart, iend);
+}
+
+bool
+GOMP_loop_ordered_guided_start (long start, long end, long incr,
+                               long chunk_size, long *istart, long *iend)
+{
+  return gomp_loop_ordered_guided_start (start, end, incr, chunk_size,
+                                        istart, iend);
+}
+
+bool
+GOMP_loop_static_next (long *istart, long *iend)
+{
+  return gomp_loop_static_next (istart, iend);
+}
+
+bool
+GOMP_loop_dynamic_next (long *istart, long *iend)
+{
+  return gomp_loop_dynamic_next (istart, iend);
+}
+
+bool
+GOMP_loop_guided_next (long *istart, long *iend)
+{
+  return gomp_loop_guided_next (istart, iend);
+}
+
+bool
+GOMP_loop_ordered_static_next (long *istart, long *iend)
+{
+  return gomp_loop_ordered_static_next (istart, iend);
+}
+
+bool
+GOMP_loop_ordered_dynamic_next (long *istart, long *iend)
+{
+  return gomp_loop_ordered_dynamic_next (istart, iend);
+}
+
+bool
+GOMP_loop_ordered_guided_next (long *istart, long *iend)
+{
+  return gomp_loop_ordered_guided_next (istart, iend);
+}
+#endif
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/loop_ull.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/loop_ull.c
new file mode 100644 (file)
index 0000000..82da2d5
--- /dev/null
@@ -0,0 +1,571 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the LOOP (FOR/DO) construct.  */
+
+#include <limits.h>
+#include <stdlib.h>
+#include "libgomp.h"
+
+typedef unsigned long long gomp_ull;
+
+/* Initialize the given work share construct from the given arguments.  */
+
+static inline void
+gomp_loop_ull_init (struct gomp_work_share *ws, bool up, gomp_ull start,
+                   gomp_ull end, gomp_ull incr, enum gomp_schedule_type sched,
+                   gomp_ull chunk_size)
+{
+  ws->sched = sched;
+  ws->chunk_size_ull = chunk_size;
+  /* Canonicalize loops that have zero iterations to ->next == ->end.  */
+  ws->end_ull = ((up && start > end) || (!up && start < end))
+               ? start : end;
+  ws->incr_ull = incr;
+  ws->next_ull = start;
+  ws->mode = 0;
+  if (sched == GFS_DYNAMIC)
+    {
+      ws->chunk_size_ull *= incr;
+
+#if defined HAVE_SYNC_BUILTINS && defined __LP64__
+      {
+       /* For dynamic scheduling prepare things to make each iteration
+          faster.  */
+       struct gomp_thread *thr = gomp_thread ();
+       struct gomp_team *team = thr->ts.team;
+       long nthreads = team ? team->nthreads : 1;
+
+       if (__builtin_expect (up, 1))
+         {
+           /* Cheap overflow protection.  */
+           if (__builtin_expect ((nthreads | ws->chunk_size_ull)
+                                 < 1ULL << (sizeof (gomp_ull)
+                                            * __CHAR_BIT__ / 2 - 1), 1))
+             ws->mode = ws->end_ull < (__LONG_LONG_MAX__ * 2ULL + 1
+                                       - (nthreads + 1) * ws->chunk_size_ull);
+         }
+       /* Cheap overflow protection.  */
+       else if (__builtin_expect ((nthreads | -ws->chunk_size_ull)
+                                  < 1ULL << (sizeof (gomp_ull)
+                                             * __CHAR_BIT__ / 2 - 1), 1))
+         ws->mode = ws->end_ull > ((nthreads + 1) * -ws->chunk_size_ull
+                                   - (__LONG_LONG_MAX__ * 2ULL + 1));
+      }
+#endif
+    }
+  if (!up)
+    ws->mode |= 2;
+}
+
+/* The *_start routines are called when first encountering a loop construct
+   that is not bound directly to a parallel construct.  The first thread
+   that arrives will create the work-share construct; subsequent threads
+   will see the construct exists and allocate work from it.
+
+   START, END, INCR are the bounds of the loop; due to the restrictions of
+   OpenMP, these values must be the same in every thread.  This is not
+   verified (nor is it entirely verifiable, since START is not necessarily
+   retained intact in the work-share data structure).  CHUNK_SIZE is the
+   scheduling parameter; again this must be identical in all threads.
+
+   Returns true if there's any work for this thread to perform.  If so,
+   *ISTART and *IEND are filled with the bounds of the iteration block
+   allocated to this thread.  Returns false if all work was assigned to
+   other threads prior to this thread's arrival.  */
+
+static bool
+gomp_loop_ull_static_start (bool up, gomp_ull start, gomp_ull end,
+                           gomp_ull incr, gomp_ull chunk_size,
+                           gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+
+  thr->ts.static_trip = 0;
+  if (gomp_work_share_start (false))
+    {
+      gomp_loop_ull_init (thr->ts.work_share, up, start, end, incr,
+                         GFS_STATIC, chunk_size);
+      gomp_work_share_init_done ();
+    }
+
+  return !gomp_iter_ull_static_next (istart, iend);
+}
+
+static bool
+gomp_loop_ull_dynamic_start (bool up, gomp_ull start, gomp_ull end,
+                            gomp_ull incr, gomp_ull chunk_size,
+                            gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  if (gomp_work_share_start (false))
+    {
+      gomp_loop_ull_init (thr->ts.work_share, up, start, end, incr,
+                         GFS_DYNAMIC, chunk_size);
+      gomp_work_share_init_done ();
+    }
+
+#if defined HAVE_SYNC_BUILTINS && defined __LP64__
+  ret = gomp_iter_ull_dynamic_next (istart, iend);
+#else
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_ull_dynamic_next_locked (istart, iend);
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+static bool
+gomp_loop_ull_guided_start (bool up, gomp_ull start, gomp_ull end,
+                           gomp_ull incr, gomp_ull chunk_size,
+                           gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  if (gomp_work_share_start (false))
+    {
+      gomp_loop_ull_init (thr->ts.work_share, up, start, end, incr,
+                         GFS_GUIDED, chunk_size);
+      gomp_work_share_init_done ();
+    }
+
+#if defined HAVE_SYNC_BUILTINS && defined __LP64__
+  ret = gomp_iter_ull_guided_next (istart, iend);
+#else
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_ull_guided_next_locked (istart, iend);
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+bool
+GOMP_loop_ull_runtime_start (bool up, gomp_ull start, gomp_ull end,
+                            gomp_ull incr, gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_task_icv *icv = gomp_icv (false);
+  switch (icv->run_sched_var)
+    {
+    case GFS_STATIC:
+      return gomp_loop_ull_static_start (up, start, end, incr,
+                                        icv->run_sched_modifier,
+                                        istart, iend);
+    case GFS_DYNAMIC:
+      return gomp_loop_ull_dynamic_start (up, start, end, incr,
+                                         icv->run_sched_modifier,
+                                         istart, iend);
+    case GFS_GUIDED:
+      return gomp_loop_ull_guided_start (up, start, end, incr,
+                                        icv->run_sched_modifier,
+                                        istart, iend);
+    case GFS_AUTO:
+      /* For now map to schedule(static), later on we could play with feedback
+        driven choice.  */
+      return gomp_loop_ull_static_start (up, start, end, incr,
+                                        0, istart, iend);
+    default:
+      abort ();
+    }
+}
+
+/* The *_ordered_*_start routines are similar.  The only difference is that
+   this work-share construct is initialized to expect an ORDERED section.  */
+
+static bool
+gomp_loop_ull_ordered_static_start (bool up, gomp_ull start, gomp_ull end,
+                                   gomp_ull incr, gomp_ull chunk_size,
+                                   gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+
+  thr->ts.static_trip = 0;
+  if (gomp_work_share_start (true))
+    {
+      gomp_loop_ull_init (thr->ts.work_share, up, start, end, incr,
+                         GFS_STATIC, chunk_size);
+      gomp_ordered_static_init ();
+      gomp_work_share_init_done ();
+    }
+
+  return !gomp_iter_ull_static_next (istart, iend);
+}
+
+static bool
+gomp_loop_ull_ordered_dynamic_start (bool up, gomp_ull start, gomp_ull end,
+                                    gomp_ull incr, gomp_ull chunk_size,
+                                    gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  if (gomp_work_share_start (true))
+    {
+      gomp_loop_ull_init (thr->ts.work_share, up, start, end, incr,
+                         GFS_DYNAMIC, chunk_size);
+      gomp_mutex_lock (&thr->ts.work_share->lock);
+      gomp_work_share_init_done ();
+    }
+  else
+    gomp_mutex_lock (&thr->ts.work_share->lock);
+
+  ret = gomp_iter_ull_dynamic_next_locked (istart, iend);
+  if (ret)
+    gomp_ordered_first ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return ret;
+}
+
+static bool
+gomp_loop_ull_ordered_guided_start (bool up, gomp_ull start, gomp_ull end,
+                                   gomp_ull incr, gomp_ull chunk_size,
+                                   gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  if (gomp_work_share_start (true))
+    {
+      gomp_loop_ull_init (thr->ts.work_share, up, start, end, incr,
+                         GFS_GUIDED, chunk_size);
+      gomp_mutex_lock (&thr->ts.work_share->lock);
+      gomp_work_share_init_done ();
+    }
+  else
+    gomp_mutex_lock (&thr->ts.work_share->lock);
+
+  ret = gomp_iter_ull_guided_next_locked (istart, iend);
+  if (ret)
+    gomp_ordered_first ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return ret;
+}
+
+bool
+GOMP_loop_ull_ordered_runtime_start (bool up, gomp_ull start, gomp_ull end,
+                                    gomp_ull incr, gomp_ull *istart,
+                                    gomp_ull *iend)
+{
+  struct gomp_task_icv *icv = gomp_icv (false);
+  switch (icv->run_sched_var)
+    {
+    case GFS_STATIC:
+      return gomp_loop_ull_ordered_static_start (up, start, end, incr,
+                                                icv->run_sched_modifier,
+                                                istart, iend);
+    case GFS_DYNAMIC:
+      return gomp_loop_ull_ordered_dynamic_start (up, start, end, incr,
+                                                 icv->run_sched_modifier,
+                                                 istart, iend);
+    case GFS_GUIDED:
+      return gomp_loop_ull_ordered_guided_start (up, start, end, incr,
+                                                icv->run_sched_modifier,
+                                                istart, iend);
+    case GFS_AUTO:
+      /* For now map to schedule(static), later on we could play with feedback
+        driven choice.  */
+      return gomp_loop_ull_ordered_static_start (up, start, end, incr,
+                                                0, istart, iend);
+    default:
+      abort ();
+    }
+}
+
+/* The *_next routines are called when the thread completes processing of
+   the iteration block currently assigned to it.  If the work-share
+   construct is bound directly to a parallel construct, then the iteration
+   bounds may have been set up before the parallel.  In which case, this
+   may be the first iteration for the thread.
+
+   Returns true if there is work remaining to be performed; *ISTART and
+   *IEND are filled with a new iteration block.  Returns false if all work
+   has been assigned.  */
+
+static bool
+gomp_loop_ull_static_next (gomp_ull *istart, gomp_ull *iend)
+{
+  return !gomp_iter_ull_static_next (istart, iend);
+}
+
+static bool
+gomp_loop_ull_dynamic_next (gomp_ull *istart, gomp_ull *iend)
+{
+  bool ret;
+
+#if defined HAVE_SYNC_BUILTINS && defined __LP64__
+  ret = gomp_iter_ull_dynamic_next (istart, iend);
+#else
+  struct gomp_thread *thr = gomp_thread ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_ull_dynamic_next_locked (istart, iend);
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+static bool
+gomp_loop_ull_guided_next (gomp_ull *istart, gomp_ull *iend)
+{
+  bool ret;
+
+#if defined HAVE_SYNC_BUILTINS && defined __LP64__
+  ret = gomp_iter_ull_guided_next (istart, iend);
+#else
+  struct gomp_thread *thr = gomp_thread ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_ull_guided_next_locked (istart, iend);
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+bool
+GOMP_loop_ull_runtime_next (gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+
+  switch (thr->ts.work_share->sched)
+    {
+    case GFS_STATIC:
+    case GFS_AUTO:
+      return gomp_loop_ull_static_next (istart, iend);
+    case GFS_DYNAMIC:
+      return gomp_loop_ull_dynamic_next (istart, iend);
+    case GFS_GUIDED:
+      return gomp_loop_ull_guided_next (istart, iend);
+    default:
+      abort ();
+    }
+}
+
+/* The *_ordered_*_next routines are called when the thread completes
+   processing of the iteration block currently assigned to it.
+
+   Returns true if there is work remaining to be performed; *ISTART and
+   *IEND are filled with a new iteration block.  Returns false if all work
+   has been assigned.  */
+
+static bool
+gomp_loop_ull_ordered_static_next (gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  int test;
+
+  gomp_ordered_sync ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  test = gomp_iter_ull_static_next (istart, iend);
+  if (test >= 0)
+    gomp_ordered_static_next ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return test == 0;
+}
+
+static bool
+gomp_loop_ull_ordered_dynamic_next (gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  gomp_ordered_sync ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_ull_dynamic_next_locked (istart, iend);
+  if (ret)
+    gomp_ordered_next ();
+  else
+    gomp_ordered_last ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return ret;
+}
+
+static bool
+gomp_loop_ull_ordered_guided_next (gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  bool ret;
+
+  gomp_ordered_sync ();
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  ret = gomp_iter_ull_guided_next_locked (istart, iend);
+  if (ret)
+    gomp_ordered_next ();
+  else
+    gomp_ordered_last ();
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+
+  return ret;
+}
+
+bool
+GOMP_loop_ull_ordered_runtime_next (gomp_ull *istart, gomp_ull *iend)
+{
+  struct gomp_thread *thr = gomp_thread ();
+
+  switch (thr->ts.work_share->sched)
+    {
+    case GFS_STATIC:
+    case GFS_AUTO:
+      return gomp_loop_ull_ordered_static_next (istart, iend);
+    case GFS_DYNAMIC:
+      return gomp_loop_ull_ordered_dynamic_next (istart, iend);
+    case GFS_GUIDED:
+      return gomp_loop_ull_ordered_guided_next (istart, iend);
+    default:
+      abort ();
+    }
+}
+
+/* We use static functions above so that we're sure that the "runtime"
+   function can defer to the proper routine without interposition.  We
+   export the static function with a strong alias when possible, or with
+   a wrapper function otherwise.  */
+
+#ifdef HAVE_ATTRIBUTE_ALIAS
+extern __typeof(gomp_loop_ull_static_start) GOMP_loop_ull_static_start
+       __attribute__((alias ("gomp_loop_ull_static_start")));
+extern __typeof(gomp_loop_ull_dynamic_start) GOMP_loop_ull_dynamic_start
+       __attribute__((alias ("gomp_loop_ull_dynamic_start")));
+extern __typeof(gomp_loop_ull_guided_start) GOMP_loop_ull_guided_start
+       __attribute__((alias ("gomp_loop_ull_guided_start")));
+
+extern __typeof(gomp_loop_ull_ordered_static_start) GOMP_loop_ull_ordered_static_start
+       __attribute__((alias ("gomp_loop_ull_ordered_static_start")));
+extern __typeof(gomp_loop_ull_ordered_dynamic_start) GOMP_loop_ull_ordered_dynamic_start
+       __attribute__((alias ("gomp_loop_ull_ordered_dynamic_start")));
+extern __typeof(gomp_loop_ull_ordered_guided_start) GOMP_loop_ull_ordered_guided_start
+       __attribute__((alias ("gomp_loop_ull_ordered_guided_start")));
+
+extern __typeof(gomp_loop_ull_static_next) GOMP_loop_ull_static_next
+       __attribute__((alias ("gomp_loop_ull_static_next")));
+extern __typeof(gomp_loop_ull_dynamic_next) GOMP_loop_ull_dynamic_next
+       __attribute__((alias ("gomp_loop_ull_dynamic_next")));
+extern __typeof(gomp_loop_ull_guided_next) GOMP_loop_ull_guided_next
+       __attribute__((alias ("gomp_loop_ull_guided_next")));
+
+extern __typeof(gomp_loop_ull_ordered_static_next) GOMP_loop_ull_ordered_static_next
+       __attribute__((alias ("gomp_loop_ull_ordered_static_next")));
+extern __typeof(gomp_loop_ull_ordered_dynamic_next) GOMP_loop_ull_ordered_dynamic_next
+       __attribute__((alias ("gomp_loop_ull_ordered_dynamic_next")));
+extern __typeof(gomp_loop_ull_ordered_guided_next) GOMP_loop_ull_ordered_guided_next
+       __attribute__((alias ("gomp_loop_ull_ordered_guided_next")));
+#else
+bool
+GOMP_loop_ull_static_start (bool up, gomp_ull start, gomp_ull end,
+                           gomp_ull incr, gomp_ull chunk_size,
+                           gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_static_start (up, start, end, incr, chunk_size, istart,
+                                    iend);
+}
+
+bool
+GOMP_loop_ull_dynamic_start (bool up, gomp_ull start, gomp_ull end,
+                            gomp_ull incr, gomp_ull chunk_size,
+                            gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_dynamic_start (up, start, end, incr, chunk_size, istart,
+                                     iend);
+}
+
+bool
+GOMP_loop_ull_guided_start (bool up, gomp_ull start, gomp_ull end,
+                           gomp_ull incr, gomp_ull chunk_size,
+                           gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_guided_start (up, start, end, incr, chunk_size, istart,
+                                    iend);
+}
+
+bool
+GOMP_loop_ull_ordered_static_start (bool up, gomp_ull start, gomp_ull end,
+                                   gomp_ull incr, gomp_ull chunk_size,
+                                   gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_ordered_static_start (up, start, end, incr, chunk_size,
+                                            istart, iend);
+}
+
+bool
+GOMP_loop_ull_ordered_dynamic_start (bool up, gomp_ull start, gomp_ull end,
+                                    gomp_ull incr, gomp_ull chunk_size,
+                                    gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_ordered_dynamic_start (up, start, end, incr, chunk_size,
+                                             istart, iend);
+}
+
+bool
+GOMP_loop_ull_ordered_guided_start (bool up, gomp_ull start, gomp_ull end,
+                                   gomp_ull incr, gomp_ull chunk_size,
+                                   gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_ordered_guided_start (up, start, end, incr, chunk_size,
+                                            istart, iend);
+}
+
+bool
+GOMP_loop_ull_static_next (gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_static_next (istart, iend);
+}
+
+bool
+GOMP_loop_ull_dynamic_next (gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_dynamic_next (istart, iend);
+}
+
+bool
+GOMP_loop_ull_guided_next (gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_guided_next (istart, iend);
+}
+
+bool
+GOMP_loop_ull_ordered_static_next (gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_ordered_static_next (istart, iend);
+}
+
+bool
+GOMP_loop_ull_ordered_dynamic_next (gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_ordered_dynamic_next (istart, iend);
+}
+
+bool
+GOMP_loop_ull_ordered_guided_next (gomp_ull *istart, gomp_ull *iend)
+{
+  return gomp_loop_ull_ordered_guided_next (istart, iend);
+}
+#endif
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/omp.h.in b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/omp.h.in
new file mode 100644 (file)
index 0000000..f2d7ba4
--- /dev/null
@@ -0,0 +1,107 @@
+/* Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef OMP_H
+#define OMP_H 1
+
+#ifndef _LIBGOMP_OMP_LOCK_DEFINED
+#define _LIBGOMP_OMP_LOCK_DEFINED 1
+/* These two structures get edited by the libgomp build process to 
+   reflect the shape of the two types.  Their internals are private
+   to the library.  */
+
+typedef struct
+{
+  unsigned char _x[@OMP_LOCK_SIZE@] 
+    __attribute__((__aligned__(@OMP_LOCK_ALIGN@)));
+} omp_lock_t;
+
+typedef struct
+{
+  unsigned char _x[@OMP_NEST_LOCK_SIZE@] 
+    __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@)));
+} omp_nest_lock_t;
+#endif
+
+typedef enum omp_sched_t
+{
+  omp_sched_static = 1,
+  omp_sched_dynamic = 2,
+  omp_sched_guided = 3,
+  omp_sched_auto = 4
+} omp_sched_t;
+
+#ifdef __cplusplus
+extern "C" {
+# define __GOMP_NOTHROW throw ()
+#else
+# define __GOMP_NOTHROW __attribute__((__nothrow__))
+#endif
+
+extern void omp_set_num_threads (int) __GOMP_NOTHROW;
+extern int omp_get_num_threads (void) __GOMP_NOTHROW;
+extern int omp_get_max_threads (void) __GOMP_NOTHROW;
+extern int omp_get_thread_num (void) __GOMP_NOTHROW;
+extern int omp_get_num_procs (void) __GOMP_NOTHROW;
+
+extern int omp_in_parallel (void) __GOMP_NOTHROW;
+
+extern void omp_set_dynamic (int) __GOMP_NOTHROW;
+extern int omp_get_dynamic (void) __GOMP_NOTHROW;
+
+extern void omp_set_nested (int) __GOMP_NOTHROW;
+extern int omp_get_nested (void) __GOMP_NOTHROW;
+
+extern void omp_init_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern void omp_destroy_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern void omp_set_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern void omp_unset_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern int omp_test_lock (omp_lock_t *) __GOMP_NOTHROW;
+
+extern void omp_init_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void omp_destroy_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void omp_set_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void omp_unset_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern int omp_test_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+
+extern double omp_get_wtime (void) __GOMP_NOTHROW;
+extern double omp_get_wtick (void) __GOMP_NOTHROW;
+
+void omp_set_schedule (omp_sched_t, int) __GOMP_NOTHROW;
+void omp_get_schedule (omp_sched_t *, int *) __GOMP_NOTHROW;
+int omp_get_thread_limit (void) __GOMP_NOTHROW;
+void omp_set_max_active_levels (int) __GOMP_NOTHROW;
+int omp_get_max_active_levels (void) __GOMP_NOTHROW;
+int omp_get_level (void) __GOMP_NOTHROW;
+int omp_get_ancestor_thread_num (int) __GOMP_NOTHROW;
+int omp_get_team_size (int) __GOMP_NOTHROW;
+int omp_get_active_level (void) __GOMP_NOTHROW;
+
+int omp_in_final (void) __GOMP_NOTHROW;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OMP_H */
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/omp_lib.f90.in b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/omp_lib.f90.in
new file mode 100644 (file)
index 0000000..d00fa05
--- /dev/null
@@ -0,0 +1,299 @@
+!  Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+!  Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+!  This file is part of the GNU OpenMP Library (libgomp).
+
+!  Libgomp is free software; you can redistribute it and/or modify it
+!  under the terms of the GNU General Public License as published by
+!  the Free Software Foundation; either version 3, or (at your option)
+!  any later version.
+
+!  Libgomp 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.
+
+!  Under Section 7 of GPL version 3, you are granted additional
+!  permissions described in the GCC Runtime Library Exception, version
+!  3.1, as published by the Free Software Foundation.
+
+!  You should have received a copy of the GNU General Public License and
+!  a copy of the GCC Runtime Library Exception along with this program;
+!  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!  <http://www.gnu.org/licenses/>.
+
+      module omp_lib_kinds
+        implicit none
+        integer, parameter :: omp_lock_kind = @OMP_LOCK_KIND@
+        integer, parameter :: omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@
+        integer, parameter :: omp_sched_kind = 4
+      end module
+
+      module omp_lib
+        use omp_lib_kinds
+        implicit none
+        integer, parameter :: openmp_version = 201107
+        integer (omp_sched_kind), parameter :: omp_sched_static = 1
+        integer (omp_sched_kind), parameter :: omp_sched_dynamic = 2
+        integer (omp_sched_kind), parameter :: omp_sched_guided = 3
+        integer (omp_sched_kind), parameter :: omp_sched_auto = 4
+
+        interface
+          subroutine omp_init_lock (lock)
+            use omp_lib_kinds
+            integer (omp_lock_kind), intent (out) :: lock
+          end subroutine omp_init_lock
+        end interface
+
+        interface
+          subroutine omp_init_nest_lock (lock)
+            use omp_lib_kinds
+            integer (omp_nest_lock_kind), intent (out) :: lock
+          end subroutine omp_init_nest_lock
+        end interface
+
+        interface
+          subroutine omp_destroy_lock (lock)
+            use omp_lib_kinds
+            integer (omp_lock_kind), intent (inout) :: lock
+          end subroutine omp_destroy_lock
+        end interface
+
+        interface
+          subroutine omp_destroy_nest_lock (lock)
+            use omp_lib_kinds
+            integer (omp_nest_lock_kind), intent (inout) :: lock
+          end subroutine omp_destroy_nest_lock
+        end interface
+
+        interface
+          subroutine omp_set_lock (lock)
+            use omp_lib_kinds
+            integer (omp_lock_kind), intent (inout) :: lock
+          end subroutine omp_set_lock
+        end interface
+
+        interface
+          subroutine omp_set_nest_lock (lock)
+            use omp_lib_kinds
+            integer (omp_nest_lock_kind), intent (inout) :: lock
+          end subroutine omp_set_nest_lock
+        end interface
+
+        interface
+          subroutine omp_unset_lock (lock)
+            use omp_lib_kinds
+            integer (omp_lock_kind), intent (inout) :: lock
+          end subroutine omp_unset_lock
+        end interface
+
+        interface
+          subroutine omp_unset_nest_lock (lock)
+            use omp_lib_kinds
+            integer (omp_nest_lock_kind), intent (inout) :: lock
+          end subroutine omp_unset_nest_lock
+        end interface
+
+        interface omp_set_dynamic
+          subroutine omp_set_dynamic (set)
+            logical (4), intent (in) :: set
+          end subroutine omp_set_dynamic
+          subroutine omp_set_dynamic_8 (set)
+            logical (8), intent (in) :: set
+          end subroutine omp_set_dynamic_8
+        end interface
+
+        interface omp_set_nested
+          subroutine omp_set_nested (set)
+            logical (4), intent (in) :: set
+          end subroutine omp_set_nested
+          subroutine omp_set_nested_8 (set)
+            logical (8), intent (in) :: set
+          end subroutine omp_set_nested_8
+        end interface
+
+        interface omp_set_num_threads
+          subroutine omp_set_num_threads (set)
+            integer (4), intent (in) :: set
+          end subroutine omp_set_num_threads
+          subroutine omp_set_num_threads_8 (set)
+            integer (8), intent (in) :: set
+          end subroutine omp_set_num_threads_8
+        end interface
+
+        interface
+          function omp_get_dynamic ()
+            use omp_lib_kinds
+            logical (4) :: omp_get_dynamic
+          end function omp_get_dynamic
+        end interface
+
+        interface
+          function omp_get_nested ()
+            use omp_lib_kinds
+            logical (4) :: omp_get_nested
+          end function omp_get_nested
+        end interface
+
+        interface
+          function omp_in_parallel ()
+            use omp_lib_kinds
+            logical (4) :: omp_in_parallel
+          end function omp_in_parallel
+        end interface
+
+        interface
+          function omp_test_lock (lock)
+            use omp_lib_kinds
+            logical (4) :: omp_test_lock
+            integer (omp_lock_kind), intent (inout) :: lock
+          end function omp_test_lock
+        end interface
+
+        interface
+          function omp_get_max_threads ()
+            use omp_lib_kinds
+            integer (4) :: omp_get_max_threads
+          end function omp_get_max_threads
+        end interface
+
+        interface
+          function omp_get_num_procs ()
+            use omp_lib_kinds
+            integer (4) :: omp_get_num_procs
+          end function omp_get_num_procs
+        end interface
+
+        interface
+          function omp_get_num_threads ()
+            use omp_lib_kinds
+            integer (4) :: omp_get_num_threads
+          end function omp_get_num_threads
+        end interface
+
+        interface
+          function omp_get_thread_num ()
+            use omp_lib_kinds
+            integer (4) :: omp_get_thread_num
+          end function omp_get_thread_num
+        end interface
+
+        interface
+          function omp_test_nest_lock (lock)
+            use omp_lib_kinds
+            integer (4) :: omp_test_nest_lock
+            integer (omp_nest_lock_kind), intent (inout) :: lock
+          end function omp_test_nest_lock
+        end interface
+
+        interface
+          function omp_get_wtick ()
+            double precision :: omp_get_wtick
+          end function omp_get_wtick
+        end interface
+
+        interface
+          function omp_get_wtime ()
+            double precision :: omp_get_wtime
+          end function omp_get_wtime
+        end interface
+
+        interface omp_set_schedule
+          subroutine omp_set_schedule (kind, modifier)
+            use omp_lib_kinds
+            integer (omp_sched_kind), intent (in) :: kind
+            integer (4), intent (in) :: modifier
+          end subroutine omp_set_schedule
+          subroutine omp_set_schedule_8 (kind, modifier)
+            use omp_lib_kinds
+            integer (omp_sched_kind), intent (in) :: kind
+            integer (8), intent (in) :: modifier
+          end subroutine omp_set_schedule_8
+         end interface
+
+        interface omp_get_schedule
+          subroutine omp_get_schedule (kind, modifier)
+            use omp_lib_kinds
+            integer (omp_sched_kind), intent (out) :: kind
+            integer (4), intent (out) :: modifier
+          end subroutine omp_get_schedule
+          subroutine omp_get_schedule_8 (kind, modifier)
+            use omp_lib_kinds
+            integer (omp_sched_kind), intent (out) :: kind
+            integer (8), intent (out) :: modifier
+          end subroutine omp_get_schedule_8
+         end interface
+
+        interface
+          function omp_get_thread_limit ()
+            use omp_lib_kinds
+            integer (4) :: omp_get_thread_limit
+          end function omp_get_thread_limit
+        end interface
+
+        interface omp_set_max_active_levels
+          subroutine omp_set_max_active_levels (max_levels)
+            use omp_lib_kinds
+            integer (4), intent (in) :: max_levels
+          end subroutine omp_set_max_active_levels
+          subroutine omp_set_max_active_levels_8 (max_levels)
+            use omp_lib_kinds
+            integer (8), intent (in) :: max_levels
+          end subroutine omp_set_max_active_levels_8
+        end interface
+
+        interface
+          function omp_get_max_active_levels ()
+            use omp_lib_kinds
+            integer (4) :: omp_get_max_active_levels
+          end function omp_get_max_active_levels
+        end interface
+
+        interface
+          function omp_get_level ()
+            use omp_lib_kinds
+            integer (4) :: omp_get_level
+          end function omp_get_level
+        end interface
+
+        interface omp_get_ancestor_thread_num
+          function omp_get_ancestor_thread_num (level)
+            use omp_lib_kinds
+            integer (4), intent (in) :: level
+            integer (4) :: omp_get_ancestor_thread_num
+          end function omp_get_ancestor_thread_num
+          function omp_get_ancestor_thread_num_8 (level)
+            use omp_lib_kinds
+            integer (8), intent (in) :: level
+            integer (4) :: omp_get_ancestor_thread_num_8
+          end function omp_get_ancestor_thread_num_8
+        end interface
+
+        interface omp_get_team_size
+          function omp_get_team_size (level)
+            use omp_lib_kinds
+            integer (4), intent (in) :: level
+            integer (4) :: omp_get_team_size
+          end function omp_get_team_size
+          function omp_get_team_size_8 (level)
+            use omp_lib_kinds
+            integer (8), intent (in) :: level
+            integer (4) :: omp_get_team_size_8
+          end function omp_get_team_size_8
+        end interface
+
+        interface
+          function omp_get_active_level ()
+            use omp_lib_kinds
+            integer (4) :: omp_get_active_level
+          end function omp_get_active_level
+        end interface
+
+        interface
+          function omp_in_final ()
+            use omp_lib_kinds
+            logical (4) :: omp_in_final
+          end function omp_in_final
+        end interface
+
+      end module omp_lib
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/omp_lib.h.in b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/omp_lib.h.in
new file mode 100644 (file)
index 0000000..c583ba3
--- /dev/null
@@ -0,0 +1,70 @@
+!  Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+!  Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+!  This file is part of the GNU OpenMP Library (libgomp).
+
+!  Libgomp is free software; you can redistribute it and/or modify it
+!  under the terms of the GNU General Public License as published by
+!  the Free Software Foundation; either version 3, or (at your option)
+!  any later version.
+
+!  Libgomp 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.
+
+!  Under Section 7 of GPL version 3, you are granted additional
+!  permissions described in the GCC Runtime Library Exception, version
+!  3.1, as published by the Free Software Foundation.
+
+!  You should have received a copy of the GNU General Public License and
+!  a copy of the GCC Runtime Library Exception along with this program;
+!  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+!  <http://www.gnu.org/licenses/>.
+
+      integer omp_lock_kind, omp_nest_lock_kind, openmp_version
+      parameter (omp_lock_kind = @OMP_LOCK_KIND@)
+      parameter (omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@)
+      integer omp_sched_kind
+      parameter (omp_sched_kind = 4)
+      integer (omp_sched_kind) omp_sched_static, omp_sched_dynamic
+      integer (omp_sched_kind) omp_sched_guided, omp_sched_auto
+      parameter (omp_sched_static = 1)
+      parameter (omp_sched_dynamic = 2)
+      parameter (omp_sched_guided = 3)
+      parameter (omp_sched_auto = 4)
+      parameter (openmp_version = 201107)
+
+      external omp_init_lock, omp_init_nest_lock
+      external omp_destroy_lock, omp_destroy_nest_lock
+      external omp_set_lock, omp_set_nest_lock
+      external omp_unset_lock, omp_unset_nest_lock
+      external omp_set_dynamic, omp_set_nested
+      external omp_set_num_threads
+
+      external omp_get_dynamic, omp_get_nested
+      logical(4) omp_get_dynamic, omp_get_nested
+      external omp_test_lock, omp_in_parallel
+      logical(4) omp_test_lock, omp_in_parallel
+
+      external omp_get_max_threads, omp_get_num_procs
+      integer(4) omp_get_max_threads, omp_get_num_procs
+      external omp_get_num_threads, omp_get_thread_num
+      integer(4) omp_get_num_threads, omp_get_thread_num
+      external omp_test_nest_lock
+      integer(4) omp_test_nest_lock
+
+      external omp_get_wtick, omp_get_wtime
+      double precision omp_get_wtick, omp_get_wtime
+
+      external omp_set_schedule, omp_get_schedule
+      external omp_get_thread_limit, omp_set_max_active_levels
+      external omp_get_max_active_levels, omp_get_level
+      external omp_get_ancestor_thread_num, omp_get_team_size
+      external omp_get_active_level
+      integer(4) omp_get_thread_limit, omp_get_max_active_levels
+      integer(4) omp_get_level, omp_get_ancestor_thread_num
+      integer(4) omp_get_team_size, omp_get_active_level
+
+      external omp_in_final
+      logical(4) omp_in_final
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/ordered.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/ordered.c
new file mode 100644 (file)
index 0000000..f84d52e
--- /dev/null
@@ -0,0 +1,251 @@
+/* Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the ORDERED construct.  */
+
+#include "libgomp.h"
+
+
+/* This function is called when first allocating an iteration block.  That
+   is, the thread is not currently on the queue.  The work-share lock must
+   be held on entry.  */
+
+void
+gomp_ordered_first (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_work_share *ws = thr->ts.work_share;
+  unsigned index;
+
+  /* Work share constructs can be orphaned.  */
+  if (team == NULL || team->nthreads == 1)
+    return;
+
+  index = ws->ordered_cur + ws->ordered_num_used;
+  if (index >= team->nthreads)
+    index -= team->nthreads;
+  ws->ordered_team_ids[index] = thr->ts.team_id;
+
+  /* If this is the first and only thread in the queue, then there is
+     no one to release us when we get to our ordered section.  Post to
+     our own release queue now so that we won't block later.  */
+  if (ws->ordered_num_used++ == 0)
+    gomp_sem_post (team->ordered_release[thr->ts.team_id]);
+}
+
+/* This function is called when completing the last iteration block.  That
+   is, there are no more iterations to perform and so the thread should be
+   removed from the queue entirely.  Because of the way ORDERED blocks are
+   managed, it follows that we currently own access to the ORDERED block,
+   and should now pass it on to the next thread.  The work-share lock must
+   be held on entry.  */
+
+void
+gomp_ordered_last (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_work_share *ws = thr->ts.work_share;
+  unsigned next_id;
+
+  /* Work share constructs can be orphaned.  */
+  if (team == NULL || team->nthreads == 1)
+    return;
+
+  /* We're no longer the owner.  */
+  ws->ordered_owner = -1;
+
+  /* If we're not the last thread in the queue, then wake the next.  */
+  if (--ws->ordered_num_used > 0)
+    {
+      unsigned next = ws->ordered_cur + 1;
+      if (next == team->nthreads)
+       next = 0;
+      ws->ordered_cur = next;
+
+      next_id = ws->ordered_team_ids[next];
+      gomp_sem_post (team->ordered_release[next_id]);
+    }
+}
+
+
+/* This function is called when allocating a subsequent allocation block.
+   That is, we're done with the current iteration block and we're allocating
+   another.  This is the logical combination of a call to gomp_ordered_last
+   followed by a call to gomp_ordered_first.  The work-share lock must be
+   held on entry. */
+
+void
+gomp_ordered_next (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_work_share *ws = thr->ts.work_share;
+  unsigned index, next_id;
+
+  /* Work share constructs can be orphaned.  */
+  if (team == NULL || team->nthreads == 1)
+    return;
+
+  /* We're no longer the owner.  */
+  ws->ordered_owner = -1;
+
+  /* If there's only one thread in the queue, that must be us.  */
+  if (ws->ordered_num_used == 1)
+    {
+      /* We have a similar situation as in gomp_ordered_first
+        where we need to post to our own release semaphore.  */
+      gomp_sem_post (team->ordered_release[thr->ts.team_id]);
+      return;
+    }
+
+  /* If the queue is entirely full, then we move ourself to the end of 
+     the queue merely by incrementing ordered_cur.  Only if it's not 
+     full do we have to write our id.  */
+  if (ws->ordered_num_used < team->nthreads)
+    {
+      index = ws->ordered_cur + ws->ordered_num_used;
+      if (index >= team->nthreads)
+       index -= team->nthreads;
+      ws->ordered_team_ids[index] = thr->ts.team_id;
+    }
+
+  index = ws->ordered_cur + 1;
+  if (index == team->nthreads)
+    index = 0;
+  ws->ordered_cur = index;
+
+  next_id = ws->ordered_team_ids[index];
+  gomp_sem_post (team->ordered_release[next_id]);
+}
+
+
+/* This function is called when a statically scheduled loop is first
+   being created.  */
+
+void
+gomp_ordered_static_init (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+
+  if (team == NULL || team->nthreads == 1)
+    return;
+
+  gomp_sem_post (team->ordered_release[0]);
+}
+
+/* This function is called when a statically scheduled loop is moving to
+   the next allocation block.  Static schedules are not first come first
+   served like the others, so we're to move to the numerically next thread,
+   not the next thread on a list.  The work-share lock should *not* be held
+   on entry.  */
+
+void
+gomp_ordered_static_next (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_work_share *ws = thr->ts.work_share;
+  unsigned id = thr->ts.team_id;
+
+  if (team == NULL || team->nthreads == 1)
+    return;
+
+  ws->ordered_owner = -1;
+
+  /* This thread currently owns the lock.  Increment the owner.  */
+  if (++id == team->nthreads)
+    id = 0;
+  ws->ordered_team_ids[0] = id;
+  gomp_sem_post (team->ordered_release[id]);
+}
+
+/* This function is called when we need to assert that the thread owns the
+   ordered section.  Due to the problem of posted-but-not-waited semaphores,
+   this needs to happen before completing a loop iteration.  */
+
+void
+gomp_ordered_sync (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_work_share *ws = thr->ts.work_share;
+
+  /* Work share constructs can be orphaned.  But this clearly means that
+     we are the only thread, and so we automatically own the section.  */
+  if (team == NULL || team->nthreads == 1)
+    return;
+
+  /* ??? I believe it to be safe to access this data without taking the
+     ws->lock.  The only presumed race condition is with the previous
+     thread on the queue incrementing ordered_cur such that it points
+     to us, concurrently with our check below.  But our team_id is
+     already present in the queue, and the other thread will always
+     post to our release semaphore.  So the two cases are that we will
+     either win the race an momentarily block on the semaphore, or lose
+     the race and find the semaphore already unlocked and so not block.
+     Either way we get correct results.
+     However, there is an implicit flush on entry to an ordered region,
+     so we do need to have a barrier here.  If we were taking a lock
+     this could be MEMMODEL_RELEASE since the acquire would be coverd
+     by the lock.  */
+
+  __atomic_thread_fence (MEMMODEL_ACQ_REL);
+  if (ws->ordered_owner != thr->ts.team_id)
+    {
+      gomp_sem_wait (team->ordered_release[thr->ts.team_id]);
+      ws->ordered_owner = thr->ts.team_id;
+    }
+}
+
+/* This function is called by user code when encountering the start of an
+   ORDERED block.  We must check to see if the current thread is at the
+   head of the queue, and if not, block.  */
+
+#ifdef HAVE_ATTRIBUTE_ALIAS
+extern void GOMP_ordered_start (void)
+       __attribute__((alias ("gomp_ordered_sync")));
+#else
+void
+GOMP_ordered_start (void)
+{
+  gomp_ordered_sync ();
+}
+#endif
+
+/* This function is called by user code when encountering the end of an
+   ORDERED block.  With the current ORDERED implementation there's nothing
+   for us to do.
+
+   However, the current implementation has a flaw in that it does not allow
+   the next thread into the ORDERED section immediately after the current
+   thread exits the ORDERED section in its last iteration.  The existance
+   of this function allows the implementation to change.  */
+
+void
+GOMP_ordered_end (void)
+{
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/parallel.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/parallel.c
new file mode 100644 (file)
index 0000000..c0966df
--- /dev/null
@@ -0,0 +1,202 @@
+/* Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the (bare) PARALLEL construct.  */
+
+#include "libgomp.h"
+#include <limits.h>
+
+
+/* Determine the number of threads to be launched for a PARALLEL construct.
+   This algorithm is explicitly described in OpenMP 3.0 section 2.4.1.
+   SPECIFIED is a combination of the NUM_THREADS clause and the IF clause.
+   If the IF clause is false, SPECIFIED is forced to 1.  When NUM_THREADS
+   is not present, SPECIFIED is 0.  */
+
+unsigned
+gomp_resolve_num_threads (unsigned specified, unsigned count)
+{
+  struct gomp_thread *thread = gomp_thread();
+  struct gomp_task_icv *icv;
+  unsigned threads_requested, max_num_threads, num_threads;
+  unsigned long remaining;
+
+  icv = gomp_icv (false);
+
+  if (specified == 1)
+    return 1;
+  else if (thread->ts.active_level >= 1 && !icv->nest_var)
+    return 1;
+  else if (thread->ts.active_level >= gomp_max_active_levels_var)
+    return 1;
+
+  /* If NUM_THREADS not specified, use nthreads_var.  */
+  if (specified == 0)
+    threads_requested = icv->nthreads_var;
+  else
+    threads_requested = specified;
+
+  max_num_threads = threads_requested;
+
+  /* If dynamic threads are enabled, bound the number of threads
+     that we launch.  */
+  if (icv->dyn_var)
+    {
+      unsigned dyn = gomp_dynamic_max_threads ();
+      if (dyn < max_num_threads)
+       max_num_threads = dyn;
+
+      /* Optimization for parallel sections.  */
+      if (count && count < max_num_threads)
+       max_num_threads = count;
+    }
+
+  /* ULONG_MAX stands for infinity.  */
+  if (__builtin_expect (gomp_thread_limit_var == ULONG_MAX, 1)
+      || max_num_threads == 1)
+    return max_num_threads;
+
+#ifdef HAVE_SYNC_BUILTINS
+  do
+    {
+      remaining = gomp_remaining_threads_count;
+      num_threads = max_num_threads;
+      if (num_threads > remaining)
+       num_threads = remaining + 1;
+    }
+  while (__sync_val_compare_and_swap (&gomp_remaining_threads_count,
+                                     remaining, remaining - num_threads + 1)
+        != remaining);
+#else
+  gomp_mutex_lock (&gomp_remaining_threads_lock);
+  num_threads = max_num_threads;
+  remaining = gomp_remaining_threads_count;
+  if (num_threads > remaining)
+    num_threads = remaining + 1;
+  gomp_remaining_threads_count -= num_threads - 1;
+  gomp_mutex_unlock (&gomp_remaining_threads_lock);
+#endif
+
+  return num_threads;
+}
+
+void
+GOMP_parallel_start (void (*fn) (void *), void *data, unsigned num_threads)
+{
+  num_threads = gomp_resolve_num_threads (num_threads, 0);
+  gomp_team_start (fn, data, num_threads, gomp_new_team (num_threads));
+}
+
+void
+GOMP_parallel_end (void)
+{
+  if (__builtin_expect (gomp_thread_limit_var != ULONG_MAX, 0))
+    {
+      struct gomp_thread *thr = gomp_thread ();
+      struct gomp_team *team = thr->ts.team;
+      if (team && team->nthreads > 1)
+       {
+#ifdef HAVE_SYNC_BUILTINS
+         __sync_fetch_and_add (&gomp_remaining_threads_count,
+                               1UL - team->nthreads);
+#else
+         gomp_mutex_lock (&gomp_remaining_threads_lock);
+         gomp_remaining_threads_count -= team->nthreads - 1;
+         gomp_mutex_unlock (&gomp_remaining_threads_lock);
+#endif
+       }
+    }
+  gomp_team_end ();
+}
+
+\f
+/* The public OpenMP API for thread and team related inquiries.  */
+
+int
+omp_get_num_threads (void)
+{
+  struct gomp_team *team = gomp_thread ()->ts.team;
+  return team ? team->nthreads : 1;
+}
+
+int
+omp_get_thread_num (void)
+{
+  return gomp_thread ()->ts.team_id;
+}
+
+/* This wasn't right for OpenMP 2.5.  Active region used to be non-zero
+   when the IF clause doesn't evaluate to false, starting with OpenMP 3.0
+   it is non-zero with more than one thread in the team.  */
+
+int
+omp_in_parallel (void)
+{
+  return gomp_thread ()->ts.active_level > 0;
+}
+
+int
+omp_get_level (void)
+{
+  return gomp_thread ()->ts.level;
+}
+
+int
+omp_get_ancestor_thread_num (int level)
+{
+  struct gomp_team_state *ts = &gomp_thread ()->ts;
+  if (level < 0 || level > ts->level)
+    return -1;
+  for (level = ts->level - level; level > 0; --level)
+    ts = &ts->team->prev_ts;
+  return ts->team_id;
+}
+
+int
+omp_get_team_size (int level)
+{
+  struct gomp_team_state *ts = &gomp_thread ()->ts;
+  if (level < 0 || level > ts->level)
+    return -1;
+  for (level = ts->level - level; level > 0; --level)
+    ts = &ts->team->prev_ts;
+  if (ts->team == NULL)
+    return 1;
+  else
+    return ts->team->nthreads;
+}
+
+int
+omp_get_active_level (void)
+{
+  return gomp_thread ()->ts.active_level;
+}
+
+ialias (omp_get_num_threads)
+ialias (omp_get_thread_num)
+ialias (omp_in_parallel)
+ialias (omp_get_level)
+ialias (omp_get_ancestor_thread_num)
+ialias (omp_get_team_size)
+ialias (omp_get_active_level)
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/sections.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/sections.c
new file mode 100644 (file)
index 0000000..c7f49b7
--- /dev/null
@@ -0,0 +1,159 @@
+/* Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the SECTIONS construct.  */
+
+#include "libgomp.h"
+
+
+/* Initialize the given work share construct from the given arguments.  */
+
+static inline void
+gomp_sections_init (struct gomp_work_share *ws, unsigned count)
+{
+  ws->sched = GFS_DYNAMIC;
+  ws->chunk_size = 1;
+  ws->end = count + 1L;
+  ws->incr = 1;
+  ws->next = 1;
+#ifdef HAVE_SYNC_BUILTINS
+  /* Prepare things to make each iteration faster.  */
+  if (sizeof (long) > sizeof (unsigned))
+    ws->mode = 1;
+  else
+    {
+      struct gomp_thread *thr = gomp_thread ();
+      struct gomp_team *team = thr->ts.team;
+      long nthreads = team ? team->nthreads : 1;
+
+      ws->mode = ((nthreads | ws->end)
+                 < 1UL << (sizeof (long) * __CHAR_BIT__ / 2 - 1));
+    }
+#else
+  ws->mode = 0;
+#endif
+}
+
+/* This routine is called when first encountering a sections construct
+   that is not bound directly to a parallel construct.  The first thread 
+   that arrives will create the work-share construct; subsequent threads
+   will see the construct exists and allocate work from it.
+
+   COUNT is the number of sections in this construct.
+
+   Returns the 1-based section number for this thread to perform, or 0 if
+   all work was assigned to other threads prior to this thread's arrival.  */
+
+unsigned
+GOMP_sections_start (unsigned count)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  long s, e, ret;
+
+  if (gomp_work_share_start (false))
+    {
+      gomp_sections_init (thr->ts.work_share, count);
+      gomp_work_share_init_done ();
+    }
+
+#ifdef HAVE_SYNC_BUILTINS
+  if (gomp_iter_dynamic_next (&s, &e))
+    ret = s;
+  else
+    ret = 0;
+#else
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  if (gomp_iter_dynamic_next_locked (&s, &e))
+    ret = s;
+  else
+    ret = 0;
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+/* This routine is called when the thread completes processing of the
+   section currently assigned to it.  If the work-share construct is
+   bound directly to a parallel construct, then the construct may have
+   been set up before the parallel.  In which case, this may be the
+   first iteration for the thread.
+
+   Returns the 1-based section number for this thread to perform, or 0 if
+   all work was assigned to other threads prior to this thread's arrival.  */
+
+unsigned
+GOMP_sections_next (void)
+{
+  long s, e, ret;
+
+#ifdef HAVE_SYNC_BUILTINS
+  if (gomp_iter_dynamic_next (&s, &e))
+    ret = s;
+  else
+    ret = 0;
+#else
+  struct gomp_thread *thr = gomp_thread ();
+
+  gomp_mutex_lock (&thr->ts.work_share->lock);
+  if (gomp_iter_dynamic_next_locked (&s, &e))
+    ret = s;
+  else
+    ret = 0;
+  gomp_mutex_unlock (&thr->ts.work_share->lock);
+#endif
+
+  return ret;
+}
+
+/* This routine pre-initializes a work-share construct to avoid one
+   synchronization once we get into the loop.  */
+
+void
+GOMP_parallel_sections_start (void (*fn) (void *), void *data,
+                             unsigned num_threads, unsigned count)
+{
+  struct gomp_team *team;
+
+  num_threads = gomp_resolve_num_threads (num_threads, count);
+  team = gomp_new_team (num_threads);
+  gomp_sections_init (&team->work_shares[0], count);
+  gomp_team_start (fn, data, num_threads, team);
+}
+
+/* The GOMP_section_end* routines are called after the thread is told
+   that all sections are complete.  This first version synchronizes
+   all threads; the nowait version does not.  */
+
+void
+GOMP_sections_end (void)
+{
+  gomp_work_share_end ();
+}
+
+void
+GOMP_sections_end_nowait (void)
+{
+  gomp_work_share_end_nowait ();
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/single.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/single.c
new file mode 100644 (file)
index 0000000..8c5ade1
--- /dev/null
@@ -0,0 +1,104 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the SINGLE construct.  */
+
+#include "libgomp.h"
+
+
+/* This routine is called when first encountering a SINGLE construct that
+   doesn't have a COPYPRIVATE clause.  Returns true if this is the thread
+   that should execute the clause.  */
+
+bool
+GOMP_single_start (void)
+{
+#ifdef HAVE_SYNC_BUILTINS
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  unsigned long single_count;
+
+  if (__builtin_expect (team == NULL, 0))
+    return true;
+
+  single_count = thr->ts.single_count++;
+  return __sync_bool_compare_and_swap (&team->single_count, single_count,
+                                      single_count + 1L);
+#else
+  bool ret = gomp_work_share_start (false);
+  if (ret)
+    gomp_work_share_init_done ();
+  gomp_work_share_end_nowait ();
+  return ret;
+#endif
+}
+
+/* This routine is called when first encountering a SINGLE construct that
+   does have a COPYPRIVATE clause.  Returns NULL if this is the thread
+   that should execute the clause; otherwise the return value is pointer
+   given to GOMP_single_copy_end by the thread that did execute the clause.  */
+
+void *
+GOMP_single_copy_start (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+
+  bool first;
+  void *ret;
+
+  first = gomp_work_share_start (false);
+  
+  if (first)
+    {
+      gomp_work_share_init_done ();
+      ret = NULL;
+    }
+  else
+    {
+      gomp_team_barrier_wait (&thr->ts.team->barrier);
+
+      ret = thr->ts.work_share->copyprivate;
+      gomp_work_share_end_nowait ();
+    }
+
+  return ret;
+}
+
+/* This routine is called when the thread that entered a SINGLE construct
+   with a COPYPRIVATE clause gets to the end of the construct.  */
+
+void
+GOMP_single_copy_end (void *data)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+
+  if (team != NULL)
+    {
+      thr->ts.work_share->copyprivate = data;
+      gomp_team_barrier_wait (&team->barrier);
+    }
+
+  gomp_work_share_end_nowait ();
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/task.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/task.c
new file mode 100644 (file)
index 0000000..13e6605
--- /dev/null
@@ -0,0 +1,408 @@
+/* Copyright (C) 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the maintainence of tasks in response to task
+   creation and termination.  */
+
+#include "libgomp.h"
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Create a new task data structure.  */
+
+void
+gomp_init_task (struct gomp_task *task, struct gomp_task *parent_task,
+               struct gomp_task_icv *prev_icv)
+{
+  task->parent = parent_task;
+  task->icv = *prev_icv;
+  task->kind = GOMP_TASK_IMPLICIT;
+  task->in_taskwait = false;
+  task->in_tied_task = false;
+  task->final_task = false;
+  task->children = NULL;
+  gomp_sem_init (&task->taskwait_sem, 0);
+}
+
+/* Clean up a task, after completing it.  */
+
+void
+gomp_end_task (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_task *task = thr->task;
+
+  gomp_finish_task (task);
+  thr->task = task->parent;
+}
+
+static inline void
+gomp_clear_parent (struct gomp_task *children)
+{
+  struct gomp_task *task = children;
+
+  if (task)
+    do
+      {
+       task->parent = NULL;
+       task = task->next_child;
+      }
+    while (task != children);
+}
+
+/* Called when encountering an explicit task directive.  If IF_CLAUSE is
+   false, then we must not delay in executing the task.  If UNTIED is true,
+   then the task may be executed by any member of the team.  */
+
+void
+GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
+          long arg_size, long arg_align, bool if_clause, unsigned flags)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+
+#ifdef HAVE_BROKEN_POSIX_SEMAPHORES
+  /* If pthread_mutex_* is used for omp_*lock*, then each task must be
+     tied to one thread all the time.  This means UNTIED tasks must be
+     tied and if CPYFN is non-NULL IF(0) must be forced, as CPYFN
+     might be running on different thread than FN.  */
+  if (cpyfn)
+    if_clause = false;
+  if (flags & 1)
+    flags &= ~1;
+#endif
+
+  if (!if_clause || team == NULL
+      || (thr->task && thr->task->final_task)
+      || team->task_count > 64 * team->nthreads)
+    {
+      struct gomp_task task;
+
+      gomp_init_task (&task, thr->task, gomp_icv (false));
+      task.kind = GOMP_TASK_IFFALSE;
+      task.final_task = (thr->task && thr->task->final_task) || (flags & 2);
+      if (thr->task)
+       task.in_tied_task = thr->task->in_tied_task;
+      thr->task = &task;
+      if (__builtin_expect (cpyfn != NULL, 0))
+       {
+         char buf[arg_size + arg_align - 1];
+         char *arg = (char *) (((uintptr_t) buf + arg_align - 1)
+                               & ~(uintptr_t) (arg_align - 1));
+         cpyfn (arg, data);
+         fn (arg);
+       }
+      else
+       fn (data);
+      /* Access to "children" is normally done inside a task_lock
+        mutex region, but the only way this particular task.children
+        can be set is if this thread's task work function (fn)
+        creates children.  So since the setter is *this* thread, we
+        need no barriers here when testing for non-NULL.  We can have
+        task.children set by the current thread then changed by a
+        child thread, but seeing a stale non-NULL value is not a
+        problem.  Once past the task_lock acquisition, this thread
+        will see the real value of task.children.  */
+      if (task.children != NULL)
+       {
+         gomp_mutex_lock (&team->task_lock);
+         gomp_clear_parent (task.children);
+         gomp_mutex_unlock (&team->task_lock);
+       }
+      gomp_end_task ();
+    }
+  else
+    {
+      struct gomp_task *task;
+      struct gomp_task *parent = thr->task;
+      char *arg;
+      bool do_wake;
+
+      task = gomp_malloc (sizeof (*task) + arg_size + arg_align - 1);
+      arg = (char *) (((uintptr_t) (task + 1) + arg_align - 1)
+                     & ~(uintptr_t) (arg_align - 1));
+      gomp_init_task (task, parent, gomp_icv (false));
+      task->kind = GOMP_TASK_IFFALSE;
+      task->in_tied_task = parent->in_tied_task;
+      thr->task = task;
+      if (cpyfn)
+       cpyfn (arg, data);
+      else
+       memcpy (arg, data, arg_size);
+      thr->task = parent;
+      task->kind = GOMP_TASK_WAITING;
+      task->fn = fn;
+      task->fn_data = arg;
+      task->in_tied_task = true;
+      task->final_task = (flags & 2) >> 1;
+      gomp_mutex_lock (&team->task_lock);
+      if (parent->children)
+       {
+         task->next_child = parent->children;
+         task->prev_child = parent->children->prev_child;
+         task->next_child->prev_child = task;
+         task->prev_child->next_child = task;
+       }
+      else
+       {
+         task->next_child = task;
+         task->prev_child = task;
+       }
+      parent->children = task;
+      if (team->task_queue)
+       {
+         task->next_queue = team->task_queue;
+         task->prev_queue = team->task_queue->prev_queue;
+         task->next_queue->prev_queue = task;
+         task->prev_queue->next_queue = task;
+       }
+      else
+       {
+         task->next_queue = task;
+         task->prev_queue = task;
+         team->task_queue = task;
+       }
+      ++team->task_count;
+      gomp_team_barrier_set_task_pending (&team->barrier);
+      do_wake = team->task_running_count + !parent->in_tied_task
+               < team->nthreads;
+      gomp_mutex_unlock (&team->task_lock);
+      if (do_wake)
+       gomp_team_barrier_wake (&team->barrier, 1);
+    }
+}
+
+void
+gomp_barrier_handle_tasks (gomp_barrier_state_t state)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_task *task = thr->task;
+  struct gomp_task *child_task = NULL;
+  struct gomp_task *to_free = NULL;
+
+  gomp_mutex_lock (&team->task_lock);
+  if (gomp_barrier_last_thread (state))
+    {
+      if (team->task_count == 0)
+       {
+         gomp_team_barrier_done (&team->barrier, state);
+         gomp_mutex_unlock (&team->task_lock);
+         gomp_team_barrier_wake (&team->barrier, 0);
+         return;
+       }
+      gomp_team_barrier_set_waiting_for_tasks (&team->barrier);
+    }
+
+  while (1)
+    {
+      if (team->task_queue != NULL)
+       {
+         struct gomp_task *parent;
+
+         child_task = team->task_queue;
+         parent = child_task->parent;
+         if (parent && parent->children == child_task)
+           parent->children = child_task->next_child;
+         child_task->prev_queue->next_queue = child_task->next_queue;
+         child_task->next_queue->prev_queue = child_task->prev_queue;
+         if (child_task->next_queue != child_task)
+           team->task_queue = child_task->next_queue;
+         else
+           team->task_queue = NULL;
+         child_task->kind = GOMP_TASK_TIED;
+         team->task_running_count++;
+         if (team->task_count == team->task_running_count)
+           gomp_team_barrier_clear_task_pending (&team->barrier);
+       }
+      gomp_mutex_unlock (&team->task_lock);
+      if (to_free)
+       {
+         gomp_finish_task (to_free);
+         free (to_free);
+         to_free = NULL;
+       }
+      if (child_task)
+       {
+         thr->task = child_task;
+         child_task->fn (child_task->fn_data);
+         thr->task = task;
+       }
+      else
+       return;
+      gomp_mutex_lock (&team->task_lock);
+      if (child_task)
+       {
+         struct gomp_task *parent = child_task->parent;
+         if (parent)
+           {
+             child_task->prev_child->next_child = child_task->next_child;
+             child_task->next_child->prev_child = child_task->prev_child;
+             if (parent->children == child_task)
+               {
+                 if (child_task->next_child != child_task)
+                   parent->children = child_task->next_child;
+                 else
+                   {
+                     /* We access task->children in GOMP_taskwait
+                        outside of the task lock mutex region, so
+                        need a release barrier here to ensure memory
+                        written by child_task->fn above is flushed
+                        before the NULL is written.  */
+                     __atomic_store_n (&parent->children, NULL,
+                                       MEMMODEL_RELEASE);
+                     if (parent->in_taskwait)
+                       gomp_sem_post (&parent->taskwait_sem);
+                   }
+               }
+           }
+         gomp_clear_parent (child_task->children);
+         to_free = child_task;
+         child_task = NULL;
+         team->task_running_count--;
+         if (--team->task_count == 0
+             && gomp_team_barrier_waiting_for_tasks (&team->barrier))
+           {
+             gomp_team_barrier_done (&team->barrier, state);
+             gomp_mutex_unlock (&team->task_lock);
+             gomp_team_barrier_wake (&team->barrier, 0);
+             gomp_mutex_lock (&team->task_lock);
+           }
+       }
+    }
+}
+
+/* Called when encountering a taskwait directive.  */
+
+void
+GOMP_taskwait (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_task *task = thr->task;
+  struct gomp_task *child_task = NULL;
+  struct gomp_task *to_free = NULL;
+
+  /* The acquire barrier on load of task->children here synchronizes
+     with the write of a NULL in gomp_barrier_handle_tasks.  It is
+     not necessary that we synchronize with other non-NULL writes at
+     this point, but we must ensure that all writes to memory by a
+     child thread task work function are seen before we exit from
+     GOMP_taskwait.  */
+  if (task == NULL
+      || __atomic_load_n (&task->children, MEMMODEL_ACQUIRE) == NULL)
+    return;
+
+  gomp_mutex_lock (&team->task_lock);
+  while (1)
+    {
+      if (task->children == NULL)
+       {
+         gomp_mutex_unlock (&team->task_lock);
+         if (to_free)
+           {
+             gomp_finish_task (to_free);
+             free (to_free);
+           }
+         return;
+       }
+      if (task->children->kind == GOMP_TASK_WAITING)
+       {
+         child_task = task->children;
+         task->children = child_task->next_child;
+         child_task->prev_queue->next_queue = child_task->next_queue;
+         child_task->next_queue->prev_queue = child_task->prev_queue;
+         if (team->task_queue == child_task)
+           {
+             if (child_task->next_queue != child_task)
+               team->task_queue = child_task->next_queue;
+             else
+               team->task_queue = NULL;
+           }
+         child_task->kind = GOMP_TASK_TIED;
+         team->task_running_count++;
+         if (team->task_count == team->task_running_count)
+           gomp_team_barrier_clear_task_pending (&team->barrier);
+       }
+      else
+       /* All tasks we are waiting for are already running
+          in other threads.  Wait for them.  */
+       task->in_taskwait = true;
+      gomp_mutex_unlock (&team->task_lock);
+      if (to_free)
+       {
+         gomp_finish_task (to_free);
+         free (to_free);
+         to_free = NULL;
+       }
+      if (child_task)
+       {
+         thr->task = child_task;
+         child_task->fn (child_task->fn_data);
+         thr->task = task;
+       }
+      else
+       {
+         gomp_sem_wait (&task->taskwait_sem);
+         task->in_taskwait = false;
+         return;
+       }
+      gomp_mutex_lock (&team->task_lock);
+      if (child_task)
+       {
+         child_task->prev_child->next_child = child_task->next_child;
+         child_task->next_child->prev_child = child_task->prev_child;
+         if (task->children == child_task)
+           {
+             if (child_task->next_child != child_task)
+               task->children = child_task->next_child;
+             else
+               task->children = NULL;
+           }
+         gomp_clear_parent (child_task->children);
+         to_free = child_task;
+         child_task = NULL;
+         team->task_count--;
+         team->task_running_count--;
+       }
+    }
+}
+
+/* Called when encountering a taskyield directive.  */
+
+void
+GOMP_taskyield (void)
+{
+  /* Nothing at the moment.  */
+}
+
+int
+omp_in_final (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  return thr->task && thr->task->final_task;
+}
+
+ialias (omp_in_final)
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/team.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/team.c
new file mode 100644 (file)
index 0000000..110bd47
--- /dev/null
@@ -0,0 +1,573 @@
+/* Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011, 2012
+   Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file handles the maintainence of threads in response to team
+   creation and termination.  */
+
+#include "libgomp.h"
+#include <stdlib.h>
+#include <string.h>
+
+/* This attribute contains PTHREAD_CREATE_DETACHED.  */
+pthread_attr_t gomp_thread_attr;
+
+/* This key is for the thread destructor.  */
+pthread_key_t gomp_thread_destructor;
+
+
+/* This is the libgomp per-thread data structure.  */
+#ifdef HAVE_TLS
+__thread struct gomp_thread gomp_tls_data;
+#else
+pthread_key_t gomp_tls_key;
+#endif
+
+
+/* This structure is used to communicate across pthread_create.  */
+
+struct gomp_thread_start_data
+{
+  void (*fn) (void *);
+  void *fn_data;
+  struct gomp_team_state ts;
+  struct gomp_task *task;
+  struct gomp_thread_pool *thread_pool;
+  bool nested;
+};
+
+
+/* This function is a pthread_create entry point.  This contains the idle
+   loop in which a thread waits to be called up to become part of a team.  */
+
+static void *
+gomp_thread_start (void *xdata)
+{
+  struct gomp_thread_start_data *data = xdata;
+  struct gomp_thread *thr;
+  struct gomp_thread_pool *pool;
+  void (*local_fn) (void *);
+  void *local_data;
+
+#ifdef HAVE_TLS
+  thr = &gomp_tls_data;
+#else
+  struct gomp_thread local_thr;
+  thr = &local_thr;
+  pthread_setspecific (gomp_tls_key, thr);
+#endif
+  gomp_sem_init (&thr->release, 0);
+
+  /* Extract what we need from data.  */
+  local_fn = data->fn;
+  local_data = data->fn_data;
+  thr->thread_pool = data->thread_pool;
+  thr->ts = data->ts;
+  thr->task = data->task;
+
+  thr->ts.team->ordered_release[thr->ts.team_id] = &thr->release;
+
+  /* Make thread pool local. */
+  pool = thr->thread_pool;
+
+  if (data->nested)
+    {
+      struct gomp_team *team = thr->ts.team;
+      struct gomp_task *task = thr->task;
+
+      gomp_barrier_wait (&team->barrier);
+
+      local_fn (local_data);
+      gomp_team_barrier_wait (&team->barrier);
+      gomp_finish_task (task);
+      gomp_barrier_wait_last (&team->barrier);
+    }
+  else
+    {
+      pool->threads[thr->ts.team_id] = thr;
+
+      gomp_barrier_wait (&pool->threads_dock);
+      do
+       {
+         struct gomp_team *team = thr->ts.team;
+         struct gomp_task *task = thr->task;
+
+         local_fn (local_data);
+         gomp_team_barrier_wait (&team->barrier);
+         gomp_finish_task (task);
+
+         gomp_barrier_wait (&pool->threads_dock);
+
+         local_fn = thr->fn;
+         local_data = thr->data;
+         thr->fn = NULL;
+       }
+      while (local_fn);
+    }
+
+  gomp_sem_destroy (&thr->release);
+  return NULL;
+}
+
+
+/* Create a new team data structure.  */
+
+struct gomp_team *
+gomp_new_team (unsigned nthreads)
+{
+  struct gomp_team *team;
+  size_t size;
+  int i;
+
+  size = sizeof (*team) + nthreads * (sizeof (team->ordered_release[0])
+                                     + sizeof (team->implicit_task[0]));
+  team = gomp_malloc (size);
+
+  team->work_share_chunk = 8;
+#ifdef HAVE_SYNC_BUILTINS
+  team->single_count = 0;
+#else
+  gomp_mutex_init (&team->work_share_list_free_lock);
+#endif
+  gomp_init_work_share (&team->work_shares[0], false, nthreads);
+  team->work_shares[0].next_alloc = NULL;
+  team->work_share_list_free = NULL;
+  team->work_share_list_alloc = &team->work_shares[1];
+  for (i = 1; i < 7; i++)
+    team->work_shares[i].next_free = &team->work_shares[i + 1];
+  team->work_shares[i].next_free = NULL;
+
+  team->nthreads = nthreads;
+  gomp_barrier_init (&team->barrier, nthreads);
+
+  gomp_sem_init (&team->master_release, 0);
+  team->ordered_release = (void *) &team->implicit_task[nthreads];
+  team->ordered_release[0] = &team->master_release;
+
+  gomp_mutex_init (&team->task_lock);
+  team->task_queue = NULL;
+  team->task_count = 0;
+  team->task_running_count = 0;
+
+  return team;
+}
+
+
+/* Free a team data structure.  */
+
+static void
+free_team (struct gomp_team *team)
+{
+  gomp_barrier_destroy (&team->barrier);
+  gomp_mutex_destroy (&team->task_lock);
+  free (team);
+}
+
+/* Allocate and initialize a thread pool. */
+
+static struct gomp_thread_pool *gomp_new_thread_pool (void)
+{
+  struct gomp_thread_pool *pool
+    = gomp_malloc (sizeof(struct gomp_thread_pool));
+  pool->threads = NULL;
+  pool->threads_size = 0;
+  pool->threads_used = 0;
+  pool->last_team = NULL;
+  return pool;
+}
+
+static void
+gomp_free_pool_helper (void *thread_pool)
+{
+  struct gomp_thread_pool *pool
+    = (struct gomp_thread_pool *) thread_pool;
+  gomp_barrier_wait_last (&pool->threads_dock);
+  gomp_sem_destroy (&gomp_thread ()->release);
+  pthread_exit (NULL);
+}
+
+/* Free a thread pool and release its threads. */
+
+static void
+gomp_free_thread (void *arg __attribute__((unused)))
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_thread_pool *pool = thr->thread_pool;
+  if (pool)
+    {
+      if (pool->threads_used > 0)
+       {
+         int i;
+         for (i = 1; i < pool->threads_used; i++)
+           {
+             struct gomp_thread *nthr = pool->threads[i];
+             nthr->fn = gomp_free_pool_helper;
+             nthr->data = pool;
+           }
+         /* This barrier undocks threads docked on pool->threads_dock.  */
+         gomp_barrier_wait (&pool->threads_dock);
+         /* And this waits till all threads have called gomp_barrier_wait_last
+            in gomp_free_pool_helper.  */
+         gomp_barrier_wait (&pool->threads_dock);
+         /* Now it is safe to destroy the barrier and free the pool.  */
+         gomp_barrier_destroy (&pool->threads_dock);
+
+#ifdef HAVE_SYNC_BUILTINS
+         __sync_fetch_and_add (&gomp_managed_threads,
+                               1L - pool->threads_used);
+#else
+         gomp_mutex_lock (&gomp_remaining_threads_lock);
+         gomp_managed_threads -= pool->threads_used - 1L;
+         gomp_mutex_unlock (&gomp_remaining_threads_lock);
+#endif
+       }
+      free (pool->threads);
+      if (pool->last_team)
+       free_team (pool->last_team);
+      free (pool);
+      thr->thread_pool = NULL;
+    }
+  if (thr->task != NULL)
+    {
+      struct gomp_task *task = thr->task;
+      gomp_end_task ();
+      free (task);
+    }
+}
+
+/* Launch a team.  */
+
+void
+gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads,
+                struct gomp_team *team)
+{
+  struct gomp_thread_start_data *start_data;
+  struct gomp_thread *thr, *nthr;
+  struct gomp_task *task;
+  struct gomp_task_icv *icv;
+  bool nested;
+  struct gomp_thread_pool *pool;
+  unsigned i, n, old_threads_used = 0;
+  pthread_attr_t thread_attr, *attr;
+  unsigned long nthreads_var;
+
+  thr = gomp_thread ();
+  nested = thr->ts.team != NULL;
+  if (__builtin_expect (thr->thread_pool == NULL, 0))
+    {
+      thr->thread_pool = gomp_new_thread_pool ();
+      pthread_setspecific (gomp_thread_destructor, thr);
+    }
+  pool = thr->thread_pool;
+  task = thr->task;
+  icv = task ? &task->icv : &gomp_global_icv;
+
+  /* Always save the previous state, even if this isn't a nested team.
+     In particular, we should save any work share state from an outer
+     orphaned work share construct.  */
+  team->prev_ts = thr->ts;
+
+  thr->ts.team = team;
+  thr->ts.team_id = 0;
+  ++thr->ts.level;
+  if (nthreads > 1)
+    ++thr->ts.active_level;
+  thr->ts.work_share = &team->work_shares[0];
+  thr->ts.last_work_share = NULL;
+#ifdef HAVE_SYNC_BUILTINS
+  thr->ts.single_count = 0;
+#endif
+  thr->ts.static_trip = 0;
+  thr->task = &team->implicit_task[0];
+  nthreads_var = icv->nthreads_var;
+  if (__builtin_expect (gomp_nthreads_var_list != NULL, 0)
+      && thr->ts.level < gomp_nthreads_var_list_len)
+    nthreads_var = gomp_nthreads_var_list[thr->ts.level];
+  gomp_init_task (thr->task, task, icv);
+  team->implicit_task[0].icv.nthreads_var = nthreads_var;
+
+  if (nthreads == 1)
+    return;
+
+  i = 1;
+
+  /* We only allow the reuse of idle threads for non-nested PARALLEL
+     regions.  This appears to be implied by the semantics of
+     threadprivate variables, but perhaps that's reading too much into
+     things.  Certainly it does prevent any locking problems, since
+     only the initial program thread will modify gomp_threads.  */
+  if (!nested)
+    {
+      old_threads_used = pool->threads_used;
+
+      if (nthreads <= old_threads_used)
+       n = nthreads;
+      else if (old_threads_used == 0)
+       {
+         n = 0;
+         gomp_barrier_init (&pool->threads_dock, nthreads);
+       }
+      else
+       {
+         n = old_threads_used;
+
+         /* Increase the barrier threshold to make sure all new
+            threads arrive before the team is released.  */
+         gomp_barrier_reinit (&pool->threads_dock, nthreads);
+       }
+
+      /* Not true yet, but soon will be.  We're going to release all
+        threads from the dock, and those that aren't part of the
+        team will exit.  */
+      pool->threads_used = nthreads;
+
+      /* Release existing idle threads.  */
+      for (; i < n; ++i)
+       {
+         nthr = pool->threads[i];
+         nthr->ts.team = team;
+         nthr->ts.work_share = &team->work_shares[0];
+         nthr->ts.last_work_share = NULL;
+         nthr->ts.team_id = i;
+         nthr->ts.level = team->prev_ts.level + 1;
+         nthr->ts.active_level = thr->ts.active_level;
+#ifdef HAVE_SYNC_BUILTINS
+         nthr->ts.single_count = 0;
+#endif
+         nthr->ts.static_trip = 0;
+         nthr->task = &team->implicit_task[i];
+         gomp_init_task (nthr->task, task, icv);
+         team->implicit_task[i].icv.nthreads_var = nthreads_var;
+         nthr->fn = fn;
+         nthr->data = data;
+         team->ordered_release[i] = &nthr->release;
+       }
+
+      if (i == nthreads)
+       goto do_release;
+
+      /* If necessary, expand the size of the gomp_threads array.  It is
+        expected that changes in the number of threads are rare, thus we
+        make no effort to expand gomp_threads_size geometrically.  */
+      if (nthreads >= pool->threads_size)
+       {
+         pool->threads_size = nthreads + 1;
+         pool->threads
+           = gomp_realloc (pool->threads,
+                           pool->threads_size
+                           * sizeof (struct gomp_thread_data *));
+       }
+    }
+
+  if (__builtin_expect (nthreads > old_threads_used, 0))
+    {
+      long diff = (long) nthreads - (long) old_threads_used;
+
+      if (old_threads_used == 0)
+       --diff;
+
+#ifdef HAVE_SYNC_BUILTINS
+      __sync_fetch_and_add (&gomp_managed_threads, diff);
+#else
+      gomp_mutex_lock (&gomp_remaining_threads_lock);
+      gomp_managed_threads += diff;
+      gomp_mutex_unlock (&gomp_remaining_threads_lock);
+#endif
+    }
+
+  attr = &gomp_thread_attr;
+  if (__builtin_expect (gomp_cpu_affinity != NULL, 0))
+    {
+      size_t stacksize;
+      pthread_attr_init (&thread_attr);
+      pthread_attr_setdetachstate (&thread_attr, PTHREAD_CREATE_DETACHED);
+      if (! pthread_attr_getstacksize (&gomp_thread_attr, &stacksize))
+       pthread_attr_setstacksize (&thread_attr, stacksize);
+      attr = &thread_attr;
+    }
+
+  start_data = gomp_alloca (sizeof (struct gomp_thread_start_data)
+                           * (nthreads-i));
+
+  /* Launch new threads.  */
+  for (; i < nthreads; ++i, ++start_data)
+    {
+      pthread_t pt;
+      int err;
+
+      start_data->fn = fn;
+      start_data->fn_data = data;
+      start_data->ts.team = team;
+      start_data->ts.work_share = &team->work_shares[0];
+      start_data->ts.last_work_share = NULL;
+      start_data->ts.team_id = i;
+      start_data->ts.level = team->prev_ts.level + 1;
+      start_data->ts.active_level = thr->ts.active_level;
+#ifdef HAVE_SYNC_BUILTINS
+      start_data->ts.single_count = 0;
+#endif
+      start_data->ts.static_trip = 0;
+      start_data->task = &team->implicit_task[i];
+      gomp_init_task (start_data->task, task, icv);
+      team->implicit_task[i].icv.nthreads_var = nthreads_var;
+      start_data->thread_pool = pool;
+      start_data->nested = nested;
+
+      if (gomp_cpu_affinity != NULL)
+       gomp_init_thread_affinity (attr);
+
+      err = pthread_create (&pt, attr, gomp_thread_start, start_data);
+      if (err != 0)
+       gomp_fatal ("Thread creation failed: %s", strerror (err));
+    }
+
+  if (__builtin_expect (gomp_cpu_affinity != NULL, 0))
+    pthread_attr_destroy (&thread_attr);
+
+ do_release:
+  gomp_barrier_wait (nested ? &team->barrier : &pool->threads_dock);
+
+  /* Decrease the barrier threshold to match the number of threads
+     that should arrive back at the end of this team.  The extra
+     threads should be exiting.  Note that we arrange for this test
+     to never be true for nested teams.  */
+  if (__builtin_expect (nthreads < old_threads_used, 0))
+    {
+      long diff = (long) nthreads - (long) old_threads_used;
+
+      gomp_barrier_reinit (&pool->threads_dock, nthreads);
+
+#ifdef HAVE_SYNC_BUILTINS
+      __sync_fetch_and_add (&gomp_managed_threads, diff);
+#else
+      gomp_mutex_lock (&gomp_remaining_threads_lock);
+      gomp_managed_threads += diff;
+      gomp_mutex_unlock (&gomp_remaining_threads_lock);
+#endif
+    }
+}
+
+
+/* Terminate the current team.  This is only to be called by the master
+   thread.  We assume that we must wait for the other threads.  */
+
+void
+gomp_team_end (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+
+  /* This barrier handles all pending explicit threads.  */
+  gomp_team_barrier_wait (&team->barrier);
+  gomp_fini_work_share (thr->ts.work_share);
+
+  gomp_end_task ();
+  thr->ts = team->prev_ts;
+
+  if (__builtin_expect (thr->ts.team != NULL, 0))
+    {
+#ifdef HAVE_SYNC_BUILTINS
+      __sync_fetch_and_add (&gomp_managed_threads, 1L - team->nthreads);
+#else
+      gomp_mutex_lock (&gomp_remaining_threads_lock);
+      gomp_managed_threads -= team->nthreads - 1L;
+      gomp_mutex_unlock (&gomp_remaining_threads_lock);
+#endif
+      /* This barrier has gomp_barrier_wait_last counterparts
+        and ensures the team can be safely destroyed.  */
+      gomp_barrier_wait (&team->barrier);
+    }
+
+  if (__builtin_expect (team->work_shares[0].next_alloc != NULL, 0))
+    {
+      struct gomp_work_share *ws = team->work_shares[0].next_alloc;
+      do
+       {
+         struct gomp_work_share *next_ws = ws->next_alloc;
+         free (ws);
+         ws = next_ws;
+       }
+      while (ws != NULL);
+    }
+  gomp_sem_destroy (&team->master_release);
+#ifndef HAVE_SYNC_BUILTINS
+  gomp_mutex_destroy (&team->work_share_list_free_lock);
+#endif
+
+  if (__builtin_expect (thr->ts.team != NULL, 0)
+      || __builtin_expect (team->nthreads == 1, 0))
+    free_team (team);
+  else
+    {
+      struct gomp_thread_pool *pool = thr->thread_pool;
+      if (pool->last_team)
+       free_team (pool->last_team);
+      pool->last_team = team;
+    }
+}
+
+
+/* Constructors for this file.  */
+
+static void __attribute__((constructor))
+initialize_team (void)
+{
+  struct gomp_thread *thr;
+
+#ifndef HAVE_TLS
+  static struct gomp_thread initial_thread_tls_data;
+
+  pthread_key_create (&gomp_tls_key, NULL);
+  pthread_setspecific (gomp_tls_key, &initial_thread_tls_data);
+#endif
+
+  if (pthread_key_create (&gomp_thread_destructor, gomp_free_thread) != 0)
+    gomp_fatal ("could not create thread pool destructor.");
+
+#ifdef HAVE_TLS
+  thr = &gomp_tls_data;
+#else
+  thr = &initial_thread_tls_data;
+#endif
+  gomp_sem_init (&thr->release, 0);
+}
+
+static void __attribute__((destructor))
+team_destructor (void)
+{
+  /* Without this dlclose on libgomp could lead to subsequent
+     crashes.  */
+  pthread_key_delete (gomp_thread_destructor);
+}
+
+struct gomp_task_icv *
+gomp_new_icv (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_task *task = gomp_malloc (sizeof (struct gomp_task));
+  gomp_init_task (task, NULL, &gomp_global_icv);
+  thr->task = task;
+  pthread_setspecific (gomp_thread_destructor, thr);
+  return &task->icv;
+}
diff --git a/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/work.c b/l4/pkg/libgomp/lib/contrib/gcc-4.7/libgomp/work.c
new file mode 100644 (file)
index 0000000..6bd9c24
--- /dev/null
@@ -0,0 +1,264 @@
+/* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
+   Contributed by Richard Henderson <rth@redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains routines to manage the work-share queue for a team
+   of threads.  */
+
+#include "libgomp.h"
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Allocate a new work share structure, preferably from current team's
+   free gomp_work_share cache.  */
+
+static struct gomp_work_share *
+alloc_work_share (struct gomp_team *team)
+{
+  struct gomp_work_share *ws;
+  unsigned int i;
+
+  /* This is called in a critical section.  */
+  if (team->work_share_list_alloc != NULL)
+    {
+      ws = team->work_share_list_alloc;
+      team->work_share_list_alloc = ws->next_free;
+      return ws;
+    }
+
+#ifdef HAVE_SYNC_BUILTINS
+  ws = team->work_share_list_free;
+  /* We need atomic read from work_share_list_free,
+     as free_work_share can be called concurrently.  */
+  __asm ("" : "+r" (ws));
+
+  if (ws && ws->next_free)
+    {
+      struct gomp_work_share *next = ws->next_free;
+      ws->next_free = NULL;
+      team->work_share_list_alloc = next->next_free;
+      return next;
+    }
+#else
+  gomp_mutex_lock (&team->work_share_list_free_lock);
+  ws = team->work_share_list_free;
+  if (ws)
+    {
+      team->work_share_list_alloc = ws->next_free;
+      team->work_share_list_free = NULL;
+      gomp_mutex_unlock (&team->work_share_list_free_lock);
+      return ws;
+    }
+  gomp_mutex_unlock (&team->work_share_list_free_lock);
+#endif
+
+  team->work_share_chunk *= 2;
+  ws = gomp_malloc (team->work_share_chunk * sizeof (struct gomp_work_share));
+  ws->next_alloc = team->work_shares[0].next_alloc;
+  team->work_shares[0].next_alloc = ws;
+  team->work_share_list_alloc = &ws[1];
+  for (i = 1; i < team->work_share_chunk - 1; i++)
+    ws[i].next_free = &ws[i + 1];
+  ws[i].next_free = NULL;
+  return ws;
+}
+
+/* Initialize an already allocated struct gomp_work_share.
+   This shouldn't touch the next_alloc field.  */
+
+void
+gomp_init_work_share (struct gomp_work_share *ws, bool ordered,
+                     unsigned nthreads)
+{
+  gomp_mutex_init (&ws->lock);
+  if (__builtin_expect (ordered, 0))
+    {
+#define INLINE_ORDERED_TEAM_IDS_CNT \
+  ((sizeof (struct gomp_work_share) \
+    - offsetof (struct gomp_work_share, inline_ordered_team_ids)) \
+   / sizeof (((struct gomp_work_share *) 0)->inline_ordered_team_ids[0]))
+
+      if (nthreads > INLINE_ORDERED_TEAM_IDS_CNT)
+       ws->ordered_team_ids
+         = gomp_malloc (nthreads * sizeof (*ws->ordered_team_ids));
+      else
+       ws->ordered_team_ids = ws->inline_ordered_team_ids;
+      memset (ws->ordered_team_ids, '\0',
+             nthreads * sizeof (*ws->ordered_team_ids));
+      ws->ordered_num_used = 0;
+      ws->ordered_owner = -1;
+      ws->ordered_cur = 0;
+    }
+  else
+    ws->ordered_team_ids = NULL;
+  gomp_ptrlock_init (&ws->next_ws, NULL);
+  ws->threads_completed = 0;
+}
+
+/* Do any needed destruction of gomp_work_share fields before it
+   is put back into free gomp_work_share cache or freed.  */
+
+void
+gomp_fini_work_share (struct gomp_work_share *ws)
+{
+  gomp_mutex_destroy (&ws->lock);
+  if (ws->ordered_team_ids != ws->inline_ordered_team_ids)
+    free (ws->ordered_team_ids);
+  gomp_ptrlock_destroy (&ws->next_ws);
+}
+
+/* Free a work share struct, if not orphaned, put it into current
+   team's free gomp_work_share cache.  */
+
+static inline void
+free_work_share (struct gomp_team *team, struct gomp_work_share *ws)
+{
+  gomp_fini_work_share (ws);
+  if (__builtin_expect (team == NULL, 0))
+    free (ws);
+  else
+    {
+      struct gomp_work_share *next_ws;
+#ifdef HAVE_SYNC_BUILTINS
+      do
+       {
+         next_ws = team->work_share_list_free;
+         ws->next_free = next_ws;
+       }
+      while (!__sync_bool_compare_and_swap (&team->work_share_list_free,
+                                           next_ws, ws));
+#else
+      gomp_mutex_lock (&team->work_share_list_free_lock);
+      next_ws = team->work_share_list_free;
+      ws->next_free = next_ws;
+      team->work_share_list_free = ws;
+      gomp_mutex_unlock (&team->work_share_list_free_lock);
+#endif
+    }
+}
+
+/* The current thread is ready to begin the next work sharing construct.
+   In all cases, thr->ts.work_share is updated to point to the new
+   structure.  In all cases the work_share lock is locked.  Return true
+   if this was the first thread to reach this point.  */
+
+bool
+gomp_work_share_start (bool ordered)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_work_share *ws;
+
+  /* Work sharing constructs can be orphaned.  */
+  if (team == NULL)
+    {
+      ws = gomp_malloc (sizeof (*ws));
+      gomp_init_work_share (ws, ordered, 1);
+      thr->ts.work_share = ws;
+      return ws;
+    }
+
+  ws = thr->ts.work_share;
+  thr->ts.last_work_share = ws;
+  ws = gomp_ptrlock_get (&ws->next_ws);
+  if (ws == NULL)
+    {
+      /* This thread encountered a new ws first.  */
+      struct gomp_work_share *ws = alloc_work_share (team);
+      gomp_init_work_share (ws, ordered, team->nthreads);
+      thr->ts.work_share = ws;
+      return true;
+    }
+  else
+    {
+      thr->ts.work_share = ws;
+      return false;
+    }
+}
+
+/* The current thread is done with its current work sharing construct.
+   This version does imply a barrier at the end of the work-share.  */
+
+void
+gomp_work_share_end (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  gomp_barrier_state_t bstate;
+
+  /* Work sharing constructs can be orphaned.  */
+  if (team == NULL)
+    {
+      free_work_share (NULL, thr->ts.work_share);
+      thr->ts.work_share = NULL;
+      return;
+    }
+
+  bstate = gomp_barrier_wait_start (&team->barrier);
+
+  if (gomp_barrier_last_thread (bstate))
+    {
+      if (__builtin_expect (thr->ts.last_work_share != NULL, 1))
+       free_work_share (team, thr->ts.last_work_share);
+    }
+
+  gomp_team_barrier_wait_end (&team->barrier, bstate);
+  thr->ts.last_work_share = NULL;
+}
+
+/* The current thread is done with its current work sharing construct.
+   This version does NOT imply a barrier at the end of the work-share.  */
+
+void
+gomp_work_share_end_nowait (void)
+{
+  struct gomp_thread *thr = gomp_thread ();
+  struct gomp_team *team = thr->ts.team;
+  struct gomp_work_share *ws = thr->ts.work_share;
+  unsigned completed;
+
+  /* Work sharing constructs can be orphaned.  */
+  if (team == NULL)
+    {
+      free_work_share (NULL, ws);
+      thr->ts.work_share = NULL;
+      return;
+    }
+
+  if (__builtin_expect (thr->ts.last_work_share == NULL, 0))
+    return;
+
+#ifdef HAVE_SYNC_BUILTINS
+  completed = __sync_add_and_fetch (&ws->threads_completed, 1);
+#else
+  gomp_mutex_lock (&ws->lock);
+  completed = ++ws->threads_completed;
+  gomp_mutex_unlock (&ws->lock);
+#endif
+
+  if (completed == team->nthreads)
+    free_work_share (team, thr->ts.last_work_share);
+  thr->ts.last_work_share = NULL;
+}
index e506dd1cae5e8a3ceac8ba69ab354901927aefe4..58a717667b74c342880d66a9ab93db21d90657fe 100644 (file)
@@ -1,4 +1,4 @@
 
 The dist/ directory contains the unmodified contents of
-libpng-1.5.14.tar.gz.
+libpng-1.6.0.tar.gz.
 
index 2eb18373aa2a59b18183249a18821d7ddb6372d1..772f1e0ebb17eac55d1163d41fdd7d329ddddf2d 100644 (file)
@@ -2,8 +2,7 @@ PKGDIR          ?= ../..
 L4DIR           ?= $(PKGDIR)/../..
 
 TARGET          = libl4png.a libl4png.so
-LIBS            = $(GCCLIB)
-SYSTEMS                = $(SYSTEMS_PLAIN)
+#LIBS            = $(GCCLIB)
 REQUIRES_LIBS   = zlib
 CONTRIB_INCDIR  = libpng
 
@@ -12,7 +11,6 @@ SRC_C           = pngerror.c pngget.c pngpread.c pngrio.c pngrutil.c \
                  pngrtran.c pngset.c pngtrans.c pngwio.c pngwtran.c
 
 PRIVATE_INCDIR  = $(SRC_DIR)
-DEFINE         = PNG_USER_MEM_SUPPORTED PNG_CONFIGURE_LIBPNG HAVE_CONFIG_H
 
 vpath %.c $(SRC_DIR)/../dist
 
index 827d17e544c8d68952319b62e7ff05937bcbdb46..a19c98e7e97f8ca79f457f75cc7f1e356e4d9229 100644 (file)
-
-/* libpng STANDARD API DEFINITION */
-
 /* pnglibconf.h - library build configuration */
 
-/* libpng version 1.5.4 - last changed on June 22, 2011 */
+/* libpng version 1.6.0 - February 14, 2013 */
 
-/* Copyright (c) 1998-2011 Glenn Randers-Pehrson */
+/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */
 
 /* This code is released under the libpng license. */
 /* For conditions of distribution and use, see the disclaimer */
 /* and license in png.h */
 
 /* pnglibconf.h */
+/* Machine generated file: DO NOT EDIT */
 /* Derived from: scripts/pnglibconf.dfa */
-/* If you edit this file by hand you must obey the rules expressed in */
-/* pnglibconf.dfa with respect to the dependencies between the following */
-/* symbols.  It is much better to generate a new file using */
-/* scripts/libpngconf.mak */
-
 #ifndef PNGLCONF_H
 #define PNGLCONF_H
 /* settings */
-#define PNG_API_RULE 0
-#define PNG_CALLOC_SUPPORTED
-#define PNG_COST_SHIFT 3
-#define PNG_DEFAULT_READ_MACROS 1
-#define PNG_GAMMA_THRESHOLD_FIXED 5000
 #define PNG_MAX_GAMMA_8 11
-#define PNG_QUANTIZE_BLUE_BITS 5
-#define PNG_QUANTIZE_GREEN_BITS 5
+#define PNG_CALLOC_SUPPORTED
 #define PNG_QUANTIZE_RED_BITS 5
+#define PNG_Z_DEFAULT_COMPRESSION Z_DEFAULT_COMPRESSION
+#define PNG_INFLATE_BUF_SIZE 1024
+#define PNG_QUANTIZE_GREEN_BITS 5
+#define PNG_Z_DEFAULT_NOFILTER_STRATEGY Z_DEFAULT_STRATEGY
+#define PNG_API_RULE 0
+#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
+#define PNG_QUANTIZE_BLUE_BITS 5
+#define PNG_TEXT_Z_DEFAULT_STRATEGY Z_DEFAULT_STRATEGY
 #define PNG_sCAL_PRECISION 5
-#define PNG_USER_CHUNK_CACHE_MAX 0
-#define PNG_USER_CHUNK_MALLOC_MAX 0
-#define PNG_USER_HEIGHT_MAX 1000000L
-#define PNG_USER_WIDTH_MAX 1000000L
+#define PNG_COST_SHIFT 3
 #define PNG_WEIGHT_SHIFT 8
+#define PNG_TEXT_Z_DEFAULT_COMPRESSION Z_DEFAULT_COMPRESSION
+#define PNG_DEFAULT_READ_MACROS 1
 #define PNG_ZBUF_SIZE 8192
+#define PNG_Z_DEFAULT_STRATEGY Z_FILTERED
+#define PNG_GAMMA_THRESHOLD_FIXED 5000
+#define PNG_sRGB_PROFILE_CHECKS 2
 /* end of settings */
 /* options */
-#define PNG_16BIT_SUPPORTED
+#define PNG_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_INFO_IMAGE_SUPPORTED
+#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_GET_PALETTE_MAX_SUPPORTED
+#define PNG_POINTER_INDEXING_SUPPORTED
+#define PNG_WARNINGS_SUPPORTED
+#define PNG_FLOATING_ARITHMETIC_SUPPORTED
+#define PNG_WRITE_SUPPORTED
+#define PNG_WRITE_INTERLACING_SUPPORTED
+#define PNG_WRITE_16BIT_SUPPORTED
+#define PNG_EASY_ACCESS_SUPPORTED
 #define PNG_ALIGN_MEMORY_SUPPORTED
-#define PNG_BENIGN_ERRORS_SUPPORTED
-#define PNG_bKGD_SUPPORTED
+#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
+#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
+#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
 #define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
-#define PNG_CHECK_cHRM_SUPPORTED
-#define PNG_cHRM_SUPPORTED
-#define PNG_CONSOLE_IO_SUPPORTED
-#define PNG_CONVERT_tIME_SUPPORTED
-#define PNG_EASY_ACCESS_SUPPORTED
+#define PNG_FIXED_POINT_SUPPORTED
 /*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
 #define PNG_ERROR_TEXT_SUPPORTED
-#define PNG_FIXED_POINT_SUPPORTED
-#define PNG_FLOATING_ARITHMETIC_SUPPORTED
+#define PNG_READ_SUPPORTED
+#define PNG_BENIGN_ERRORS_SUPPORTED
+#define PNG_SETJMP_SUPPORTED
+#define PNG_TIME_RFC1123_SUPPORTED
+#define PNG_BENIGN_READ_ERRORS_SUPPORTED
+#define PNG_WRITE_FLUSH_SUPPORTED
+#define PNG_MNG_FEATURES_SUPPORTED
+/*#undef PNG_SAFE_LIMITS_SUPPORTED*/
 #define PNG_FLOATING_POINT_SUPPORTED
-#define PNG_gAMA_SUPPORTED
-#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-#define PNG_hIST_SUPPORTED
-#define PNG_iCCP_SUPPORTED
+#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
 #define PNG_INCH_CONVERSIONS_SUPPORTED
-#define PNG_INFO_IMAGE_SUPPORTED
+#define PNG_STDIO_SUPPORTED
+#define PNG_USER_MEM_SUPPORTED
 #define PNG_IO_STATE_SUPPORTED
-#define PNG_iTXt_SUPPORTED
-#define PNG_MNG_FEATURES_SUPPORTED
-#define PNG_oFFs_SUPPORTED
-#define PNG_pCAL_SUPPORTED
-#define PNG_pHYs_SUPPORTED
-#define PNG_POINTER_INDEXING_SUPPORTED
-#define PNG_PROGRESSIVE_READ_SUPPORTED
-#define PNG_READ_16BIT_SUPPORTED
-#define PNG_READ_ALPHA_MODE_SUPPORTED
 #define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
-#define PNG_READ_BACKGROUND_SUPPORTED
-#define PNG_READ_BGR_SUPPORTED
+#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
+#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
+#define PNG_WRITE_FILTER_SUPPORTED
+#define PNG_WRITE_zTXt_SUPPORTED
+#define PNG_WRITE_iCCP_SUPPORTED
+#define PNG_READ_TRANSFORMS_SUPPORTED
 #define PNG_READ_bKGD_SUPPORTED
-#define PNG_READ_cHRM_SUPPORTED
-#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
-#define PNG_READ_COMPRESSED_TEXT_SUPPORTED
-#define PNG_READ_EXPAND_16_SUPPORTED
-#define PNG_READ_EXPAND_SUPPORTED
-#define PNG_READ_FILLER_SUPPORTED
-#define PNG_READ_gAMA_SUPPORTED
-#define PNG_READ_GAMMA_SUPPORTED
+#define PNG_READ_sCAL_SUPPORTED
+#define PNG_WRITE_hIST_SUPPORTED
+#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+#define PNG_READ_OPT_PLTE_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_SUPPORTED
 #define PNG_READ_GRAY_TO_RGB_SUPPORTED
-#define PNG_READ_hIST_SUPPORTED
-#define PNG_READ_iCCP_SUPPORTED
-#define PNG_READ_INTERLACING_SUPPORTED
-#define PNG_READ_INT_FUNCTIONS_SUPPORTED
+#define PNG_WRITE_pCAL_SUPPORTED
 #define PNG_READ_INVERT_ALPHA_SUPPORTED
-#define PNG_READ_INVERT_SUPPORTED
-#define PNG_READ_iTXt_SUPPORTED
-#define PNG_READ_oFFs_SUPPORTED
-#define PNG_READ_OPT_PLTE_SUPPORTED
-#define PNG_READ_PACK_SUPPORTED
-#define PNG_READ_PACKSWAP_SUPPORTED
-#define PNG_READ_pCAL_SUPPORTED
-#define PNG_READ_pHYs_SUPPORTED
-#define PNG_READ_QUANTIZE_SUPPORTED
-#define PNG_READ_RGB_TO_GRAY_SUPPORTED
+#define PNG_WRITE_TRANSFORMS_SUPPORTED
+#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
 #define PNG_READ_sBIT_SUPPORTED
-#define PNG_READ_SCALE_16_TO_8_SUPPORTED
-#define PNG_READ_sCAL_SUPPORTED
-#define PNG_READ_SHIFT_SUPPORTED
-#define PNG_READ_sPLT_SUPPORTED
-#define PNG_READ_sRGB_SUPPORTED
+#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
+#define PNG_READ_PACK_SUPPORTED
+#define PNG_WRITE_iTXt_SUPPORTED
+#define PNG_WRITE_SWAP_SUPPORTED
+#define PNG_READ_cHRM_SUPPORTED
 #define PNG_READ_STRIP_16_TO_8_SUPPORTED
-#define PNG_READ_STRIP_ALPHA_SUPPORTED
-#define PNG_READ_SUPPORTED
-#define PNG_READ_SWAP_ALPHA_SUPPORTED
-#define PNG_READ_SWAP_SUPPORTED
-#define PNG_READ_tEXt_SUPPORTED
-#define PNG_READ_TEXT_SUPPORTED
-#define PNG_READ_tIME_SUPPORTED
-#define PNG_READ_TRANSFORMS_SUPPORTED
+#define PNG_WRITE_tIME_SUPPORTED
+#define PNG_READ_INTERLACING_SUPPORTED
 #define PNG_READ_tRNS_SUPPORTED
-#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
-#define PNG_READ_USER_CHUNKS_SUPPORTED
+#define PNG_WRITE_pHYs_SUPPORTED
+#define PNG_WRITE_INVERT_SUPPORTED
+#define PNG_WRITE_sRGB_SUPPORTED
+#define PNG_READ_oFFs_SUPPORTED
+#define PNG_WRITE_FILLER_SUPPORTED
+#define PNG_WRITE_SHIFT_SUPPORTED
+#define PNG_PROGRESSIVE_READ_SUPPORTED
+#define PNG_READ_SHIFT_SUPPORTED
+#define PNG_CONVERT_tIME_SUPPORTED
 #define PNG_READ_USER_TRANSFORM_SUPPORTED
-#define PNG_READ_zTXt_SUPPORTED
-#define PNG_SAVE_INT_32_SUPPORTED
-#define PNG_sBIT_SUPPORTED
-#define PNG_sCAL_SUPPORTED
+#define PNG_READ_INT_FUNCTIONS_SUPPORTED
+#define PNG_READ_USER_CHUNKS_SUPPORTED
+#define PNG_READ_hIST_SUPPORTED
+#define PNG_READ_SWAP_ALPHA_SUPPORTED
+#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
 #define PNG_SEQUENTIAL_READ_SUPPORTED
-#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
-#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
-#define PNG_SETJMP_SUPPORTED
-#define PNG_SET_USER_LIMITS_SUPPORTED
-#define PNG_sPLT_SUPPORTED
-#define PNG_sRGB_SUPPORTED
-#define PNG_STDIO_SUPPORTED
-#define PNG_tEXt_SUPPORTED
-#define PNG_TEXT_SUPPORTED
-#define PNG_TIME_RFC1123_SUPPORTED
-#define PNG_tIME_SUPPORTED
-#define PNG_tRNS_SUPPORTED
-#define PNG_UNKNOWN_CHUNKS_SUPPORTED
-#define PNG_USER_CHUNKS_SUPPORTED
+#define PNG_READ_QUANTIZE_SUPPORTED
+#define PNG_READ_zTXt_SUPPORTED
 #define PNG_USER_LIMITS_SUPPORTED
-#define PNG_USER_MEM_SUPPORTED
-#define PNG_USER_TRANSFORM_INFO_SUPPORTED
-#define PNG_USER_TRANSFORM_PTR_SUPPORTED
-#define PNG_WARNINGS_SUPPORTED
-#define PNG_WRITE_16BIT_SUPPORTED
-#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
+#define PNG_READ_iCCP_SUPPORTED
+#define PNG_READ_PACKSWAP_SUPPORTED
+#define PNG_READ_sRGB_SUPPORTED
+#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
+#define PNG_READ_gAMA_SUPPORTED
+#define PNG_READ_pCAL_SUPPORTED
+#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_WRITE_sPLT_SUPPORTED
+#define PNG_READ_iTXt_SUPPORTED
+/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
+#define PNG_READ_tIME_SUPPORTED
+#define PNG_READ_pHYs_SUPPORTED
+#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
 #define PNG_WRITE_BGR_SUPPORTED
-#define PNG_WRITE_bKGD_SUPPORTED
-#define PNG_WRITE_cHRM_SUPPORTED
+#define PNG_USER_CHUNKS_SUPPORTED
+#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED
+#define PNG_CONSOLE_IO_SUPPORTED
 #define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
-#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
-#define PNG_WRITE_FILLER_SUPPORTED
-#define PNG_WRITE_FILTER_SUPPORTED
-#define PNG_WRITE_FLUSH_SUPPORTED
-#define PNG_WRITE_gAMA_SUPPORTED
-#define PNG_WRITE_hIST_SUPPORTED
-#define PNG_WRITE_iCCP_SUPPORTED
-#define PNG_WRITE_INTERLACING_SUPPORTED
-#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
-#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
-#define PNG_WRITE_INVERT_SUPPORTED
-#define PNG_WRITE_iTXt_SUPPORTED
-#define PNG_WRITE_oFFs_SUPPORTED
-#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
+#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
 #define PNG_WRITE_PACK_SUPPORTED
-#define PNG_WRITE_PACKSWAP_SUPPORTED
-#define PNG_WRITE_pCAL_SUPPORTED
-#define PNG_WRITE_pHYs_SUPPORTED
-#define PNG_WRITE_sBIT_SUPPORTED
-#define PNG_WRITE_sCAL_SUPPORTED
-#define PNG_WRITE_SHIFT_SUPPORTED
-#define PNG_WRITE_sPLT_SUPPORTED
-#define PNG_WRITE_sRGB_SUPPORTED
-#define PNG_WRITE_SUPPORTED
-#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
-#define PNG_WRITE_SWAP_SUPPORTED
-#define PNG_WRITE_tEXt_SUPPORTED
-#define PNG_WRITE_TEXT_SUPPORTED
-#define PNG_WRITE_tIME_SUPPORTED
-#define PNG_WRITE_TRANSFORMS_SUPPORTED
+#define PNG_WRITE_bKGD_SUPPORTED
 #define PNG_WRITE_tRNS_SUPPORTED
-#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_READ_sPLT_SUPPORTED
+#define PNG_WRITE_sCAL_SUPPORTED
+#define PNG_WRITE_oFFs_SUPPORTED
+#define PNG_SET_USER_LIMITS_SUPPORTED
+#define PNG_WRITE_sBIT_SUPPORTED
+#define PNG_READ_INVERT_SUPPORTED
+#define PNG_WRITE_cHRM_SUPPORTED
 #define PNG_WRITE_USER_TRANSFORM_SUPPORTED
-#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
-#define PNG_WRITE_zTXt_SUPPORTED
+#define PNG_READ_BGR_SUPPORTED
+#define PNG_WRITE_PACKSWAP_SUPPORTED
+#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
+#define PNG_sCAL_SUPPORTED
+#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
+#define PNG_READ_GAMMA_SUPPORTED
+#define PNG_USER_TRANSFORM_INFO_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
+#define PNG_READ_GET_PALETTE_MAX_SUPPORTED
+#define PNG_sBIT_SUPPORTED
+#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
+#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_WRITE_gAMA_SUPPORTED
+#define PNG_cHRM_SUPPORTED
+#define PNG_bKGD_SUPPORTED
+#define PNG_tRNS_SUPPORTED
+#define PNG_oFFs_SUPPORTED
+#define PNG_USER_TRANSFORM_PTR_SUPPORTED
+#define PNG_WRITE_TEXT_SUPPORTED
+#define PNG_READ_COMPRESSED_TEXT_SUPPORTED
+#define PNG_hIST_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
 #define PNG_zTXt_SUPPORTED
+#define PNG_iCCP_SUPPORTED
+#define PNG_sRGB_SUPPORTED
+#define PNG_gAMA_SUPPORTED
+#define PNG_pCAL_SUPPORTED
+#define PNG_WRITE_tEXt_SUPPORTED
+#define PNG_iTXt_SUPPORTED
+#define PNG_tIME_SUPPORTED
+#define PNG_pHYs_SUPPORTED
+#define PNG_READ_TEXT_SUPPORTED
+#define PNG_SAVE_INT_32_SUPPORTED
+#define PNG_sPLT_SUPPORTED
+#define PNG_COLORSPACE_SUPPORTED
+#define PNG_READ_tEXt_SUPPORTED
+#define PNG_SIMPLIFIED_READ_SUPPORTED
+#define PNG_READ_ALPHA_MODE_SUPPORTED
+#define PNG_READ_RGB_TO_GRAY_SUPPORTED
+#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
+#define PNG_READ_16BIT_SUPPORTED
+#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED
+#define PNG_READ_STRIP_ALPHA_SUPPORTED
+#define PNG_READ_EXPAND_SUPPORTED
+#define PNG_READ_SWAP_SUPPORTED
+#define PNG_TEXT_SUPPORTED
+#define PNG_READ_SCALE_16_TO_8_SUPPORTED
+#define PNG_GAMMA_SUPPORTED
+#define PNG_READ_FILLER_SUPPORTED
+#define PNG_tEXt_SUPPORTED
+#define PNG_16BIT_SUPPORTED
+#define PNG_FORMAT_AFIRST_SUPPORTED
+#define PNG_READ_EXPAND_16_SUPPORTED
+#define PNG_FORMAT_BGR_SUPPORTED
+#define PNG_READ_BACKGROUND_SUPPORTED
 /* end of options */
 #endif /* PNGLCONF_H */
index 718deeb5edd8118a0e9bafc81503683d77d545f0..b719f6683b018ddcaf83b03ec492915823d1d02a 100644 (file)
@@ -1,5 +1,5 @@
 
-Libpng 1.5.14 - January 24, 2013
+Libpng 1.6.0 - February 14, 2013
 
 This is a public release of libpng, intended for use in production codes.
 
@@ -8,64 +8,452 @@ Files available for download:
 Source files with LF line endings (for Unix/Linux) and with a
 "configure" script
 
-   libpng-1.5.14.tar.xz (LZMA-compressed, recommended)
-   libpng-1.5.14.tar.gz
-   libpng-1.5.14.tar.bz2
+   libpng-1.6.0.tar.xz (LZMA-compressed, recommended)
+   libpng-1.6.0.tar.gz
 
 Source files with CRLF line endings (for Windows), without the
 "configure" script
 
-   lpng1514.7z  (LZMA-compressed, recommended)
-   lpng1514.zip
+   lpng160.7z  (LZMA-compressed, recommended)
+   lpng160.zip
 
 Other information:
 
-   libpng-1.5.14-README.txt
-   libpng-1.5.14-LICENSE.txt
+   libpng-1.6.0-README.txt
+   libpng-1.6.0-LICENSE.txt
 
-Changes since the last public release (1.5.13):
+Changes since the last public release (1.5.7):
+
+  Removed machine-generated configure files from the GIT repository (they will
+    continue to appear in the tarball distributions and in the libpng15 and
+    earlier GIT branches).
+  Restored the new 'simplified' API, which was started in libpng-1.5.7beta02
+    but later deleted from libpng-1.5.7beta05.
+  Added example programs and test program pngstest for the new 'simplified' API.
+  Added ANSI-C (C90) headers and require them, and take advantage of the
+    change. Also fixed some of the projects/* and contrib/* files that needed
+    updates for libpng16 and the move of pngvalid.c.
+    With this change the required ANSI-C header files are assumed to exist: the
+    implementation must provide float.h, limits.h, stdarg.h and stddef.h and
+    libpng relies on limits.h and stddef.h existing and behaving as defined
+    (the other two required headers aren't used).  Non-ANSI systems that don't
+    have stddef.h or limits.h will have to provide an appropriate fake
+    containing the relevant types and #defines.
+  The use of FAR/far has been eliminated and the definition of png_alloc_size_t
+    is now controlled by a flag so that 'small size_t' systems can select it
+    if necessary.  Libpng 1.6 may not currently work on such systems -- it
+    seems likely that it will ask 'malloc' for more than 65535 bytes with any
+    image that has a sufficiently large row size (rather than simply failing
+    to read such images).
+  New tools directory containing tools used to generate libpng code.
+  Fixed race conditions in parallel make builds. With higher degrees of
+    parallelism during 'make' the use of the same temporary file names such
+    as 'dfn*' can result in a race where a temporary file from one arm of the
+    build is deleted or overwritten in another arm.  This changes the
+    temporary files for suffix rules to always use $* and ensures that the
+    non-suffix rules use unique file names.
+  Correct configure builds where build and source directories are separate.
+    The include path of 'config.h' was erroneously made relative in pngvalid.c
+    in libpng 1.5.7.
+  Start-up code size improvements, error handler flexibility. These changes
+    alter how the tricky allocation of the initial png_struct and png_info
+    structures are handled. png_info is now handled in pretty much the same
+    way as everything else, except that the allocations handle NULL return
+    silently.  png_struct is changed in a similar way on allocation and on
+    deallocation a 'safety' error handler is put in place (which should never
+    be required).  The error handler itself is changed to permit mismatches
+    in the application and libpng error buffer size; however, this means a
+    silent change to the API to return the jmp_buf if the size doesn't match
+    the size from the libpng compilation; libpng now allocates the memory and
+    this may fail.  Overall these changes result in slight code size
+    reductions; however, this is a reduction in code that is always executed
+    so is particularly valuable.  Overall on a 64-bit system the libpng DLL
+    decreases in code size by 1733 bytes.  pngerror.o increases in size by
+    about 465 bytes because of the new functionality.
+  Added png_convert_to_rfc1123_buffer() and deprecated png_convert_to_rfc1123()
+    to avoid including a spurious buffer in the png_struct.
+  Regenerated configure scripts with automake-1.11.2
+  Eliminated png_info_destroy(). It is now used only in png.c and only calls
+    one other internal function and memset().
+  Enabled png_get_sCAL_fixed() if floating point APIs are enabled. Previously
+    it was disabled whenever internal fixed point arithmetic was selected,
+    which meant it didn't exist even on systems where FP was available but not
+    preferred.
+  Added pngvalid.c compile time checks for const APIs.
+  Implemented 'restrict' for png_info and png_struct. Because of the way
+    libpng works both png_info and png_struct are always accessed via a
+    single pointer.  This means adding C99 'restrict' to the pointer gives
+    the compiler some opportunity to optimize the code.  This change allows
+    that.
+  Moved AC_MSG_CHECKING([if libraries can be versioned]) later to the proper
+    location in configure.ac (Gilles Espinasse).
+  Changed png_memcpy to C assignment where appropriate. Changed all those
+    uses of png_memcpy that were doing a simple assignment to assignments
+    (all those cases where the thing being copied is a non-array C L-value).
+  Added some error checking to png_set_*() routines.
+  Removed the reference to the non-exported function png_memcpy() from
+    example.c.
+  Fixed the Visual C 64-bit build - it requires jmp_buf to be aligned, but
+    it had become misaligned.
+  Revised contrib/pngminus/pnm2png.c to avoid warnings when png_uint_32
+    and unsigned long are of different sizes.
+  Updated manual with description of the simplified API.
+  Fix bug in pngerror.c: some long warnings were being improperly truncated
+    (CVE-2011-3464, bug introduced in libpng-1.5.4).
+  Increased the formatted warning buffer to 192 bytes.
+  Fixed Min/GW uninstall to remove libpng.dll.a
+  Eliminated Intel icc/icl compiler warnings. The Intel (GCC derived)
+    compiler issues slightly different warnings from those issued by the
+    current vesions of GCC. This eliminates those warnings by
+    adding/removing casts and small code rewrites.
+  Updated configure.ac from autoupdate: added --enable-werror option.
+    Also some layout regularization and removal of introduced tab characters
+    (replaced with 3-character indentation).  Obsolete macros identified by
+    autoupdate have been removed; the replacements are all in 2.59 so
+    the pre-req hasn't been changed.  --enable-werror checks for support
+    for -Werror (or the given argument) in the compiler.  This mimics the
+    gcc configure option by allowing -Werror to be turned on safely; without
+    the option the tests written in configure itself fail compilation because
+    they cause compiler warnings.
+  Rewrote autogen.sh to run autoreconf instead of running tools one-by-one.
+  Conditionalize the install rules for MINGW and CYGWIN in CMakeLists.txt and
+    set CMAKE_LIBRARY_OUTPUT_DIRECTORY to "lib" on all platforms (C. Yapp).
+  Freeze libtool files in the 'scripts' directory. This version of autogen.sh
+    attempts to dissuade people from running it when it is not, or should not,
+    be necessary.  In fact, autogen.sh does not work when run in a libpng
+    directory extracted from a tar distribution anymore. You must run it in
+    a GIT clone instead.
+  Added two images to contrib/pngsuite (1-bit and 2-bit transparent grayscale),
+    and renamed three whose names were inconsistent with those in
+    pngsuite/README.txt.
+  Check libtool/libtoolize version number (2.4.2) in configure.ac
+  Moved automake options to AM_INIT_AUTOMAKE in configure.ac
+  Added color-tests, silent-rules (Not yet implemented in Makefile.am) and
+    version checking to configure.ac
+  Cleaned up pngpriv.h to consistently declare all functions and data.
+    Also eliminated PNG_CONST_DATA, which is apparently not needed but we
+    can't be sure until it is gone.
+  Added symbol prefixing that allows all the libpng external symbols
+    to be prefixed (suggested by Reuben Hawkins).
+  Updated "ftbb*.png" list in the owatcom and vstudio projects.
+  Added Z_SOLO for zlib-1.2.6+ and correct pngstest tests
+  Revised INSTALL information about autogen.sh.
+  Updated list of test images in CMakeLists.txt
+  Corrected estimate of error in libpng png_set_rgb_to_gray API.  The API is
+    extremely inaccurate for sRGB conversions because it uses an 8-bit
+    intermediate linear value and it does not use the sRGB transform, so it
+    suffers from the known instability in gamma transforms for values close
+    to 0 (see Poynton).  The net result is that the calculation has a maximum
+    error of 14.99/255; 0.5/255^(1/2.2).  pngstest now uses 15 for the
+    permitted 8-bit error. This may still not be enough because of arithmetic
+    error.
+  Removed some unused arrays (with #ifdef) from png_read_push_finish_row().
+  Fixed a memory overwrite bug in simplified read of RGB PNG with
+    non-linear gamma Also bugs in the error checking in pngread.c and changed
+    quite a lot of the checks in pngstest.c to be correct; either correctly
+    written or not over-optimistic.  The pngstest changes are insufficient to
+    allow all possible RGB transforms to be passed; pngstest cmppixel needs
+    to be rewritten to make it clearer which errors it allows and then changed
+    to permit known inaccuracies.
+  Removed tests for no-longer-used *_EMPTY_PLTE_SUPPORTED from pngstruct.h
+  Fixed fixed/float API export conditionals. 1) If FIXED_POINT or
+    FLOATING_POINT options were switched off, png.h ended up with lone ';'
+    characters.  This is not valid ANSI-C outside a function.  The ';'
+    characters have been moved inside the definition of PNG_FP_EXPORT and
+    PNG_FIXED_EXPORT. 2) If either option was switched off, the declaration
+    of the corresponding functions were completely omitted, even though some
+    of them are still used internally.  The result is still valid, but
+    produces warnings from gcc with some warning options (including -Wall). The
+    fix is to cause png.h to declare the functions with PNG_INTERNAL_FUNCTION
+    when png.h is included from pngpriv.h.
+  Check for invalid palette index while reading paletted PNG.  When one is
+    found, issue a warning.
+  Fixed CVE-2011-3026 buffer overrun bug.  Deal more correctly with the test
+    on iCCP chunk length. Also removed spurious casts that may hide problems
+    on 16-bit systems.
+  Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
+    pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c;
+    now that png_ptr->buffer is inaccessible to applications, the special
+    handling is no longer useful.
+  Added PNG_SAFE_LIMITS feature to pnglibconf.dfa, pngpriv.h, and new
+    pngusr.dfa to reset the user limits to safe ones if PNG_SAFE_LIMITS is
+    defined.  To enable, use "CPPFLAGS=-DPNG_SAFE_LIMITS_SUPPORTED=1" on the
+    configure command or put #define PNG_SAFE_LIMITS_SUPPORTED in
+    pnglibconf.h.prebuilt and pnglibconf.h.
+  Added information about the new limits in the manual.
+  Removed unused "current_text" members of png_struct and the png_free()
+    of png_ptr->current_text from pngread.c
+  Added PNG_IMAGE_FLAG_FAST for the benefit of applications that store
+    intermediate files, or intermediate in-memory data, while processing
+    image data with the simplified API.  The option makes the files larger
+    but faster to write and read.  pngstest now uses this by default; this
+    can be disabled with the --slow option.
+  Improved pngstest fine tuning of error numbers, new test file generator.
+    The generator generates images that test the full range of sample values,
+    allow the error numbers in pngstest to be tuned and checked.  makepng
+    also allows generation of images with extra chunks, although this is
+    still work-in-progress.
+  Fixed some bugs in ICC profile writing. The code should now accept
+    all potentially valid ICC profiles and reject obviously invalid ones.
+    It now uses png_error() to do so rather than casually writing a PNG
+    without the necessary color data.
+  Removed whitespace from the end of lines in all source files and scripts.
+  Added tests for invalid palette index while reading and writing.
+  Changed png_inflate() and calling routines to avoid overflow problems.
+    This is an intermediate check-in that solves the immediate problems and
+    introduces one performance improvement (avoiding a copy via png_ptr->zbuf.)
+    Further changes will be made to make ICC profile handling more secure.
+  Added contrib/libtests/tarith.c to test internal arithmetic functions from
+    png.c. This is a libpng maintainer program used to validate changes to the
+    internal arithmetic functions.
+  Made read 'inflate' handling like write 'deflate' handling. The read
+    code now claims and releases png_ptr->zstream, like the write code.
+    The bug whereby the progressive reader failed to release the zstream
+    is now fixed, all initialization is delayed, and the code checks for
+    changed parameters on deflate rather than always calling
+    deflatedEnd/deflateInit.
+  Validate the zTXt strings in pngvalid.
+  Added code to validate the windowBits value passed to deflateInit2().
+    If the call to deflateInit2() is wrong a png_warning will be issued
+    (in fact this is harmless, but the PNG data produced may be sub-optimal).
+  Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition. 
+  Reject all iCCP chunks after the first, even if the first one is invalid.
+  Deflate/inflate was reworked to move common zlib calls into single
+    functions [rw]util.c.  A new shared keyword check routine was also added
+    and the 'zbuf' is no longer allocated on progressive read.  It is now
+    possible to call png_inflate() incrementally.
+  If benign errors are disabled use maximum window on ancilliary inflate.
+    This works round a bug introduced in 1.5.4 where compressed ancillary
+    chunks could end up with a too-small windowBits value in the deflate
+    header.
+  Issue a png_benign_error() instead of png_warning() about bad palette index.
+  In pngtest, treat benign errors as errors if "-strict" is present.
+  Fixed a compiler warning under Cygwin (Windows-7, 32-bit system)
+  Revised example.c to put text strings in a temporary character array
+    instead of directly assigning string constants to png_textp members.
+    This avoids compiler warnings when -Wwrite-strings is enabled.
+  Added output flushing to aid debugging under Visual Studio. Unfortunately
+    this is necessary because the VS2010 output window otherwise simply loses
+    the error messages on error (they weren't flushed to the window before
+    the process exited, apparently!)
+  Added configuration support for benign errors and changed the read
+    default. Also changed some warnings in the iCCP and sRGB handling
+    from to benign errors. Configuration now makes read benign
+    errors warnings and write benign errors to errors by default (thus
+    changing the behavior on read).  The simplified API always forces
+    read benign errors to warnings (regardless of the system default, unless
+    this is disabled in which case the simplified API can't be built.)
+  Work around for duplicate row start calls; added warning messages.
+    This turns on PNG_FLAG_DETECT_UNINITIALIZED to detect app code that
+    fails to call one of the 'start' routines (not enabled in libpng-1.5
+    because it is technically an API change, since it did normally work
+    before.)  It also makes duplicate calls to png_read_start_row (an
+    internal function called at the start of the image read) benign, as
+    they were before changes to use png_inflate_claim. Somehow webkit is
+    causing this to happen; this is probably a mis-feature in the zlib
+    changes so this commit is only a work-round.
+  Removed erroneous setting of DETECT_UNINITIALIZED and added more
+    checks. The code now does a png_error if an attempt is made to do the
+    row initialization twice; this is an application error and it has
+    serious consequences because the transform data in png_struct is
+    changed by each call.
+  Added application error reporting and added chunk names to read
+    benign errors; also added --strict to pngstest - not enabled
+    yet because a warning is produced.
+  Avoid the double gamma correction warning in the simplified API.
+    This allows the --strict option to pass in the pngstest checks
+  Changed chunk handler warnings into benign errors, incrementally load iCCP
+  Added checksum-icc.c to contrib/tools
+  Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
+  Recognize known sRGB ICC profiles while reading; prefer writing the
+    iCCP profile over writing the sRGB chunk, controlled by the
+    PNG_sRGB_PROFILE_CHECKS option.
+  Revised png_set_text_2() to avoid potential memory corruption (fixes
+    CVE-2011-3048).
+  Revised scripts/makefile.darwin: use system zlib; remove quotes around
+    architecture list; add missing ppc architecture; add architecture options
+    to shared library link; don't try to create a shared lib based on missing
+    RELEASE variable.
+  Enable png_set_check_for_invalid_index() for both read and write.
+  Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpriv.h around
+    declaration of png_handle_unknown().
+  Added -lssp_nonshared in a comment in scripts/makefile.freebsd
+    and changed deprecated NOOBJ and NOPROFILE to NO_OBJ and NO_PROFILE.
+  Removed need for -Wno-cast-align with clang.  clang correctly warns on
+    alignment increasing pointer casts when -Wcast-align is passed. This
+    fixes the cases that clang warns about either by eliminating the
+    casts from png_bytep to png_uint_16p (pngread.c), or, for pngrutil.c
+    where the cast is previously verified or pngstest.c where it is OK, by
+    introducing new png_aligncast macros to do the cast in a way that clang
+    accepts.
+  Revised CMakeLists.txt to not attempt to make a symlink under mingw.
+  Made fixes for new optimization warnings from gcc 4.7.0. The compiler
+    performs an optimization which is safe; however it then warns about it.
+    Changing the type of 'palette_number' in pngvalid.c removes the warning.
+  Do not depend upon a GCC feature macro being available for use in generating
+    the linker mapfile symbol prefix.
+  Improved performance of new do_check_palette_indexes() function (only
+    update the value when it actually increases, move test for whether
+    the check is wanted out of the function.
+  Don't check palette indexes if num_palette is 0 (as it can be in MNG files).
+  Revised png_set_keep_unknown_chunks() so num_chunks < 0 means ignore all
+    unknown chunks and all known chunks except for IHDR, PLTE, tRNS, IDAT,
+    and IEND.  Previously it only meant ignore all unknown chunks, the
+    same as num_chunks == 0. Revised png_image_skip_unused_chunks() to
+    provide a list of chunks to be processed instead of a list of chunks to
+    ignore.  Revised contrib/gregbook/readpng2.c accordingly.
+  Removed scripts/makefile.cegcc from the *.zip and *.7z distributions; it
+    depends on configure, which is not included in those archives.
+  Moved scripts/chkfmt to contrib/tools.
+  Changed "a+w" to "u+w" in Makefile.in to fix CVE-2012-3386.
+  Do not compile PNG_DEPRECATED, PNG_ALLOC and PNG_PRIVATE when __GNUC__ < 3.
+  Do not use __restrict when GNUC is <= 3.1
+  Removed references to png_zalloc() and png_zfree() from the manual.
+  Fixed configurations where floating point is completely disabled.  Because
+    of the changes to support symbol prefixing PNG_INTERNAL_FUNCTION declares
+    floating point APIs during libpng builds even if they are completely
+    disabled. This requires the png floating point types (png_double*) to be
+    declared even though the functions are never actually defined.  This
+    change provides a dummy definition so that the declarations work, yet any
+    implementation will fail to compile because of an incomplete type.
+  Re-eliminated the use of strcpy() in pngtest.c.  An unncessary use of
+    strcpy() was accidentally re-introduced in libpng16; this change replaces
+    it with strncpy().
+  Eliminated use of png_sizeof(); use sizeof() instead.
+  Use a consistent style for (sizeof type) and (sizeof (array))
+  Cleanup of png_set_filler().  This function does very different things on
+    read and write.  In libpng 1.6 the two cases can be distinguished and
+    considerable code cleanup, and extra error checking, is possible.  This
+    makes calls on the write side that have no effect be ignored with a
+    png_app_error(), which can be disabled in the app using
+    png_set_benign_errors(), and removes the spurious use of usr_channels
+    on the read side.
+  Insist on autotools 1.12.1 for git builds because there are security issues
+    with 1.12 and insisting on anything less would allow 1.12 to be used.
+  Removed info_ptr->signature[8] from WRITE-only builds.
+  Add some conditions for compiling png_fixed().  This is a small function
+    but it requires "-lm" on some platforms.
+  Cause pngtest --strict to fail on any warning from libpng (not just errors)
+    and cause it not to fail at the comparison step if libpng lacks support
+    for writing chunks that it reads from the input (currently only implemented
+    for compressed text chunks).
+  Make all three "make check" test programs work without READ or WRITE support.
+    Now "make check" will succeed even if libpng is compiled with -DPNG_NO_READ
+    or -DPNG_NO_WRITE.  The tests performed are reduced, but the basic reading
+    and writing of a PNG file is always tested by one or more of the tests.
+  Consistently use strlen(), memset(), memcpy(), and memcmp() instead of the
+    png_strlen(), png_memset(), png_memcpy(), and png_memcmp() macros.
+  Removed the png_sizeof(), png_strlen(), png_memset(), png_memcpy(), and
+    png_memcmp() macros.
+  Work around gcc 3.x and Microsoft Visual Studio 2010 complaints. Both object
+    to the split initialization of num_chunks.
+  Unknown handling fixes and clean up. This adds more correct option
+    control of the unknown handling, corrects the pre-existing bug where
+    the per-chunk 'keep' setting is ignored and makes it possible to skip
+    IDAT chunks in the sequential reader (broken in earlier 1.6 versions).
+    There is a new test program, test-unknown.c, which is a work in progress
+    (not currently part of the test suite).  Comments in the header files now
+    explain how the unknown handling works.
+  Allow fine grain control of unknown chunk APIs. This change allows
+    png_set_keep_unknown_chunks() to be turned off if not required and causes
+    both read and write to behave appropriately (on read this is only possible
+    if the user callback is used to handle unknown chunks).  The change
+    also removes the support for storing unknown chunks in the info_struct
+    if the only unknown handling enabled is via the callback, allowing libpng
+    to be configured with callback reading and none of the unnecessary code.
+  Corrected fix for unknown handling in pngtest. This reinstates the
+    libpng handling of unknown chunks other than vpAg and sTER (including
+    unsafe-to-copy chunks which were dropped before) and eliminates the
+    repositioning of vpAg and sTER in pngtest.png by changing pngtest.png
+    (so the chunks are where libpng would put them).
+  Added "tunknown" test and corrected a logic error in png_handle_unknown()
+    when SAVE support is absent.  Moved the shell test scripts for
+    contrib/libtests from the libpng top directory to contrib/libtests.
+    png_handle_unknown() must always read or skip the chunk, if
+    SAVE_UNKNOWN_CHUNKS is turned off *and* the application does not set
+    a user callback an unknown chunk will not be read, leading to a read
+    error, which was revealed by the "tunknown" test.
+  Cleaned up and corrected ICC profile handling.
+    contrib/libtests/makepng: corrected 'rgb' and 'gray' cases.  profile_error
+    messages could be truncated; made a correct buffer size calculation and
+    adjusted pngerror.c appropriately. png_icc_check_* checking improved;
+    changed the functions to receive the correct color type of the PNG on read
+    or write and check that it matches the color space of the profile (despite
+    what the comments said before, there is danger in assuming the app will
+    cope correctly with an RGB profile on a grayscale image and, since it
+    violates the PNG spec, allowing it is certain to produce inconsistent
+    app behavior and might even cause app crashes.) Check that profiles
+    contain the tags needed to process the PNG (tags all required by the ICC
+    spec). Removed unused PNG_STATIC from pngpriv.h.
+  Fixed the simplified API example programs and improved the error message
+    if the version field is not set.
+  Updated simplified API synopses and description of the png_image structure
+    in the manual.
+  Made makepng and pngtest produce identical PNGs, add "--relaxed" option
+    to pngtest. The "--relaxed" option turns off the benign errors that are
+    enabled by default in pre-RC builds. makepng can now write ICC profiles
+    where the length has not been extended to a multiple of 4, and pngtest
+    now intercepts all libpng errors, allowing the previously-introduced
+    "--strict test" on no warnings to actually work.
+  Added a work around for GCC 4.2 optimization bug.
+  Marked the broken (bad white point) original HP sRGB profiles correctly and
+    correct comments.
   Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7
-  Warn about the incorrect runtime library setting for VS2010 debug DLL builds.
+  Use /MDd for vstudio debug builds. Also added pngunkown to the vstudio
+    builds, fixed build errors and corrected a minor exit code error in
+    pngvalid if the 'touch' file name is invalid.
+  Add updated WARNING file to projects/vstudio from libpng 1.5/vstudio
   Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in
     pngrtran.c (Domani Hannes).
-  Check for png_ptr==NULL earlier in png_zalloc().
-  Ignore, with a warning, out-of-range value of num_trans in png_set_tRNS().
-  Rearranged building of ARM NEON optimizations. The ARM specific code is
-    split out entirely to the arm subdirectory and changes to configure.ac and
-    Makefile.am to add new stuff are reduced.  Now material code changes,
-    although for build test purposes, --enable-arm-neon now builds on non-ARM
-    systems.
-  Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.12.5.
+  Made pngvalid so that it will build outside the libpng source tree.
+  Made PNG_NO_READ_GAMMA switch off interfaces that depend on READ_GAMMA.
+    Prior to 1.6.0 switching off READ_GAMMA did unpredictable things to the
+    interfaces that use it (specifically, png_do_background in 1.4 would
+    simply display composite for grayscale images but do composition
+    with the incorrect arithmetic for color ones). In 1.6 the semantic
+    of -DPNG_NO_READ_GAMMA is changed to simply disable any interface that
+    depends on it; this obliges people who set it to consider whether they
+    really want it off if they happen to use any of the interfaces in
+    question (typically most users who disable it won't).
+  Added the ability for contrib/libtests/makepng.c to make a PNG with just one
+    color. This is useful for debugging pngstest color inaccuracy reports.
+  Made png_user_version_check() ok to use with libpng version 1.10.x and later.
+  Fixed typo in png.c (PNG_SET_CHUNK_MALLOC_MAX should be PNG_CHUNK_MALLOC_MAX)
+    that causes the MALLOC_MAX limit not to work (John Bowler)
+  Change png_warning() to png_app_error() in pngwrite.c and comment the
+    fall-through condition.
+  Change png_warning() to png_app_warning() in png_write_tRNS().
+  Rearranged the ARM-NEON optimizations: Isolated the machine specific code
+    to the hardware subdirectory and added comments to pngrutil.c so that
+    implementors of other optimizations know what to do.
   Fixed cases of unquoted DESTDIR in Makefile.am
-  Fixed a minor bug in types to malloc and major bug in handling compressed
-    iTXt. Compressed iTXt could not be handled.
   Cleaned up whitespace in the synopsis portion of the manpage "libpng.3"
   Disassembled the version number in scripts/options.awk (necessary for
     building on SunOs).
+  Made default Zlib compression settings be configurable. This adds #defines to
+    pnglibconf.h to control the defaults.
   Fixed Windows build issues, enabled ARM compilation. Various warnings issued
     by earlier versions of GCC fixed for Cygwin and Min/GW (which both use old
     GCCs.) ARM support is enabled by default in zlib.props (unsupported by
     Microsoft) and ARM compilation is made possible by deleting the check for
     x86. The test programs cannot be run because they are not signed.
+  Discontinued distributing libpng-1.x.x.tar.bz2.
+  Discontinued distributing libpng-1.7.0-1.6.0-diff.txt and similar.
+  Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.12.5.
   Fixed 'make distcheck' on SUN OS - libpng.so was not being removed
-  Replaced AM_CONFIG_HEADER(config.h) with AC_CONFIG_HEADERS([config.h])
-    in configure.ac
-  De-configured build fixes to make a range of deconfiguration options (such
-    as switching off read or write support) work in more cases.  Also upgraded
-    pngtest and pngvalid to the libpng 1.6 versions (with some modifications)
-    which provide more extensive testing.  Replaced pngtest.png because pngtest
-    writes the ancillary chunks in a different order.
-  Check validity of "num_unknowns" parameter of png_set_unknown_chunks()
-    (Bug report from yuris).
-  Revised test for validity of "num_unknowns" to eliminate compiler warnings.
-  Check the validity of the "nentries" parameter of png_set_sPLT() and the
-  "num_text" parameter of png_set_text_2().
-
-  ===========================================================================
-                       NOTICE November 17, 2012:
-     The location of the git repository at SourceForge has changed.
-               Visit http://libpng.sf.net/ for details.
-  ===========================================================================
+  Fixed conceivable but difficult to repro overflow. Also added two test
+    programs to generate and test a PNG which should have the problem.
+  Added overflow detection in png_set_sPLT() and png_set_text_2().
+  Use consistent handling of overflows in text, sPLT and unknown png_set_* APIs
+  Added png_get_palette_max() function.
+  Fixed missing dependency in --prefix builds The intermediate
+    internal 'prefix.h' file can only be generated correctly after
+    pnglibconf.h, however the dependency was not in Makefile.am.  The
+    symptoms are unpredictable depending on the order make chooses to
+    build pngprefix.h and pnglibconf.h, often the error goes unnoticed
+    because there is a system pnglibconf.h to use instead.
+  Enclosed the new png_get_palette_max in #ifdef PNG_GET_PALETTE_MAX_SUPPORTED
+    block, and revised pnglibconf.h and pnglibconf.h.prebuilt accordingly.
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
index 2b56071e2d1d1544241173e2c03766d526c908be..b7e8cca519460aa0d8566382ca5f28665d7d83c9 100644 (file)
@@ -3775,219 +3775,611 @@ Version 1.5.7rc03 [December 7, 2011]
 Version 1.5.7 [December 15, 2011]
   Minor fixes to pngvalid.c for gcc 4.6.2 compatibility to remove warnings
     reported by earlier versions.
-
-Version 1.5.8beta01 [January 15, 2011]
-  Removed '#include config.h"' from contrib/libtests/pngvalid.c.  It's not
-    needed and causes trouble for VPATH building.
+  Fixed minor memset/sizeof errors in pngvalid.c.
+
+Version 1.6.0beta01 [December 15, 2011]
+  Removed machine-generated configure files from the GIT repository (they will
+    continue to appear in the tarball distributions and in the libpng15 and
+    earlier GIT branches).
+  Restored the new 'simplified' API, which was started in libpng-1.5.7beta02
+    but later deleted from libpng-1.5.7beta05.
+  Added example programs for the new 'simplified' API.
+  Added ANSI-C (C90) headers and require them, and take advantage of the
+    change. Also fixed some of the projects/* and contrib/* files that needed
+    updates for libpng16 and the move of pngvalid.c.
+    With this change the required ANSI-C header files are assumed to exist: the
+    implementation must provide float.h, limits.h, stdarg.h and stddef.h and
+    libpng relies on limits.h and stddef.h existing and behaving as defined
+    (the other two required headers aren't used).  Non-ANSI systems that don't
+    have stddef.h or limits.h will have to provide an appropriate fake
+    containing the relevant types and #defines.
+  The use of FAR/far has been eliminated and the definition of png_alloc_size_t
+    is now controlled by a flag so that 'small size_t' systems can select it
+    if necessary.  Libpng 1.6 may not currently work on such systems -- it
+    seems likely that it will ask 'malloc' for more than 65535 bytes with any
+    image that has a sufficiently large row size (rather than simply failing
+    to read such images).
+  New tools directory containing tools used to generate libpng code.
+  Fixed race conditions in parallel make builds. With higher degrees of
+    parallelism during 'make' the use of the same temporary file names such
+    as 'dfn*' can result in a race where a temporary file from one arm of the
+    build is deleted or overwritten in another arm.  This changes the
+    temporary files for suffix rules to always use $* and ensures that the
+    non-suffix rules use unique file names.
+
+Version 1.6.0beta02 [December 21, 2011]
+  Correct configure builds where build and source directories are separate.
+    The include path of 'config.h' was erroneously made relative in pngvalid.c
+    in libpng 1.5.7.
+
+Version 1.6.0beta03 [December 22, 2011]
+  Start-up code size improvements, error handler flexibility. These changes
+    alter how the tricky allocation of the initial png_struct and png_info
+    structures are handled. png_info is now handled in pretty much the same
+    way as everything else, except that the allocations handle NULL return
+    silently.  png_struct is changed in a similar way on allocation and on
+    deallocation a 'safety' error handler is put in place (which should never
+    be required).  The error handler itself is changed to permit mismatches
+    in the application and libpng error buffer size; however, this means a
+    silent change to the API to return the jmp_buf if the size doesn't match
+    the size from the libpng compilation; libpng now allocates the memory and
+    this may fail.  Overall these changes result in slight code size
+    reductions; however, this is a reduction in code that is always executed
+    so is particularly valuable.  Overall on a 64-bit system the libpng DLL
+    decreases in code size by 1733 bytes.  pngerror.o increases in size by
+    about 465 bytes because of the new functionality.
+  Added png_convert_to_rfc1123_buffer() and deprecated png_convert_to_rfc1123()
+    to avoid including a spurious buffer in the png_struct.
+
+Version 1.6.0beta04 [December 30, 2011]
+  Regenerated configure scripts with automake-1.11.2
+  Eliminated png_info_destroy(). It is now used only in png.c and only calls
+    one other internal function and memset().
+  Enabled png_get_sCAL_fixed() if floating point APIs are enabled. Previously
+    it was disabled whenever internal fixed point arithmetic was selected,
+    which meant it didn't exist even on systems where FP was available but not
+    preferred.
+  Added pngvalid.c compile time checks for const APIs.
+  Implemented 'restrict' for png_info and png_struct. Because of the way
+    libpng works both png_info and png_struct are always accessed via a
+    single pointer.  This means adding C99 'restrict' to the pointer gives
+    the compiler some opportunity to optimize the code.  This change allows
+    that.
   Moved AC_MSG_CHECKING([if libraries can be versioned]) later to the proper
     location in configure.ac (Gilles Espinasse).
+  Changed png_memcpy to C assignment where appropriate. Changed all those
+    uses of png_memcpy that were doing a simple assignment to assignments
+    (all those cases where the thing being copied is a non-array C L-value).
+  Added some error checking to png_set_*() routines.
+  Removed the reference to the non-exported function png_memcpy() from
+    example.c.
+  Fixed the Visual C 64-bit build - it requires jmp_buf to be aligned, but
+    it had become misaligned.
+  Revised contrib/pngminus/pnm2png.c to avoid warnings when png_uint_32
+    and unsigned long are of different sizes.
+
+Version 1.6.0beta05 [January 15, 2012]
+  Updated manual with description of the simplified API (copied from png.h)
   Fix bug in pngerror.c: some long warnings were being improperly truncated
     (CVE-2011-3464, bug introduced in libpng-1.5.3beta05).
 
-Version 1.5.8rc01 [January 21, 2012]
-  No changes.
-
-Version 1.5.8rc02 [January 25, 2012]
+Version 1.6.0beta06 [January 24, 2012]
+  Added palette support to the simplified APIs. This commit
+    changes some of the macro definitions in png.h, app code
+    may need corresponding changes.
+  Increased the formatted warning buffer to 192 bytes.
+  Added color-map support to simplified API. This is an initial version for
+    review; the documentation has not yet been updated.
   Fixed Min/GW uninstall to remove libpng.dll.a
-  Conditionalize the install rules for MINGW and CYGWIN in CMakeLists.txt
-
-Version 1.5.8 [February 1, 2012]
-  No changes.
 
-Version 1.5.9beta01 [February 3, 2012]
-  Rebuilt configure scripts in the tar distributions.
+Version 1.6.0beta07 [January 28, 2012]
+  Eliminated Intel icc/icl compiler warnings. The Intel (GCC derived)
+    compiler issues slightly different warnings from those issued by the
+    current vesions of GCC. This eliminates those warnings by
+    adding/removing casts and small code rewrites.
+  Updated configure.ac from autoupdate: added --enable-werror option.
+    Also some layout regularization and removal of introduced tab characters
+    (replaced with 3-character indentation).  Obsolete macros identified by
+    autoupdate have been removed; the replacements are all in 2.59 so
+    the pre-req hasn't been changed.  --enable-werror checks for support
+    for -Werror (or the given argument) in the compiler.  This mimics the
+    gcc configure option by allowing -Werror to be turned on safely; without
+    the option the tests written in configure itself fail compilation because
+    they cause compiler warnings.
+  Rewrote autogen.sh to run autoreconf instead of running tools one-by-one.
+  Conditionalize the install rules for MINGW and CYGWIN in CMakeLists.txt and
+    set CMAKE_LIBRARY_OUTPUT_DIRECTORY to "lib" on all platforms (C. Yapp).
+  Freeze libtool files in the 'scripts' directory. This version of autogen.sh
+    attempts to dissuade people from running it when it is not, or should not,
+    be necessary.  In fact, autogen.sh does not work when run in a libpng
+    directory extracted from a tar distribution anymore. You must run it in
+    a GIT clone instead.
+  Added two images to contrib/pngsuite (1-bit and 2-bit transparent grayscale),
+    and renamed three whose names were inconsistent with those in
+    pngsuite/README.txt.
 
-Version 1.5.9beta02 [February 16, 2012]
-  Removed two unused definitions from scripts/pnglibconf.h.prebuilt
+Version 1.6.0beta08 [February 1, 2012]
+  Fixed Image::colormap misalignment in pngstest.c
+  Check libtool/libtoolize version number (2.4.2) in configure.ac
+  Divide test-pngstest.sh into separate pngstest runs for basic and
+    transparent images.
+  Moved automake options to AM_INIT_AUTOMAKE in configure.ac
+  Added color-tests, silent-rules (Not yet implemented in Makefile.am) and
+    version checking to configure.ac
+  Improved pngstest speed by not doing redundant tests and add const to
+    the background parameter of png_image_finish_read. The --background
+    option is now done automagically only when required, so that commandline
+    option no longer exists.
+  Cleaned up pngpriv.h to consistently declare all functions and data.
+    Also eliminated PNG_CONST_DATA, which is apparently not needed but we
+    can't be sure until it is gone.
+  Added symbol prefixing that allows all the libpng external symbols
+    to be prefixed (suggested by Reuben Hawkins).
+  Updated "ftbb*.png" list in the owatcom and vstudio projects.
+  Fixed 'prefix' builds on clean systems. The generation of pngprefix.h
+    should not require itself.
+  Updated INSTALL to explain that autogen.sh must be run in a GIT clone,
+    not in a libpng directory extracted from a tar distribution.
+
+Version 1.6.0beta09 [February 1, 2012]
+  Reverted the prebuilt configure files to libpng-1.6.0beta05 condition.
+
+Version 1.6.0beta10 [February 3, 2012]
+  Added Z_SOLO for zlib-1.2.6+ and correct pngstest tests
+  Updated list of test images in CMakeLists.txt
+  Updated the prebuilt configure files to current condition.
+  Revised INSTALL information about autogen.sh; it works in tar distributions.
+
+Version 1.6.0beta11 [February 16, 2012]
+  Fix character count in pngstest command in projects/owatcom/pngstest.tgt
+  Revised test-pngstest.sh to report PASS/FAIL for each image.
+  Updated documentation about the simplified API.
+  Corrected estimate of error in libpng png_set_rgb_to_gray API.  The API is
+    extremely inaccurate for sRGB conversions because it uses an 8-bit
+    intermediate linear value and it does not use the sRGB transform, so it
+    suffers from the known instability in gamma transforms for values close
+    to 0 (see Poynton).  The net result is that the calculation has a maximum
+    error of 14.99/255; 0.5/255^(1/2.2).  pngstest now uses 15 for the
+    permitted 8-bit error. This may still not be enough because of arithmetic
+    error.
   Removed some unused arrays (with #ifdef) from png_read_push_finish_row().
+  Fixed a memory overwrite bug in simplified read of RGB PNG with
+    non-linear gamma Also bugs in the error checking in pngread.c and changed
+    quite a lot of the checks in pngstest.c to be correct; either correctly
+    written or not over-optimistic.  The pngstest changes are insufficient to
+    allow all possible RGB transforms to be passed; pngstest cmppixel needs
+    to be rewritten to make it clearer which errors it allows and then changed
+    to permit known inaccuracies.
   Removed tests for no-longer-used *_EMPTY_PLTE_SUPPORTED from pngstruct.h
-
-Version 1.5.9rc01 [February 17, 2012]
+  Fixed fixed/float API export conditionals. 1) If FIXED_POINT or
+    FLOATING_POINT options were switched off, png.h ended up with lone ';'
+    characters.  This is not valid ANSI-C outside a function.  The ';'
+    characters have been moved inside the definition of PNG_FP_EXPORT and
+    PNG_FIXED_EXPORT. 2) If either option was switched off, the declaration
+    of the corresponding functions were completely omitted, even though some
+    of them are still used internally.  The result is still valid, but
+    produces warnings from gcc with some warning options (including -Wall). The
+    fix is to cause png.h to declare the functions with PNG_INTERNAL_FUNCTION
+    when png.h is included from pngpriv.h.
+  Check for invalid palette index while reading paletted PNG.  When one is
+    found, issue a warning and increase png_ptr->num_palette accordingly.
+    Apps are responsible for checking to see if that happened.
+
+Version 1.6.0beta12 [February 18, 2012]
+  Do not increase num_palette on invalid_index.
+  Relocated check for invalid palette index to pngrtran.c, after unpacking
+    the sub-8-bit pixels.
   Fixed CVE-2011-3026 buffer overrun bug.  This bug was introduced when
     iCCP chunk support was added at libpng-1.0.6. Deal more correctly with the
     test on iCCP chunk length. Also removed spurious casts that may hide
     problems on 16-bit systems.
 
-Version 1.5.9 [February 18, 2012]
-  No changes.
-
-Version 1.5.10beta01 [February 24, 2012]
-  Removed two useless #ifdef directives from pngread.c and one from pngrutil.c
-  Always put the CMAKE_LIBRARY in "lib" (removed special WIN32 case).
-  Removed empty vstudio/pngstest directory (Clifford Yapp).
+Version 1.6.0beta13 [February 24, 2012]
   Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
     pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c;
     now that png_ptr->buffer is inaccessible to applications, the special
     handling is no longer useful.
-  Fixed bug with png_handle_hIST with odd chunk length (Frank Busse).
-  Added PNG_SAFE_LIMITS feature to pnglibconf.dfa and code in pngconf.h
-    to reset the user limits to safe ones if PNG_SAFE_LIMITS is defined.
-    To enable, use "CPPFLAGS=-DPNG_SAFE_LIMITS_SUPPORTED" on the configure
-    command or put "#define PNG_SAFE_LIMITS_SUPPORTED" in pnglibconf.h.
-  Revised the SAFE_LIMITS feature to be the same as the feature in libpng16.
-  Added information about the new limits in the manual.
+  Added PNG_SAFE_LIMITS feature to pnglibconf.dfa, pngpriv.h, and new
+    pngusr.dfa to reset the user limits to safe ones if PNG_SAFE_LIMITS is
+    defined.  To enable, use "CPPFLAGS=-DPNG_SAFE_LIMITS_SUPPORTED=1" on the
+    configure command or put #define PNG_SAFE_LIMITS_SUPPORTED in
+    pnglibconf.h.prebuilt and pnglibconf.h.
 
-Version 1.5.10beta02 [February 27, 2012]
+Version 1.6.0beta14 [February 27, 2012]
+  Added information about the new limits in the manual.
   Updated Makefile.in
 
-Version 1.5.10beta03 [March 6, 2012]
+Version 1.6.0beta15 [March 2, 2012]
   Removed unused "current_text" members of png_struct and the png_free()
     of png_ptr->current_text from pngread.c
-  Added palette-index checking. Issue a png_warning() if an invalid index is
-    found.
-
-Version 1.5.10beta04 [March 10, 2012]
-  Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
-  Fixed CMF optimization of non-IDAT compressed chunks, which was added at
-    libpng-1.5.4.  It sometimes produced too small of a window.
-
-Version 1.5.10beta05 [March 10, 2012]
+  Rewrote pngstest.c for substantial speed improvement.
+  Fixed transparent pixel and 16-bit rgb tests in pngstest and removed a
+    spurious check in pngwrite.c
+  Added PNG_IMAGE_FLAG_FAST for the benefit of applications that store
+    intermediate files, or intermediate in-memory data, while processing
+    image data with the simplified API.  The option makes the files larger
+    but faster to write and read.  pngstest now uses this by default; this
+    can be disabled with the --slow option.
+  Improved pngstest fine tuning of error numbers, new test file generator.
+    The generator generates images that test the full range of sample values,
+    allow the error numbers in pngstest to be tuned and checked.  makepng
+    also allows generation of images with extra chunks, although this is
+    still work-in-progress.
+  Added check for invalid palette index while reading.
+  Fixed some bugs in ICC profile writing. The code should now accept
+    all potentially valid ICC profiles and reject obviously invalid ones.
+    It now uses png_error() to do so rather than casually writing a PNG
+    without the necessary color data.
+  Removed whitespace from the end of lines in all source files and scripts.
+
+Version 1.6.0beta16 [March 6, 2012]
+  Relocated palette-index checking function from pngrutil.c to pngtrans.c
+  Added palette-index checking while writing.
+  Changed png_inflate() and calling routines to avoid overflow problems.
+    This is an intermediate check-in that solves the immediate problems and
+    introduces one performance improvement (avoiding a copy via png_ptr->zbuf.)
+    Further changes will be made to make ICC profile handling more secure.
+  Fixed build warnings (MSVC, GCC, GCC v3). Cygwin GCC with default options
+    declares 'index' as a global, causing a warning if it is used as a local
+    variable.  GCC 64-bit warns about assigning a (size_t) (unsigned 64-bit)
+    to an (int) (signed 32-bit).  MSVC, however, warns about using the
+    unary '-' operator on an unsigned value (even though it is well defined
+    by ANSI-C to be ~x+1).  The padding calculation was changed to use a
+    different method.  Removed the tests on png_ptr->pass.
+  Added contrib/libtests/tarith.c to test internal arithmetic functions from
+    png.c. This is a libpng maintainer program used to validate changes to the
+    internal arithmetic functions.
+  Made read 'inflate' handling like write 'deflate' handling. The read
+    code now claims and releases png_ptr->zstream, like the write code.
+    The bug whereby the progressive reader failed to release the zstream
+    is now fixed, all initialization is delayed, and the code checks for
+    changed parameters on deflate rather than always calling
+    deflatedEnd/deflateInit.
+  Validate the zTXt strings in pngvalid.
+  Added code to validate the windowBits value passed to deflateInit2().
+    If the call to deflateInit2() is wrong a png_warning will be issued
+    (in fact this is harmless, but the PNG data produced may be sub-optimal).
+
+Version 1.6.0beta17 [March 10, 2012]
+  Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition. 
   Reject all iCCP chunks after the first, even if the first one is invalid.
+  Deflate/inflate was reworked to move common zlib calls into single
+    functions [rw]util.c.  A new shared keyword check routine was also added
+    and the 'zbuf' is no longer allocated on progressive read.  It is now
+    possible to call png_inflate() incrementally.
+  If benign errors are disabled use maximum window on ancilliary inflate.
+    This works round a bug introduced in 1.5.4 where compressed ancillary
+    chunks could end up with a too-small windowBits value in the deflate
+    header.
+
+Version 1.6.0beta18 [March 16, 2012]
   Issue a png_benign_error() instead of png_warning() about bad palette index.
+  In pngtest, treat benign errors as errors if "-strict" is present.
   Fixed an off-by-one error in the palette index checking function.
+  Fixed a compiler warning under Cygwin (Windows-7, 32-bit system)
   Revised example.c to put text strings in a temporary character array
     instead of directly assigning string constants to png_textp members.
     This avoids compiler warnings when -Wwrite-strings is enabled.
-
-Version 1.5.10 [March 29, 2012]
+  Added output flushing to aid debugging under Visual Studio. Unfortunately
+    this is necessary because the VS2010 output window otherwise simply loses
+    the error messages on error (they weren't flushed to the window before
+    the process exited, apparently!)
+  Added configuration support for benign errors and changed the read
+    default. Also changed some warnings in the iCCP and sRGB handling
+    from to benign errors. Configuration now makes read benign
+    errors warnings and write benign errors to errors by default (thus
+    changing the behavior on read).  The simplified API always forces
+    read benign errors to warnings (regardless of the system default, unless
+    this is disabled in which case the simplified API can't be built.)
+
+Version 1.6.0beta19 [March 18, 2012]
+  Work around for duplicate row start calls; added warning messages.
+    This turns on PNG_FLAG_DETECT_UNINITIALIZED to detect app code that
+    fails to call one of the 'start' routines (not enabled in libpng-1.5
+    because it is technically an API change, since it did normally work
+    before.)  It also makes duplicate calls to png_read_start_row (an
+    internal function called at the start of the image read) benign, as
+    they were before changes to use png_inflate_claim. Somehow webkit is
+    causing this to happen; this is probably a mis-feature in the zlib
+    changes so this commit is only a work-round.
+  Removed erroneous setting of DETECT_UNINITIALIZED and added more
+    checks. The code now does a png_error if an attempt is made to do the
+    row initialization twice; this is an application error and it has
+    serious consequences because the transform data in png_struct is
+    changed by each call.
+  Added application error reporting and added chunk names to read
+    benign errors; also added --strict to pngstest - not enabled
+    yet because a warning is produced.
+  Avoid the double gamma correction warning in the simplified API.
+    This allows the --strict option to pass in the pngstest checks
+
+Version 1.6.0beta20 [March 29, 2012]
+  Changed chunk handler warnings into benign errors, incrementally load iCCP
+  Added checksum-icc.c to contrib/tools
   Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
+  Recognize known sRGB ICC profiles while reading; prefer writing the
+    iCCP profile over writing the sRGB chunk, controlled by the
+    PNG_sRGB_PROFILE_CHECKS option.
   Revised png_set_text_2() to avoid potential memory corruption (fixes
     CVE-2011-3048, also known as CVE-2012-3425).
 
-Version 1.5.11beta01 [April 28, 2012]
+Version 1.6.0beta21 [April 27, 2012]
   Revised scripts/makefile.darwin: use system zlib; remove quotes around
     architecture list; add missing ppc architecture; add architecture options
     to shared library link; don't try to create a shared lib based on missing
     RELEASE variable.
   Enable png_set_check_for_invalid_index() for both read and write.
-  Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED/#endif in pngpriv.h around
+  Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpriv.h around
     declaration of png_handle_unknown().
   Added -lssp_nonshared in a comment in scripts/makefile.freebsd
     and changed deprecated NOOBJ and NOPROFILE to NO_OBJ and NO_PROFILE.
 
-Version 1.5.11rc01 [May 23, 2012]
-  No changes.
+Version 1.6.0beta22 [May 23, 2012]
+  Removed need for -Wno-cast-align with clang.  clang correctly warns on
+    alignment increasing pointer casts when -Wcast-align is passed. This
+    fixes the cases that clang warns about either by eliminating the
+    casts from png_bytep to png_uint_16p (pngread.c), or, for pngrutil.c
+    where the cast is previously verified or pngstest.c where it is OK, by
+    introducing new png_aligncast macros to do the cast in a way that clang
+    accepts.
 
-Version 1.5.11rc02 [May 29, 2012]
-  Fixed some typos in comments.
+Version 1.6.0beta23 [June 6, 2012]
   Revised CMakeLists.txt to not attempt to make a symlink under mingw.
-  Added two images to contrib/pngsuite (1-bit and 2-bit transparent grayscale),
-    and renamed three whose names were inconsistent with those in
-    pngsuite/README.txt.
-
-Version 1.5.11rc03 [June 4, 2012]
-  Do not depend upon a GCC feature macro being available for use in generating
-    the linker mapfile symbol prefix.
   Made fixes for new optimization warnings from gcc 4.7.0. The compiler
-    performed an optimization which is safe but then warned about it.
+    performs an optimization which is safe; however it then warns about it.
     Changing the type of 'palette_number' in pngvalid.c removes the warning.
+  Do not depend upon a GCC feature macro being available for use in generating
+    the linker mapfile symbol prefix.
+  Improved performance of new do_check_palette_indexes() function (only
+    update the value when it actually increases, move test for whether
+    the check is wanted out of the function.
 
-Version 1.5.11rc04 [June 6, 2012]
-  Improved performance of new do_check_palette_indexes() function.
-
-Version 1.5.11rc05 [June 7, 2012]
+Version 1.6.0beta24 [June 7, 2012]
   Don't check palette indexes if num_palette is 0 (as it can be in MNG files).
 
-Version 1.5.11 [June 14, 2012]
-  Include zlib.h in contrib/gregbook and contrib/visupng examples.
+Version 1.6.0beta25 [June 16, 2012]
+  Revised png_set_keep_unknown_chunks() so num_chunks < 0 means ignore all
+    unknown chunks and all known chunks except for IHDR, PLTE, tRNS, IDAT,
+    and IEND.  Previously it only meant ignore all unknown chunks, the
+    same as num_chunks == 0. Revised png_image_skip_unused_chunks() to
+    provide a list of chunks to be processed instead of a list of chunks to
+    ignore.  Revised contrib/gregbook/readpng2.c accordingly.
 
-Version 1.5.12 [July 11, 2012]
+Version 1.6.0beta26 [July 10, 2012]
   Removed scripts/makefile.cegcc from the *.zip and *.7z distributions; it
     depends on configure, which is not included in those archives.
+  Moved scripts/chkfmt to contrib/tools.
   Changed "a+w" to "u+w" in Makefile.in to fix CVE-2012-3386.
 
-Version 1.5.13beta01 [August 8, 2012]
+Version 1.6.0beta27 [August 11, 2012]
   Do not compile PNG_DEPRECATED, PNG_ALLOC and PNG_PRIVATE when __GNUC__ < 3.
+  Do not use __restrict when GNUC is <= 3.1
   Removed references to png_zalloc() and png_zfree() from the manual.
-  Revised PNG_FP_EXPORT and PNG_FIXED_EXPORT macros to avoid generating
-    lone semicolons (patch ported from libpng-1.6.0beta11).
-
-Version 1.5.13beta02 [September 10, 2012]
-  Corrected handling of the image array and the row_pointers array in example.c
-  When png_set_filler is used to strip a filler channel during write, the
-    code prior to 1.5 would ignore the case where the output required an
-    alpha channel or when the output was a palettized PNG.  In libpng-1.5 the
-    ignorance was lost and libpng proceeded to strip the channel resulting
-    in a bad (potential memory overwrite) failure later.  This reverts
-    the behavior to the pre-1.5 state but issues a warning. libpng-1.6 is
-    expected to issue an error on the erroneous png_set_filler call.
-  Use png_memset() consistently (pngmem.c contained some bare "memset" calls).
-
-Version 1.5.13rc01 [September 17, 2012]
-  No changes.
-
-Version 1.5.13 [September 27, 2012]
-  No changes.
-
-Version 1.5.14beta01 [October 24, 2012]
+  Fixed configurations where floating point is completely disabled.  Because
+    of the changes to support symbol prefixing PNG_INTERNAL_FUNCTION declares
+    floating point APIs during libpng builds even if they are completely
+    disabled. This requires the png floating point types (png_double*) to be
+    declared even though the functions are never actually defined.  This
+    change provides a dummy definition so that the declarations work, yet any
+    implementation will fail to compile because of an incomplete type.
+  Re-eliminated the use of strcpy() in pngtest.c.  An unncessary use of
+    strcpy() was accidentally re-introduced in libpng16; this change replaces
+    it with strncpy().
+  Eliminated use of png_sizeof(); use sizeof() instead.
+  Use a consistent style for (sizeof type) and (sizeof (array))
+  Cleanup of png_set_filler().  This function does very different things on
+    read and write.  In libpng 1.6 the two cases can be distinguished and
+    considerable code cleanup, and extra error checking, is possible.  This
+    makes calls on the write side that have no effect be ignored with a
+    png_app_error(), which can be disabled in the app using
+    png_set_benign_errors(), and removes the spurious use of usr_channels
+    on the read side.
+  Insist on autotools 1.12.1 for git builds because there are security issues
+    with 1.12 and insisting on anything less would allow 1.12 to be used.
+  Removed info_ptr->signature[8] from WRITE-only builds.
+  Add some conditions for compiling png_fixed().  This is a small function
+    but it requires "-lm" on some platforms.
+  Cause pngtest --strict to fail on any warning from libpng (not just errors)
+    and cause it not to fail at the comparison step if libpng lacks support
+    for writing chunks that it reads from the input (currently only implemented
+    for compressed text chunks).
+  Make all three "make check" test programs work without READ or WRITE support.
+    Now "make check" will succeed even if libpng is compiled with -DPNG_NO_READ
+    or -DPNG_NO_WRITE.  The tests performed are reduced, but the basic reading
+    and writing of a PNG file is always tested by one or more of the tests.
+  Consistently use strlen(), memset(), memcpy(), and memcmp() instead of the
+    png_strlen(), png_memset(), png_memcpy(), and png_memcmp() macros.
+  Removed the png_sizeof(), png_strlen(), png_memset(), png_memcpy(), and
+    png_memcmp() macros.
+  Work around gcc 3.x and Microsoft Visual Studio 2010 complaints. Both object
+    to the split initialization of num_chunks.
+
+Version 1.6.0beta28 [August 29, 2012]
+  Unknown handling fixes and clean up. This adds more correct option
+    control of the unknown handling, corrects the pre-existing bug where
+    the per-chunk 'keep' setting is ignored and makes it possible to skip
+    IDAT chunks in the sequential reader (broken in earlier 1.6 versions).
+    There is a new test program, test-unknown.c, which is a work in progress
+    (not currently part of the test suite).  Comments in the header files now
+    explain how the unknown handling works.
+  Allow fine grain control of unknown chunk APIs. This change allows
+    png_set_keep_unknown_chunks() to be turned off if not required and causes
+    both read and write to behave appropriately (on read this is only possible
+    if the user callback is used to handle unknown chunks).  The change
+    also removes the support for storing unknown chunks in the info_struct
+    if the only unknown handling enabled is via the callback, allowing libpng
+    to be configured with callback reading and none of the unnecessary code.
+  Corrected fix for unknown handling in pngtest. This reinstates the
+    libpng handling of unknown chunks other than vpAg and sTER (including
+    unsafe-to-copy chunks which were dropped before) and eliminates the
+    repositioning of vpAg and sTER in pngtest.png by changing pngtest.png
+    (so the chunks are where libpng would put them).
+  Added "tunknown" test and corrected a logic error in png_handle_unknown()
+    when SAVE support is absent.  Moved the shell test scripts for
+    contrib/libtests from the libpng top directory to contrib/libtests.
+    png_handle_unknown() must always read or skip the chunk, if
+    SAVE_UNKNOWN_CHUNKS is turned off *and* the application does not set
+    a user callback an unknown chunk will not be read, leading to a read
+    error, which was revealed by the "tunknown" test.
+  Cleaned up and corrected ICC profile handling.
+    contrib/libtests/makepng: corrected 'rgb' and 'gray' cases.  profile_error
+    messages could be truncated; made a correct buffer size calculation and
+    adjusted pngerror.c appropriately. png_icc_check_* checking improved;
+    changed the functions to receive the correct color type of the PNG on read
+    or write and check that it matches the color space of the profile (despite
+    what the comments said before, there is danger in assuming the app will
+    cope correctly with an RGB profile on a grayscale image and, since it
+    violates the PNG spec, allowing it is certain to produce inconsistent
+    app behavior and might even cause app crashes.) Check that profiles
+    contain the tags needed to process the PNG (tags all required by the ICC
+    spec). Removed unused PNG_STATIC from pngpriv.h.
+
+Version 1.6.0beta29 [September 4, 2012]
+  Fixed the simplified API example programs to add the *colormap parameter
+    to several of he API and improved the error message if the version field
+    is not set.
+  Added contrib/examples/* to the *.zip and *.7z distributions.
+  Updated simplified API synopses and description of the png_image structure
+    in the manual.
+  Made makepng and pngtest produce identical PNGs, add "--relaxed" option
+    to pngtest. The "--relaxed" option turns off the benign errors that are
+    enabled by default in pre-RC builds. makepng can now write ICC profiles
+    where the length has not been extended to a multiple of 4, and pngtest
+    now intercepts all libpng errors, allowing the previously-introduced
+    "--strict test" on no warnings to actually work.
+  Improved ICC profile handling including cHRM chunk generation and fixed
+    Cygwin+MSVC build errors. The ICC profile handling now includes more
+    checking.  Several errors that caused rejection of the profile are now
+    handled with a warning in such a way that the invalid profiles will be
+    read by default in release (but not pre-RC) builds but will not be
+    written by default.  The easy part of handling the cHRM chunk is written,
+    where the ICC profile contains the required data.  The more difficult
+    part plus guessing a gAMA value requires code to pass selected RGB values
+    through the profile.
+
+Version 1.6.0beta30 [October 24, 2012]
+  Changed ICC profile matrix/vector types to not depend on array type rules.
+    By the ANSI-C standard the new types should be identical to the previous
+    versions, and all known versions of gcc tested with the previous versions
+    except for GCC-4.2.1 work with this version.  The change makes the ANSI-C
+    rule that const applied to an array of elements applies instead to the
+    elements in the array moot by explicitly applying const to the base
+    elements of the png_icc_matrix and png_icc_vector types. The accidental
+    (harmless) 'const' previously applied to the parameters of two of the
+    functions have also been removed.
+  Added a work around for GCC 4.2 optimization bug.
+  Marked the broken (bad white point) original HP sRGB profiles correctly and
+    correct comments.
   Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7
-  Warn about the incorrect runtime library setting for VS2010 debug DLL builds.
+  Use /MDd for vstudio debug builds. Also added pngunkown to the vstudio
+    builds, fixed build errors and corrected a minor exit code error in
+    pngvalid if the 'touch' file name is invalid.
+  Add updated WARNING file to projects/vstudio from libpng 1.5/vstudio
   Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in
     pngrtran.c (Domani Hannes).
 
-Version 1.5.14beta02 [omitted]
-
-Version 1.5.14beta03 [December 15, 2012]
-  Added missing "-" in front of DNO_GZIP in contrib/pngminim/*/makefile.
-  Check for png_ptr==NULL earlier in png_zalloc().
-  Ignore, with a warning, out-of-range value of num_trans in png_set_tRNS().
-  Rearranged building of ARM NEON optimizations. The ARM specific code is
-    split out entirely to the arm subdirectory and changes to configure.ac and
-    Makefile.am to add new stuff are reduced.  Now material code changes,
-    although for build test purposes, --enable-arm-neon now builds on non-ARM
-    systems.
-  Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.12.5.
+Version 1.6.0beta31 [November 1, 2012]
+  Undid the erroneous change to vstudio/pngvalid build in libpng-1.6.0beta30.
+  Made pngvalid so that it will build outside the libpng source tree.
+  Made builds -DPNG_NO_READ_GAMMA compile (the unit tests still fail).
+  Made PNG_NO_READ_GAMMA switch off interfaces that depend on READ_GAMMA.
+    Prior to 1.6.0 switching off READ_GAMMA did unpredictable things to the
+    interfaces that use it (specifically, png_do_background in 1.4 would
+    simply display composite for grayscale images but do composition
+    with the incorrect arithmetic for color ones). In 1.6 the semantic
+    of -DPNG_NO_READ_GAMMA is changed to simply disable any interface that
+    depends on it; this obliges people who set it to consider whether they
+    really want it off if they happen to use any of the interfaces in
+    question (typically most users who disable it won't).
+  Fixed GUIDs in projects/vstudio. Some were duplicated or missing,
+    resulting in VS2010 having to update the files.
+  Removed non-working ICC profile support code that was mostly added to
+    libpng-1.6.0beta29 and beta30. There was too much code for too little
+    gain; implementing full ICC color correction may be desireable but is left
+    up to applications.
+
+Version 1.6.0beta32 [November 25, 2012]
+  Fixed an intermittent SEGV in pngstest due to an uninitialized array element.
+  Added the ability for contrib/libtests/makepng.c to make a PNG with just one
+    color. This is useful for debugging pngstest color inaccuracy reports.
+  Fixed error checking in the simplified write API (Olaf van der Spek)
+  Made png_user_version_check() ok to use with libpng version 1.10.x and later.
+
+Version 1.6.0beta33 [December 15, 2012]
+  Fixed typo in png.c (PNG_SET_CHUNK_MALLOC_MAX should be PNG_CHUNK_MALLOC_MAX)
+    that causes the MALLOC_MAX limit not to work (John Bowler)
+  Change png_warning() to png_app_error() in pngwrite.c and comment the
+    fall-through condition.
+  Change png_warning() to png_app_warning() in png_write_tRNS().
+  Rearranged the ARM-NEON optimizations: Isolated the machine specific code
+    to the hardware subdirectory and added comments to pngrutil.c so that
+    implementors of other optimizations know what to do.
   Fixed cases of unquoted DESTDIR in Makefile.am
-  Fixed a minor bug in types to malloc and major bug in handling compressed
-    iTXt. Compressed iTXt could not be handled.
+  Rebuilt Makefile.in, etc., with autoconf-2.69 and automake-1.12.5.
 
-Version 1.5.14beta04 [December 19, 2012]
+Version 1.6.0beta34 [December 19, 2012]
   Cleaned up whitespace in the synopsis portion of the manpage "libpng.3"
   Disassembled the version number in scripts/options.awk (necessary for
     building on SunOs).
 
-Version 1.5.14beta05 [December 23, 2012]
+Version 1.6.0beta35 [December 23, 2012]
+  Made default Zlib compression settings be configurable. This adds #defines to
+    pnglibconf.h to control the defaults.
   Fixed Windows build issues, enabled ARM compilation. Various warnings issued
     by earlier versions of GCC fixed for Cygwin and Min/GW (which both use old
     GCCs.) ARM support is enabled by default in zlib.props (unsupported by
     Microsoft) and ARM compilation is made possible by deleting the check for
     x86. The test programs cannot be run because they are not signed.
 
-Version 1.5.14beta06 [January 1, 2013]
-  Discontinued distributing libpng-1.5.14-1.5.13-diff.txt and similar.
+Version 1.6.0beta36 [January 2, 2013]
+  Discontinued distributing libpng-1.x.x.tar.bz2.
+  Discontinued distributing libpng-1.7.0-1.6.0-diff.txt and similar.
+  Rebuilt configure with autoconf-2.69 (inadvertently not done in beta33)
   Fixed 'make distcheck' on SUN OS - libpng.so was not being removed
 
-Version 1.5.14beta07 [January 6, 2012]
-  Replaced AM_CONFIG_HEADER(config.h) with AC_CONFIG_HEADERS([config.h])
-    in configure.ac
-  De-configured build fixes to make a range of deconfiguration options (such
-    as switching off read or write support) work in more cases.  Also upgraded
-    pngtest and pngvalid to the libpng 1.6 versions (with some modifications)
-    which provide more extensive testing.  Replaced pngtest.png because pngtest
-    writes the ancillary chunks in a different order.
+Version 1.6.0beta37 [January 10, 2013]
+  Fixed conceivable but difficult to repro overflow. Also added two test
+    programs to generate and test a PNG which should have the problem.
 
-Version 1.5.14beta08 [January 10, 2013]
-  Check validity of "num_unknowns" parameter of png_set_unknown_chunks()
-    (Bug report from yuris).
+Version 1.6.0beta39 [January 19, 2013]
+  Again corrected attempt at overflow detection in png_set_unknown_chunks().
+  Added overflow detection in png_set_sPLT() and png_set_text_2().
 
-Version 1.5.14rc01 [January 17, 2013]
+Version 1.6.0beta40 [January 20, 2013]
+  Use consistent handling of overflows in text, sPLT and unknown png_set_* APIs
+
+Version 1.6.0rc01 [January 26, 2013]
   No changes.
 
-Version 1.5.14rc02 [January 17, 2013]
-  Revised test for validity of "num_unknowns" to eliminate compiler warnings.
+Version 1.6.0rc02 [February 4, 2013]
+  Added png_get_palette_max() function.
+
+Version 1.6.0rc03 [February 5, 2013]
+  Fixed the png_get_palette_max API.
 
-Version 1.5.14rc03 [January 18, 2013]
-  Check the validity of the "nentries" parameter of png_set_sPLT() and the
-  "num_text" parameter of png_set_text_2().
+Version 1.6.0rc04 [February 7, 2013]
+  Turn serial tests back on (recently turned off by autotools upgrade).
 
-Version 1.5.14 [January 24, 2013]
-  Removed an obsolete line from the manual.
+Version 1.6.0rc05 [February 8, 2013]
+  Update manual about png_get_palette_max().
 
-  ===========================================================================
-                       NOTICE November 17, 2012:
-     The location of the git repository at SourceForge has changed.
-               Visit http://libpng.sf.net/ for details.
-  ===========================================================================
+Version 1.6.0rc06 [February 9, 2013]
+  Fixed missing dependency in --prefix builds The intermediate
+    internal 'prefix.h' file can only be generated correctly after
+    pnglibconf.h, however the dependency was not in Makefile.am.  The
+    symptoms are unpredictable depending on the order make chooses to
+    build pngprefix.h and pnglibconf.h, often the error goes unnoticed
+    because there is a system pnglibconf.h to use instead.
+
+Version 1.6.0rc07 [February 10, 2013]
+  Enclosed the new png_get_palette_max in #ifdef PNG_GET_PALETTE_MAX_SUPPORTED
+    block, and revised pnglibconf.h and pnglibconf.h.prebuilt accordingly.
+
+Version 1.6.0rc08 [February 10, 2013]
+  Fix typo in png.h #ifdef
+
+Version 1.6.0 [February 14, 2013]
+  No changes.
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
index 486874f496116912583b09ab0fb29a057c8a3575..728a419e319c418312b98b2b5c96723f62e14c8c 100644 (file)
@@ -34,8 +34,8 @@ project(libpng C)
 enable_testing()
 
 set(PNGLIB_MAJOR 1)
-set(PNGLIB_MINOR 5)
-set(PNGLIB_RELEASE 14)
+set(PNGLIB_MINOR 6)
+set(PNGLIB_RELEASE 0)
 set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
 set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
 
@@ -123,10 +123,11 @@ set(pngtest_sources
 set(pngvalid_sources
   contrib/libtests/pngvalid.c
 )
+set(pngstest_sources
+  contrib/libtests/pngstest.c
+)
 # SOME NEEDED DEFINITIONS
 
-add_definitions(-DPNG_CONFIGURE_LIBPNG)
-
 if(MSVC)
   add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
 endif(MSVC)
@@ -172,6 +173,40 @@ if(PNG_TESTS AND PNG_SHARED)
   add_executable(pngvalid ${pngvalid_sources})
   target_link_libraries(pngvalid ${PNG_LIB_NAME})
   add_test(pngvalid ./pngvalid)
+  add_executable(pngstest ${pngstest_sources})
+  target_link_libraries(pngstest ${PNG_LIB_NAME})
+  add_test(pngstest ./pngstest
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn0g01.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn0g02.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn0g04.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn0g08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn0g16.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn2c08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn2c16.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn3p01.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn3p02.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn3p04.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn3p08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn4a08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn4a16.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn6a08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/basn6a16.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbbn0g01.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbbn0g02.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbbn0g04.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbbn2c16.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbbn3p08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbgn2c16.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbgn3p08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbrn2c08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbwn0g16.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbwn3p08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftbyn3p08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftp0n0g08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftp0n2c08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftp0n3p08.png
+    ${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/ftp1n3p08.png
+  )
 endif()
 
 # Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set
@@ -207,7 +242,7 @@ endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
 # we use the same files like ./configure, so we have to set its vars
 # Only do this on Windows for Cygwin - the files don't make much sense outside
 # a UNIX look alike
-if(NOT WIN32 OR CYGWIN OR MINGW) 
+if(NOT WIN32 OR CYGWIN OR MINGW)
   set(prefix      ${CMAKE_INSTALL_PREFIX})
   set(exec_prefix ${CMAKE_INSTALL_PREFIX})
   set(libdir      ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
@@ -225,9 +260,9 @@ endif(NOT WIN32 OR CYGWIN OR MINGW)
 # SET UP LINKS
 if(PNG_SHARED)
   set_target_properties(${PNG_LIB_NAME} PROPERTIES
-#   VERSION 15.${PNGLIB_RELEASE}.1.5.14
-    VERSION 15.${PNGLIB_RELEASE}.0
-    SOVERSION 15
+#   VERSION 16.${PNGLIB_RELEASE}.1.6.0
+    VERSION 16.${PNGLIB_RELEASE}.0
+    SOVERSION 16
     CLEAN_DIRECT_OUTPUT 1)
 endif()
 if(PNG_STATIC)
@@ -259,7 +294,7 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
         ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
-    # Create a symlink for libpng.dll.a => libpng15.dll.a on Cygwin
+    # Create a symlink for libpng.dll.a => libpng16.dll.a on Cygwin
     if(CYGWIN OR MINGW)
        get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE})
        get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME)
index e6979c6fb01656c5cf73c252cafb9bc91a71e536..2644c7a4f892e189f07b13e07b2ddc4b95cd2b9a 100644 (file)
@@ -9,16 +9,16 @@ On Unix/Linux and similar systems, you can simply type
 
 and ignore the rest of this document.
 
-If configure does not work on your system and you have a reasonably
-up-to-date set of tools, running ./autogen.sh before running ./configure
-may fix the problem.  You can also run the individual commands in
-autogen.sh with the --force option, if supported by your version of
-the tools.  To be really sure that you aren't using any of the included
-pre-built scripts, you can do this:
+If configure does not work on your system, or if you have a need to
+change configure.ac or Makefile.am, and you have a reasonably
+up-to-date set of tools, running ./autogen.sh in a git clone before
+running ./configure may fix the problem.  To be really sure that you
+aren't using any of the included pre-built scripts, you can do this:
 
     ./configure --enable-maintainer-mode
     make maintainer-clean
-    ./autogen.sh
+    ./autogen.sh --maintainer --clean
+    ./autogen.sh --maintainer
     ./configure [--prefix=/path] [other options]
     make
     make install
index 8d7ebb6cfb84f3cec0bbcf77b27c8e6746d98469..e95d3598b4368f8ef15e6cbd0521c684a0634c5f 100644 (file)
@@ -10,7 +10,7 @@ this sentence.
 
 This code is released under the libpng license.
 
-libpng versions 1.2.6, August 15, 2004, through 1.5.14, January 24, 2013, are
+libpng versions 1.2.6, August 15, 2004, through 1.6.0, February 14, 2013, are
 Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are
 distributed according to the same disclaimer and license as libpng-1.2.5
 with the following individual added to the list of Contributing Authors
@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-January 24, 2013
+February 14, 2013
index a1d22aea89bd1e3ae331f57aaa4eb84332bf2099..ca44c68d45896321e4c0e3f5d80d3afeed272e58 100644 (file)
@@ -4,12 +4,7 @@
 
 PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
 
-# libpng does not follow GNU file name conventions
-
-# "color-tests" requires automake 1.11.1 or later.  Enable it if you like,
-# to get red "FAIL" and green "PASS" notations during tests.
-# AUTOMAKE_OPTIONS = foreign color-tests
-AUTOMAKE_OPTIONS = foreign
+ACLOCAL_AMFLAGS = -I scripts
 
 # test programs - run on make check, make distcheck
 TESTS_ENVIRONMENT= srcdir=$(srcdir)
@@ -19,10 +14,17 @@ pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
 TESTS = test-pngtest.sh
 
 # Only do the following if the contrib directory is present.
-check_PROGRAMS+= pngvalid
+check_PROGRAMS+= pngvalid pngstest pngunknown
 pngvalid_SOURCES = contrib/libtests/pngvalid.c
+pngstest_SOURCES = contrib/libtests/pngstest.c
+pngunknown_SOURCES = contrib/libtests/pngunknown.c
 pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
-TESTS += test-pngvalid-simple.sh test-pngvalid-full.sh
+pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
+pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
+TESTS += contrib/libtests/test-pngunknown.sh\
+        contrib/libtests/test-pngvalid-simple.sh\
+        contrib/libtests/test-pngvalid-full.sh\
+        contrib/libtests/test-pngstest.sh
 
 # man pages
 dist_man_MANS= libpng.3 libpngpf.3 png.5
@@ -47,8 +49,6 @@ endif
 
 nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
 
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@
-
 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
        -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
 
@@ -87,14 +87,20 @@ EXTRA_DIST= \
 
 SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.dfn
 
-CLEANFILES= dfn.c dfn?.out pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
+CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
        libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
-       check.new pnglibconf.* symbols.new pngtest-log.txt \
+       check.new pnglibconf.* pngprefix.h symbols.new pngtest-log.txt \
        $(SCRIPT_CLEANFILES)
 
 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
 config.sub configure depcomp install-sh ltmain.sh missing
 
+# PNG_COPTS give extra options for the C compiler to be used on all compilation
+# steps (unless targe_CFLAGS is specified; that will take precedence over
+# AM_CFLAGS)
+PNG_COPTS = @PNG_COPTS@
+AM_CFLAGS = ${PNG_COPTS}
+
 # DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe
 # other operating systems (NeXT?) the C preprocessor selected by configure
 # checks input tokens for validity - effectively it performs part of the ANSI-C
@@ -111,7 +117,9 @@ $(PNGLIB_BASENAME)-config: libpng-config
        cp libpng-config $@
 
 scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
+scripts/prefix.out: png.h pngconf.h pnglibconf.out
 scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
+scripts/intprefix.out: pnglibconf.h
 
 libpng.sym: scripts/sym.out
        rm -f $@
@@ -119,9 +127,34 @@ libpng.sym: scripts/sym.out
 libpng.vers: scripts/vers.out
        rm -f $@
        cp $? $@
+
+if DO_PNG_PREFIX
+# Rename functions in scripts/prefix.out with a PNG_PREFIX prefix.
+# Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual
+# implementation of the macro).
+pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst
+       rm -f $@
+       $(AWK) 's==0 && NR>1{print prev}\
+          s==0{prev=$$0}\
+          s==1{print "#define", $$1, "@PNG_PREFIX@" $$1}\
+          s==2{print "#define @PNG_PREFIX@png_" $$1, "PNG_" $$1}\
+          END{print prev}' s=0 pnglibconf.out s=1 scripts/prefix.out\
+          s=2 ${srcdir}/scripts/macro.lst >pnglibconf.tf8
+       mv pnglibconf.tf8 $@
+
+pngprefix.h: scripts/intprefix.out
+       rm -f pngprefix.tf1
+       $(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1
+       mv pngprefix.tf1 $@
+else
 pnglibconf.h: pnglibconf.out
        rm -f $@
        cp $? $@
+
+pngprefix.h: # is empty
+       :>$@
+endif
+
 $(srcdir)/scripts/pnglibconf.h.prebuilt:
        @echo "Attempting to build $@" >&2
        @echo "This is a machine generated file, but if you want to make" >&2
@@ -131,7 +164,8 @@ $(srcdir)/scripts/pnglibconf.h.prebuilt:
 # The following is necessary to ensure that the local pnglibconf.h is used, not
 # an installed one (this can happen immediately after on a clean system if
 # 'make test' is the first thing the user does.)
-contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h
+contrib/libtests/pngstest.o contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h
+contrib/libtests/pngunknown.o: pnglibconf.h
 
 # We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
 # be built with PNG_USE_READ_MACROS; this prevents the read macros from
@@ -141,51 +175,57 @@ SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
                -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
                -DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
 
+if DO_PNG_PREFIX
+SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@'
+endif
+
 .dfn.out:
-       rm -f $@ dfn.c dfn?.out
+       rm -f $@ $*.c $*.tf[123]
        test -d scripts || mkdir scripts
-       echo '#include "$<"' >dfn.c
-       $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\
-           $(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c > dfn1.out
+       echo '#include "$<"' >$*.c
+       $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
+           $(CPPFLAGS) $(SYMBOL_CFLAGS) $*.c > $*.tf1
        $(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\
-           dfn1.out >dfn2.out
-       $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out
-       rm -f dfn.c dfn[12].out
-       mv dfn3.out $@
+           $*.tf1 >$*.tf2
+       $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' $*.tf2 >$*.tf3
+       rm -f $*.c $*.tf[12]
+       mv $*.tf3 $@
 
 # The .dfn file for pnglibconf.h is machine generated
 pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
-       rm -f $@ dfn?.out
-       $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out version=search\
+       rm -f $@ $*.tf[45]
+       $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
            ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
            ${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2
-       $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2
-       rm dfn1.out
-       mv dfn2.out $@
+       $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2
+       rm $*.tf4
+       mv $*.tf5 $@
 
 # Symbol checks (.def and .out files should match)
 scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out
+
 .out.chk:
-       rm -f $@ symbols.new
+       rm -f $@ $*.new
        $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\
-           $< >&2
-       mv symbols.new $@
+           of="$*.new" $< >&2
+       mv $*.new $@
 
 # used on demand to regenerate the standard header, CPPFLAGS should
 # be empty - no non-standard defines
 scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
-       rm -f $@ dfn?.out
+       rm -f $@ pnglibconf.tf[67]
        test -z "$(CPPFLAGS)"
        echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
-       $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out logunsupported=1
-               version=search ${srcdir}/pngconf.h -\
-               ${srcdir}/scripts/pnglibconf.dfa 1>&2
-       $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2
-       rm dfn1.out
-       mv dfn2.out $@
+       $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\
+           logunsupported=1 version=search ${srcdir}/pngconf.h -\
+           ${srcdir}/scripts/pnglibconf.dfa 1>&2
+       $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf7\
+           pnglibconf.tf6 1>&2
+       rm pnglibconf.tf6
+       mv pnglibconf.tf7 $@
 
 $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
-       pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h
+       pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h
 
 test: check-am
 
index 9f2d39e1a5e599e5776526246aa03ae7475abc95..2341ab74cfc3d94db646adb144c3888530c9aa68 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.12.5 from Makefile.am.
+# Makefile.in generated by automake 1.13 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2012 Free Software Foundation, Inc.
@@ -56,7 +56,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-check_PROGRAMS = pngtest$(EXEEXT) pngvalid$(EXEEXT)
+check_PROGRAMS = pngtest$(EXEEXT) pngvalid$(EXEEXT) pngstest$(EXEEXT) \
+       pngunknown$(EXEEXT)
 @PNG_ARM_NEON_TRUE@am__append_1 = arm/arm_init.c\
 @PNG_ARM_NEON_TRUE@    arm/filter_neon.S
 
@@ -66,15 +67,21 @@ check_PROGRAMS = pngtest$(EXEEXT) pngvalid$(EXEEXT)
 @HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_FALSE@am__append_3 = -Wl,--version-script=libpng.vers
 #   Only restricted exports when possible
 @HAVE_LD_VERSION_SCRIPT_FALSE@am__append_4 = -export-symbols libpng.sym
+@DO_PNG_PREFIX_TRUE@am__append_5 = -DPNG_PREFIX='@PNG_PREFIX@'
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \
-       $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(srcdir)/config.h.in \
-       $(srcdir)/libpng-config.in $(srcdir)/libpng.pc.in \
-       $(top_srcdir)/configure INSTALL TODO config.guess config.sub \
-       depcomp install-sh ltmain.sh missing
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+       $(top_srcdir)/configure $(am__configure_deps) \
+       $(srcdir)/config.h.in $(srcdir)/libpng.pc.in \
+       $(srcdir)/libpng-config.in depcomp $(dist_man_MANS) \
+       $(pkginclude_HEADERS) INSTALL README TODO config.guess \
+       config.sub install-sh missing ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/scripts/libtool.m4 \
+       $(top_srcdir)/scripts/ltoptions.m4 \
+       $(top_srcdir)/scripts/ltsugar.m4 \
+       $(top_srcdir)/scripts/ltversion.m4 \
+       $(top_srcdir)/scripts/lt~obsolete.m4 \
+       $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -122,65 +129,89 @@ am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST = png.c \
        pngwtran.c pngwutil.c png.h pngconf.h pngdebug.h pnginfo.h \
        pngpriv.h pngstruct.h pngusr.dfa arm/arm_init.c \
        arm/filter_neon.S
-@PNG_ARM_NEON_TRUE@am__objects_1 = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.lo \
-@PNG_ARM_NEON_TRUE@    libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo
-am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS =  \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.lo \
-       libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo \
-       $(am__objects_1)
+@PNG_ARM_NEON_TRUE@am__objects_1 = arm_init.lo filter_neon.lo
+am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS = png.lo pngerror.lo \
+       pngget.lo pngmem.lo pngpread.lo pngread.lo pngrio.lo \
+       pngrtran.lo pngrutil.lo pngset.lo pngtrans.lo pngwio.lo \
+       pngwrite.lo pngwtran.lo pngwutil.lo $(am__objects_1)
 nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS =
 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS =  \
        $(am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) \
        $(nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS)
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK = $(LIBTOOL) --tag=CC \
-       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
-       $(AM_CFLAGS) $(CFLAGS) \
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK = $(LIBTOOL) $(AM_V_lt) \
+       --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+       $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS) $(LDFLAGS) -o \
        $@
+am_pngstest_OBJECTS = pngstest.$(OBJEXT)
+pngstest_OBJECTS = $(am_pngstest_OBJECTS)
+pngstest_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
 am_pngtest_OBJECTS = pngtest.$(OBJEXT)
 pngtest_OBJECTS = $(am_pngtest_OBJECTS)
 pngtest_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
+am_pngunknown_OBJECTS = pngunknown.$(OBJEXT)
+pngunknown_OBJECTS = $(am_pngunknown_OBJECTS)
+pngunknown_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
 am_pngvalid_OBJECTS = pngvalid.$(OBJEXT)
 pngvalid_OBJECTS = $(am_pngvalid_OBJECTS)
 pngvalid_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
 SCRIPTS = $(bin_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-       --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
+LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CCASFLAGS) $(CCASFLAGS)
+AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
+am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
+am__v_CPPAS_0 = @echo "  CPPAS   " $@;
+am__v_CPPAS_1 = 
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-       $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES) \
        $(nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES) \
-       $(pngtest_SOURCES) $(pngvalid_SOURCES)
+       $(pngstest_SOURCES) $(pngtest_SOURCES) $(pngunknown_SOURCES) \
+       $(pngvalid_SOURCES)
 DIST_SOURCES =  \
        $(am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST) \
-       $(pngtest_SOURCES) $(pngvalid_SOURCES)
+       $(pngstest_SOURCES) $(pngtest_SOURCES) $(pngunknown_SOURCES) \
+       $(pngvalid_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -192,6 +223,24 @@ NROFF = nroff
 MANS = $(dist_man_MANS)
 DATA = $(pkgconfig_DATA)
 HEADERS = $(nodist_pkginclude_HEADERS) $(pkginclude_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+       $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
@@ -199,7 +248,25 @@ AM_RECURSIVE_TARGETS = cscope
 am__tty_colors_dummy = \
   mgn= red= grn= lgn= blu= brg= std=; \
   am__color_tests=no
-am__tty_colors = $(am__tty_colors_dummy)
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red='\e[0;31m'; \
+    grn='\e[0;32m'; \
+    lgn='\e[1;32m'; \
+    blu='\e[1;34m'; \
+    mgn='\e[0;35m'; \
+    brg='\e[1m'; \
+    std='\e[m'; \
+  fi; \
+}
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -210,9 +277,9 @@ am__remove_distdir = \
       || { sleep 5 && rm -rf "$(distdir)"; }; \
   else :; fi
 am__post_remove_distdir = $(am__remove_distdir)
-DIST_ARCHIVES = $(distdir).tar.gz
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz
 GZIP_ENV = --best
-DIST_TARGETS = dist-gzip
+DIST_TARGETS = dist-xz dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -223,6 +290,7 @@ pkgincludedir = $(includedir)/$(PNGLIB_BASENAME)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_CCASFLAGS = @AM_CCASFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AS = @AS@
 AUTOCONF = @AUTOCONF@
@@ -265,7 +333,6 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
-LIBPNG_DEFINES = @LIBPNG_DEFINES@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
@@ -293,6 +360,12 @@ PNGLIB_MAJOR = @PNGLIB_MAJOR@
 PNGLIB_MINOR = @PNGLIB_MINOR@
 PNGLIB_RELEASE = @PNGLIB_RELEASE@
 PNGLIB_VERSION = @PNGLIB_VERSION@
+
+# PNG_COPTS give extra options for the C compiler to be used on all compilation
+# steps (unless targe_CFLAGS is specified; that will take precedence over
+# AM_CFLAGS)
+PNG_COPTS = @PNG_COPTS@
+PNG_PREFIX = @PNG_PREFIX@
 POW_LIB = @POW_LIB@
 RANLIB = @RANLIB@
 SED = @SED@
@@ -361,21 +434,22 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 PNGLIB_BASENAME = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
-
-# libpng does not follow GNU file name conventions
-
-# "color-tests" requires automake 1.11.1 or later.  Enable it if you like,
-# to get red "FAIL" and green "PASS" notations during tests.
-# AUTOMAKE_OPTIONS = foreign color-tests
-AUTOMAKE_OPTIONS = foreign
+ACLOCAL_AMFLAGS = -I scripts
 
 # test programs - run on make check, make distcheck
 TESTS_ENVIRONMENT = srcdir=$(srcdir)
 pngtest_SOURCES = pngtest.c
 pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
-TESTS = test-pngtest.sh test-pngvalid-simple.sh test-pngvalid-full.sh
+TESTS = test-pngtest.sh contrib/libtests/test-pngunknown.sh \
+       contrib/libtests/test-pngvalid-simple.sh \
+       contrib/libtests/test-pngvalid-full.sh \
+       contrib/libtests/test-pngstest.sh
 pngvalid_SOURCES = contrib/libtests/pngvalid.c
+pngstest_SOURCES = contrib/libtests/pngstest.c
+pngunknown_SOURCES = contrib/libtests/pngunknown.c
 pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
+pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
+pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
 
 # man pages
 dist_man_MANS = libpng.3 libpngpf.3 png.5
@@ -391,7 +465,6 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c \
        pngwutil.c png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h \
        pngstruct.h pngusr.dfa $(am__append_1)
 nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@
 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined \
        -export-dynamic -version-number \
        @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0 \
@@ -411,24 +484,24 @@ EXTRA_DIST = \
        CMakeLists.txt example.c libpng-manual.txt
 
 SCRIPT_CLEANFILES = scripts/*.out scripts/*.chk scripts/pnglibconf.dfn
-CLEANFILES = dfn.c dfn?.out pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
+CLEANFILES = *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
        libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
-       check.new pnglibconf.* symbols.new pngtest-log.txt \
+       check.new pnglibconf.* pngprefix.h symbols.new pngtest-log.txt \
        $(SCRIPT_CLEANFILES)
 
 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
 config.sub configure depcomp install-sh ltmain.sh missing
 
+AM_CFLAGS = ${PNG_COPTS}
 SUFFIXES = .chk .dfn .out
 
 # We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
 # be built with PNG_USE_READ_MACROS; this prevents the read macros from
 # interfering with the symbol file format.
-SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
-               -DPNGLIB_VERSION='@PNGLIB_VERSION@'\
-               -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
-               -DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
-
+SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0' \
+       -DPNGLIB_VERSION='@PNGLIB_VERSION@' \
+       -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)' -DPNG_NO_USE_READ_MACROS \
+       -DPNG_BUILDING_SYMBOL_TABLE $(am__append_5)
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -487,6 +560,7 @@ libpng.pc: $(top_builddir)/config.status $(srcdir)/libpng.pc.in
        cd $(top_builddir) && $(SHELL) ./config.status $@
 libpng-config: $(top_builddir)/config.status $(srcdir)/libpng-config.in
        cd $(top_builddir) && $(SHELL) ./config.status $@
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
        @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -522,7 +596,7 @@ clean-libLTLIBRARIES:
          rm -f $${locs}; \
        }
 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES) $(EXTRA_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES) 
-       $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK) -rpath $(libdir) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD) $(LIBS)
+       $(AM_V_CCLD)$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK) -rpath $(libdir) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD) $(LIBS)
 
 clean-checkPROGRAMS:
        @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
@@ -532,12 +606,18 @@ clean-checkPROGRAMS:
        list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
        echo " rm -f" $$list; \
        rm -f $$list
+pngstest$(EXEEXT): $(pngstest_OBJECTS) $(pngstest_DEPENDENCIES) $(EXTRA_pngstest_DEPENDENCIES) 
+       @rm -f pngstest$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(pngstest_OBJECTS) $(pngstest_LDADD) $(LIBS)
 pngtest$(EXEEXT): $(pngtest_OBJECTS) $(pngtest_DEPENDENCIES) $(EXTRA_pngtest_DEPENDENCIES) 
        @rm -f pngtest$(EXEEXT)
-       $(LINK) $(pngtest_OBJECTS) $(pngtest_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(pngtest_OBJECTS) $(pngtest_LDADD) $(LIBS)
+pngunknown$(EXEEXT): $(pngunknown_OBJECTS) $(pngunknown_DEPENDENCIES) $(EXTRA_pngunknown_DEPENDENCIES) 
+       @rm -f pngunknown$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(pngunknown_OBJECTS) $(pngunknown_LDADD) $(LIBS)
 pngvalid$(EXEEXT): $(pngvalid_OBJECTS) $(pngvalid_DEPENDENCIES) $(EXTRA_pngvalid_DEPENDENCIES) 
        @rm -f pngvalid$(EXEEXT)
-       $(LINK) $(pngvalid_OBJECTS) $(pngvalid_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(pngvalid_OBJECTS) $(pngvalid_LDADD) $(LIBS)
 install-binSCRIPTS: $(bin_SCRIPTS)
        @$(NORMAL_INSTALL)
        @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
@@ -580,200 +660,125 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arm_init.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter_neon.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/png.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngerror.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngget.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngmem.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngpread.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngread.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrio.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrtran.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrutil.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngset.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngstest.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngtrans.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngunknown.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngvalid.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwio.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwrite.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwtran.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwutil.Plo@am__quote@
 
 .S.o:
-@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@    DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@        $(CPPASCOMPILE) -c -o $@ $<
+@am__fastdepCCAS_FALSE@        $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<
 
 .S.obj:
-@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@    DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@        $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCCAS_FALSE@        $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .S.lo:
-@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@    DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@        $(LTCPPASCOMPILE) -c -o $@ $<
+@am__fastdepCCAS_FALSE@        $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $<
 
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo: arm/filter_neon.S
-@am__fastdepCCAS_TRUE@ $(LIBTOOL)  $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo `test -f 'arm/filter_neon.S' || echo '$(srcdir)/'`arm/filter_neon.S
-@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.Plo
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    source='arm/filter_neon.S' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo' libtool=yes @AMDEPBACKSLASH@
+filter_neon.lo: arm/filter_neon.S
+@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT filter_neon.lo -MD -MP -MF $(DEPDIR)/filter_neon.Tpo -c -o filter_neon.lo `test -f 'arm/filter_neon.S' || echo '$(srcdir)/'`arm/filter_neon.S
+@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/filter_neon.Tpo $(DEPDIR)/filter_neon.Plo
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    $(AM_V_CPPAS)source='arm/filter_neon.S' object='filter_neon.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@    DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@        $(LIBTOOL)  $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo `test -f 'arm/filter_neon.S' || echo '$(srcdir)/'`arm/filter_neon.S
+@am__fastdepCCAS_FALSE@        $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o filter_neon.lo `test -f 'arm/filter_neon.S' || echo '$(srcdir)/'`arm/filter_neon.S
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.lo: png.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.lo `test -f 'png.c' || echo '$(srcdir)/'`png.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='png.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.lo' libtool=yes @AMDEPBACKSLASH@
+arm_init.lo: arm/arm_init.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT arm_init.lo -MD -MP -MF $(DEPDIR)/arm_init.Tpo -c -o arm_init.lo `test -f 'arm/arm_init.c' || echo '$(srcdir)/'`arm/arm_init.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/arm_init.Tpo $(DEPDIR)/arm_init.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='arm/arm_init.c' object='arm_init.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.lo `test -f 'png.c' || echo '$(srcdir)/'`png.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o arm_init.lo `test -f 'arm/arm_init.c' || echo '$(srcdir)/'`arm/arm_init.c
 
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.lo: pngerror.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.lo `test -f 'pngerror.c' || echo '$(srcdir)/'`pngerror.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngerror.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.lo' libtool=yes @AMDEPBACKSLASH@
+pngstest.o: contrib/libtests/pngstest.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngstest.o -MD -MP -MF $(DEPDIR)/pngstest.Tpo -c -o pngstest.o `test -f 'contrib/libtests/pngstest.c' || echo '$(srcdir)/'`contrib/libtests/pngstest.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/pngstest.Tpo $(DEPDIR)/pngstest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='contrib/libtests/pngstest.c' object='pngstest.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.lo `test -f 'pngerror.c' || echo '$(srcdir)/'`pngerror.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngstest.o `test -f 'contrib/libtests/pngstest.c' || echo '$(srcdir)/'`contrib/libtests/pngstest.c
 
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.lo: pngget.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.lo `test -f 'pngget.c' || echo '$(srcdir)/'`pngget.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngget.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.lo' libtool=yes @AMDEPBACKSLASH@
+pngstest.obj: contrib/libtests/pngstest.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngstest.obj -MD -MP -MF $(DEPDIR)/pngstest.Tpo -c -o pngstest.obj `if test -f 'contrib/libtests/pngstest.c'; then $(CYGPATH_W) 'contrib/libtests/pngstest.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngstest.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/pngstest.Tpo $(DEPDIR)/pngstest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='contrib/libtests/pngstest.c' object='pngstest.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.lo `test -f 'pngget.c' || echo '$(srcdir)/'`pngget.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngstest.obj `if test -f 'contrib/libtests/pngstest.c'; then $(CYGPATH_W) 'contrib/libtests/pngstest.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngstest.c'; fi`
 
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.lo: pngmem.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.lo `test -f 'pngmem.c' || echo '$(srcdir)/'`pngmem.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngmem.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.lo' libtool=yes @AMDEPBACKSLASH@
+pngunknown.o: contrib/libtests/pngunknown.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngunknown.o -MD -MP -MF $(DEPDIR)/pngunknown.Tpo -c -o pngunknown.o `test -f 'contrib/libtests/pngunknown.c' || echo '$(srcdir)/'`contrib/libtests/pngunknown.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/pngunknown.Tpo $(DEPDIR)/pngunknown.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='contrib/libtests/pngunknown.c' object='pngunknown.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngmem.lo `test -f 'pngmem.c' || echo '$(srcdir)/'`pngmem.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngunknown.o `test -f 'contrib/libtests/pngunknown.c' || echo '$(srcdir)/'`contrib/libtests/pngunknown.c
 
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.lo: pngpread.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.lo `test -f 'pngpread.c' || echo '$(srcdir)/'`pngpread.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngpread.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.lo' libtool=yes @AMDEPBACKSLASH@
+pngunknown.obj: contrib/libtests/pngunknown.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngunknown.obj -MD -MP -MF $(DEPDIR)/pngunknown.Tpo -c -o pngunknown.obj `if test -f 'contrib/libtests/pngunknown.c'; then $(CYGPATH_W) 'contrib/libtests/pngunknown.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngunknown.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/pngunknown.Tpo $(DEPDIR)/pngunknown.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='contrib/libtests/pngunknown.c' object='pngunknown.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngpread.lo `test -f 'pngpread.c' || echo '$(srcdir)/'`pngpread.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.lo: pngread.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.lo `test -f 'pngread.c' || echo '$(srcdir)/'`pngread.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngread.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngread.lo `test -f 'pngread.c' || echo '$(srcdir)/'`pngread.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.lo: pngrio.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.lo `test -f 'pngrio.c' || echo '$(srcdir)/'`pngrio.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngrio.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrio.lo `test -f 'pngrio.c' || echo '$(srcdir)/'`pngrio.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.lo: pngrtran.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.lo `test -f 'pngrtran.c' || echo '$(srcdir)/'`pngrtran.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngrtran.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrtran.lo `test -f 'pngrtran.c' || echo '$(srcdir)/'`pngrtran.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.lo: pngrutil.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.lo `test -f 'pngrutil.c' || echo '$(srcdir)/'`pngrutil.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngrutil.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngrutil.lo `test -f 'pngrutil.c' || echo '$(srcdir)/'`pngrutil.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.lo: pngset.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.lo `test -f 'pngset.c' || echo '$(srcdir)/'`pngset.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngset.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngset.lo `test -f 'pngset.c' || echo '$(srcdir)/'`pngset.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.lo: pngtrans.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.lo `test -f 'pngtrans.c' || echo '$(srcdir)/'`pngtrans.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngtrans.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngtrans.lo `test -f 'pngtrans.c' || echo '$(srcdir)/'`pngtrans.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.lo: pngwio.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.lo `test -f 'pngwio.c' || echo '$(srcdir)/'`pngwio.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngwio.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.lo `test -f 'pngwio.c' || echo '$(srcdir)/'`pngwio.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.lo: pngwrite.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.lo `test -f 'pngwrite.c' || echo '$(srcdir)/'`pngwrite.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngwrite.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.lo `test -f 'pngwrite.c' || echo '$(srcdir)/'`pngwrite.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.lo: pngwtran.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.lo `test -f 'pngwtran.c' || echo '$(srcdir)/'`pngwtran.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngwtran.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.lo `test -f 'pngwtran.c' || echo '$(srcdir)/'`pngwtran.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo: pngwutil.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo `test -f 'pngwutil.c' || echo '$(srcdir)/'`pngwutil.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='pngwutil.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo `test -f 'pngwutil.c' || echo '$(srcdir)/'`pngwutil.c
-
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.lo: arm/arm_init.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.lo `test -f 'arm/arm_init.c' || echo '$(srcdir)/'`arm/arm_init.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='arm/arm_init.c' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-arm_init.lo `test -f 'arm/arm_init.c' || echo '$(srcdir)/'`arm/arm_init.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngunknown.obj `if test -f 'contrib/libtests/pngunknown.c'; then $(CYGPATH_W) 'contrib/libtests/pngunknown.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngunknown.c'; fi`
 
 pngvalid.o: contrib/libtests/pngvalid.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngvalid.o -MD -MP -MF $(DEPDIR)/pngvalid.Tpo -c -o pngvalid.o `test -f 'contrib/libtests/pngvalid.c' || echo '$(srcdir)/'`contrib/libtests/pngvalid.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pngvalid.Tpo $(DEPDIR)/pngvalid.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='contrib/libtests/pngvalid.c' object='pngvalid.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngvalid.o -MD -MP -MF $(DEPDIR)/pngvalid.Tpo -c -o pngvalid.o `test -f 'contrib/libtests/pngvalid.c' || echo '$(srcdir)/'`contrib/libtests/pngvalid.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/pngvalid.Tpo $(DEPDIR)/pngvalid.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='contrib/libtests/pngvalid.c' object='pngvalid.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngvalid.o `test -f 'contrib/libtests/pngvalid.c' || echo '$(srcdir)/'`contrib/libtests/pngvalid.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngvalid.o `test -f 'contrib/libtests/pngvalid.c' || echo '$(srcdir)/'`contrib/libtests/pngvalid.c
 
 pngvalid.obj: contrib/libtests/pngvalid.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngvalid.obj -MD -MP -MF $(DEPDIR)/pngvalid.Tpo -c -o pngvalid.obj `if test -f 'contrib/libtests/pngvalid.c'; then $(CYGPATH_W) 'contrib/libtests/pngvalid.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngvalid.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/pngvalid.Tpo $(DEPDIR)/pngvalid.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='contrib/libtests/pngvalid.c' object='pngvalid.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngvalid.obj -MD -MP -MF $(DEPDIR)/pngvalid.Tpo -c -o pngvalid.obj `if test -f 'contrib/libtests/pngvalid.c'; then $(CYGPATH_W) 'contrib/libtests/pngvalid.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngvalid.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/pngvalid.Tpo $(DEPDIR)/pngvalid.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='contrib/libtests/pngvalid.c' object='pngvalid.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngvalid.obj `if test -f 'contrib/libtests/pngvalid.c'; then $(CYGPATH_W) 'contrib/libtests/pngvalid.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngvalid.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngvalid.obj `if test -f 'contrib/libtests/pngvalid.c'; then $(CYGPATH_W) 'contrib/libtests/pngvalid.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngvalid.c'; fi`
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -933,26 +938,15 @@ uninstall-pkgincludeHEADERS:
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
        dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -964,15 +958,11 @@ TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -981,18 +971,16 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
-
 cscope: cscope.files
        test ! -s cscope.files \
          || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-
 clean-cscope:
        -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
 
-cscope.files: clean-cscope  cscopelist
-
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -1103,19 +1091,6 @@ check-TESTS: $(TESTS)
        else :; fi
 
 distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
        $(am__remove_distdir)
        test -d "$(distdir)" || mkdir "$(distdir)"
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -1168,7 +1143,6 @@ dist-bzip2: distdir
 dist-lzip: distdir
        tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
        $(am__post_remove_distdir)
-
 dist-xz: distdir
        tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
        $(am__post_remove_distdir)
@@ -1401,12 +1375,12 @@ uninstall-man: uninstall-man3 uninstall-man5
 .MAKE: all check-am install-am install-data-am install-exec-am \
        install-strip uninstall-am
 
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \
-       clean clean-checkPROGRAMS clean-cscope clean-generic \
-       clean-libLTLIBRARIES clean-libtool cscope cscopelist ctags \
-       dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzip \
-       dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
-       distclean-compile distclean-generic distclean-hdr \
+.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \
+       check-am clean clean-checkPROGRAMS clean-cscope clean-generic \
+       clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \
+       ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \
+       dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \
+       distclean distclean-compile distclean-generic distclean-hdr \
        distclean-libtool distclean-tags distcleancheck distdir \
        distuninstallcheck dvi dvi-am html html-am info info-am \
        install install-am install-binSCRIPTS install-data \
@@ -1419,7 +1393,7 @@ uninstall-man: uninstall-man3 uninstall-man5
        install-ps-am install-strip installcheck installcheck-am \
        installdirs maintainer-clean maintainer-clean-generic \
        mostlyclean mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
        uninstall-am uninstall-binSCRIPTS uninstall-hook \
        uninstall-libLTLIBRARIES uninstall-man uninstall-man3 \
        uninstall-man5 uninstall-nodist_pkgincludeHEADERS \
@@ -1433,7 +1407,9 @@ $(PNGLIB_BASENAME)-config: libpng-config
        cp libpng-config $@
 
 scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
+scripts/prefix.out: png.h pngconf.h pnglibconf.out
 scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
+scripts/intprefix.out: pnglibconf.h
 
 libpng.sym: scripts/sym.out
        rm -f $@
@@ -1441,9 +1417,31 @@ libpng.sym: scripts/sym.out
 libpng.vers: scripts/vers.out
        rm -f $@
        cp $? $@
-pnglibconf.h: pnglibconf.out
-       rm -f $@
-       cp $? $@
+
+# Rename functions in scripts/prefix.out with a PNG_PREFIX prefix.
+# Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual
+# implementation of the macro).
+@DO_PNG_PREFIX_TRUE@pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst
+@DO_PNG_PREFIX_TRUE@   rm -f $@
+@DO_PNG_PREFIX_TRUE@   $(AWK) 's==0 && NR>1{print prev}\
+@DO_PNG_PREFIX_TRUE@      s==0{prev=$$0}\
+@DO_PNG_PREFIX_TRUE@      s==1{print "#define", $$1, "@PNG_PREFIX@" $$1}\
+@DO_PNG_PREFIX_TRUE@      s==2{print "#define @PNG_PREFIX@png_" $$1, "PNG_" $$1}\
+@DO_PNG_PREFIX_TRUE@      END{print prev}' s=0 pnglibconf.out s=1 scripts/prefix.out\
+@DO_PNG_PREFIX_TRUE@      s=2 ${srcdir}/scripts/macro.lst >pnglibconf.tf8
+@DO_PNG_PREFIX_TRUE@   mv pnglibconf.tf8 $@
+
+@DO_PNG_PREFIX_TRUE@pngprefix.h: scripts/intprefix.out
+@DO_PNG_PREFIX_TRUE@   rm -f pngprefix.tf1
+@DO_PNG_PREFIX_TRUE@   $(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1
+@DO_PNG_PREFIX_TRUE@   mv pngprefix.tf1 $@
+@DO_PNG_PREFIX_FALSE@pnglibconf.h: pnglibconf.out
+@DO_PNG_PREFIX_FALSE@  rm -f $@
+@DO_PNG_PREFIX_FALSE@  cp $? $@
+
+@DO_PNG_PREFIX_FALSE@pngprefix.h: # is empty
+@DO_PNG_PREFIX_FALSE@  :>$@
+
 $(srcdir)/scripts/pnglibconf.h.prebuilt:
        @echo "Attempting to build $@" >&2
        @echo "This is a machine generated file, but if you want to make" >&2
@@ -1453,53 +1451,56 @@ $(srcdir)/scripts/pnglibconf.h.prebuilt:
 # The following is necessary to ensure that the local pnglibconf.h is used, not
 # an installed one (this can happen immediately after on a clean system if
 # 'make test' is the first thing the user does.)
-contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h
+contrib/libtests/pngstest.o contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h
+contrib/libtests/pngunknown.o: pnglibconf.h
 
 .dfn.out:
-       rm -f $@ dfn.c dfn?.out
+       rm -f $@ $*.c $*.tf[123]
        test -d scripts || mkdir scripts
-       echo '#include "$<"' >dfn.c
-       $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\
-           $(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c > dfn1.out
+       echo '#include "$<"' >$*.c
+       $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
+           $(CPPFLAGS) $(SYMBOL_CFLAGS) $*.c > $*.tf1
        $(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\
-           dfn1.out >dfn2.out
-       $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out
-       rm -f dfn.c dfn[12].out
-       mv dfn3.out $@
+           $*.tf1 >$*.tf2
+       $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' $*.tf2 >$*.tf3
+       rm -f $*.c $*.tf[12]
+       mv $*.tf3 $@
 
 # The .dfn file for pnglibconf.h is machine generated
 pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
-       rm -f $@ dfn?.out
-       $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out version=search\
+       rm -f $@ $*.tf[45]
+       $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
            ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
            ${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2
-       $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2
-       rm dfn1.out
-       mv dfn2.out $@
+       $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2
+       rm $*.tf4
+       mv $*.tf5 $@
 
 # Symbol checks (.def and .out files should match)
 scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out
+
 .out.chk:
-       rm -f $@ symbols.new
+       rm -f $@ $*.new
        $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\
-           $< >&2
-       mv symbols.new $@
+           of="$*.new" $< >&2
+       mv $*.new $@
 
 # used on demand to regenerate the standard header, CPPFLAGS should
 # be empty - no non-standard defines
 scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
-       rm -f $@ dfn?.out
+       rm -f $@ pnglibconf.tf[67]
        test -z "$(CPPFLAGS)"
        echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
-       $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out logunsupported=1
-               version=search ${srcdir}/pngconf.h -\
-               ${srcdir}/scripts/pnglibconf.dfa 1>&2
-       $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2
-       rm dfn1.out
-       mv dfn2.out $@
+       $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\
+           logunsupported=1 version=search ${srcdir}/pngconf.h -\
+           ${srcdir}/scripts/pnglibconf.dfa 1>&2
+       $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf7\
+           pnglibconf.tf6 1>&2
+       rm pnglibconf.tf6
+       mv pnglibconf.tf7 $@
 
 $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
-       pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h
+       pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h
 
 test: check-am
 
index 10231106faaced8ff4def1ed9694c2c6f7b14912..295ee1f8277672b6d18f3c884784a06b98d8824f 100644 (file)
@@ -1,4 +1,4 @@
-README for libpng version 1.5.14 - January 24, 2013 (shared library 15.0)
+README for libpng version 1.6.0 - February 14, 2013 (shared library 16.0)
 See the note about version numbers near the top of png.h
 
 See INSTALL for instructions on how to install libpng.
@@ -105,7 +105,7 @@ based in a large way on Guy's and Andreas' earlier work), and the PNG
 development group.
 
 Send comments/corrections/commendations to png-mng-implement at
-lists.sourceforge.net (subscription required; visit 
+lists.sourceforge.net (subscription required; visit
 https://lists.sourceforge.net/lists/listinfo/png-mng-implement
 to subscribe) or to glennrp at users.sourceforge.net
 
index 5e128c0eeec20f9129ebf8a9c5a355e3379fe6d6..c2233b72adb4a36894ca18d6bb0e39e3c61e7e7c 100644 (file)
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.12.5 -*- Autoconf -*-
+# generated automatically by aclocal 1.13 -*- Autoconf -*-
 
 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
 
@@ -11,6 +11,7 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
@@ -19,8593 +20,6 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 57 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
-       [m4_default([$3],
-                  [m4_fatal([Libtool version $1 or higher is required],
-                            63)])],
-       [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
-  *\ * | *\    *)
-    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    _LT_PATH_MAGIC
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-])
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
-              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME.  Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
-    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
-       [m4_ifval([$1], [$1], [$2])])
-    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
-    m4_ifval([$4],
-       [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
-    lt_dict_add_subkey([lt_decl_dict], [$2],
-       [tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
-  [0], [m4_fatal([$0: too few arguments: $#])],
-  [1], [m4_fatal([$0: too few arguments: $#: $1])],
-  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
-  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
-  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
-    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
-    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
-     m4_if([$2], [],
-          m4_quote(lt_decl_varnames),
-       m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
-                       lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'.  VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly.  In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
-    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-#    # Some comment about what VAR is for.
-#    visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
-                                          [description])))[]dnl
-m4_pushdef([_libtool_name],
-    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
-    [0], [_libtool_name=[$]$1],
-    [1], [_libtool_name=$lt_[]$1],
-    [2], [_libtool_name=$lt_[]$1],
-    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
-    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'.  Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
-       dnl If the libtool generation code has been placed in $CONFIG_LT,
-       dnl instead of duplicating it all over again into config.status,
-       dnl then we will have config.status run $CONFIG_LT later, so it
-       dnl needs to know what name is stored there:
-        [AC_CONFIG_COMMANDS([libtool],
-            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
-    dnl If the libtool generation code is destined for config.status,
-    dnl expand the accumulated commands and init code now:
-    [AC_CONFIG_COMMANDS([libtool],
-        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$[]1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable.  If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins.  After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script.  The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-lt_cl_silent=false
-exec AS_MESSAGE_LOG_FD>>config.log
-{
-  echo
-  AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
-  -h, --help      print this help, then exit
-  -V, --version   print version number, then exit
-  -q, --quiet     do not print progress messages
-  -d, --debug     don't remove temporary files
-
-Report bugs to <bug-libtool@gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2011 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
-  case $[1] in
-    --version | --v* | -V )
-      echo "$lt_cl_version"; exit 0 ;;
-    --help | --h* | -h )
-      echo "$lt_cl_help"; exit 0 ;;
-    --debug | --d* | -d )
-      debug=: ;;
-    --quiet | --q* | --silent | --s* | -q )
-      lt_cl_silent=: ;;
-
-    -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
-    *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
-  esac
-  shift
-done
-
-if $lt_cl_silent; then
-  exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure.  Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-lt_cl_success=:
-test "$silent" = yes &&
-  lt_config_lt_args="$lt_config_lt_args --quiet"
-exec AS_MESSAGE_LOG_FD>/dev/null
-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-exec AS_MESSAGE_LOG_FD>>config.log
-$lt_cl_success || AS_EXIT(1)
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars.  Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
-  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
-  m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options which allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile="${ofile}T"
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-  _LT_PROG_LTMAIN
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" \
-     || (rm -f "$cfgfile"; exit 1)
-
-  _LT_PROG_REPLACE_SHELLFNS
-
-   mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
-    RM='$RM'
-    ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
-  [C],                 [_LT_LANG(C)],
-  [C++],               [_LT_LANG(CXX)],
-  [Go],                        [_LT_LANG(GO)],
-  [Java],              [_LT_LANG(GCJ)],
-  [Fortran 77],                [_LT_LANG(F77)],
-  [Fortran],           [_LT_LANG(FC)],
-  [Windows Resource],  [_LT_LANG(RC)],
-  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
-    [_LT_LANG($1)],
-    [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
-  [LT_SUPPORTED_TAG([$1])dnl
-  m4_append([_LT_TAGS], [$1 ])dnl
-  m4_define([_LT_LANG_]$1[_enabled], [])dnl
-  _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-m4_ifndef([AC_PROG_GO], [
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC],     [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
-  fi
-fi
-if test -z "$GOC"; then
-  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
-  [LT_LANG(CXX)],
-  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
-  [LT_LANG(F77)],
-  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
-  [LT_LANG(FC)],
-  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-  [LT_LANG(GCJ)],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-    [LT_LANG(GCJ)],
-    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
-      [LT_LANG(GCJ)],
-      [m4_ifdef([AC_PROG_GCJ],
-       [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([A][M_PROG_GCJ],
-       [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([LT_PROG_GCJ],
-       [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([AC_PROG_GO],
-  [LT_LANG(GO)],
-  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
-  [LT_LANG(RC)],
-  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
-  case $host_os in
-    rhapsody* | darwin*)
-    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
-    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
-    AC_CHECK_TOOL([LIPO], [lipo], [:])
-    AC_CHECK_TOOL([OTOOL], [otool], [:])
-    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
-    _LT_DECL([], [DSYMUTIL], [1],
-      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
-    _LT_DECL([], [NMEDIT], [1],
-      [Tool to change global to local symbols on Mac OS X])
-    _LT_DECL([], [LIPO], [1],
-      [Tool to manipulate fat objects and archives on Mac OS X])
-    _LT_DECL([], [OTOOL], [1],
-      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
-    _LT_DECL([], [OTOOL64], [1],
-      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
-    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
-      [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-       # By default we will add the -single_module flag. You can override
-       # by either setting the environment variable LT_MULTI_MODULE
-       # non-empty at configure time, or by adding -multi_module to the
-       # link flags.
-       rm -rf libconftest.dylib*
-       echo "int foo(void){return 1;}" > conftest.c
-       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
-       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-       # If there is a non-empty error log, and "single_module"
-       # appears in it, assume the flag caused a linker warning
-        if test -s conftest.err && $GREP single_module conftest.err; then
-         cat conftest.err >&AS_MESSAGE_LOG_FD
-       # Otherwise, if the output was created with a 0 exit code from
-       # the compiler, it worked.
-       elif test -f libconftest.dylib && test $_lt_result -eq 0; then
-         lt_cv_apple_cc_single_mod=yes
-       else
-         cat conftest.err >&AS_MESSAGE_LOG_FD
-       fi
-       rm -rf libconftest.dylib*
-       rm -f conftest.*
-      fi])
-
-    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
-      [lt_cv_ld_exported_symbols_list],
-      [lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-       [lt_cv_ld_exported_symbols_list=yes],
-       [lt_cv_ld_exported_symbols_list=no])
-       LDFLAGS="$save_LDFLAGS"
-    ])
-
-    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
-      [lt_cv_ld_force_load=no
-      cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
-      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
-      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
-      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
-      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
-      cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
-      _lt_result=$?
-      if test -s conftest.err && $GREP force_load conftest.err; then
-       cat conftest.err >&AS_MESSAGE_LOG_FD
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
-       lt_cv_ld_force_load=yes
-      else
-       cat conftest.err >&AS_MESSAGE_LOG_FD
-      fi
-        rm -f conftest.err libconftest.a conftest conftest.c
-        rm -rf conftest.dSYM
-    ])
-    case $host_os in
-    rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-       10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-       10.[[012]]*)
-         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-       10.*)
-         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
-  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_automatic, $1)=yes
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
-                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
-  else
-    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
-  fi
-  _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    m4_if([$1], [CXX],
-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-    fi
-],[])
-  else
-  _LT_TAGVAR(ld_shlibs, $1)=no
-  fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-# ----------------------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-# Store the results from the different compilers for each TAGNAME.
-# Allow to override them for all tags through lt_cv_aix_libpath.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
-  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
-  lt_aix_libpath_sed='[
-      /Import File Strings/,/^$/ {
-         /^0/ {
-             s/^0  *\([^ ]*\) *$/\1/
-             p
-         }
-      }]'
-  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi],[])
-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
-  fi
-  ])
-  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _LT_SHELL_INIT
-
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='printf %s\n'
-else
-  # Use this function as a fallback that always works.
-  func_fallback_echo ()
-  {
-    eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
-  }
-  ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*" 
-}
-
-case "$ECHO" in
-  printf*) AC_MSG_RESULT([printf]) ;;
-  print*) AC_MSG_RESULT([print -r]) ;;
-  *) AC_MSG_RESULT([cat]) ;;
-esac
-
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
-  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
-    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-    PATH=/empty FPATH=/empty; export PATH FPATH
-    test "X`printf %s $ECHO`" = "X$ECHO" \
-      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_WITH_SYSROOT
-# ----------------
-AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
-AC_ARG_WITH([sysroot],
-[  --with-sysroot[=DIR] Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).],
-[], [with_sysroot=no])
-
-dnl lt_sysroot will always be passed unquoted.  We quote it here
-dnl in case the user passed a directory name.
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
-   if test "$GCC" = yes; then
-     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-   fi
-   ;; #(
- /*)
-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-   ;; #(
- no|'')
-   ;; #(
- *)
-   AC_MSG_RESULT([${with_sysroot}])
-   AC_MSG_ERROR([The sysroot must be an absolute path.])
-   ;;
-esac
-
- AC_MSG_RESULT([${lt_sysroot:-no}])
-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-  [AS_HELP_STRING([--disable-libtool-lock],
-    [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-       HPUX_IA64_MODE="32"
-       ;;
-      *ELF-64*)
-       HPUX_IA64_MODE="64"
-       ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
-      case `/usr/bin/file conftest.$ac_objext` in
-       *32-bit*)
-         LD="${LD-ld} -melf32bsmip"
-         ;;
-       *N32*)
-         LD="${LD-ld} -melf32bmipn32"
-         ;;
-       *64-bit*)
-         LD="${LD-ld} -melf64bmip"
-       ;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-       *32-bit*)
-         LD="${LD-ld} -32"
-         ;;
-       *N32*)
-         LD="${LD-ld} -n32"
-         ;;
-       *64-bit*)
-         LD="${LD-ld} -64"
-         ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-       case $host in
-         x86_64-*kfreebsd*-gnu)
-           LD="${LD-ld} -m elf_i386_fbsd"
-           ;;
-         x86_64-*linux*)
-           LD="${LD-ld} -m elf_i386"
-           ;;
-         ppc64-*linux*|powerpc64-*linux*)
-           LD="${LD-ld} -m elf32ppclinux"
-           ;;
-         s390x-*linux*)
-           LD="${LD-ld} -m elf_s390"
-           ;;
-         sparc64-*linux*)
-           LD="${LD-ld} -m elf32_sparc"
-           ;;
-       esac
-       ;;
-      *64-bit*)
-       case $host in
-         x86_64-*kfreebsd*-gnu)
-           LD="${LD-ld} -m elf_x86_64_fbsd"
-           ;;
-         x86_64-*linux*)
-           LD="${LD-ld} -m elf_x86_64"
-           ;;
-         ppc*-*linux*|powerpc*-*linux*)
-           LD="${LD-ld} -m elf64ppc"
-           ;;
-         s390*-*linux*|s390*-*tpf*)
-           LD="${LD-ld} -m elf64_s390"
-           ;;
-         sparc*-*linux*)
-           LD="${LD-ld} -m elf64_sparc"
-           ;;
-       esac
-       ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_PUSH(C)
-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*)
-        case $host in
-        i?86-*-solaris*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        sparc*-*-solaris*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-        esac
-        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
-        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
-        fi
-        ;;
-      *)
-       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-         LD="${LD-ld} -64"
-       fi
-       ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_PROG_AR
-# -----------
-m4_defun([_LT_PROG_AR],
-[AC_CHECK_TOOLS(AR, [ar], false)
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-
-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
-  [lt_cv_ar_at_file=no
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
-     [echo conftest.$ac_objext > conftest.lst
-      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
-      AC_TRY_EVAL([lt_ar_try])
-      if test "$ac_status" -eq 0; then
-       # Ensure the archiver fails upon bogus file names.
-       rm -f conftest.$ac_objext libconftest.a
-       AC_TRY_EVAL([lt_ar_try])
-       if test "$ac_status" -ne 0; then
-          lt_cv_ar_at_file=@
-        fi
-      fi
-      rm -f conftest.* libconftest.a
-     ])
-  ])
-
-if test "x$lt_cv_ar_at_file" = xno; then
-  archiver_list_spec=
-else
-  archiver_list_spec=$lt_cv_ar_at_file
-fi
-_LT_DECL([], [archiver_list_spec], [1],
-  [How to feed a file listing to the archiver])
-])# _LT_PROG_AR
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[_LT_PROG_AR
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
-    [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
-  darwin*)
-    lock_old_archive_extraction=yes ;;
-  *)
-    lock_old_archive_extraction=no ;;
-esac
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
-    [Commands used to build an old-style archive])
-_LT_DECL([], [lock_old_archive_extraction], [0],
-    [Whether to use a lock for old archive extraction])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$5], , :, [$5])
-else
-    m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                  [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$4], , :, [$4])
-else
-    m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
-  i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  mint*)
-    # On MiNT this can take a long time and run out of memory.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  os2*)
-    # The test takes a long time on OS/2.
-    lt_cv_sys_max_cmd_len=8192
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[        ]]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
-                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-             test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
-  AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
-    [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-       }
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}]
-_LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_dlunknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    AC_CHECK_LIB([dl], [dlopen],
-               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ])
-    ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-         [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
-       [AC_CHECK_FUNC([dlopen],
-             [lt_cv_dlopen="dlopen"],
-         [AC_CHECK_LIB([dl], [dlopen],
-               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-           [AC_CHECK_LIB([svld], [dlopen],
-                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-             [AC_CHECK_LIB([dld], [dld_link],
-                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
-             ])
-           ])
-         ])
-       ])
-      ])
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-         lt_cv_dlopen_self, [dnl
-         _LT_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-         lt_cv_dlopen_self_static, [dnl
-         _LT_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
-        [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
-        [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
-        [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-     fi
-   fi
-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
-       [Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
-         [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
-   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
-    [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      AC_MSG_RESULT([yes])
-    else
-      AC_MSG_RESULT([no])
-    fi
-    ;;
-  *)
-    AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
-       [], [
-if test "$GCC" = yes; then
-  case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
-  esac
-  case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
-  case $lt_search_path_spec in
-  *\;*)
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
-    ;;
-  *)
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
-    ;;
-  esac
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
-      test -d "$lt_sys_path" && \
-       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
-  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
-  # AWK program above erroneously prepends '/' to C:/dos/paths
-  # for these hosts.
-  case $host_os in
-    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
-  esac
-  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[[4-9]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-          echo ' yes '
-          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-       :
-      else
-       can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$cc_basename in
-  yes,*)
-    # gcc
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-m4_if([$1], [],[
-      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    dynamic_linker='Win32 ld.exe'
-    ;;
-
-  *,cl*)
-    # Native MSVC
-    libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
-
-    case $build_os in
-    mingw*)
-      sys_lib_search_path_spec=
-      lt_save_ifs=$IFS
-      IFS=';'
-      for lt_path in $LIB
-      do
-        IFS=$lt_save_ifs
-        # Let DOS variable expansion print the short 8.3 style file name.
-        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-      done
-      IFS=$lt_save_ifs
-      # Convert to MSYS style.
-      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
-      ;;
-    cygwin*)
-      # Convert to unix form, then to dos form, then back to unix form
-      # but this time dos style (no spaces!) so that the unix form looks
-      # like /cygdrive/c/PROGRA~1:/cygdr...
-      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      ;;
-    *)
-      sys_lib_search_path_spec="$LIB"
-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      # FIXME: find the short name or the path components, as spaces are
-      # common. (e.g. "Program Files" -> "PROGRA~1")
-      ;;
-    esac
-
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-    dynamic_linker='Win32 link.exe'
-    ;;
-
-  *)
-    # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    dynamic_linker='Win32 ld.exe'
-    ;;
-  esac
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[[23]].*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2.*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
-  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-haiku*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
-  postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
-  ;;
-
-interix[[3-9]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux # correct to gnu/linux during the next big refactor
-       else
-               version_type=irix
-       fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-
-  # Some binutils ld are patched to set DT_RUNPATH
-  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
-    [lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
-        LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
-        [lt_cv_shlibpath_overrides_runpath=yes])])
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-    ])
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-       shlibpath_overrides_runpath=no
-       ;;
-      *)
-       shlibpath_overrides_runpath=yes
-       ;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-       ;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
-    [Variables whose values should be saved in libtool wrapper scripts and
-    restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
-    [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
-    [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
-    [[List of archive names.  First name is the real one, the rest are links.
-    The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
-    [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [install_override_mode], [1],
-    [Permission mode override for installation of shared libraries])
-_LT_DECL([], [postinstall_cmds], [2],
-    [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
-    [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
-    [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
-    [[As "finish_cmds", except a single script fragment to be evaled but
-    not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
-    [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
-    [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
-    [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="m4_if([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           $EGREP "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
-        [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
-
-AC_ARG_WITH([gnu-ld],
-    [AS_HELP_STRING([--with-gnu-ld],
-       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
-    [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break
-       ;;
-      *)
-       test "$with_gnu_ld" != yes && break
-       ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
-  lt_cv_ld_reload_flag,
-  [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
-      reload_cmds=false
-    fi
-    ;;
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[[45]]*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    # Keep this pattern in sync with the one in func_win32_libid.
-    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  ;;
-
-cegcc*)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-haiku*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[[3-9]]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
-  case $host_os in
-  mingw* | pw32*)
-    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-      want_nocaseglob=yes
-    else
-      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
-    fi
-    ;;
-  esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
-    [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
-    [Command to use when deplibs_check_method = "file_magic"])
-_LT_DECL([], [file_magic_glob], [1],
-    [How to find potential files when deplibs_check_method = "file_magic"])
-_LT_DECL([], [want_nocaseglob], [1],
-    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-       # Check to see if the nm accepts a BSD-compat flag.
-       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-       #   nm: unknown option "B" ignored
-       # Tru64's nm complains that /dev/null is an invalid object file
-       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-       */dev/null* | *'Invalid file or object type'*)
-         lt_cv_path_NM="$tmp_nm -B"
-         break
-         ;;
-       *)
-         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-         */dev/null*)
-           lt_cv_path_NM="$tmp_nm -p"
-           break
-           ;;
-         *)
-           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-           continue # so that we can try to find one that supports BSD flags
-           ;;
-         esac
-         ;;
-       esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$DUMPBIN"; then :
-    # Let the user override the test.
-  else
-    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
-    *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
-      ;;
-    *)
-      DUMPBIN=:
-      ;;
-    esac
-  fi
-  AC_SUBST([DUMPBIN])
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
-  [lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
-  cat conftest.out >&AS_MESSAGE_LOG_FD
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-# --------------------------------
-# how to determine the name of the shared library
-# associated with a specific link library.
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-m4_require([_LT_DECL_DLLTOOL])
-AC_CACHE_CHECK([how to associate runtime and link libraries],
-lt_cv_sharedlib_from_linklib_cmd,
-[lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
-  case `$DLLTOOL --help 2>&1` in
-  *--identify-strict*)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-    ;;
-  *)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-    ;;
-  esac
-  ;;
-*)
-  # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-  ;;
-esac
-])
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
-    [Command to associate shared and link libraries])
-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-
-
-# _LT_PATH_MANIFEST_TOOL
-# ----------------------
-# locate the manifest tool
-m4_defun([_LT_PATH_MANIFEST_TOOL],
-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
-  [lt_cv_path_mainfest_tool=no
-  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
-  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-    lt_cv_path_mainfest_tool=yes
-  fi
-  rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
-  MANIFEST_TOOL=:
-fi
-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-])# _LT_PATH_MANIFEST_TOOL
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
-  ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
-  case $cc_basename in
-  nvcc*)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
-  esac
-
-  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
-       [Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris*)
-  symcode='[[BDRT]]'
-  ;;
-sco3.2v5*)
-  symcode='[[DT]]'
-  ;;
-sysv4.2uw2*)
-  symcode='[[DT]]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[[ABDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK ['"\
-"     {last_section=section; section=\$ 3};"\
-"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx]"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[    ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-       mv -f "$nlist"T "$nlist"
-      else
-       rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-         cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT@&t@_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data.  */
-# define LT@&t@_DLSYM_CONST
-#else
-# define LT@&t@_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-         cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-LT@&t@_DLSYM_CONST struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-         cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         lt_globsym_save_LIBS=$LIBS
-         lt_globsym_save_CFLAGS=$CFLAGS
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-         if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
-           pipe_works=yes
-         fi
-         LIBS=$lt_globsym_save_LIBS
-         CFLAGS=$lt_globsym_save_CFLAGS
-       else
-         echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
-       fi
-      else
-       echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
-    fi
-  else
-    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
-  nm_file_list_spec='@'
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
-    [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
-    [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
-    [lt_cv_sys_global_symbol_to_c_name_address], [1],
-    [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
-    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
-    [Transform the output of nm in a C name address pair when lib prefix is needed])
-_LT_DECL([], [nm_file_list_spec], [1],
-    [Specify filename containing input files for $NM])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-m4_if([$1], [CXX], [
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-       ;;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       ;;
-      esac
-      ;;
-    *qnx* | *nto*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[[4-9]]*)
-       # All AIX code is PIC.
-       if test "$host_cpu" = ia64; then
-         # AIX 5 now supports IA64 processor
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-       else
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-       fi
-       ;;
-      chorus*)
-       case $cc_basename in
-       cxch68*)
-         # Green Hills C++ Compiler
-         # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-         ;;
-       esac
-       ;;
-      mingw* | cygwin* | os2* | pw32* | cegcc*)
-       # This hack is so that the source file can tell whether it is being
-       # built for inclusion in a dll (and should export symbols for example).
-       m4_if([$1], [GCJ], [],
-         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-       ;;
-      dgux*)
-       case $cc_basename in
-         ec++*)
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           ;;
-         ghcx*)
-           # Green Hills C++ Compiler
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      freebsd* | dragonfly*)
-       # FreeBSD uses GNU C++
-       ;;
-      hpux9* | hpux10* | hpux11*)
-       case $cc_basename in
-         CC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-           if test "$host_cpu" != ia64; then
-             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-           fi
-           ;;
-         aCC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-           case $host_cpu in
-           hppa*64*|ia64*)
-             # +Z the default
-             ;;
-           *)
-             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-             ;;
-           esac
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      interix*)
-       # This is c89, which is MS Visual C++ (no shared libs)
-       # Anyone wants to do a port?
-       ;;
-      irix5* | irix6* | nonstopux*)
-       case $cc_basename in
-         CC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           # CC pic flag -KPIC is the default.
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-       case $cc_basename in
-         KCC*)
-           # KAI C++ Compiler
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-           ;;
-         ecpc* )
-           # old Intel C++ for x86_64 which still supported -KPIC.
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-           ;;
-         icpc* )
-           # Intel C++, used to be incompatible with GCC.
-           # ICC 10 doesn't accept -KPIC any more.
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-           ;;
-         pgCC* | pgcpp*)
-           # Portland Group C++ compiler
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           ;;
-         cxx*)
-           # Compaq C++
-           # Make sure the PIC flag is empty.  It appears that all Alpha
-           # Linux and Compaq Tru64 Unix objects are PIC.
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           ;;
-         xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
-           # IBM XL 8.0, 9.0 on PPC and BlueGene
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-           ;;
-         *)
-           case `$CC -V 2>&1 | sed 5q` in
-           *Sun\ C*)
-             # Sun C++ 5.9
-             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-             ;;
-           esac
-           ;;
-       esac
-       ;;
-      lynxos*)
-       ;;
-      m88k*)
-       ;;
-      mvs*)
-       case $cc_basename in
-         cxx*)
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      netbsd*)
-       ;;
-      *qnx* | *nto*)
-        # QNX uses GNU C++, but need to define -shared option too, otherwise
-        # it will coredump.
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-        ;;
-      osf3* | osf4* | osf5*)
-       case $cc_basename in
-         KCC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-           ;;
-         RCC*)
-           # Rational C++ 2.4.1
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         cxx*)
-           # Digital/Compaq C++
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           # Make sure the PIC flag is empty.  It appears that all Alpha
-           # Linux and Compaq Tru64 Unix objects are PIC.
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      psos*)
-       ;;
-      solaris*)
-       case $cc_basename in
-         CC* | sunCC*)
-           # Sun C++ 4.2, 5.x and Centerline C++
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-           ;;
-         gcx*)
-           # Green Hills C++ Compiler
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      sunos4*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.x
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           ;;
-         lcc*)
-           # Lucid
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-       case $cc_basename in
-         CC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           ;;
-       esac
-       ;;
-      tandem*)
-       case $cc_basename in
-         NCC*)
-           # NonStop-UX NCC 3.20
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      vxworks*)
-       ;;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-       ;;
-    esac
-  fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-       # +Z the default
-       ;;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       ;;
-      esac
-      ;;
-
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-
-    case $cc_basename in
-    nvcc*) # Cuda Compiler Driver 2.2
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
-      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
-      fi
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      m4_if([$1], [GCJ], [],
-       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-       # +Z the default
-       ;;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-       ;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
-      case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
-      ecc*)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
-       ;;
-      nagfor*)
-       # NAG Fortran compiler
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-       ;;
-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-       # which looks to be a dead project)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      xl* | bgxl* | bgf* | mpixl*)
-       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-       ;;
-      *)
-       case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
-         # Sun Fortran 8.3 passes all unrecognized flags to the linker
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
-         ;;
-       *Sun\ F* | *Sun*Fortran*)
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-         ;;
-       *Sun\ C*)
-         # Sun C 5.9
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         ;;
-        *Intel*\ [[CF]]*Compiler*)
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-         ;;
-       *Portland\ Group*)
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-         ;;
-       esac
-       ;;
-      esac
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    rdos*)
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    unicos*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-
-AC_CACHE_CHECK([for $compiler option to produce PIC],
-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
-    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
-    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
-       [Additional compiler flags for building library objects])
-
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
-       [How to pass a linker flag through the compiler])
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
-  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
-  $lt_tmp_static_flag,
-  [],
-  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
-       [Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  case $host_os in
-  aix[[4-9]]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-    ;;
-  cygwin* | mingw* | cegcc*)
-    case $cc_basename in
-    cl*)
-      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-      ;;
-    *)
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-      ;;
-    esac
-    ;;
-  *)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-    ;;
-  esac
-], [
-  runpath_var=
-  _LT_TAGVAR(allow_undefined_flag, $1)=
-  _LT_TAGVAR(always_export_symbols, $1)=no
-  _LT_TAGVAR(archive_cmds, $1)=
-  _LT_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_TAGVAR(compiler_needs_object, $1)=no
-  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  _LT_TAGVAR(hardcode_automatic, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
-  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(inherit_rpath, $1)=no
-  _LT_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_TAGVAR(module_cmds, $1)=
-  _LT_TAGVAR(module_expsym_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_TAGVAR(include_expsyms, $1)=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  # 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.
-  # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  _LT_TAGVAR(ld_shlibs, $1)=yes
-
-  # On some targets, GNU ld is compatible enough with the native linker
-  # that we're better off using the native interface for both.
-  lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
-    case $host_os in
-      aix*)
-       # The AIX port of GNU ld has always aspired to compatibility
-       # with the native linker.  However, as the warning in the GNU ld
-       # block says, versions before 2.19.5* couldn't really create working
-       # shared libraries, regardless of the interface used.
-       case `$LD -v 2>&1` in
-         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
-         *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
-         *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
-         *)
-           lt_use_gnu_ld_interface=yes
-           ;;
-       esac
-       ;;
-      *)
-       lt_use_gnu_ld_interface=yes
-       ;;
-    esac
-  fi
-
-  if test "$lt_use_gnu_ld_interface" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[[3-9]]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-       # support --undefined.  This deserves some investigation.  FIXME
-       _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=no
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-       # If the export-symbols file already is a .def file (1st line
-       # is EXPORTS), use it as is; otherwise, prepend...
-       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-         cp $export_symbols $output_objdir/$soname.def;
-       else
-         echo EXPORTS > $output_objdir/$soname.def;
-         cat $export_symbols >> $output_objdir/$soname.def;
-       fi~
-       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    interix[[3-9]]*)
-      _LT_TAGVAR(hardcode_direct, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
-      tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
-       case $cc_basename in
-         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
-       esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-        && test "$tmp_diet" = no
-      then
-       tmp_addflag=' $pic_flag'
-       tmp_sharedflag='-shared'
-       case $cc_basename,$host_cpu in
-        pgcc*)                         # Portland Group C compiler
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95* | pgfortran*)
-                                       # Portland Group f77 and f90 compilers
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag -Mnomain' ;;
-       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
-         tmp_addflag=' -i_dynamic' ;;
-       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
-         tmp_addflag=' -i_dynamic -nofor_main' ;;
-       ifc* | ifort*)                  # Intel Fortran compiler
-         tmp_addflag=' -nofor_main' ;;
-       lf95*)                          # Lahey Fortran 8.1
-         _LT_TAGVAR(whole_archive_flag_spec, $1)=
-         tmp_sharedflag='--shared' ;;
-       xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
-         tmp_sharedflag='-qmkshrobj'
-         tmp_addflag= ;;
-       nvcc*)  # Cuda Compiler Driver 2.2
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         _LT_TAGVAR(compiler_needs_object, $1)=yes
-         ;;
-       esac
-       case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ C*)                       # Sun C 5.9
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         _LT_TAGVAR(compiler_needs_object, $1)=yes
-         tmp_sharedflag='-G' ;;
-       *Sun\ F*)                       # Sun Fortran 8.3
-         tmp_sharedflag='-G' ;;
-       esac
-       _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-        if test "x$supports_anon_versioning" = xyes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-           echo "local: *; };" >> $output_objdir/$libname.ver~
-           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-        fi
-
-       case $cc_basename in
-       xlf* | bgf* | bgxlf* | mpixlf*)
-         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-         _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-         if test "x$supports_anon_versioning" = xyes; then
-           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-             echo "local: *; };" >> $output_objdir/$libname.ver~
-             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-         fi
-         ;;
-       esac
-      else
-        _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-       wlarc=
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       cat <<_LT_EOF 1>&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.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-       ;;
-       *)
-         # For security reasons, it is highly recommended that you always
-         # use absolute paths for naming shared libraries, and exclude the
-         # DT_RUNPATH tag from executables and libraries.  But doing so
-         # requires that you compile everything twice, which is a pain.
-         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-         else
-           _LT_TAGVAR(ld_shlibs, $1)=no
-         fi
-       ;;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       _LT_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
-       # On IA64, the linker does run time linking by default, so we don't
-       # have to do anything special.
-       aix_use_runtimelinking=no
-       exp_sym_flag='-Bexport'
-       no_entry_flag=""
-      else
-       # If we're using GNU nm, then we don't want the "-C" option.
-       # -C means demangle to AIX nm, but means don't demangle with GNU nm
-       # Also, AIX nm treats weak defined symbols like other global
-       # defined symbols, whereas GNU nm marks them as "W".
-       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-       else
-         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-       fi
-       aix_use_runtimelinking=no
-
-       # Test if we are trying to use run time linking or normal
-       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-       # need to do runtime linking.
-       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-         for ld_flag in $LDFLAGS; do
-         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-           aix_use_runtimelinking=yes
-           break
-         fi
-         done
-         ;;
-       esac
-
-       exp_sym_flag='-bexport'
-       no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      _LT_TAGVAR(archive_cmds, $1)=''
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-      if test "$GCC" = yes; then
-       case $host_os in aix4.[[012]]|aix4.[[012]].*)
-       # We only want to do this on AIX 4.2 and lower, the check
-       # below for broken collect2 doesn't work under 4.3+
-         collect2name=`${CC} -print-prog-name=collect2`
-         if test -f "$collect2name" &&
-          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-         then
-         # We have reworked collect2
-         :
-         else
-         # We have old collect2
-         _LT_TAGVAR(hardcode_direct, $1)=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         _LT_TAGVAR(hardcode_minus_L, $1)=yes
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_TAGVAR(hardcode_libdir_separator, $1)=
-         fi
-         ;;
-       esac
-       shared_flag='-shared'
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag="$shared_flag "'${wl}-G'
-       fi
-      else
-       # not using gcc
-       if test "$host_cpu" = ia64; then
-       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-       # chokes on -Wl,-G. The following line is correct:
-         shared_flag='-G'
-       else
-         if test "$aix_use_runtimelinking" = yes; then
-           shared_flag='${wl}-G'
-         else
-           shared_flag='${wl}-bM:SRE'
-         fi
-       fi
-      fi
-
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
-       # Warning - without using the other runtime loading flags (-brtl),
-       # -berok will link without error, but may produce a broken library.
-       _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-      else
-       if test "$host_cpu" = ia64; then
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-         _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-         # Warning - without using the other run time loading flags,
-         # -berok will link without error, but may produce a broken library.
-         _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-         if test "$with_gnu_ld" = yes; then
-           # We only use this code for GNU lds that support --whole-archive.
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-         else
-           # Exported symbols can be pulled into shared objects from archives
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-         fi
-         _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-         # This is similar to how AIX traditionally builds its shared libraries.
-         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[[45]]*)
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      case $cc_basename in
-      cl*)
-       # Native MSVC
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-       _LT_TAGVAR(always_export_symbols, $1)=yes
-       _LT_TAGVAR(file_list_spec, $1)='@'
-       # Tell ltmain to make .lib files, not .a files.
-       libext=lib
-       # Tell ltmain to make .dll files, not .so files.
-       shrext_cmds=".dll"
-       # FIXME: Setting linknames here is a bad hack.
-       _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-         else
-           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-         fi~
-         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-         linknames='
-       # The linker will not automatically build a static lib if we build a DLL.
-       # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-       _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-       _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-       # Don't use ranlib
-       _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-       _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-         lt_tool_outputfile="@TOOL_OUTPUT@"~
-         case $lt_outputfile in
-           *.exe|*.EXE) ;;
-           *)
-             lt_outputfile="$lt_outputfile.exe"
-             lt_tool_outputfile="$lt_tool_outputfile.exe"
-             ;;
-         esac~
-         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-           $RM "$lt_outputfile.manifest";
-         fi'
-       ;;
-      *)
-       # Assume MSVC wrapper
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-       # Tell ltmain to make .lib files, not .a files.
-       libext=lib
-       # Tell ltmain to make .dll files, not .so files.
-       shrext_cmds=".dll"
-       # FIXME: Setting linknames here is a bad hack.
-       _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-       # The linker will automatically build a .lib file if we build a DLL.
-       _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-       # FIXME: Should let the user specify the lib program.
-       _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-       ;;
-      esac
-      ;;
-
-    darwin* | rhapsody*)
-      _LT_DARWIN_LINKER_FEATURES($1)
-      ;;
-
-    dgux*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2.*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-       _LT_TAGVAR(hardcode_direct, $1)=yes
-       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-       # hardcode_minus_L: Not really in the search PATH,
-       # but as the default location of the library.
-       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       ia64*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       ia64*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-       m4_if($1, [], [
-         # Older versions of the 11.00 compiler do not understand -b yet
-         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
-         _LT_LINKER_OPTION([if $CC understands -b],
-           _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-           [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
-           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-         [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_TAGVAR(hardcode_direct, $1)=no
-         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-         ;;
-       *)
-         _LT_TAGVAR(hardcode_direct, $1)=yes
-         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         _LT_TAGVAR(hardcode_minus_L, $1)=yes
-         ;;
-       esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       # Try to use the -exported_symbol ld option, if it does not
-       # work, assume that -exports_file does not work either and
-       # implicitly export all symbols.
-       # This should be the same for all languages, so no per-tag cache variable.
-       AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
-         [lt_cv_irix_exported_symbol],
-         [save_LDFLAGS="$LDFLAGS"
-          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-          AC_LINK_IFELSE(
-            [AC_LANG_SOURCE(
-               [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
-                             [C++], [[int foo (void) { return 0; }]],
-                             [Fortran 77], [[
-      subroutine foo
-      end]],
-                             [Fortran], [[
-      subroutine foo
-      end]])])],
-             [lt_cv_irix_exported_symbol=yes],
-             [lt_cv_irix_exported_symbol=no])
-           LDFLAGS="$save_LDFLAGS"])
-       if test "$lt_cv_irix_exported_symbol" = yes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-       fi
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(inherit_rpath, $1)=yes
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-       _LT_TAGVAR(hardcode_direct, $1)=yes
-       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-       else
-         case $host_os in
-          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-            _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-            ;;
-          *)
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-            ;;
-         esac
-       fi
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    os2*)
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    osf4* | osf5*)     # as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
-       # Both c and cxx compiler support -rpath directly
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-       case `$CC -V 2>&1` in
-       *"Compilers 5.0"*)
-         wlarc=''
-         _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-         ;;
-       *)
-         wlarc='${wl}'
-         _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-         ;;
-       esac
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-       # The compiler driver will combine and reorder linker options,
-       # but understands `-z linker_flag'.  GCC discards it without `$wl',
-       # but is careful enough not to reorder.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       if test "$GCC" = yes; then
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-       else
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-       fi
-       ;;
-      esac
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-       # Use $CC to link under sequent, because it throws in some extra .o
-       # files that make .init and .fini sections work.
-       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-       sni)
-         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-       ;;
-       siemens)
-         ## LD is ld it makes a PLAMLIB
-         ## CC just makes a GrossModule.
-         _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-         _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-         _LT_TAGVAR(hardcode_direct, $1)=no
-        ;;
-       motorola)
-         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-       ;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4.3*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       runpath_var=LD_RUN_PATH
-       hardcode_runpath_var=yes
-       _LT_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-
-    if test x$host_vendor = xsni; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
-       ;;
-      esac
-    fi
-  fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
-    [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_TAGVAR(archive_cmds, $1) in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
-       [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
-       [$RM conftest*
-       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-         soname=conftest
-         lib=conftest
-         libobjs=conftest.$ac_objext
-         deplibs=
-         wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
-         pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
-         compiler_flags=-v
-         linker_flags=-v
-         verstring=
-         output_objdir=.
-         libname=conftest
-         lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
-         _LT_TAGVAR(allow_undefined_flag, $1)=
-         if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
-         then
-           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-         else
-           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-         fi
-         _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-       else
-         cat conftest.err 1>&5
-       fi
-       $RM conftest*
-       ])
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
-    [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
-    [enable_shared_with_static_runtimes], [0],
-    [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
-    [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
-    [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
-    [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
-    [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
-    [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
-    [Commands used to build a loadable module if different from building
-    a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
-    [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
-    [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
-    [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
-    [Flag to hardcode $libdir into a binary during linking.
-    This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
-    [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
-    library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
-    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
-    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
-    [Set to "yes" if building a shared library automatically hardcodes DIR
-    into the library and all subsequent libraries and executables linked
-    against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
-    [Set to yes if linker adds runtime paths of dependent libraries
-    to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
-    [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [always_export_symbols], [0],
-    [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
-    [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
-    [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
-    [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
-    [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [postlink_cmds], [2],
-    [Commands necessary for finishing linking programs])
-_LT_TAGDECL([], [file_list_spec], [1],
-    [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl    [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_SYS_DYNAMIC_LINKER($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-  LT_SYS_DLOPEN_SELF
-  _LT_CMD_STRIPLIB
-
-  # Report which library types will actually be built
-  AC_MSG_CHECKING([if libtool supports shared libraries])
-  AC_MSG_RESULT([$can_build_shared])
-
-  AC_MSG_CHECKING([whether to build shared libraries])
-  test "$can_build_shared" = "no" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[[4-9]]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  AC_MSG_RESULT([$enable_shared])
-
-  AC_MSG_CHECKING([whether to build static libraries])
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  AC_MSG_RESULT([$enable_static])
-
-  _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_CFLAGS=$CFLAGS
-  lt_save_LD=$LD
-  lt_save_GCC=$GCC
-  GCC=$GXX
-  lt_save_with_gnu_ld=$with_gnu_ld
-  lt_save_path_LD=$lt_cv_path_LD
-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-  else
-    $as_unset lt_cv_prog_gnu_ld
-  fi
-  if test -n "${lt_cv_path_LDCXX+set}"; then
-    lt_cv_path_LD=$lt_cv_path_LDCXX
-  else
-    $as_unset lt_cv_path_LD
-  fi
-  test -z "${LDCXX+set}" || LD=$LDCXX
-  CC=${CXX-"c++"}
-  CFLAGS=$CXXFLAGS
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    # We don't want -fno-exception when compiling C++ code, so set the
-    # no_builtin_flag separately
-    if test "$GXX" = yes; then
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-    else
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-    fi
-
-    if test "$GXX" = yes; then
-      # Set up default GNU C++ configuration
-
-      LT_PATH_LD
-
-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
-      # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-        # If archive_cmds runs LD, not CC, wlarc should be empty
-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-        #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
-
-        # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-         $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-        else
-          _LT_TAGVAR(whole_archive_flag_spec, $1)=
-        fi
-      else
-        with_gnu_ld=no
-        wlarc=
-
-        # A generic and very simple default shared library creation
-        # command for GNU C++ for the case where it uses the native
-        # linker, instead of GNU ld.  If possible, this setting should
-        # overridden to take advantage of the native linker features on
-        # the platform it is being used on.
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      fi
-
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-    else
-      GXX=no
-      with_gnu_ld=no
-      wlarc=
-    fi
-
-    # PORTME: fill in a description of your system's C++ link characteristics
-    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-    _LT_TAGVAR(ld_shlibs, $1)=yes
-    case $host_os in
-      aix3*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-      aix[[4-9]]*)
-        if test "$host_cpu" = ia64; then
-          # On IA64, the linker does run time linking by default, so we don't
-          # have to do anything special.
-          aix_use_runtimelinking=no
-          exp_sym_flag='-Bexport'
-          no_entry_flag=""
-        else
-          aix_use_runtimelinking=no
-
-          # Test if we are trying to use run time linking or normal
-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
-          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-           for ld_flag in $LDFLAGS; do
-             case $ld_flag in
-             *-brtl*)
-               aix_use_runtimelinking=yes
-               break
-               ;;
-             esac
-           done
-           ;;
-          esac
-
-          exp_sym_flag='-bexport'
-          no_entry_flag='-bnoentry'
-        fi
-
-        # When large executables or shared objects are built, AIX ld can
-        # have problems creating the table of contents.  If linking a library
-        # or program results in "error TOC overflow" add -mminimal-toc to
-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-        _LT_TAGVAR(archive_cmds, $1)=''
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-        if test "$GXX" = yes; then
-          case $host_os in aix4.[[012]]|aix4.[[012]].*)
-          # We only want to do this on AIX 4.2 and lower, the check
-          # below for broken collect2 doesn't work under 4.3+
-         collect2name=`${CC} -print-prog-name=collect2`
-         if test -f "$collect2name" &&
-            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-         then
-           # We have reworked collect2
-           :
-         else
-           # We have old collect2
-           _LT_TAGVAR(hardcode_direct, $1)=unsupported
-           # It fails to find uninstalled libraries when the uninstalled
-           # path is not listed in the libpath.  Setting hardcode_minus_L
-           # to unsupported forces relinking
-           _LT_TAGVAR(hardcode_minus_L, $1)=yes
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-           _LT_TAGVAR(hardcode_libdir_separator, $1)=
-         fi
-          esac
-          shared_flag='-shared'
-         if test "$aix_use_runtimelinking" = yes; then
-           shared_flag="$shared_flag "'${wl}-G'
-         fi
-        else
-          # not using gcc
-          if test "$host_cpu" = ia64; then
-         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-         # chokes on -Wl,-G. The following line is correct:
-         shared_flag='-G'
-          else
-           if test "$aix_use_runtimelinking" = yes; then
-             shared_flag='${wl}-G'
-           else
-             shared_flag='${wl}-bM:SRE'
-           fi
-          fi
-        fi
-
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-        # It seems that -bexpall does not export symbols beginning with
-        # underscore (_), so it is better to generate a list of symbols to
-       # export.
-        _LT_TAGVAR(always_export_symbols, $1)=yes
-        if test "$aix_use_runtimelinking" = yes; then
-          # Warning - without using the other runtime loading flags (-brtl),
-          # -berok will link without error, but may produce a broken library.
-          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-          # Determine the default libpath from the value encoded in an empty
-          # executable.
-          _LT_SYS_MODULE_PATH_AIX([$1])
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-        else
-          if test "$host_cpu" = ia64; then
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-           _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-          else
-           # Determine the default libpath from the value encoded in an
-           # empty executable.
-           _LT_SYS_MODULE_PATH_AIX([$1])
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-           # Warning - without using the other run time loading flags,
-           # -berok will link without error, but may produce a broken library.
-           _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-           _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-           if test "$with_gnu_ld" = yes; then
-             # We only use this code for GNU lds that support --whole-archive.
-             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-           else
-             # Exported symbols can be pulled into shared objects from archives
-             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-           fi
-           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-           # This is similar to how AIX traditionally builds its shared
-           # libraries.
-           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-          fi
-        fi
-        ;;
-
-      beos*)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-         # support --undefined.  This deserves some investigation.  FIXME
-         _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       else
-         _LT_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-
-      chorus*)
-        case $cc_basename in
-          *)
-         # FIXME: insert proper C++ library support
-         _LT_TAGVAR(ld_shlibs, $1)=no
-         ;;
-        esac
-        ;;
-
-      cygwin* | mingw* | pw32* | cegcc*)
-       case $GXX,$cc_basename in
-       ,cl* | no,cl*)
-         # Native MSVC
-         # hardcode_libdir_flag_spec is actually meaningless, as there is
-         # no search path for DLLs.
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-         _LT_TAGVAR(always_export_symbols, $1)=yes
-         _LT_TAGVAR(file_list_spec, $1)='@'
-         # Tell ltmain to make .lib files, not .a files.
-         libext=lib
-         # Tell ltmain to make .dll files, not .so files.
-         shrext_cmds=".dll"
-         # FIXME: Setting linknames here is a bad hack.
-         _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-             $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-           else
-             $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-           fi~
-           $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-           linknames='
-         # The linker will not automatically build a static lib if we build a DLL.
-         # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-         # Don't use ranlib
-         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-           lt_tool_outputfile="@TOOL_OUTPUT@"~
-           case $lt_outputfile in
-             *.exe|*.EXE) ;;
-             *)
-               lt_outputfile="$lt_outputfile.exe"
-               lt_tool_outputfile="$lt_tool_outputfile.exe"
-               ;;
-           esac~
-           func_to_tool_file "$lt_outputfile"~
-           if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-             $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-             $RM "$lt_outputfile.manifest";
-           fi'
-         ;;
-       *)
-         # g++
-         # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-         # as there is no search path for DLLs.
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
-         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-         _LT_TAGVAR(always_export_symbols, $1)=no
-         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-         if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-           # If the export-symbols file already is a .def file (1st line
-           # is EXPORTS), use it as is; otherwise, prepend...
-           _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-             cp $export_symbols $output_objdir/$soname.def;
-           else
-             echo EXPORTS > $output_objdir/$soname.def;
-             cat $export_symbols >> $output_objdir/$soname.def;
-           fi~
-           $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-         else
-           _LT_TAGVAR(ld_shlibs, $1)=no
-         fi
-         ;;
-       esac
-       ;;
-      darwin* | rhapsody*)
-        _LT_DARWIN_LINKER_FEATURES($1)
-       ;;
-
-      dgux*)
-        case $cc_basename in
-          ec++*)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          ghcx*)
-           # Green Hills C++ Compiler
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          *)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-        esac
-        ;;
-
-      freebsd2.*)
-        # C++ shared libraries reported to be fairly broken before
-       # switch to ELF
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      freebsd-elf*)
-        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        ;;
-
-      freebsd* | dragonfly*)
-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-        # conventions
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-        ;;
-
-      gnu*)
-        ;;
-
-      haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        ;;
-
-      hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-                                            # but as the default
-                                            # location of the library.
-
-        case $cc_basename in
-          CC*)
-            # FIXME: insert proper C++ library support
-            _LT_TAGVAR(ld_shlibs, $1)=no
-            ;;
-          aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            # Commands to make compiler produce verbose output that lists
-            # what "hidden" libraries, object files and flags are used when
-            # linking a shared library.
-            #
-            # There doesn't appear to be a way to prevent this compiler from
-            # explicitly linking system object files so we need to strip them
-            # from the output so that they don't get included in the library
-            # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-            ;;
-          *)
-            if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            else
-              # FIXME: insert proper C++ library support
-              _LT_TAGVAR(ld_shlibs, $1)=no
-            fi
-            ;;
-        esac
-        ;;
-
-      hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-          case $host_cpu in
-            hppa*64*|ia64*)
-              ;;
-            *)
-             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-              ;;
-          esac
-        fi
-        case $host_cpu in
-          hppa*64*|ia64*)
-            _LT_TAGVAR(hardcode_direct, $1)=no
-            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-            ;;
-          *)
-            _LT_TAGVAR(hardcode_direct, $1)=yes
-            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-                                                # but as the default
-                                                # location of the library.
-            ;;
-        esac
-
-        case $cc_basename in
-          CC*)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          aCC*)
-           case $host_cpu in
-             hppa*64*)
-               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-               ;;
-             ia64*)
-               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-               ;;
-             *)
-               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-               ;;
-           esac
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-           ;;
-          *)
-           if test "$GXX" = yes; then
-             if test $with_gnu_ld = no; then
-               case $host_cpu in
-                 hppa*64*)
-                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-                   ;;
-                 ia64*)
-                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-                   ;;
-                 *)
-                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-                   ;;
-               esac
-             fi
-           else
-             # FIXME: insert proper C++ library support
-             _LT_TAGVAR(ld_shlibs, $1)=no
-           fi
-           ;;
-        esac
-        ;;
-
-      interix[[3-9]]*)
-       _LT_TAGVAR(hardcode_direct, $1)=no
-       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-       # Instead, shared libraries are loaded at an image base (0x10000000 by
-       # default) and relocated if they conflict, which is a slow very memory
-       # consuming and fragmenting process.  To avoid this, we pick a random,
-       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-       ;;
-      irix5* | irix6*)
-        case $cc_basename in
-          CC*)
-           # SGI C++
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
-           # Archives containing C++ object files must be created using
-           # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-           # necessary to make sure instantiated templates are included
-           # in the archive.
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-           ;;
-          *)
-           if test "$GXX" = yes; then
-             if test "$with_gnu_ld" = no; then
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-             else
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
-             fi
-           fi
-           _LT_TAGVAR(link_all_deplibs, $1)=yes
-           ;;
-        esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(inherit_rpath, $1)=yes
-        ;;
-
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-        case $cc_basename in
-          KCC*)
-           # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-           # KCC will only create a shared library if the output file
-           # ends with ".so" (or ".sl" for HP-UX), so rename the library
-           # to its proper name (with version) after linking.
-           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-           # Archives containing C++ object files must be created using
-           # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-           ;;
-         icpc* | ecpc* )
-           # Intel C++
-           with_gnu_ld=yes
-           # version 8.0 and above of icpc choke on multiply defined symbols
-           # if we add $predep_objects and $postdep_objects, however 7.1 and
-           # earlier do not add the objects themselves.
-           case `$CC -V 2>&1` in
-             *"Version 7."*)
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-               ;;
-             *)  # Version 8.0 or newer
-               tmp_idyn=
-               case $host_cpu in
-                 ia64*) tmp_idyn=' -i_dynamic';;
-               esac
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-               ;;
-           esac
-           _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-           ;;
-          pgCC* | pgcpp*)
-            # Portland Group C++ compiler
-           case `$CC -V` in
-           *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
-             _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
-             _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-               $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-               $RANLIB $oldlib'
-             _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-             _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-             ;;
-           *) # Version 6 and above use weak symbols
-             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-             ;;
-           esac
-
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-            ;;
-         cxx*)
-           # Compaq C++
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-           runpath_var=LD_RUN_PATH
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
-           ;;
-         xl* | mpixl* | bgxl*)
-           # IBM XL 8.0 on PPC, with GNU ld
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-           _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           if test "x$supports_anon_versioning" = xyes; then
-             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-               echo "local: *; };" >> $output_objdir/$libname.ver~
-               $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-           fi
-           ;;
-         *)
-           case `$CC -V 2>&1 | sed 5q` in
-           *Sun\ C*)
-             # Sun C++ 5.9
-             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-             _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-             _LT_TAGVAR(compiler_needs_object, $1)=yes
-
-             # Not sure whether something based on
-             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-             # would be better.
-             output_verbose_link_cmd='func_echo_all'
-
-             # Archives containing C++ object files must be created using
-             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-             # necessary to make sure instantiated templates are included
-             # in the archive.
-             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-             ;;
-           esac
-           ;;
-       esac
-       ;;
-
-      lynxos*)
-        # FIXME: insert proper C++ library support
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       ;;
-
-      m88k*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-       ;;
-
-      mvs*)
-        case $cc_basename in
-          cxx*)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-         *)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-       esac
-       ;;
-
-      netbsd*)
-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-         wlarc=
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-         _LT_TAGVAR(hardcode_direct, $1)=yes
-         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       fi
-       # Workaround some broken pre-1.5 toolchains
-       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-       ;;
-
-      *nto* | *qnx*)
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-       ;;
-
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       ;;
-
-      openbsd*)
-       if test -f /usr/libexec/ld.so; then
-         _LT_TAGVAR(hardcode_direct, $1)=yes
-         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-         if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-           _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-         fi
-         output_verbose_link_cmd=func_echo_all
-       else
-         _LT_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-
-      osf3* | osf4* | osf5*)
-        case $cc_basename in
-          KCC*)
-           # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-           # KCC will only create a shared library if the output file
-           # ends with ".so" (or ".sl" for HP-UX), so rename the library
-           # to its proper name (with version) after linking.
-           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-           # Archives containing C++ object files must be created using
-           # the KAI C++ compiler.
-           case $host in
-             osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
-             *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
-           esac
-           ;;
-          RCC*)
-           # Rational C++ 2.4.1
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          cxx*)
-           case $host in
-             osf3*)
-               _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-               ;;
-             *)
-               _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-                 echo "-hidden">> $lib.exp~
-                 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-                 $RM $lib.exp'
-               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-               ;;
-           esac
-
-           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-           ;;
-         *)
-           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-             _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-             case $host in
-               osf3*)
-                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-                 ;;
-               *)
-                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-                 ;;
-             esac
-
-             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-             # Commands to make compiler produce verbose output that lists
-             # what "hidden" libraries, object files and flags are used when
-             # linking a shared library.
-             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-           else
-             # FIXME: insert proper C++ library support
-             _LT_TAGVAR(ld_shlibs, $1)=no
-           fi
-           ;;
-        esac
-        ;;
-
-      psos*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      sunos4*)
-        case $cc_basename in
-          CC*)
-           # Sun C++ 4.x
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          lcc*)
-           # Lucid
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          *)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-        esac
-        ;;
-
-      solaris*)
-        case $cc_basename in
-          CC* | sunCC*)
-           # Sun C++ 4.2, 5.x and Centerline C++
-            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
-           _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-           _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-             $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-           case $host_os in
-             solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-             *)
-               # The compiler driver will combine and reorder linker options,
-               # but understands `-z linker_flag'.
-               # Supported since Solaris 2.6 (maybe 2.5.1?)
-               _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-               ;;
-           esac
-           _LT_TAGVAR(link_all_deplibs, $1)=yes
-
-           output_verbose_link_cmd='func_echo_all'
-
-           # Archives containing C++ object files must be created using
-           # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-           # necessary to make sure instantiated templates are included
-           # in the archive.
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-           ;;
-          gcx*)
-           # Green Hills C++ Compiler
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-           # The C++ compiler must be used to create the archive.
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-           ;;
-          *)
-           # GNU C++ compiler with Solaris linker
-           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-             _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-             if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-               # Commands to make compiler produce verbose output that lists
-               # what "hidden" libraries, object files and flags are used when
-               # linking a shared library.
-               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-             else
-               # g++ 2.7 appears to require `-G' NOT `-shared' on this
-               # platform.
-               _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-               # Commands to make compiler produce verbose output that lists
-               # what "hidden" libraries, object files and flags are used when
-               # linking a shared library.
-               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-             fi
-
-             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-             case $host_os in
-               solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-               *)
-                 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-                 ;;
-             esac
-           fi
-           ;;
-        esac
-        ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      case $cc_basename in
-        CC*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-      esac
-      ;;
-
-      sysv5* | sco3.2v5* | sco5v6*)
-       # Note: We can NOT use -z defs as we might desire, because we do not
-       # link with -lc, and that would cause any symbols used from libc to
-       # always be unresolved, which means just about no library would
-       # ever link correctly.  If we're not using GNU ld we use -z text
-       # though, which does catch some bad symbols but isn't as heavy-handed
-       # as -z defs.
-       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-       _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-       _LT_TAGVAR(link_all_deplibs, $1)=yes
-       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-       runpath_var='LD_RUN_PATH'
-
-       case $cc_basename in
-          CC*)
-           _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-             '"$_LT_TAGVAR(old_archive_cmds, $1)"
-           _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-             '"$_LT_TAGVAR(reload_cmds, $1)"
-           ;;
-         *)
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           ;;
-       esac
-      ;;
-
-      tandem*)
-        case $cc_basename in
-          NCC*)
-           # NonStop-UX NCC 3.20
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          *)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-        esac
-        ;;
-
-      vxworks*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      *)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-    esac
-
-    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-    _LT_TAGVAR(GCC, $1)="$GXX"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_FUNC_STRIPNAME_CNF
-# ----------------------
-# func_stripname_cnf prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-#
-# This function is identical to the (non-XSI) version of func_stripname,
-# except this one can be used by m4 code that may be executed by configure,
-# rather than the libtool script.
-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-AC_REQUIRE([_LT_DECL_SED])
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-func_stripname_cnf ()
-{
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-  esac
-} # func_stripname_cnf
-])# _LT_FUNC_STRIPNAME_CNF
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-_LT_EOF
-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
-package foo
-func foo() {
-}
-_LT_EOF
-])
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
-        prev=$p
-        continue
-       fi
-
-       # Expand the sysroot to ease extracting the directories later.
-       if test -z "$prev"; then
-         case $p in
-         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
-         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
-         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
-         esac
-       fi
-       case $p in
-       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
-       esac
-       if test "$pre_test_object_deps_done" = no; then
-        case ${prev} in
-        -L | -R)
-          # Internal compiler library paths should come after those
-          # provided the user.  The postdeps already come after the
-          # user supplied libs so there is no need to process them.
-          if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-            _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-          else
-            _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
-          fi
-          ;;
-        # The "-l" case would never come before the object being
-        # linked, so don't bother handling this case.
-        esac
-       else
-        if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-          _LT_TAGVAR(postdeps, $1)="${prev}${p}"
-        else
-          _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
-        fi
-       fi
-       prev=
-       ;;
-
-    *.lto.$objext) ;; # Ignore GCC LTO objects
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-        pre_test_object_deps_done=yes
-        continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-        if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-          _LT_TAGVAR(predep_objects, $1)="$p"
-        else
-          _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
-        fi
-       else
-        if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-          _LT_TAGVAR(postdep_objects, $1)="$p"
-        else
-          _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
-        fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  _LT_TAGVAR(predep_objects,$1)=
-  _LT_TAGVAR(postdep_objects,$1)=
-  _LT_TAGVAR(postdeps,$1)=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
-    [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
-    [Dependencies to place before and after the objects being linked to
-    create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
-    [The library search path used internally by the compiler when linking
-    a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
-  _lt_disable_F77=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
-  CC=${F77-"f77"}
-  CFLAGS=$FFLAGS
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-  GCC=$G77
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-         test "$enable_shared" = yes && enable_static=no
-       fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$G77"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-  CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_LANG_PUSH(Fortran)
-
-if test -z "$FC" || test "X$FC" = "Xno"; then
-  _lt_disable_FC=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
-  CC=${FC-"f95"}
-  CFLAGS=$FCFLAGS
-  compiler=$CC
-  GCC=$ac_cv_fc_compiler_gnu
-
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-         test "$enable_shared" = yes && enable_static=no
-       fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-CFLAGS=$GCJFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GO_CONFIG],
-[AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
-
-# Source file extension for Go test sources.
-ac_ext=go
-
-# Object file extension for compiled Go test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GO_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-CFLAGS=
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
-  :
-  _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
-  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
-    [AC_CHECK_TOOL(GCJ, gcj,)
-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-      AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_GO
-# ----------
-AC_DEFUN([LT_PROG_GO],
-[AC_CHECK_TOOL(GOC, gccgo,)
-])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-# _LT_DECL_DLLTOOL
-# ----------------
-# Ensure DLLTOOL variable is set.
-m4_defun([_LT_DECL_DLLTOOL],
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-AC_SUBST([DLLTOOL])
-])
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
-    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
-  fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([    ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary parameter first.
-    func_stripname_result=${3}
-    func_stripname_result=${func_stripname_result#"${1}"}
-    func_stripname_result=${func_stripname_result%"${2}"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
-
-  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
-
-  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
-    func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
-    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
-# _LT_PATH_CONVERSION_FUNCTIONS
-# -----------------------------
-# Determine which file name conversion functions should be used by
-# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
-# for certain cross-compile configurations and native mingw.
-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_MSG_CHECKING([how to convert $build file names to $host format])
-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-[case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-        ;;
-    esac
-    ;;
-  *-*-cygwin* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_noop
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-        ;;
-    esac
-    ;;
-  * ) # unhandled hosts (and "normal" native builds)
-    lt_cv_to_host_file_cmd=func_convert_file_noop
-    ;;
-esac
-])
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
-         [0], [convert $build file names to $host format])dnl
-
-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-[#assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-        ;;
-    esac
-    ;;
-esac
-])
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
-         [0], [convert $build files to toolchain format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS
-
-# Helper functions for option handling.                    -*- Autoconf -*-
-#
-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-#   Inc.
-#   Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 7 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
-        _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-           [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
-                     [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME.  If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-    [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
-  dnl
-  dnl Simply set some default values (i.e off) if boolean options were not
-  dnl specified:
-  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
-  ])
-  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
-  ])
-  dnl
-  dnl If no reference was made to various pairs of opposing options, then
-  dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
-  dnl archives by default:
-  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
-  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-                  [_LT_ENABLE_FAST_INSTALL])
-  ])
-])# _LT_SET_OPTIONS
-
-
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS],      [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
-    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-       [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_shared=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
-    _LT_DECL([build_libtool_libs], [enable_shared], [0],
-       [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
-    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-       [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_static=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
-    _LT_DECL([build_old_libs], [enable_static], [0],
-       [Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
-    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_fast_install=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
-        [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
-       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [lt_p=${PACKAGE-default}
-    case $withval in
-    yes|no) pic_mode=$withval ;;
-    *)
-      pic_mode=default
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for lt_pkg in $withval; do
-       IFS="$lt_save_ifs"
-       if test "X$lt_pkg" = "X$lt_p"; then
-         pic_mode=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
-                [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
-                [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
-                [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
-                [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
-                [m4_define([_LTDL_TYPE], [convenience])])
-
-# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
-       [$#], [2], [[$2]],
-       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
-       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
-       [$#], 1, [],
-       [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
-          m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
-       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
-            [m4_foreach([_Lt_suffix],
-               ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
-       [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
-         [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
-                [lt_append([$1], [$2], [$3])$4],
-                [$5])],
-         [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
-       m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
-    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
-       [$5],
-    [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
-  [lt_join(m4_quote(m4_default([$4], [[, ]])),
-           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
-                     [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
-
-# ltversion.m4 -- version numbers                      -*- Autoconf -*-
-#
-#   Copyright (C) 2004 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# @configure_input@
-
-# serial 3337 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
-
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
-#
-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else.  This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION],  [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP],             [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],        [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT],         [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],    [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN],           [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR],             [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL],    [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN],           [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER],       [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK],               [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],        [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],    [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],    [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR],         [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR],            [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],  [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC],             [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU],            [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG],    [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD],   [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP],          [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED],            [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME],           [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE],  [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE],    [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL],          [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP],          [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN],                [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],     [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG],          [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL],   [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX],           [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77],           [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ],           [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],  [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG],      [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG],    [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG],    [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],    [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG],     [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG],         [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C],       [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],        [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP],                [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],        [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH],   [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77],              [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC],               [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX],              [AC_DEFUN([_LT_PROG_CXX])])
-
 # Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -8618,10 +32,10 @@ m4_ifndef([_LT_PROG_CXX],         [AC_DEFUN([_LT_PROG_CXX])])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.12'
+[am__api_version='1.13'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.12.5], [],
+m4_if([$1], [1.13], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -8637,7 +51,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.12.5])dnl
+[AM_AUTOMAKE_VERSION([1.13])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -8950,7 +364,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 [{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -9013,15 +427,6 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 ])
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
 # Do all the work for Automake.                             -*- Autoconf -*-
 
 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
@@ -9045,7 +450,7 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -9075,8 +480,7 @@ AC_SUBST([CYGPATH_W])
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
 [AC_DIAGNOSE([obsolete],
-[$0: two- and three-arguments forms are deprecated.  For more info, see:
-http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+             [$0: two- and three-arguments forms are deprecated.])
 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
@@ -9130,18 +534,15 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
                  [_AM_DEPENDENCIES([OBJC])],
                  [m4_define([AC_PROG_OBJC],
                             m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-dnl Support for Objective C++ was only introduced in Autoconf 2.65,
-dnl but we still cater to Autoconf 2.62.
-m4_ifdef([AC_PROG_OBJCXX],
-[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
                  [_AM_DEPENDENCIES([OBJCXX])],
                  [m4_define([AC_PROG_OBJCXX],
-                            m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
+                            m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
-dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
@@ -9251,8 +652,6 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 ]
 )
 
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
 # Copyright (C) 2001-2012 Free Software Foundation, Inc.
@@ -9320,8 +719,8 @@ AC_SUBST($1)])
 
 # AM_MISSING_HAS_RUN
 # ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
@@ -9334,8 +733,8 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
   AC_MSG_WARN(['missing' script is too old or missing])
@@ -9456,6 +855,66 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
+# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
 # Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -9596,3 +1055,8 @@ AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
+m4_include([scripts/libtool.m4])
+m4_include([scripts/ltoptions.m4])
+m4_include([scripts/ltsugar.m4])
+m4_include([scripts/ltversion.m4])
+m4_include([scripts/lt~obsolete.m4])
index 5be104eb1d9faff14bdbf82f2c8185f470e9e4aa..b6db4eb1c214d3b6da52ba74d71d0832369b04f2 100755 (executable)
 #! /bin/sh
-# a quick hack script to generate necessary files from 
-# auto* tools.
-#
-# WARNING: if you run this you will change the versions
-# of the tools which are used and, maybe, required!
-
-# You can define your own replacements in your environment.
-# $AUTOCONF,  $AUTOMAKE, $AUTOHEADER, $AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
-
-touch Makefile.am configure.ac
-{
-   LT=${LIBTOOLIZE-libtoolize}
-   echo "running $LT" >&2
-   $LT --force --copy --automake
-} && {
-   AL=${ACLOCAL-aclocal}
-   echo "running $AL" >&2
-   $AL
-} && {
-   AH=${AUTOHEADER-autoheader}
-   echo "running $AH [ignore the warnings]" >&2
-   $AH
-} && {
-   AM=${AUTOMAKE-automake}
-   echo "running $AM" >&2
-   $AM --force-missing --foreign -a -c
-} && {
-   AC=${AUTOCONF-autoconf}
-   echo "running $AC" >&2
-   $AC
-} &&
-   echo "autogen complete" >&2 ||
-   echo "ERROR: autogen.sh failed, autogen is incomplete" >&2
+#
+# Run 'autoreconf' to build 'configure', 'Makefile.in' and other configure
+# control files.
+#
+# The first time this is run on a GIT checkout the only files that exist are
+# configure.ac and Makefile.am; all of the autotools support scripts are
+# missing.  They are instantiated with autoreconf --force --install.
+#
+# For regular ("tarball") distributions all the files should exist.  We do not
+# want them to be updated *under any circumstances*.  It should never be
+# necessary to rune autogen.sh because ./configure --enable-maintainer-mode says
+# what to do if Makeile.am or configure.ac are changed.
+#
+# It is *probably* OK to update the files on a GIT checkout, because they have
+# come from the local tools, but leave that to the user who is assumed to know
+# whether it is ok or required.
+#
+# This script is intended to work without arguments, there are, however, hidden
+# arguments for (a) use while testing the script and (b) to fix up systems that
+# have been broken.  If (b) is required the script prompts for the correct
+# options.  For this reason the options are *NOT* documented in the help; this
+# is deliberate; UTSL.
+#
+clean=
+maintainer=
+while test $# -gt 0
+do
+   case "$1" in
+      --maintainer)
+         maintainer=1;;
+
+      --clean)
+         clean=1;;
+
+      *)
+         exec >&2
+         echo "$0: usage: ./autogen.sh"
+         if test -d .git
+         then
+            echo "  ./autogen.sh generates the configure script and"
+            echo "  Makefile.in, or refreshes them after changes to Makefile.am"
+            echo "  or configure.ac.  You may prefer to just run autoreconf."
+         elif test -z "$maintainer"
+         then
+            echo "  DO NOT RUN THIS SCRIPT."
+            echo "  If you need to change Makefile.am or configure.ac then you"
+            echo "  also need to run ./configure --enable-maintainer-mode and"
+            echo "  use the appropriate autotools, *NOT* this script, to update"
+            echo "  everything, please check the documentation of autoreconf."
+            echo "  WARNING: libpng is intentionally generated with a known,"
+            echo "  fixed, set of autotools.  It is known *NOT* to work with"
+            echo "  the collection of autotools distributed on highly reputable"
+            echo "  operating systems."
+            echo "  Remember: autotools is GNU software, you are expected to"
+            echo "  pay for support."
+         else
+            echo "  You have run autogen.sh with --maintainer enabled and you"
+            echo "  are not using a GIT distribution, then you have given an"
+            echo "  unrecognized argument.  This is not good. --maintainer"
+            echo "  switches off any assumptions that you might not know what"
+            echo "  you are doing."
+         fi
+         exit 1;;
+   esac
+
+   shift
+done
+#
+# First check for a set of the autotools files; if absent then this is assumed
+# to be a GIT version and the local autotools must be used.  If present this
+# is a tarball distribution and the script should not be used.  If partially
+# present bad things are happening.
+#
+# The autotools generated files:
+libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in\
+   config.sub configure depcomp install-sh ltmain.sh missing"
+#
+# These are separate because 'maintainer-clean' does not remove them.
+libpng_libtool_files="scripts/libtool.m4 scripts/ltoptions.m4\
+   scripts/ltsugar.m4 scripts/ltversion.m4 scripts/lt~obsolete.m4"
+
+libpng_autotools_dirs="autom4te.cache" # not required
+#
+# The configure generated files:
+libpng_configure_files="Makefile config.h config.log config.status\
+   libpng-config libpng.pc libtool stamp-h1"
+
+libpng_configure_dirs=".deps"
+#
+# We must remove the configure generated files as well as the autotools
+# generated files if autotools are regenerated because otherwise if configure
+# has been run without "--enable-maintainer-mode" make can do a partial update
+# of Makefile.  These functions do the two bits of cleaning.
+clean_autotools(){
+   rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs
+}
+
+clean_configure(){
+   rm -rf $libpng_configure_files $libpng_configure_dirs
+}
+#
+# Clean: remove everything (this is to help with testing)
+if test -n "$clean"
+then
+   clean_configure
+   if test -n "$maintainer"
+   then
+      clean_autotools
+   fi
+
+   exit 0
+fi
+#
+# Validate the distribution.
+libpng_autotools_file_found=
+libpng_autotools_file_missing=
+for file in $libpng_autotools_files
+do
+   if test -f  "$file"
+   then
+      libpng_autotools_file_found=1
+   else
+      libpng_autotools_file_missing=1
+   fi
+done
+#
+# Presence of one of these does not *invalidate* missing, but absence
+# invalidates found.
+for file in $libpng_libtool_files
+do
+   if test ! -f "$file"
+   then
+      libpng_autotools_file_missing=1
+   fi
+done
+#
+# The cache directory doesn't matter - it will be regenerated and does not exist
+# anyway in a tarball.
+#
+# Either everything is missing or everything is there, the --maintainer option
+# just changes this so that the mode is set to generate all the files.
+mode=
+if test -z "$libpng_autotools_file_found" -o -n "$maintainer"
+then
+   mode="autoreconf"
+else
+   if test -n "$libpng_autotools_file_missing"
+   then
+      mode="broken"
+   else
+      mode="configure"
+   fi
+fi
+#
+# So:
+case "$mode" in
+   autoreconf)
+      # Clean in case configure files exist
+      clean_configure
+      clean_autotools
+      # Everything must be initialized, so use --force
+      if autoreconf --warnings=all --force --install
+      then
+         missing=
+         for file in $libpng_autotools_files
+         do
+            test -f "$file" || missing=1
+         done
+         # ignore the cache directory
+         test -z "$missing" || {
+            exec >&2
+            echo "autoreconf was run, but did not produce all the expected"
+            echo "files.  It is likely that your autotools installation is"
+            echo "not compatible with that expected by libpng."
+            exit 1
+         }
+      else
+         exec >&2
+         echo "autoreconf failed: your version of autotools is incompatible"
+         echo "with this libpng version.  Please use a distributed archive"
+         echo "(which includes the autotools generated files) and run configure"
+         echo "instead."
+         exit 1
+      fi;;
+
+   configure)
+      if test -d .git
+      then
+         exec >&2
+         echo "ERROR: running autoreconf on an initialized sytem"
+         echo "  This is not necessary; it is only necessary to remake the"
+         echo "  autotools generated files if Makefile.am or configure.ac"
+         echo "  change and make does the right thing with:"
+         echo
+         echo "     ./configure --enable-maintainer-mode."
+         echo
+         echo "  You can run autoreconf yourself if you don't like maintainer"
+         echo "  mode and you can also just run autoreconf -f -i to initialize"
+         echo "  everything in the first place; this script is only for"
+         echo "  compatiblity with prior releases."
+         exit 1
+      else
+         exec >&2
+         echo "autogen.sh is intended only to generate 'configure' on systems"
+         echo "that do not have it.  You have a complete 'configure', if you"
+         echo "need to change Makefile.am or configure.ac you also need to"
+         echo "run configure with the --enable-maintainer-mode option."
+         exit 1
+      fi;;
+
+   broken)
+      exec >&2
+      echo "Your system has a partial set of autotools generated files."
+      echo "autogen.sh is unable to proceed.  The full set of files is"
+      echo "contained in the libpng 'tar' distribution archive and you do"
+      echo "not need to run autogen.sh if you use it."
+      exit 1;;
+esac
index 89b1286300aeccdd11354909580678eacfa5bd3c..8df5511094a7647957ed5294f1319bfb38ca2d2b 100755 (executable)
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
 #   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2012-10-10'
+timestamp='2012-12-06'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -1026,7 +1026,11 @@ case $basic_machine in
                basic_machine=i586-unknown
                os=-pw32
                ;;
-       rdos)
+       rdos | rdos64)
+               basic_machine=x86_64-pc
+               os=-rdos
+               ;;
+       rdos32)
                basic_machine=i386-pc
                os=-rdos
                ;;
index 1537865c461faac9a3285e84fb5e5df036da9607..2f2f5f22bdea662dc5d3d730ba0a7eb61bf8cbaf 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libpng 1.5.14.
+# Generated by GNU Autoconf 2.69 for libpng 1.6.0.
 #
 # Report bugs to <png-mng-implement@lists.sourceforge.net>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='libpng'
 PACKAGE_TARNAME='libpng'
-PACKAGE_VERSION='1.5.14'
-PACKAGE_STRING='libpng 1.5.14'
+PACKAGE_VERSION='1.6.0'
+PACKAGE_STRING='libpng 1.6.0'
 PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
 PACKAGE_URL=''
 
@@ -638,6 +638,9 @@ LTLIBOBJS
 PNG_ARM_NEON_FALSE
 PNG_ARM_NEON_TRUE
 AM_CCASFLAGS
+DO_PNG_PREFIX_FALSE
+DO_PNG_PREFIX_TRUE
+PNG_PREFIX
 binconfigs
 pkgconfigdir
 PNGLIB_RELEASE
@@ -649,9 +652,9 @@ HAVE_LD_VERSION_SCRIPT_FALSE
 HAVE_LD_VERSION_SCRIPT_TRUE
 HAVE_SOLARIS_LD_FALSE
 HAVE_SOLARIS_LD_TRUE
-LIBPNG_DEFINES
 LIBOBJS
 POW_LIB
+PNG_COPTS
 DFNCPP
 OTOOL64
 OTOOL
@@ -709,6 +712,10 @@ CC
 MAINT
 MAINTAINER_MODE_FALSE
 MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
@@ -773,6 +780,7 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_silent_rules
 enable_maintainer_mode
 enable_dependency_tracking
 with_gnu_ld
@@ -782,9 +790,11 @@ with_pic
 enable_fast_install
 with_sysroot
 enable_libtool_lock
+enable_werror
 with_zlib_prefix
 with_pkgconfigdir
 with_binconfigs
+with_libpng_prefix
 enable_arm_neon
 '
       ac_precious_vars='build_alias
@@ -797,7 +807,8 @@ LIBS
 CPPFLAGS
 CCAS
 CCASFLAGS
-CPP'
+CPP
+PNG_COPTS'
 
 
 # Initialize some variables set by options.
@@ -1338,7 +1349,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libpng 1.5.14 to adapt to many kinds of systems.
+\`configure' configures libpng 1.6.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1408,7 +1419,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libpng 1.5.14:";;
+     short | recursive ) echo "Configuration of libpng 1.6.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1416,16 +1427,23 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-maintainer-mode  enable make rules and dependencies not useful
-                         (and sometimes confusing) to the casual installer
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-maintainer-mode
+                          enable make rules and dependencies not useful (and
+                          sometimes confusing) to the casual installer
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
-  --enable-arm-neon       Enable ARM NEON optimizations
+  --enable-werror[=OPT] Pass -Werror or the given argument to the compiler
+                          if it is supported
+  --enable-arm-neon     Enable ARM NEON optimizations
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1435,11 +1453,13 @@ Optional Packages:
                           both]
   --with-sysroot=DIR Search for dependent libraries within DIR
                         (or the compiler's sysroot if not specified).
-  --with-zlib-prefix      prefix that may have been used in installed zlib
-  --with-pkgconfigdir     Use the specified pkgconfig dir (default is
+  --with-zlib-prefix    prefix that may have been used in installed zlib
+  --with-pkgconfigdir   Use the specified pkgconfig dir (default is
                           libdir/pkgconfig)
-  --with-binconfigs       Generate shell libpng-config scripts as well as
+  --with-binconfigs     Generate shell libpng-config scripts as well as
                           pkg-config data [default=yes]
+  --with-libpng-prefix  prefix libpng exported function (API) names with the
+                          given value
 
 Some influential environment variables:
   CC          C compiler command
@@ -1452,6 +1472,8 @@ Some influential environment variables:
   CCAS        assembler compiler command (defaults to CC)
   CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
   CPP         C preprocessor
+  PNG_COPTS   additional flags for the C compiler, use this for options that
+              would cause configure itself to fail
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1519,7 +1541,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libpng configure 1.5.14
+libpng configure 1.6.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1942,7 +1964,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libpng $as_me 1.5.14, which was
+It was created by libpng $as_me 1.6.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2290,7 +2312,14 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-am__api_version='1.11'
+
+
+# libpng does not follow GNU file name conventions (hence 'foreign')
+# color-tests requires automake 1.11 or later
+# silent-rules requires automake 1.11 or later
+# dist-xz requires automake 1.11 or later
+# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1
+am__api_version='1.13'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2416,9 +2445,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
 $as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -2429,32 +2455,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" "$LINENO" 5
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+       # -L didn't work.
+       set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+       && test "$*" != "X conftest.file $srcdir/configure"; then
+
+       # If neither matched, then we have a broken ls.  This can happen
+       # if, for instance, CONFIG_SHELL is bash and it inherits a
+       # broken ls alias from the environment.  This has actually
+       # happened.  Such a system could not be considered "sane".
+       as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
@@ -2466,6 +2500,16 @@ Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
@@ -2488,12 +2532,12 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
 if test x"${install_sh}" != xset; then
@@ -2505,10 +2549,10 @@ if test x"${install_sh}" != xset; then
   esac
 fi
 
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
 if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
@@ -2647,12 +2691,6 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
 $as_echo "$MKDIR_P" >&6; }
 
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -2735,6 +2773,45 @@ else
 fi
 rmdir .tst 2>/dev/null
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
@@ -2757,7 +2834,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libpng'
- VERSION='1.5.14'
+ VERSION='1.6.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2785,6 +2862,12 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 # Always define AMTAR for backward compatibility.  Yes, it's still used
@@ -2797,6 +2880,8 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
+# was:
+# AM_INIT_AUTOMAKE
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
@@ -2821,10 +2906,11 @@ fi
 
 
 
-PNGLIB_VERSION=1.5.14
+
+PNGLIB_VERSION=1.6.0
 PNGLIB_MAJOR=1
-PNGLIB_MINOR=5
-PNGLIB_RELEASE=14
+PNGLIB_MINOR=6
+PNGLIB_RELEASE=0
 
 
 
@@ -3645,7 +3731,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -3701,8 +3787,8 @@ else
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
   rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
@@ -3737,16 +3823,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -3755,8 +3841,8 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
        continue
       else
@@ -3764,7 +3850,7 @@ else
       fi
       ;;
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -3836,8 +3922,8 @@ else
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
   rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
@@ -3870,16 +3956,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -3888,8 +3974,8 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
        continue
       else
@@ -3897,7 +3983,7 @@ else
       fi
       ;;
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -4848,6 +4934,7 @@ $as_echo "no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
+
 case `pwd` in
   *\ * | *\    *)
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@@ -8498,6 +8585,10 @@ _lt_linker_boilerplate=`cat conftest.err`
 $RM -r conftest*
 
 
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
 if test -n "$compiler"; then
 
 lt_prog_compiler_no_builtin_flag=
@@ -10843,14 +10934,7 @@ freebsd* | dragonfly*)
     *) objformat=elf ;;
     esac
   fi
-  # Handle Gentoo/FreeBSD as it was Linux
-  case $host_vendor in
-    gentoo)
-      version_type=linux ;;
-    *)
-      version_type=freebsd-$objformat ;;
-  esac
-
+  version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
@@ -10861,12 +10945,6 @@ freebsd* | dragonfly*)
       library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
       need_version=yes
       ;;
-    linux)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-      soname_spec='${libname}${release}${shared_ext}$major'
-      need_lib_prefix=no
-      need_version=no
-      ;;
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
@@ -12051,6 +12129,7 @@ CC="$lt_save_CC"
 
 
 
+
 # On Solaris 10 and 12 CPP gets set to cc -E, however this still
 # does some input parsing.  We need strict ANSI-C style tokenization,
 # check this:
@@ -12059,25 +12138,27 @@ CC="$lt_save_CC"
 $as_echo_n "checking for a C preprocessor that does not parse its input... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-1.5.0 16BIT
+1.1.1 16BIT
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
   DFNCPP="$CPP"
 else
-  DFNCPP=""
-   sav_CPP="$CPP"
-   for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"; do
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    DFNCPP=""
+      sav_CPP="$CPP"
+      for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"
+      do
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-1.5.0 16BIT
+1.1.1 16BIT
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
   DFNCPP="$CPP"
-         break
+            break
 fi
 rm -f conftest.err conftest.i conftest.$ac_ext
-   done
-   CPP="$sav_CPP"
+      done
+      CPP="$sav_CPP"
+
 fi
 rm -f conftest.err conftest.i conftest.$ac_ext
 if test -n "$DFNCPP"; then
@@ -12091,6 +12172,39 @@ as_fn_error 1 "not found
 See \`config.log' for more details" "$LINENO" 5; }
 fi
 
+# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it
+# checks the compiler with a program that generates a warning), add the
+# following option to deal with this
+
+# Check whether --enable-werror was given.
+if test "${enable_werror+set}" = set; then :
+  enableval=$enable_werror; test "$enable_werror" = "yes" && enable_werror="-Werror"
+    if test "$enable_werror" != "no"; then
+      sav_CFLAGS="$CFLAGS"
+      CFLAGS="$enable_werror $CFLAGS"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler allows $enable_werror" >&5
+$as_echo_n "checking if the compiler allows $enable_werror... " >&6; }
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+            int main(int argc, char **argv){
+            return argv[argc-1][0];
+            }
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+         PNG_COPTS="$PNG_COPTS $enable_werror"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+      CFLAGS="$sav_CFLAGS"
+    fi
+fi
+
+
 # Checks for header files.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
 done
 
 
-LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
-LIBPNG_DEFINES=$LIBPNG_DEFINES
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if using Solaris linker" >&5
 $as_echo_n "checking if using Solaris linker... " >&6; }
 SLD=`$LD --version 2>&1 | grep Solaris`
@@ -12848,18 +12958,38 @@ $as_echo "$as_me: pkgconfig directory is ${pkgconfigdir}" >&6;}
 # Check whether --with-binconfigs was given.
 if test "${with_binconfigs+set}" = set; then :
   withval=$with_binconfigs; if test "${withval}" = no; then
-               binconfigs=
-               { $as_echo "$as_me:${as_lineno-$LINENO}: libpng-config scripts will not be built" >&5
+      binconfigs=
+      { $as_echo "$as_me:${as_lineno-$LINENO}: libpng-config scripts will not be built" >&5
 $as_echo "$as_me: libpng-config scripts will not be built" >&6;}
-       else
-               binconfigs='${binconfigs}'
-       fi
+    else
+      binconfigs='${binconfigs}'
+    fi
 else
   binconfigs='${binconfigs}'
 fi
 
 
 
+# Support for prefixes to the API function names; this will generate defines
+# at the start of the build to rename exported library functions
+
+# Check whether --with-libpng-prefix was given.
+if test "${with_libpng_prefix+set}" = set; then :
+  withval=$with_libpng_prefix; if test "${withval:-no}" != "no"; then
+      PNG_PREFIX=${withval}
+
+    fi
+fi
+
+ if test "${with_libpng_prefix:-no}" != "no"; then
+  DO_PNG_PREFIX_TRUE=
+  DO_PNG_PREFIX_FALSE='#'
+else
+  DO_PNG_PREFIX_TRUE='#'
+  DO_PNG_PREFIX_FALSE=
+fi
+
+
 # Because GCC by default assembles code with an executable stack, even though it
 # compiles C code with a non-executable stack, it is necessary to do a fixup
 # here (this may by GCC specific)
@@ -12868,14 +12998,14 @@ AM_CCASFLAGS=-Wa,--noexecstack
 
 # Check whether --enable-arm-neon was given.
 if test "${enable_arm_neon+set}" = set; then :
-  enableval=$enable_arm_neon; if test "${enableval}" = yes; then
+  enableval=$enable_arm_neon; if test "${enableval}" = "yes"; then
 
 $as_echo "#define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon" >>confdefs.h
 
 
 $as_echo "#define PNG_ALIGNED_MEMORY_SUPPORTED 1" >>confdefs.h
 
-       fi
+    fi
 fi
 
  if test "${enable_arm_neon:-no}" = yes; then
@@ -12887,6 +13017,9 @@ else
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Extra options for compiler: $PNG_COPTS" >&5
+$as_echo "$as_me: Extra options for compiler: $PNG_COPTS" >&6;}
+
 # Config files, substituting as above
 ac_config_files="$ac_config_files Makefile libpng.pc:libpng.pc.in"
 
@@ -13002,6 +13135,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
  if test -n "$EXEEXT"; then
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
@@ -13034,6 +13175,10 @@ if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT
   as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${DO_PNG_PREFIX_TRUE}" && test -z "${DO_PNG_PREFIX_FALSE}"; then
+  as_fn_error $? "conditional \"DO_PNG_PREFIX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${PNG_ARM_NEON_TRUE}" && test -z "${PNG_ARM_NEON_FALSE}"; then
   as_fn_error $? "conditional \"PNG_ARM_NEON\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -13435,7 +13580,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libpng $as_me 1.5.14, which was
+This file was extended by libpng $as_me 1.6.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -13501,7 +13646,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libpng config.status 1.5.14
+libpng config.status 1.6.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -14511,7 +14656,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
   case $ac_file$ac_mode in
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -14524,7 +14669,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -14558,21 +14703,19 @@ $as_echo X"$mf" |
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
     test -z "am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
     # expansion.
     for file in `sed -n "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`$as_dirname -- "$file" ||
index 9d72d9beff356d40d0520136251fdedfe7c9aba1..e6ff077da615d04bb2d77abbae15f5e3fb731106 100644 (file)
@@ -14,19 +14,33 @@ dnl Makefile.am to upgrade the package name.
 dnl This is here to prevent earlier autoconf from being used, it
 dnl should not be necessary to regenerate configure if the time
 dnl stamps are correct
-AC_PREREQ(2.59)
+AC_PREREQ([2.68])
 
 dnl Version number stuff here:
 
-AC_INIT([libpng], [1.5.14], [png-mng-implement@lists.sourceforge.net])
-AM_INIT_AUTOMAKE
-dnl stop configure from automagically running automake
+AC_INIT([libpng],[1.6.0],[png-mng-implement@lists.sourceforge.net])
+AC_CONFIG_MACRO_DIR([scripts])
+
+# libpng does not follow GNU file name conventions (hence 'foreign')
+# color-tests requires automake 1.11 or later
+# silent-rules requires automake 1.11 or later
+# dist-xz requires automake 1.11 or later
+# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1
+AM_INIT_AUTOMAKE([1.12.2 foreign dist-xz color-tests silent-rules serial-tests])
+# was:
+# AM_INIT_AUTOMAKE
 AM_MAINTAINER_MODE
 
-PNGLIB_VERSION=1.5.14
+dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later
+dnl version; aclocal.m4 will generate a failure if you use a prior version of
+dnl automake, so the following is not necessary (and is not defined anyway):
+dnl AM_PREREQ([1.11.2])
+dnl stop configure from automagically running automake
+
+PNGLIB_VERSION=1.6.0
 PNGLIB_MAJOR=1
-PNGLIB_MINOR=5
-PNGLIB_RELEASE=14
+PNGLIB_MINOR=6
+PNGLIB_RELEASE=0
 
 dnl End of version number stuff
 
@@ -37,30 +51,36 @@ AC_CONFIG_HEADERS([config.h])
 AC_LANG([C])
 AC_PROG_CC
 AM_PROG_AS
-AC_PROG_LD
+LT_PATH_LD
 AC_PROG_CPP
 AC_CHECK_TOOL(SED, sed, :)
 AC_CHECK_TOOL(AWK, awk, :)
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
+
+dnl libtool/libtoolize; version 2.4.2 is the tested version, this or any
+dnl compatible later version may be used
 LT_INIT([win32-dll])
+LT_PREREQ([2.4.2])
 
 # On Solaris 10 and 12 CPP gets set to cc -E, however this still
 # does some input parsing.  We need strict ANSI-C style tokenization,
 # check this:
 AC_REQUIRE_CPP
 AC_MSG_CHECKING([for a C preprocessor that does not parse its input])
-AC_TRY_CPP([1.5.0 16BIT],
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])],
    [DFNCPP="$CPP"],
-   [DFNCPP=""
-   sav_CPP="$CPP"
-   for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"; do
-      AC_TRY_CPP([1.5.0 16BIT],
-         [DFNCPP="$CPP"]
-         [break],,)
-   done
-   CPP="$sav_CPP"])
+   [  DFNCPP=""
+      sav_CPP="$CPP"
+      for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"
+      do
+         AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])],
+            [DFNCPP="$CPP"]
+            [break],,)
+      done
+      CPP="$sav_CPP"
+   ])
 if test -n "$DFNCPP"; then
    AC_MSG_RESULT([$DFNCPP])
    AC_SUBST(DFNCPP)
@@ -68,6 +88,31 @@ else
    AC_MSG_FAILURE([not found], 1)
 fi
 
+# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it
+# checks the compiler with a program that generates a warning), add the
+# following option to deal with this
+AC_ARG_VAR(PNG_COPTS,
+   [additional flags for the C compiler, use this for options that would]
+   [cause configure itself to fail])
+AC_ARG_ENABLE(werror,
+   AS_HELP_STRING([[[--enable-werror[=OPT]]]],
+      [Pass -Werror or the given argument to the compiler if it is supported]),
+   [test "$enable_werror" = "yes" && enable_werror="-Werror"
+    if test "$enable_werror" != "no"; then
+      sav_CFLAGS="$CFLAGS"
+      CFLAGS="$enable_werror $CFLAGS"
+      AC_MSG_CHECKING([if the compiler allows $enable_werror])
+      AC_COMPILE_IFELSE(
+         [AC_LANG_SOURCE([
+            [int main(int argc, char **argv){]
+            [return argv[argc-1][0];]
+            [}]])],
+         AC_MSG_RESULT(yes)
+         PNG_COPTS="$PNG_COPTS $enable_werror",
+         AC_MSG_RESULT(no))
+      CFLAGS="$sav_CFLAGS"
+    fi],)
+
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
@@ -80,16 +125,15 @@ AC_C_RESTRICT
 
 # Checks for library functions.
 AC_FUNC_STRTOD
-AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
-AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
+AC_CHECK_FUNCS([memset], , AC_MSG_ERROR(memset not found in libc))
+AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)) )
 AC_ARG_WITH(zlib-prefix,
-   AC_HELP_STRING([--with-zlib-prefix],
-                  [prefix that may have been used in installed zlib]),
-                  [ZPREFIX=${withval}],
-                  [ZPREFIX='z_'])
+   AS_HELP_STRING([[[--with-zlib-prefix]]],
+      [prefix that may have been used in installed zlib]),
+      [ZPREFIX=${withval}],
+      [ZPREFIX='z_'])
 AC_CHECK_LIB(z, zlibVersion, ,
-    AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, ,
-                 AC_ERROR([zlib not installed])))
+    AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_MSG_ERROR(zlib not installed)))
 
 # The following is for pngvalid, to ensure it catches FP errors even on
 # platforms that don't enable FP exceptions, the function appears in the math
@@ -97,10 +141,6 @@ AC_CHECK_LIB(z, zlibVersion, ,
 AC_CHECK_LIB([m], [feenableexcept])
 AC_CHECK_FUNCS([feenableexcept])
 
-LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
-LIBPNG_DEFINES=$LIBPNG_DEFINES
-AC_SUBST(LIBPNG_DEFINES)
-
 AC_MSG_CHECKING([if using Solaris linker])
 SLD=`$LD --version 2>&1 | grep Solaris`
 if test "$SLD"; then
@@ -161,47 +201,59 @@ AC_SUBST(PNGLIB_RELEASE)
 # Additional arguments (and substitutions)
 # Allow the pkg-config directory to be set
 AC_ARG_WITH(pkgconfigdir,
-       AC_HELP_STRING([--with-pkgconfigdir],
-       [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
-       [pkgconfigdir=${withval}],
-       [pkgconfigdir='${libdir}/pkgconfig'])
+   AS_HELP_STRING([[[--with-pkgconfigdir]]],
+      [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
+   [pkgconfigdir=${withval}],
+   [pkgconfigdir='${libdir}/pkgconfig'])
 
 AC_SUBST([pkgconfigdir])
-AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
+AC_MSG_NOTICE([[pkgconfig directory is ${pkgconfigdir}]])
 
 # Make the *-config binary config scripts optional
 AC_ARG_WITH(binconfigs,
-       AC_HELP_STRING([--with-binconfigs],
-               [Generate shell libpng-config scripts as well as pkg-config data]
-               [@<:@default=yes@:>@]),
-       [if test "${withval}" = no; then
-               binconfigs=
-               AC_MSG_NOTICE([libpng-config scripts will not be built])
-       else
-               binconfigs='${binconfigs}'
-       fi],
-       [binconfigs='${binconfigs}'])
+   AS_HELP_STRING([[[--with-binconfigs]]],
+      [Generate shell libpng-config scripts as well as pkg-config data]
+      [@<:@default=yes@:>@]),
+   [if test "${withval}" = no; then
+      binconfigs=
+      AC_MSG_NOTICE([[libpng-config scripts will not be built]])
+    else
+      binconfigs='${binconfigs}'
+    fi],
+   [binconfigs='${binconfigs}'])
 AC_SUBST([binconfigs])
 
+# Support for prefixes to the API function names; this will generate defines
+# at the start of the build to rename exported library functions
+AC_ARG_WITH(libpng-prefix,
+   AS_HELP_STRING([[[--with-libpng-prefix]]],
+      [prefix libpng exported function (API) names with the given value]),
+   [if test "${withval:-no}" != "no"; then
+      AC_SUBST([PNG_PREFIX], [${withval}])
+    fi])
+AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
+
 # Because GCC by default assembles code with an executable stack, even though it
 # compiles C code with a non-executable stack, it is necessary to do a fixup
 # here (this may by GCC specific)
 AC_SUBST([AM_CCASFLAGS], [-Wa,--noexecstack])
 
 AC_ARG_ENABLE([arm-neon],
-       AC_HELP_STRING([--enable-arm-neon], [Enable ARM NEON optimizations]),
-       [if test "${enableval}" = yes; then
-               AC_DEFINE([PNG_FILTER_OPTIMIZATIONS],
-                          [png_init_filter_functions_neon],
-                          [ARM NEON filter initialization function])
-               AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [1],
-                          [Align row buffers])
-       fi])
+   AS_HELP_STRING([[[--enable-arm-neon]]], [Enable ARM NEON optimizations]),
+   [if test "${enableval}" = "yes"; then
+      AC_DEFINE([PNG_FILTER_OPTIMIZATIONS],
+                [png_init_filter_functions_neon],
+                [ARM NEON filter initialization function])
+      AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [1],
+                [Align row buffers])
+    fi])
 AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" = yes])
 
+AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
+
 # Config files, substituting as above
 AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
 AC_CONFIG_FILES([libpng-config:libpng-config.in],
-               [chmod +x libpng-config])
+   [chmod +x libpng-config])
 
 AC_OUTPUT
index e1f51f482a96af58acdaeb17d21ab51a0831dd9b..3f02f5d008616707958aedde54d826f8991d2e7c 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2012-07-12.20; # UTC
+scriptversion=2012-10-18.11; # UTC
 
 # Copyright (C) 1999-2012 Free Software Foundation, Inc.
 
@@ -27,9 +27,9 @@ scriptversion=2012-07-12.20; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
   -h | --h*)
     cat <<\EOF
 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -56,11 +56,65 @@ EOF
     ;;
 esac
 
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
 # A tabulation character.
 tab='  '
 # A newline character.
 nl='
 '
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
 
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
@@ -88,32 +142,32 @@ if test "$depmode" = hp; then
 fi
 
 if test "$depmode" = dashXmstdout; then
-   # This is just like dashmstdout with a different argument.
-   dashmflag=-xM
-   depmode=dashmstdout
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
 fi
 
 cygpath_u="cygpath -u -f -"
 if test "$depmode" = msvcmsys; then
-   # This is just like msvisualcpp but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u='sed s,\\\\,/,g'
-   depmode=msvisualcpp
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
 fi
 
 if test "$depmode" = msvc7msys; then
-   # This is just like msvc7 but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u='sed s,\\\\,/,g'
-   depmode=msvc7
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
 fi
 
 if test "$depmode" = xlc; then
-   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
-   gccflag=-qmakedep=gcc,-MF
-   depmode=gcc
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
 fi
 
 case "$depmode" in
@@ -136,8 +190,7 @@ gcc3)
   done
   "$@"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -163,15 +216,14 @@ gcc)
   fi
   "$@" -Wp,"$gccflag$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
 ## This next piece of magic avoids the "deleted header file" problem.
@@ -180,15 +232,15 @@ gcc)
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' "$nl" < "$tmpdepfile" |
 ## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
 ## well.  hp depmode also adds that space, but also prefixes the VPATH
 ## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
-      | sed -e 's/$/ :/' >> "$depfile"
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -206,8 +258,7 @@ sgi)
     "$@" -MDupdate "$tmpdepfile"
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -215,7 +266,6 @@ sgi)
 
   if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
     echo "$object : \\" > "$depfile"
-
     # Clip off the initial element (the dependent).  Don't try to be
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
@@ -223,19 +273,15 @@ sgi)
     # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
     tr ' ' "$nl" < "$tmpdepfile" \
-    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr "$nl" ' ' >> "$depfile"
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
-
     # The second pass generates a dummy entry for each header file.
     tr ' ' "$nl" < "$tmpdepfile" \
-   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> "$depfile"
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
   else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile"
   ;;
@@ -253,9 +299,8 @@ aix)
   # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.u
     tmpdepfile2=$base.u
@@ -268,9 +313,7 @@ aix)
     "$@" -M
   fi
   stat=$?
-
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
@@ -279,65 +322,37 @@ aix)
   do
     test -f "$tmpdepfile" && break
   done
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form 'foo.o: dependent.h'.
-    # Do two passes, one to just change these to
-    # '$object: dependent.h' and one to simply 'dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-  else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
-  fi
-  rm -f "$tmpdepfile"
+  aix_post_process_depfile
   ;;
 
-icc)
-  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
-  # However on
-  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
-  # ICC 7.0 will fill foo.d with something like
-  #    foo.o: sub/foo.c
-  #    foo.o: sub/foo.h
-  # which is wrong.  We want
-  #    sub/foo.o: sub/foo.c
-  #    sub/foo.o: sub/foo.h
-  #    sub/foo.c:
-  #    sub/foo.h:
-  # ICC 7.1 will output
-  #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using '\':
-  #    foo.o: sub/foo.c ... \
-  #     sub/foo.h ... \
-  #     ...
-  # tcc 0.9.26 (FIXME still under development at the moment of writing)
-  # will emit a similar output, but also prepend the continuation lines
-  # with horizontal tabulation characters.
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form 'foo.o: dependent.h',
-  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
-  # Do two passes, one to just change these to
-  # '$object: dependent.h' and one to simply 'dependent.h:'.
-  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
-    < "$tmpdepfile" > "$depfile"
-  sed '
-    s/[ '"$tab"'][ '"$tab"']*/ /g
-    s/^ *//
-    s/ *\\*$//
-    s/^[^:]*: *//
-    /^$/d
-    /:$/d
-    s/$/ :/
-  ' < "$tmpdepfile" >> "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -356,34 +371,37 @@ pgcc)
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
+  set_dir_from "$object"
   # Use the source, not the object, to determine the base name, since
   # that's sadly what pgcc will do too.
-  base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'`
-  tmpdepfile="$base.d"
+  set_base_from "$source"
+  tmpdepfile=$base.d
 
   # For projects that build the same source file twice into different object
   # files, the pgcc approach of using the *source* file root name can cause
   # problems in parallel builds.  Use a locking strategy to avoid stomping on
   # the same $tmpdepfile.
-  lockdir="$base.d-lock"
-  trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
   numtries=100
   i=$numtries
-  while test $i -gt 0 ; do
+  while test $i -gt 0; do
     # mkdir is a portable test-and-set.
-    if mkdir $lockdir 2>/dev/null; then
+    if mkdir "$lockdir" 2>/dev/null; then
       # This process acquired the lock.
       "$@" -MD
       stat=$?
       # Release the lock.
-      rm -rf $lockdir
+      rmdir "$lockdir"
       break
     else
-      ## the lock is being held by a different process,
-      ## wait until the winning process is done or we timeout
-      while test -d $lockdir && test $i -gt 0; do
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
         sleep 1
         i=`expr $i - 1`
       done
@@ -409,8 +427,8 @@ pgcc)
   sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
   # Some versions of the HPUX 10.20 sed can't process this invocation
   # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -421,9 +439,8 @@ hp2)
   # 'foo.d', which lands next to the object file, wherever that
   # happens to be.
   # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from  "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.d
     tmpdepfile2=$dir.libs/$base.d
@@ -434,8 +451,7 @@ hp2)
     "$@" +Maked
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
      rm -f "$tmpdepfile1" "$tmpdepfile2"
      exit $stat
   fi
@@ -445,76 +461,61 @@ hp2)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
     # Add 'dependent.h:' lines.
     sed -ne '2,${
-              s/^ *//
-              s/ \\*$//
-              s/$/:/
-              p
-            }' "$tmpdepfile" >> "$depfile"
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
   else
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile" "$tmpdepfile2"
   ;;
 
 tru64)
-   # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in 'foo.d' instead, so we check for that too.
-   # Subdirectories are respected.
-   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-   test "x$dir" = "x$object" && dir=
-   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
-   if test "$libtool" = yes; then
-      # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
-      # handle both shared and static libraries in a single compilation.
-      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
-      #
-      # With libtool 1.5 this exception was removed, and libtool now
-      # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
-      # in $dir$base.o.d.  We have to check for both files, because
-      # one of the two compilations can be disabled.  We should prefer
-      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-      # automatically cleaned when .libs/ is deleted, while ignoring
-      # the former would cause a distcleancheck panic.
-      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
-      tmpdepfile2=$dir$base.o.d          # libtool 1.5
-      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
-      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
-      "$@" -Wc,-MD
-   else
-      tmpdepfile1=$dir$base.o.d
-      tmpdepfile2=$dir$base.d
-      tmpdepfile3=$dir$base.d
-      tmpdepfile4=$dir$base.d
-      "$@" -MD
-   fi
-
-   stat=$?
-   if test $stat -eq 0; then :
-   else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-      exit $stat
-   fi
-
-   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-   do
-     test -f "$tmpdepfile" && break
-   done
-   if test -f "$tmpdepfile"; then
-      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-   else
-      echo "#dummy" > "$depfile"
-   fi
-   rm -f "$tmpdepfile"
-   ;;
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
 
 msvc7)
   if test "$libtool" = yes; then
@@ -525,8 +526,7 @@ msvc7)
   "$@" $showIncludes > "$tmpdepfile"
   stat=$?
   grep -v '^Note: including file: ' "$tmpdepfile"
-  if test "$stat" = 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -603,13 +603,14 @@ dashmstdout)
   # in the target name.  This is to cope with DOS-style filenames:
   # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' "$nl" < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -662,10 +663,12 @@ makedepend)
   # makedepend may prepend the VPATH from the source file name to the object.
   # No need to regex-escape $object, excess matching of '.' is harmless.
   sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile" "$tmpdepfile".bak
   ;;
 
@@ -701,10 +704,10 @@ cpp)
     esac
   done
 
-  "$@" -E |
-    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
-    sed '$ s: \\$::' > "$tmpdepfile"
+  "$@" -E \
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    sed '$ s: \\$::' > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
   cat < "$tmpdepfile" >> "$depfile"
@@ -736,15 +739,15 @@ msvisualcpp)
       shift
       ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-       set fnord "$@"
-       shift
-       shift
-       ;;
+        set fnord "$@"
+        shift
+        shift
+        ;;
     *)
-       set fnord "$@" "$arg"
-       shift
-       shift
-       ;;
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
     esac
   done
   "$@" -E 2>/dev/null |
index 86068ea1ebf5b004b7878c9e04099b3ed00118f1..ee4e227bcf24ebac1891f985245539a4ee1ab61d 100644 (file)
@@ -2,10 +2,13 @@
 #if 0 /* in case someone actually tries to compile this */
 
 /* example.c - an example of using libpng
- * Last changed in libpng 1.5.10 [March 8, 2012]
- * Maintained 1998-2012 Glenn Randers-Pehrson
- * Maintained 1996, 1997 Andreas Dilger
- * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+ * Last changed in libpng 1.6.0 [February 14, 2013]
+ * Maintained 1998-2013 Glenn Randers-Pehrson
+ * Maintained 1996, 1997 Andreas Dilger)
+ * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * To the extent possible under law, the authors have waived
+ * all copyright and related or neighboring rights to this file.
+ * This work is published from: United States.
  */
 
 /* This is an example of how to use libpng to read and write PNG files.
@@ -13,8 +16,6 @@
  * read it, do so first.  This was designed to be a starting point of an
  * implementation.  This is not officially part of libpng, is hereby placed
  * in the public domain, and therefore does not require a copyright notice.
- * To the extent possible under law, the authors have waived all copyright and
- * related or neighboring rights to this file.
  *
  * This file does not currently compile, because it is missing certain
  * parts, like allocating memory to hold an image.  You will have to
  * see also the programs in the contrib directory.
  */
 
-#define _POSIX_SOURCE 1  /* libpng and zlib are POSIX-compliant.  You may
-                          * change this if your application uses non-POSIX
-                          * extensions. */
+/* The simple, but restricted, approach to reading a PNG file or data stream
+ * just requires two function calls, as in the following complete program.
+ * Writing a file just needs one function call, so long as the data has an
+ * appropriate layout.
+ *
+ * The following code reads PNG image data from a file and writes it, in a
+ * potentially new format, to a new file.  While this code will compile there is
+ * minimal (insufficient) error checking; for a more realistic version look at
+ * contrib/examples/pngtopng.c
+ */
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <png.h>
+#include <zlib.h>
+
+int main(int argc, const char **argv)
+{
+   if (argc == 3)
+   {
+      png_image image; /* The control structure used by libpng */
+
+      /* Initialize the 'png_image' structure. */
+      memset(&image, 0, (sizeof image));
+      image.version = PNG_IMAGE_VERSION;
+
+      /* The first argument is the file to read: */
+      if (png_image_begin_read_from_file(&image, argv[1]))
+      {
+         png_bytep buffer;
+
+         /* Set the format in which to read the PNG file; this code chooses a
+          * simple sRGB format with a non-associated alpha channel, adequate to
+          * store most images.
+          */
+         image.format = PNG_FORMAT_RGBA;
+
+         /* Now allocate enough memory to hold the image in this format; the
+          * PNG_IMAGE_SIZE macro uses the information about the image (width,
+          * height and format) stored in 'image'.
+          */
+         buffer = malloc(PNG_IMAGE_SIZE(image));
+
+         /* If enough memory was available read the image in the desired format
+          * then write the result out to the new file.  'background' is not
+          * necessary when reading the image because the alpha channel is
+          * preserved; if it were to be removed, for example if we requested
+          * PNG_FORMAT_RGB, then either a solid background color would have to
+          * be supplied or the output buffer would have to be initialized to the
+          * actual background of the image.
+          *
+          * The fourth argument to png_image_finish_read is the 'row_stride' -
+          * this is the number of components allocated for the image in each
+          * row.  It has to be at least as big as the value returned by
+          * PNG_IMAGE_ROW_STRIDE, but if you just allocate space for the
+          * default, minimum, size using PNG_IMAGE_SIZE as above you can pass
+          * zero.
+          *
+          * The final argument is a pointer to a buffer for the colormap;
+          * colormaps have exactly the same format as a row of image pixels (so
+          * you choose what format to make the colormap by setting
+          * image.format).  A colormap is only returned if
+          * PNG_FORMAT_FLAG_COLORMAP is also set in image.format, so in this
+          * case NULL is passed as the final argument.  If you do want to force
+          * all images into an index/color-mapped format then you can use:
+          *
+          *    PNG_IMAGE_COLORMAP_SIZE(image)
+          *
+          * to find the maximum size of the colormap in bytes.
+          */
+         if (buffer != NULL &&
+            png_image_finish_read(&image, NULL/*background*/, buffer,
+               0/*row_stride*/, NULL/*colormap*/))
+         {
+            /* Now write the image out to the second argument.  In the write
+             * call 'convert_to_8bit' allows 16-bit data to be squashed down to
+             * 8 bits; this isn't necessary here because the original read was
+             * to the 8-bit format.
+             */
+            if (png_image_write_to_file(&image, argv[2], 0/*convert_to_8bit*/,
+               buffer, 0/*row_stride*/, NULL/*colormap*/))
+            {
+               /* The image has been written successfully. */
+               exit(0);
+            }
+         }
+
+         else
+         {
+            /* Calling png_free_image is optional unless the simplified API was
+             * not run to completion.  In this case if there wasn't enough
+             * memory for 'buffer' we didn't complete the read, so we must free
+             * the image:
+             */
+            if (buffer == NULL)
+               png_free_image(&image);
+
+            else
+               free(buffer);
+      }
+
+      /* Something went wrong reading or writing the image.  libpng stores a
+       * textual message in the 'png_image' structure:
+       */
+      fprintf(stderr, "pngtopng: error: %s\n", image.message);
+      exit (1);
+   }
+
+   fprintf(stderr, "pngtopng: usage: pngtopng input-file output-file\n");
+   exit(1);
+}
+
+/* That's it ;-)  Of course you probably want to do more with PNG files than
+ * just converting them all to 32-bit RGBA PNG files; you can do that between
+ * the call to png_image_finish_read and png_image_write_to_file.  You can also
+ * ask for the image data to be presented in a number of different formats.  You
+ * do this by simply changing the 'format' parameter set before allocating the
+ * buffer.
+ *
+ * The format parameter consists of five flags that define various aspects of
+ * the image, you can simply add these together to get the format or you can use
+ * one of the predefined macros from png.h (as above):
+ *
+ * PNG_FORMAT_FLAG_COLOR: if set the image will have three color components per
+ *    pixel (red, green and blue), if not set the image will just have one
+ *    luminance (grayscale) component.
+ *
+ * PNG_FORMAT_FLAG_ALPHA: if set each pixel in the image will have an additional
+ *    alpha value; a linear value that describes the degree the image pixel
+ *    covers (overwrites) the contents of the existing pixel on the display.
+ *
+ * PNG_FORMAT_FLAG_LINEAR: if set the components of each pixel will be returned
+ *    as a series of 16-bit linear values, if not set the components will be
+ *    returned as a series of 8-bit values encoded according to the 'sRGB'
+ *    standard.  The 8-bit format is the normal format for images intended for
+ *    direct display, because almost all display devices do the inverse of the
+ *    sRGB transformation to the data they receive.  The 16-bit format is more
+ *    common for scientific data and image data that must be further processed;
+ *    because it is linear simple math can be done on the component values.
+ *    Regardless of the setting of this flag the alpha channel is always linear,
+ *    although it will be 8 bits or 16 bits wide as specified by the flag.
+ *
+ * PNG_FORMAT_FLAG_BGR: if set the components of a color pixel will be returned
+ *    in the order blue, then green, then red.  If not set the pixel components
+ *    are in the order red, then green, then blue.
+ *
+ * PNG_FORMAT_FLAG_AFIRST: if set the alpha channel (if present) precedes the
+ *    color or grayscale components.  If not set the alpha channel follows the
+ *    components.
+ *
+ * You do not have to read directly from a file.  You can read from memory or,
+ * on systems that support it, from a <stdio.h> FILE*.  This is controlled by
+ * the particular png_image_read_from_ function you call at the start.  Likewise
+ * on write you can write to a FILE* if your system supports it.  Check the
+ * macro PNG_STDIO_SUPPORTED to see if stdio support has been included in your
+ * libpng build.
+ *
+ * If you read 16-bit (PNG_FORMAT_FLAG_LINEAR) data you may need to write it in
+ * the 8-bit format for display.  You do this by setting the convert_to_8bit
+ * flag to 'true'.
+ *
+ * Don't repeatedly convert between the 8-bit and 16-bit forms.  There is
+ * significant data loss when 16-bit data is converted to the 8-bit encoding and
+ * the current libpng implementation of convertion to 16-bit is also
+ * significantly lossy.  The latter will be fixed in the future, but the former
+ * is unavoidable - the 8-bit format just doesn't have enough resolution.
+ */
 
-#include "png.h"
+/* If your program needs more information from the PNG data it reads, or if you
+ * need to do more complex transformations, or minimise transformations, on the
+ * data you read, then you must use one of the several lower level libpng
+ * interfaces.
+ *
+ * All these interfaces require that you do your own error handling - your
+ * program must be able to arrange for control to return to your own code any
+ * time libpng encounters a problem.  There are several ways to do this, but the
+ * standard way is to use the ANSI-C (C90) <setjmp.h> interface to establish a
+ * return point within your own code.  You must do this if you do not use the
+ * simplified interface (above).
+ *
+ * The first step is to include the header files you need, including the libpng
+ * header file.  Include any standard headers and feature test macros your
+ * program requires before including png.h:
+ */
+#include <png.h>
 
  /* The png_jmpbuf() macro, used in error handling, became available in
   * libpng version 1.0.6.  If you want to be able to run your code with older
@@ -549,7 +731,7 @@ row_callback(png_structp png_ptr, png_bytep new_row,
     * png_progressive_combine_row() passing in the new row and the
     * old row, as demonstrated above.  You can call this function for
     * NULL rows (it will just return) and for non-interlaced images
-    * (it just does the png_memcpy for you) if it will make the code
+    * (it just does the memcpy for you) if it will make the code
     * easier.  Thus, you can just do this for all cases:
     */
 
@@ -664,7 +846,7 @@ void write_png(char *file_name /* , ... other image information ... */)
 
    /* Set the palette if there is one.  REQUIRED for indexed-color images */
    palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH
-             * png_sizeof(png_color));
+             * (sizeof (png_color)));
    /* ... Set palette colors ... */
    png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH);
    /* You must not free palette here, because png_set_PLTE only makes a link to
@@ -805,7 +987,7 @@ void write_png(char *file_name /* , ... other image information ... */)
 
    png_bytep row_pointers[height];
 
-   if (height > PNG_UINT_32_MAX/png_sizeof(png_bytep))
+   if (height > PNG_UINT_32_MAX/(sizeof (png_bytep)))
      png_error (png_ptr, "Image is too tall to process in memory");
 
    /* Set up pointers into your "image" byte array */
index 677535cb5a13c3021ae572787b6a00dde10182a4..63fa15b43a666a2bef9da6ca99ef0a7eb24d1d97 100644 (file)
@@ -1,9 +1,9 @@
-Libpng-manual.txt - A description on how to use and modify libpng
+libpng-manual.txt - A description on how to use and modify libpng
 
- libpng version 1.5.14 - January 24, 2013
+ libpng version 1.6.0 - February 14, 2013
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
- Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ Copyright (c) 1998-2013 Glenn Randers-Pehrson
 
  This document is released under the libpng license.
  For conditions of distribution and use, see the disclaimer
@@ -11,9 +11,9 @@ Libpng-manual.txt - A description on how to use and modify libpng
 
  Based on:
 
- libpng versions 0.97, January 1998, through 1.5.14 - January 24, 2013
+ libpng versions 0.97, January 1998, through 1.6.0 - February 14, 2013
  Updated and distributed by Glenn Randers-Pehrson
- Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ Copyright (c) 1998-2013 Glenn Randers-Pehrson
 
  libpng 1.0 beta 6  version 0.96 May 28, 1997
  Updated and distributed by Andreas Dilger
@@ -28,6 +28,25 @@ Libpng-manual.txt - A description on how to use and modify libpng
  Copyright (c) 1995, 1996 Frank J. T. Wojcik
  December 18, 1995 & January 20, 1996
 
+ TABLE OF CONTENTS
+
+    I. Introduction
+   II. Structures
+  III. Reading
+   IV. Writing
+    V. Simplified API
+   VI. Modifying/Customizing libpng
+  VII. MNG support
+ VIII. Changes to Libpng from version 0.88
+   IX. Changes to Libpng from version 1.0.x to 1.2.x
+    X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
+   XI. Changes to Libpng from version 1.4.x to 1.5.x
+  XII. Changes to Libpng from version 1.5.x to 1.6.x
+ XIII. Detecting libpng
+  XIV. Source code repository
+   XV. Coding style
+  XVI. Y2K Compliance in libpng
+
 I. Introduction
 
 This file describes how to use and modify the PNG reference library
@@ -553,6 +572,7 @@ chunk types. To change this, you can call:
 
     png_set_keep_unknown_chunks(png_ptr, keep,
         chunk_list, num_chunks);
+
     keep       - 0: default unknown chunk handling
                  1: ignore; do not keep
                  2: keep only if safe-to-copy
@@ -566,11 +586,16 @@ chunk types. To change this, you can call:
 
     chunk_list - list of chunks affected (a byte string,
                  five bytes per chunk, NULL or '\0' if
-                 num_chunks is 0)
+                 num_chunks is positive; ignored if
+                 numchunks <= 0).
 
     num_chunks - number of chunks affected; if 0, all
-                 unknown chunks are affected.  If nonzero,
-                 only the chunks in the list are affected
+                 unknown chunks are affected.  If positive,
+                 only the chunks in the list are affected,
+                 and if negative all unknown chunks and
+                 all known chunks except for the IHDR,
+                 PLTE, tRNS, IDAT, and IEND chunks are
+                 affected.
 
 Unknown chunks declared in this way will be saved as raw data onto a
 list of png_unknown_chunk structures.  If a chunk that is normally
@@ -686,7 +711,8 @@ assumes that the PNG data matches your system, to keep this default call:
 
 or you can use the fixed point equivalent:
 
-   png_set_gamma_fixed(png_ptr, PNG_FP_1*screen_gamma, PNG_FP_1/screen_gamma);
+   png_set_gamma_fixed(png_ptr, PNG_FP_1*screen_gamma,
+      PNG_FP_1/screen_gamma);
 
 If you don't know the gamma for your system it is probably 2.2 - a good
 approximation to the IEC standard for display systems (sRGB).  If images are
@@ -698,12 +724,15 @@ display driver, a few systems, including older Macs, change the response by
 default.  As of 1.5.4 three special values are available to handle common
 situations:
 
-   PNG_DEFAULT_sRGB: Indicates that the system conforms to the IEC 61966-2-1
-                     standard.  This matches almost all systems.
-   PNG_GAMMA_MAC_18: Indicates that the system is an older (pre Mac OS 10.6)
-                     Apple Macintosh system with the default settings.
-   PNG_GAMMA_LINEAR: Just the fixed point value for 1.0 - indicates that the
-                     system expects data with no gamma encoding.
+   PNG_DEFAULT_sRGB: Indicates that the system conforms to the
+                     IEC 61966-2-1 standard.  This matches almost
+                     all systems.
+   PNG_GAMMA_MAC_18: Indicates that the system is an older
+                     (pre Mac OS 10.6) Apple Macintosh system with
+                     the default settings.
+   PNG_GAMMA_LINEAR: Just the fixed point value for 1.0 - indicates
+                     that the system expects data with no gamma
+                     encoding.
 
 You would use the linear (unencoded) value if you need to process the pixel
 values further because this avoids the need to decode and reencode each
@@ -720,11 +749,11 @@ Libpng only supports composing onto a single color (using png_set_background;
 see below).  Otherwise you must do the composition yourself and, in this case,
 you may need to call png_set_alpha_mode:
 
-    #if PNG_LIBPNG_VER >= 10504
-       png_set_alpha_mode(png_ptr, mode, screen_gamma);
-    #else
-       png_set_gamma(png_ptr, screen_gamma, 1.0/screen_gamma);
-    #endif
+   #if PNG_LIBPNG_VER >= 10504
+      png_set_alpha_mode(png_ptr, mode, screen_gamma);
+   #else
+      png_set_gamma(png_ptr, screen_gamma, 1.0/screen_gamma);
+   #endif
 
 The screen_gamma value is the same as the argument to png_set_gamma; however,
 how it affects the output depends on the mode.  png_set_alpha_mode() sets the
@@ -1130,7 +1159,11 @@ pointer into the info_ptr is returned for any complex types.
 The colorspace data from gAMA, cHRM, sRGB, iCCP, and sBIT chunks
 is simply returned to give the application information about how the
 image was encoded.  Libpng itself only does transformations using the file
-gamma when combining semitransparent pixels with the background color.
+gamma when combining semitransparent pixels with the background color, and,
+since libpng-1.6.0, when converting between 8-bit sRGB and 16-bit linear pixels
+within the simplified API.  Libpng also uses the file gamma when converting
+RGB to gray, beginning with libpng-1.0.5, if the application calls
+png_set_rgb_to_gray()).
 
     png_get_PLTE(png_ptr, info_ptr, &palette,
                      &num_palette);
@@ -1143,7 +1176,7 @@ gamma when combining semitransparent pixels with the background color.
     png_get_gAMA(png_ptr, info_ptr, &file_gamma);
     png_get_gAMA_fixed(png_ptr, info_ptr, &int_file_gamma);
 
-    file_gamma     - the gamma at which the file was
+    file_gamma     - the gamma at which the file is
                      written (PNG_INFO_gAMA)
 
     int_file_gamma - 100,000 times the gamma at which the
@@ -1151,14 +1184,17 @@ gamma when combining semitransparent pixels with the background color.
 
     png_get_cHRM(png_ptr, info_ptr,  &white_x, &white_y, &red_x,
                      &red_y, &green_x, &green_y, &blue_x, &blue_y)
-    png_get_cHRM_XYZ(png_ptr, info_ptr, &red_X, &red_Y, &red_Z, &green_X,
-                     &green_Y, &green_Z, &blue_X, &blue_Y, &blue_Z)
-    png_get_cHRM_fixed(png_ptr, info_ptr, &int_white_x, &int_white_y,
-                     &int_red_x, &int_red_y, &int_green_x, &int_green_y,
-                     &int_blue_x, &int_blue_y)
+    png_get_cHRM_XYZ(png_ptr, info_ptr, &red_X, &red_Y, &red_Z,
+                     &green_X, &green_Y, &green_Z, &blue_X, &blue_Y,
+                     &blue_Z)
+    png_get_cHRM_fixed(png_ptr, info_ptr, &int_white_x,
+                     &int_white_y, &int_red_x, &int_red_y,
+                     &int_green_x, &int_green_y, &int_blue_x,
+                     &int_blue_y)
     png_get_cHRM_XYZ_fixed(png_ptr, info_ptr, &int_red_X, &int_red_Y,
-                     &int_red_Z, &int_green_X, &int_green_Y, &int_green_Z,
-                     &int_blue_X, &int_blue_Y, &int_blue_Z)
+                     &int_red_Z, &int_green_X, &int_green_Y,
+                     &int_green_Z, &int_blue_X, &int_blue_Y,
+                     &int_blue_Z)
 
     {white,red,green,blue}_{x,y}
                      A color space encoding specified using the
@@ -1166,11 +1202,12 @@ gamma when combining semitransparent pixels with the background color.
                      white point. (PNG_INFO_cHRM)
 
     {red,green,blue}_{X,Y,Z}
-                     A color space encoding specified using the encoding end
-                     points - the CIE tristimulus specification of the intended
-                     color of the red, green and blue channels in the PNG RGB
-                     data.  The white point is simply the sum of the three end
-                     points. (PNG_INFO_cHRM)
+                     A color space encoding specified using the
+                     encoding end points - the CIE tristimulus
+                     specification of the intended color of the red,
+                     green and blue channels in the PNG RGB data.
+                     The white point is simply the sum of the three
+                     end points. (PNG_INFO_cHRM)
 
     png_get_sRGB(png_ptr, info_ptr, &srgb_intent);
 
@@ -2527,6 +2564,20 @@ You can #define PNG_ABORT() to a function that does something
 more useful than abort(), as long as your function does not
 return.
 
+Checking for invalid palette index on write was added at libpng
+1.5.10.  If a pixel contains an invalid (out-of-range) index libpng issues
+a benign error.  This is enabled by default because this condition is an
+error according to the PNG specification, Clause 11.3.2, but the error can
+be ignored in each png_ptr with
+
+   png_set_check_for_invalid_index(png_ptr, 0);
+
+If the error is ignored, or if png_benign_error() treats it as a warning,
+any invalid pixels are written as-is by the encoder, resulting in an
+invalid PNG datastream as output.  In this case the application is
+responsible for ensuring that the pixel indexes are in range when it writes
+a PLTE chunk with fewer entries than the bit depth would allow.
+
 Now you need to set up the output code.  The default for libpng is to
 use the C function fwrite().  If you use this, you will need to pass a
 valid FILE * in the function png_init_io().  Be sure that the file is
@@ -3029,8 +3080,9 @@ tEXt chunk use RFC 1123 format dates (e.g. "22 May 1997 18:07:10 GMT"),
 although this isn't a requirement.  Unlike the tIME chunk, the
 "Creation Time" tEXt chunk is not expected to be automatically changed
 by the software.  To facilitate the use of RFC 1123 dates, a function
-png_convert_to_rfc1123(png_ptr, png_timep) is provided to convert
-from PNG time to an RFC 1123 format string.
+png_convert_to_rfc1123_buffer(png_ptr, buffer, png_timep) is provided to
+convert from PNG time to an RFC 1123 format string.  The caller must provide
+a writeable buffer of at least 29 bytes.
 
 Writing unknown chunks
 
@@ -3438,7 +3490,364 @@ if you transfer responsibility for free'ing text_ptr from libpng to your
 application, your application must not separately free those members.
 For a more compact example of writing a PNG image, see the file example.c.
 
-V. Modifying/Customizing libpng:
+V. Simplified API
+
+The simplified API, which became available in libpng-1.6.0, hides the details
+of both libpng and the PNG file format itself.
+It allows PNG files to be read into a very limited number of
+in-memory bitmap formats or to be written from the same formats.  If these
+formats do not accomodate your needs then you can, and should, use the more
+sophisticated APIs above - these support a wide variety of in-memory formats
+and a wide variety of sophisticated transformations to those formats as well
+as a wide variety of APIs to manipulate ancilliary information.
+
+To read a PNG file using the simplified API:
+
+  1) Declare a 'png_image' structure (see below) on the
+     stack and memset() it to all zero.
+
+  2) Call the appropriate png_image_begin_read... function.
+
+  3) Set the png_image 'format' member to the required
+     format and allocate a buffer for the image.
+
+  4) Call png_image_finish_read to read the image into
+     your buffer.
+
+There are no restrictions on the format of the PNG input itself; all valid
+color types, bit depths, and interlace methods are acceptable, and the
+input image is transformed as necessary to the requested in-memory format
+during the png_image_finish_read() step.
+
+To write a PNG file using the simplified API:
+
+  1) Declare a 'png_image' structure on the stack and memset()
+     it to all zero.
+
+  2) Initialize the members of the structure that describe the
+     image, setting the 'format' member to the format of the
+     image in memory.
+
+  3) Call the appropriate png_image_write... function with a
+     pointer to the image to write the PNG data.
+
+png_image is a structure that describes the in-memory format of an image
+when it is being read or define the in-memory format of an image that you
+need to write.  The "png_image" structure contains the following members:
+
+   png_uint_32  version Set to PNG_IMAGE_VERSION
+   png_uint_32  width   Image width in pixels (columns)
+   png_uint_32  height  Image height in pixels (rows)
+   png_uint_32  format  Image format as defined below
+   png_uint_32  flags   A bit mask containing informational flags
+   png_controlp opaque  Initialize to NULL, free with png_image_free
+   png_uint_32  colormap_entries; Number of entries in the color-map
+   png_uint_32  warning_or_error;
+   char         message[64];
+
+In the event of an error or warning the following field warning_or_error
+field will be set to a non-zero value and the 'message' field will contain
+a '\0' terminated string with the libpng error or warning message.  If both
+warnings and an error were encountered, only the error is recorded.  If there
+are multiple warnings, only the first one is recorded.
+
+The upper 30 bits of this value are reserved; the low two bits contain
+a two bit code such that a value more than 1 indicates a failure in the API
+just called:
+
+   0 - no warning or error
+   1 - warning
+   2 - error
+   3 - error preceded by warning
+
+The pixels (samples) of the image have one to four channels whose components
+have original values in the range 0 to 1.0:
+
+  1: A single gray or luminance channel (G).
+  2: A gray/luminance channel and an alpha channel (GA).
+  3: Three red, green, blue color channels (RGB).
+  4: Three color channels and an alpha channel (RGBA).
+
+The channels are encoded in one of two ways:
+
+  a) As a small integer, value 0..255, contained in a single byte.  For the
+alpha channel the original value is simply value/255.  For the color or
+luminance channels the value is encoded according to the sRGB specification
+and matches the 8-bit format expected by typical display devices.
+
+The color/gray channels are not scaled (pre-multiplied) by the alpha
+channel and are suitable for passing to color management software.
+
+  b) As a value in the range 0..65535, contained in a 2-byte integer.  All
+channels can be converted to the original value by dividing by 65535; all
+channels are linear.  Color channels use the RGB encoding (RGB end-points) of
+the sRGB specification.  This encoding is identified by the
+PNG_FORMAT_FLAG_LINEAR flag below.
+
+When an alpha channel is present it is expected to denote pixel coverage
+of the color or luminance channels and is returned as an associated alpha
+channel: the color/gray channels are scaled (pre-multiplied) by the alpha
+value.
+
+When a color-mapped image is used as a result of calling
+png_image_read_colormap or png_image_write_colormap the channels are encoded
+in the color-map and the descriptions above apply to the color-map entries.
+The image data is encoded as small integers, value 0..255, that index the
+entries in the color-map.  One integer (one byte) is stored for each pixel.
+
+PNG_FORMAT_*
+
+The #defines to be used in png_image::format.  Each #define identifies a
+particular layout of channel data and, if present, alpha values.  There are
+separate defines for each of the two channel encodings.
+
+A format is built up using single bit flag values.  Not all combinations are
+valid: use the bit flag values below for testing a format returned by the
+read APIs, but set formats from the derived values.
+
+When reading or writing color-mapped images the format should be set to the
+format of the entries in the color-map then png_image_{read,write}_colormap
+called to read or write the color-map and set the format correctly for the
+image data.  Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly!
+
+NOTE: libpng can be built with particular features disabled, if you see
+compiler errors because the definition of one of the following flags has been
+compiled out it is because libpng does not have the required support.  It is
+possible, however, for the libpng configuration to enable the format on just
+read or just write; in that case you may see an error at run time.  You can
+guard against this by checking for the definition of:
+
+   PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED
+
+   PNG_FORMAT_FLAG_ALPHA    0x01 format with an alpha channel
+   PNG_FORMAT_FLAG_COLOR    0x02 color format: otherwise grayscale
+   PNG_FORMAT_FLAG_LINEAR   0x04 png_uint_16 channels else png_byte
+   PNG_FORMAT_FLAG_COLORMAP 0x08 libpng use only
+   PNG_FORMAT_FLAG_BGR      0x10 BGR colors, else order is RGB
+   PNG_FORMAT_FLAG_AFIRST   0x20 alpha channel comes first
+
+Supported formats are as follows.  Future versions of libpng may support more
+formats; for compatibility with older versions simply check if the format
+macro is defined using #ifdef.  These defines describe the in-memory layout
+of the components of the pixels of the image.
+
+First the single byte formats:
+
+   PNG_FORMAT_GRAY 0
+   PNG_FORMAT_GA   PNG_FORMAT_FLAG_ALPHA
+   PNG_FORMAT_AG   (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST)
+   PNG_FORMAT_RGB  PNG_FORMAT_FLAG_COLOR
+   PNG_FORMAT_BGR  (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR)
+   PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA)
+   PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST)
+   PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA)
+   PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST)
+
+Then the linear 2-byte formats.  When naming these "Y" is used to
+indicate a luminance (gray) channel.  The component order within the pixel
+is always the same - there is no provision for swapping the order of the
+components in the linear format.
+
+   PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR
+   PNG_FORMAT_LINEAR_Y_ALPHA
+      (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA)
+   PNG_FORMAT_LINEAR_RGB
+      (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR)
+   PNG_FORMAT_LINEAR_RGB_ALPHA
+      (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|
+      PNG_FORMAT_FLAG_ALPHA)
+
+Color-mapped formats are obtained by calling png_image_{read,write}_colormap,
+as appropriate after setting png_image::format to the format of the color-map
+to be read or written.  Applications may check the value of
+PNG_FORMAT_FLAG_COLORMAP to see if they have called the colormap API.  The
+format of the color-map may be extracted using the following macro.
+
+   PNG_FORMAT_OF_COLORMAP(fmt) ((fmt) & ~PNG_FORMAT_FLAG_COLORMAP)
+
+PNG_IMAGE macros
+
+These are convenience macros to derive information from a png_image
+structure.  The PNG_IMAGE_SAMPLE_ macros return values appropriate to the
+actual image sample values - either the entries in the color-map or the
+pixels in the image.  The PNG_IMAGE_PIXEL_ macros return corresponding values
+for the pixels and will always return 1 after a call to
+png_image_{read,write}_colormap.  The remaining macros return information
+about the rows in the image and the complete image.
+
+NOTE: All the macros that take a png_image::format parameter are compile time
+constants if the format parameter is, itself, a constant.  Therefore these
+macros can be used in array declarations and case labels where required.
+Similarly the macros are also pre-processor constants (sizeof is not used) so
+they can be used in #if tests.
+
+First the information about the samples.
+
+  PNG_IMAGE_SAMPLE_CHANNELS(fmt)
+    Returns the total number of channels in a given format: 1..4
+
+  PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)
+    Returns the size in bytes of a single component of a pixel or color-map
+    entry (as appropriate) in the image.
+
+  PNG_IMAGE_SAMPLE_SIZE(fmt)
+    This is the size of the sample data for one sample.  If the image is
+    color-mapped it is the size of one color-map entry (and image pixels are
+    one byte in size), otherwise it is the size of one image pixel.
+
+  PNG_IMAGE_COLORMAP_SIZE(fmt)
+   The size of the color-map required by the format; this is the size of the
+   color-map buffer passed to the png_image_{read,write}_colormap APIs, it is
+   a fixed number determined by the format so can easily be allocated on the
+   stack if necessary.
+
+#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\
+   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256)
+   /* The maximum size of the color-map required by the format expressed in a
+    * count of components.  This can be used to compile-time allocate a
+    * color-map:
+    *
+    * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)];
+    *
+    * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)];
+    *
+    * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the
+    * information from one of the png_image_begin_read_ APIs and dynamically
+    * allocate the required memory.
+    */
+
+
+Corresponding information about the pixels
+
+  PNG_IMAGE_PIXEL_(test,fmt)
+
+  PNG_IMAGE_PIXEL_CHANNELS(fmt)
+   The number of separate channels (components) in a pixel; 1 for a
+   color-mapped image.
+
+  PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\
+   The size, in bytes, of each component in a pixel; 1 for a color-mapped
+   image.
+
+  PNG_IMAGE_PIXEL_SIZE(fmt)
+   The size, in bytes, of a complete pixel; 1 for a color-mapped image.
+
+Information about the whole row, or whole image
+
+  PNG_IMAGE_ROW_STRIDE(image)
+   Returns the total number of components in a single row of the image; this
+   is the minimum 'row stride', the minimum count of components between each
+   row.  For a color-mapped image this is the minimum number of bytes in a
+   row.
+
+  PNG_IMAGE_BUFFER_SIZE(image, row_stride)
+    Returns the size, in bytes, of an image buffer given a png_image and a row
+    stride - the number of components to leave space for in each row.
+
+  PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB == 0x01
+    This indicates the the RGB values of the in-memory bitmap do not
+    correspond to the red, green and blue end-points defined by sRGB.
+
+  PNG_IMAGE_FLAG_COLORMAP == 0x02
+    The PNG is color-mapped.  If this flag is set png_image_read_colormap
+    can be used without further loss of image information.  If it is not set
+    png_image_read_colormap will cause significant loss if the image has any
+
+READ APIs
+
+   The png_image passed to the read APIs must have been initialized by setting
+   the png_controlp field 'opaque' to NULL (or, better, memset the whole thing.)
+
+   int png_image_begin_read_from_file( png_imagep image,
+     const char *file_name)
+
+     The named file is opened for read and the image header
+     is filled in from the PNG header in the file.
+
+   int png_image_begin_read_from_stdio (png_imagep image,
+     FILE* file)
+
+      The PNG header is read from the stdio FILE object.
+
+   int png_image_begin_read_from_memory(png_imagep image,
+      png_const_voidp memory, png_size_t size)
+
+      The PNG header is read from the given memory buffer.
+
+   int png_image_finish_read(png_imagep image,
+      png_colorp background, void *buffer,
+      png_int_32 row_stride, void *colormap));
+
+      Finish reading the image into the supplied buffer and
+      clean up the png_image structure.
+
+      row_stride is the step, in png_byte or png_uint_16 units
+      as appropriate, between adjacent rows.  A positive stride
+      indicates that the top-most row is first in the buffer -
+      the normal top-down arrangement.  A negative stride
+      indicates that the bottom-most row is first in the buffer.
+
+      background need only be supplied if an alpha channel must
+      be removed from a png_byte format and the removal is to be
+      done by compositing on a solid color; otherwise it may be
+      NULL and any composition will be done directly onto the
+      buffer.  The value is an sRGB color to use for the
+      background, for grayscale output the green channel is used.
+
+      For linear output removing the alpha channel is always done
+      by compositing on black.
+
+   void png_image_free(png_imagep image)
+
+      Free any data allocated by libpng in image->opaque,
+      setting the pointer to NULL.  May be called at any time
+      after the structure is initialized.
+
+When the simplified API needs to convert between sRGB and linear colorspaces,
+the actual sRGB transfer curve defined in the sRGB specification (see the
+article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+approximation used elsewhere in libpng.
+
+WRITE APIS
+
+For write you must initialize a png_image structure to describe the image to
+be written:
+
+   version: must be set to PNG_IMAGE_VERSION
+   opaque: must be initialized to NULL
+   width: image width in pixels
+   height: image height in rows
+   format: the format of the data you wish to write
+   flags: set to 0 unless one of the defined flags applies; set
+      PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images
+      where the RGB values do not correspond to the colors in sRGB.
+   colormap_entries: set to the number of entries in the color-map (0 to 256)
+
+   int png_image_write_to_file, (png_imagep image,
+      const char *file, int convert_to_8bit, const void *buffer,
+      png_int_32 row_stride, const void *colormap));
+
+      Write the image to the named file.
+
+   int png_image_write_to_stdio(png_imagep image, FILE *file,
+      int convert_to_8_bit, const void *buffer,
+      png_int_32 row_stride, const void *colormap)
+
+      Write the image to the given (FILE*).
+
+With all write APIs if image is in one of the linear formats with
+(png_uint_16) data then setting convert_to_8_bit will cause the output to be
+a (png_byte) PNG gamma encoded according to the sRGB specification, otherwise
+a 16-bit linear encoded PNG file is written.
+
+With all APIs row_stride is handled as in the read APIs - it is the spacing
+from one row to the next in component sized units (float) and if negative
+indicates a bottom-up row layout in the buffer.
+
+Note that the write API does not support interlacing, sub-8-bit pixels,
+and indexed (paletted) images.
+
+VI. Modifying/Customizing libpng
 
 There are two issues here.  The first is changing how libpng does
 standard things like memory allocation, input/output, and error handling.
@@ -3572,6 +3981,15 @@ compiler documentation for more details.  For an alternative approach, you
 may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net),
 which is illustrated in pngvalid.c and in contrib/visupng.
 
+Beginning in libpng-1.4.0, the png_set_benign_errors() API became available.
+You can use this to handle certain errors (normally handled as errors)
+as warnings.
+
+    png_set_benign_errors (png_ptr, int allowed);
+
+    allowed: 0: (default) treat png_benign_error() an error.
+             1: treat png_benign_error() as a warning.
+
 Custom chunks
 
 If you need to read or write custom chunks, you may need to get deeper
@@ -3860,7 +4278,18 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements
 having level = 0 will be printed.  There aren't any such statements in
 this version of libpng, but if you insert some they will be printed.
 
-VI.  MNG support
+Prepending a prefix to exported symbols
+
+Starting with libpng-1.6.0, you can configure libpng (when using the
+"configure" script) to prefix all exported symbols by means of the
+configuration option "--with-libpng-prefix=FOO_", where FOO_ can be any
+string beginning with a letter and containing only uppercase
+and lowercase letters, digits, and the underscore (i.e., a C language
+identifier).  This creates a set of macros in pnglibconf.h, so this is
+transparent to applications; their function calls get transformed by
+the macros to use the modified names.
+
+VII.  MNG support
 
 The MNG specification (available at http://www.libpng.org/pub/mng) allows
 certain extensions to PNG for PNG images that are embedded in MNG datastreams.
@@ -3887,7 +4316,7 @@ or any other MNG chunks; your application must provide its own support for
 them.  You may wish to consider using libmng (available at
 http://www.libmng.com) instead.
 
-VII.  Changes to Libpng from version 0.88
+VIII.  Changes to Libpng from version 0.88
 
 It should be noted that versions of libpng later than 0.96 are not
 distributed by the original libpng author, Guy Schalnat, nor by
@@ -3939,7 +4368,7 @@ application:
 
    png_uint_32 application_vn = PNG_LIBPNG_VER;
 
-VIII.  Changes to Libpng from version 1.0.x to 1.2.x
+IX.  Changes to Libpng from version 1.0.x to 1.2.x
 
 Support for user memory management was enabled by default.  To
 accomplish this, the functions png_create_read_struct_2(),
@@ -4036,7 +4465,7 @@ which also expands tRNS to alpha was replaced with
     png_set_expand_gray_1_2_4_to_8()
 which does not. It has been deprecated since libpng-1.0.18 and 1.2.9.
 
-IX.  Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
+X.  Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
 
 Private libpng prototypes and macro definitions were moved from
 png.h and pngconf.h into a new pngpriv.h header file.
@@ -4091,8 +4520,8 @@ png_get_mmx_bitdepth_threshold(), png_get_mmx_rowbytes_threshold(),
 png_set_asm_flags(), and png_mmx_supported()
 
 We removed the obsolete png_check_sig(), png_memcpy_check(), and
-png_memset_check() functions.  Instead use !png_sig_cmp(), png_memcpy(),
-and png_memset(), respectively.
+png_memset_check() functions.  Instead use !png_sig_cmp(), memcpy(),
+and memset(), respectively.
 
 The function png_set_gray_1_2_4_to_8() was removed. It has been
 deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with
@@ -4146,20 +4575,41 @@ was renamed to PNG_READ_QUANTIZE_SUPPORTED.
 
 We removed the trailing '.' from the warning and error messages.
 
-X.  Changes to Libpng from version 1.4.x to 1.5.x
+XI.  Changes to Libpng from version 1.4.x to 1.5.x
 
 From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
 function) incorrectly returned a value of type png_uint_32.
 
 Checking for invalid palette index on read or write was added at libpng
 1.5.10.  When an invalid index is found, libpng issues a benign error.
-This is enabled by default but can be disabled in each png_ptr with
+This is enabled by default because this condition is an error according
+to the PNG specification, Clause 11.3.2, but the error can be ignored in
+each png_ptr with
 
    png_set_check_for_invalid_index(png_ptr, allowed);
 
       allowed  - one of
-                 0: disable
-                 1: enable
+                 0: disable benign error (accept the
+                    invalid data without warning).
+                 1: enable benign error (treat the
+                    invalid data as an error or a
+                    warning).
+
+If the error is ignored, or if png_benign_error() treats it as a warning,
+any invalid pixels are decoded as opaque black by the decoder and written
+as-is by the encoder.
+
+Retrieving the maximum palette index found was added at libpng-1.5.15.
+This statement must appear after png_read_png() or png_read_image() while
+reading, and after png_write_png() or png_write_image() while writing.
+
+   int max_palette = png_get_palette_max(png_ptr, info_ptr);
+
+This will return the maximum palette index found in the image, or "-1" if
+the palette was not checked, or "0" if no palette was found.  Note that this
+does not account for any palette index used by ancillary chunks such as the
+bKGD chunk; you must check those separately to determine the maximum
+palette index actually used.
 
 A. Changes that affect users of libpng
 
@@ -4169,9 +4619,10 @@ members of the main libpng control structures, png_struct and png_info,
 deprecated in earlier versions of libpng, has been completely removed from
 libpng 1.5.
 
-We no longer include zlib.h in png.h.  Applications that need access
-to information in zlib.h will need to add the '#include "zlib.h"'
-directive.  It does not matter whether it is placed prior to or after
+We no longer include zlib.h in png.h.  The include statement has been moved
+to pngstruct.h, where it is not accessible by applications. Applications that
+need access to information in zlib.h will need to add the '#include "zlib.h"'
+directive.  It does not matter whether this is placed prior to or after
 the '"#include png.h"' directive.
 
 The png_sprintf(), png_strcpy(), and png_strncpy() macros are no longer used
@@ -4462,7 +4913,83 @@ pngusr.h a system builder may also define equivalent options in pngusr.dfa
 DFA_XTRA to the file name.  The makefiles in contrib/pngminim illustrate
 how to do this, and a case where pngusr.h is still required.
 
-XI. Detecting libpng
+XII.  Changes to Libpng from version 1.5.x to 1.6.x
+
+A "simplified API" has been added (see documentation in png.h and a simple
+example in contrib/examples/pngtopng.c).  The new publicly visible API
+includes the following:
+
+   macros:
+     PNG_FORMAT_*
+     PNG_IMAGE_*
+   structures:
+     png_control
+     png_image
+   read functions
+     png_image_begin_read_from_file()
+     png_image_begin_read_from_stdio()
+     png_image_begin_read_from_memory()
+     png_image_finish_read()
+     png_image_free()
+   write functions
+     png_image_write_to_file()
+     png_image_write_to_stdio()
+
+Starting with libpng-1.6.0, you can configure libpng to prefix all exported
+symbols, using the PNG_PREFIX macro.
+
+We no longer include string.h in png.h.  The include statement has been moved
+to pngpriv.h, where it is not accessible by applications.  Applications that
+need access to information in string.h must add an '#include "string.h"'
+directive.  It does not matter whether this is placed prior to or after
+the '"#include png.h"' directive.
+
+The following API are now DEPRECATED:
+   png_info_init_3()
+   png_convert_to_rfc1123() which has been replaced
+     with png_convert_to_rfc1123_buffer()
+   png_data_freer()
+   png_malloc_default()
+   png_free_default()
+   png_reset_zstream()
+
+The following has been removed:
+   png_get_io_chunk_name(), which has been replaced
+     with png_get_io_chunk_type().  The new
+     function returns a 32-bit integer instead of
+     a string.
+   The png_sizeof(), png_strlen(), png_memcpy(), png_memcmp(), and
+     png_memset() macros are no longer used in the libpng sources and
+     have been removed.  These had already been made invisible to applications
+     (i.e., defined in the private pngpriv.h header file) since libpng-1.5.0.
+
+The signatures of many exported functions were changed, such that
+   png_structp became png_structrp or png_const_structrp
+   png_infop became png_inforp or png_const_inforp
+where "rp" indicates a "restricted pointer".
+
+Error detection in some chunks has improved; in particular the iCCP chunk
+reader now does pretty complete validation of the basic format.  Some bad
+profiles that were previously accepted are now rejected, in particular the
+very old broken Microsoft/HP sRGB profile.
+
+The library now issues a warning if both background processing and RGB to
+gray are used when gamma correction happens. As with previous versions of
+the library the results are numerically very incorrect in this case.
+
+There are some minor arithmetic changes in some transforms such as
+png_set_background(), that might be detected by certain regression tests.
+
+Unknown chunk handling has been improved internally, without any API change.
+This adds more correct option control of the unknown handling, corrects
+a pre-existing bug where the per-chunk 'keep' setting is ignored, and makes
+it possible to skip IDAT chunks in the sequential reader.
+
+The machine-generated configure files are no longer included in branches
+libpng16 and later of the GIT repository.  They continue to be included
+in the tarball releases, however.
+
+XIII.  Detecting libpng
 
 The png_get_io_ptr() function has been present since libpng-0.88, has never
 changed, and is unaffected by conditional compilation macros.  It is the
@@ -4471,7 +4998,7 @@ libpng version since 0.88.  In an autoconf "configure.in" you could use
 
     AC_CHECK_LIB(png, png_get_io_ptr, ...
 
-XII. Source code repository
+XV. Source code repository
 
 Since about February 2009, version 1.2.34, libpng has been under "git" source
 control.  The git repository was built from old libpng-x.y.z.tar.gz files
@@ -4495,7 +5022,7 @@ simple verbal discriptions of bug fixes, reported either to the
 SourceForge bug tracker, to the png-mng-implement at lists.sf.net
 mailing list, or directly to glennrp.
 
-XIII. Coding style
+XV. Coding style
 
 Our coding style is similar to the "Allman" style, with curly
 braces on separate lines:
@@ -4580,6 +5107,17 @@ above the comment that says
 
   /* Maintainer: Put new private prototypes here ^ */
 
+We put a space after the "sizeof" operator and we omit the
+optional parentheses around its argument when the argument
+is an expression, not a type name, and we always enclose the
+sizeof operator, with its argument, in parentheses:
+
+  (sizeof (png_uint_32))
+  (sizeof array)
+
+Prior to libpng-1.6.0 we used a "png_sizeof()" macro, formatted as
+though it were a function.
+
 To avoid polluting the global namespace, the names of all exported
 functions and variables begin with "png_", and all publicly visible C
 preprocessor macros begin with "PNG".  We request that applications that
@@ -4601,33 +5139,36 @@ when there is only one macro being tested.
 We prefer to express integers that are used as bit masks in hex format,
 with an even number of lower-case hex digits (e.g., 0x00, 0xff, 0x0100).
 
+We prefer to use underscores in variable names rather than camelCase, except
+for a few type names that we inherit from zlib.h.
+
 We do not use the TAB character for indentation in the C sources.
 
 Lines do not exceed 80 characters.
 
 Other rules can be inferred by inspecting the libpng source.
 
-XIV. Y2K Compliance in libpng
+XVI. Y2K Compliance in libpng
 
-January 24, 2013
+February 14, 2013
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
 
 This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.5.14 are Y2K compliant.  It is my belief that earlier
+upward through 1.6.0 are Y2K compliant.  It is my belief that earlier
 versions were also Y2K compliant.
 
-Libpng only has two year fields.  One is a 2-byte unsigned integer that
-will hold years up to 65535.  The other holds the date in text
-format, and will hold years up to 9999.
+Libpng only has two year fields.  One is a 2-byte unsigned integer
+that will hold years up to 65535.  The other, which is deprecated,
+holds the date in text format, and will hold years up to 9999.
 
 The integer is
     "png_uint_16 year" in png_time_struct.
 
 The string is
-    "char time_buffer[29]" in png_struct.  This will no
-longer be used in libpng-1.6.x and will be removed from libpng-1.7.0.
+    "char time_buffer[29]" in png_struct.  This is no longer used
+in libpng-1.6.x and will be removed from libpng-1.7.0.
 
 There are seven time-related functions:
 
index 089e5186f6f5f52684bbe0ad968890cda1b39f63..11da8ceacb1b44ee81b7dbe1df7bc463cc23d3eb 100644 (file)
@@ -1,6 +1,6 @@
-.TH LIBPNG 3 "January 24, 2013"
+.TH LIBPNG 3 "February 14, 2013"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.5.14
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.0
 .SH SYNOPSIS
 \fB
 #include <png.h>\fP
@@ -111,8 +111,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.5.14
 
 \fBpng_byte png_get_interlace_type (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
 
-\fBpng_const_bytep png_get_io_chunk_name (png_structp \fIpng_ptr\fP\fB);\fP
-
 \fBpng_uint_32 png_get_io_chunk_type (png_const_structp \fIpng_ptr\fP\fB);\fP
 
 \fBpng_voidp png_get_io_ptr (png_structp \fIpng_ptr\fP\fB);\fP
@@ -217,6 +215,20 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.5.14
 
 \fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
 
+\fBint png_image_begin_read_from_file (png_imagep \fP\fIimage\fP\fB, const char \fI*file_name\fP\fB);\fP
+
+\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE* \fIfile\fP\fB);\fP
+
+\fBint, png_image_begin_read_from_memory (png_imagep \fP\fIimage\fP\fB, png_const_voidp \fP\fImemory\fP\fB, png_size_t \fIsize\fP\fB);\fP
+
+\fBint png_image_finish_read (png_imagep \fP\fIimage\fP\fB, png_colorp \fP\fIbackground\fP\fB, void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP
+
+\fBvoid png_image_free (png_imagep \fIimage\fP\fB);\fP
+
+\fBint png_image_write_to_file (png_imagep \fP\fIimage\fP\fB, const char \fP\fI*file\fP\fB, int \fP\fIconvert_to_8bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP
+
+\fBint png_image_write_to_stdio (png_imagep \fP\fIimage\fP\fB, FILE \fP\fI*file\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap)\fP\fB);\fP
+
 \fBvoid png_info_init_3 (png_infopp \fP\fIinfo_ptr\fP\fB, png_size_t \fIpng_info_struct_size\fP\fB);\fP
 
 \fBvoid png_init_io (png_structp \fP\fIpng_ptr\fP\fB, FILE \fI*fp\fP\fB);\fP
@@ -490,12 +502,12 @@ the Portable Network Graphics (PNG) format image files.  It uses the
 compression library.
 Following is a copy of the libpng-manual.txt file that accompanies libpng.
 .SH LIBPNG.TXT
-Libpng-manual.txt - A description on how to use and modify libpng
+libpng-manual.txt - A description on how to use and modify libpng
 
- libpng version 1.5.14 - January 24, 2013
+ libpng version 1.6.0 - February 14, 2013
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
- Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ Copyright (c) 1998-2013 Glenn Randers-Pehrson
 
  This document is released under the libpng license.
  For conditions of distribution and use, see the disclaimer
@@ -503,9 +515,9 @@ Libpng-manual.txt - A description on how to use and modify libpng
 
  Based on:
 
- libpng versions 0.97, January 1998, through 1.5.14 - January 24, 2013
+ libpng versions 0.97, January 1998, through 1.6.0 - February 14, 2013
  Updated and distributed by Glenn Randers-Pehrson
- Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ Copyright (c) 1998-2013 Glenn Randers-Pehrson
 
  libpng 1.0 beta 6  version 0.96 May 28, 1997
  Updated and distributed by Andreas Dilger
@@ -520,6 +532,25 @@ Libpng-manual.txt - A description on how to use and modify libpng
  Copyright (c) 1995, 1996 Frank J. T. Wojcik
  December 18, 1995 & January 20, 1996
 
+ TABLE OF CONTENTS
+
+    I. Introduction
+   II. Structures
+  III. Reading
+   IV. Writing
+    V. Simplified API
+   VI. Modifying/Customizing libpng
+  VII. MNG support
+ VIII. Changes to Libpng from version 0.88
+   IX. Changes to Libpng from version 1.0.x to 1.2.x
+    X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
+   XI. Changes to Libpng from version 1.4.x to 1.5.x
+  XII. Changes to Libpng from version 1.5.x to 1.6.x
+ XIII. Detecting libpng
+  XIV. Source code repository
+   XV. Coding style
+  XVI. Y2K Compliance in libpng
+
 .SH I. Introduction
 
 This file describes how to use and modify the PNG reference library
@@ -1045,6 +1076,7 @@ chunk types. To change this, you can call:
 
     png_set_keep_unknown_chunks(png_ptr, keep,
         chunk_list, num_chunks);
+
     keep       - 0: default unknown chunk handling
                  1: ignore; do not keep
                  2: keep only if safe-to-copy
@@ -1058,11 +1090,16 @@ chunk types. To change this, you can call:
 
     chunk_list - list of chunks affected (a byte string,
                  five bytes per chunk, NULL or '\0' if
-                 num_chunks is 0)
+                 num_chunks is positive; ignored if
+                 numchunks <= 0).
 
     num_chunks - number of chunks affected; if 0, all
-                 unknown chunks are affected.  If nonzero,
-                 only the chunks in the list are affected
+                 unknown chunks are affected.  If positive,
+                 only the chunks in the list are affected,
+                 and if negative all unknown chunks and
+                 all known chunks except for the IHDR,
+                 PLTE, tRNS, IDAT, and IEND chunks are
+                 affected.
 
 Unknown chunks declared in this way will be saved as raw data onto a
 list of png_unknown_chunk structures.  If a chunk that is normally
@@ -1178,7 +1215,8 @@ assumes that the PNG data matches your system, to keep this default call:
 
 or you can use the fixed point equivalent:
 
-   png_set_gamma_fixed(png_ptr, PNG_FP_1*screen_gamma, PNG_FP_1/screen_gamma);
+   png_set_gamma_fixed(png_ptr, PNG_FP_1*screen_gamma,
+      PNG_FP_1/screen_gamma);
 
 If you don't know the gamma for your system it is probably 2.2 - a good
 approximation to the IEC standard for display systems (sRGB).  If images are
@@ -1190,12 +1228,15 @@ display driver, a few systems, including older Macs, change the response by
 default.  As of 1.5.4 three special values are available to handle common
 situations:
 
-   PNG_DEFAULT_sRGB: Indicates that the system conforms to the IEC 61966-2-1
-                     standard.  This matches almost all systems.
-   PNG_GAMMA_MAC_18: Indicates that the system is an older (pre Mac OS 10.6)
-                     Apple Macintosh system with the default settings.
-   PNG_GAMMA_LINEAR: Just the fixed point value for 1.0 - indicates that the
-                     system expects data with no gamma encoding.
+   PNG_DEFAULT_sRGB: Indicates that the system conforms to the
+                     IEC 61966-2-1 standard.  This matches almost
+                     all systems.
+   PNG_GAMMA_MAC_18: Indicates that the system is an older
+                     (pre Mac OS 10.6) Apple Macintosh system with
+                     the default settings.
+   PNG_GAMMA_LINEAR: Just the fixed point value for 1.0 - indicates
+                     that the system expects data with no gamma
+                     encoding.
 
 You would use the linear (unencoded) value if you need to process the pixel
 values further because this avoids the need to decode and reencode each
@@ -1212,11 +1253,11 @@ Libpng only supports composing onto a single color (using png_set_background;
 see below).  Otherwise you must do the composition yourself and, in this case,
 you may need to call png_set_alpha_mode:
 
-    #if PNG_LIBPNG_VER >= 10504
-       png_set_alpha_mode(png_ptr, mode, screen_gamma);
-    #else
-       png_set_gamma(png_ptr, screen_gamma, 1.0/screen_gamma);
-    #endif
+   #if PNG_LIBPNG_VER >= 10504
+      png_set_alpha_mode(png_ptr, mode, screen_gamma);
+   #else
+      png_set_gamma(png_ptr, screen_gamma, 1.0/screen_gamma);
+   #endif
 
 The screen_gamma value is the same as the argument to png_set_gamma; however,
 how it affects the output depends on the mode.  png_set_alpha_mode() sets the
@@ -1622,7 +1663,11 @@ pointer into the info_ptr is returned for any complex types.
 The colorspace data from gAMA, cHRM, sRGB, iCCP, and sBIT chunks
 is simply returned to give the application information about how the
 image was encoded.  Libpng itself only does transformations using the file
-gamma when combining semitransparent pixels with the background color.
+gamma when combining semitransparent pixels with the background color, and,
+since libpng-1.6.0, when converting between 8-bit sRGB and 16-bit linear pixels
+within the simplified API.  Libpng also uses the file gamma when converting
+RGB to gray, beginning with libpng-1.0.5, if the application calls
+png_set_rgb_to_gray()).
 
     png_get_PLTE(png_ptr, info_ptr, &palette,
                      &num_palette);
@@ -1635,7 +1680,7 @@ gamma when combining semitransparent pixels with the background color.
     png_get_gAMA(png_ptr, info_ptr, &file_gamma);
     png_get_gAMA_fixed(png_ptr, info_ptr, &int_file_gamma);
 
-    file_gamma     - the gamma at which the file was
+    file_gamma     - the gamma at which the file is
                      written (PNG_INFO_gAMA)
 
     int_file_gamma - 100,000 times the gamma at which the
@@ -1643,14 +1688,17 @@ gamma when combining semitransparent pixels with the background color.
 
     png_get_cHRM(png_ptr, info_ptr,  &white_x, &white_y, &red_x,
                      &red_y, &green_x, &green_y, &blue_x, &blue_y)
-    png_get_cHRM_XYZ(png_ptr, info_ptr, &red_X, &red_Y, &red_Z, &green_X,
-                     &green_Y, &green_Z, &blue_X, &blue_Y, &blue_Z)
-    png_get_cHRM_fixed(png_ptr, info_ptr, &int_white_x, &int_white_y,
-                     &int_red_x, &int_red_y, &int_green_x, &int_green_y,
-                     &int_blue_x, &int_blue_y)
+    png_get_cHRM_XYZ(png_ptr, info_ptr, &red_X, &red_Y, &red_Z,
+                     &green_X, &green_Y, &green_Z, &blue_X, &blue_Y,
+                     &blue_Z)
+    png_get_cHRM_fixed(png_ptr, info_ptr, &int_white_x,
+                     &int_white_y, &int_red_x, &int_red_y,
+                     &int_green_x, &int_green_y, &int_blue_x,
+                     &int_blue_y)
     png_get_cHRM_XYZ_fixed(png_ptr, info_ptr, &int_red_X, &int_red_Y,
-                     &int_red_Z, &int_green_X, &int_green_Y, &int_green_Z,
-                     &int_blue_X, &int_blue_Y, &int_blue_Z)
+                     &int_red_Z, &int_green_X, &int_green_Y,
+                     &int_green_Z, &int_blue_X, &int_blue_Y,
+                     &int_blue_Z)
 
     {white,red,green,blue}_{x,y}
                      A color space encoding specified using the
@@ -1658,11 +1706,12 @@ gamma when combining semitransparent pixels with the background color.
                      white point. (PNG_INFO_cHRM)
 
     {red,green,blue}_{X,Y,Z}
-                     A color space encoding specified using the encoding end
-                     points - the CIE tristimulus specification of the intended
-                     color of the red, green and blue channels in the PNG RGB
-                     data.  The white point is simply the sum of the three end
-                     points. (PNG_INFO_cHRM)
+                     A color space encoding specified using the
+                     encoding end points - the CIE tristimulus
+                     specification of the intended color of the red,
+                     green and blue channels in the PNG RGB data.
+                     The white point is simply the sum of the three
+                     end points. (PNG_INFO_cHRM)
 
     png_get_sRGB(png_ptr, info_ptr, &srgb_intent);
 
@@ -3019,6 +3068,20 @@ You can #define PNG_ABORT() to a function that does something
 more useful than abort(), as long as your function does not
 return.
 
+Checking for invalid palette index on write was added at libpng
+1.5.10.  If a pixel contains an invalid (out-of-range) index libpng issues
+a benign error.  This is enabled by default because this condition is an
+error according to the PNG specification, Clause 11.3.2, but the error can
+be ignored in each png_ptr with
+
+   png_set_check_for_invalid_index(png_ptr, 0);
+
+If the error is ignored, or if png_benign_error() treats it as a warning,
+any invalid pixels are written as-is by the encoder, resulting in an
+invalid PNG datastream as output.  In this case the application is
+responsible for ensuring that the pixel indexes are in range when it writes
+a PLTE chunk with fewer entries than the bit depth would allow.
+
 Now you need to set up the output code.  The default for libpng is to
 use the C function fwrite().  If you use this, you will need to pass a
 valid FILE * in the function png_init_io().  Be sure that the file is
@@ -3521,8 +3584,9 @@ tEXt chunk use RFC 1123 format dates (e.g. "22 May 1997 18:07:10 GMT"),
 although this isn't a requirement.  Unlike the tIME chunk, the
 "Creation Time" tEXt chunk is not expected to be automatically changed
 by the software.  To facilitate the use of RFC 1123 dates, a function
-png_convert_to_rfc1123(png_ptr, png_timep) is provided to convert
-from PNG time to an RFC 1123 format string.
+png_convert_to_rfc1123_buffer(png_ptr, buffer, png_timep) is provided to
+convert from PNG time to an RFC 1123 format string.  The caller must provide
+a writeable buffer of at least 29 bytes.
 
 .SS Writing unknown chunks
 
@@ -3930,7 +3994,364 @@ if you transfer responsibility for free'ing text_ptr from libpng to your
 application, your application must not separately free those members.
 For a more compact example of writing a PNG image, see the file example.c.
 
-.SH V. Modifying/Customizing libpng:
+.SH V. Simplified API
+
+The simplified API, which became available in libpng-1.6.0, hides the details
+of both libpng and the PNG file format itself.
+It allows PNG files to be read into a very limited number of
+in-memory bitmap formats or to be written from the same formats.  If these
+formats do not accomodate your needs then you can, and should, use the more
+sophisticated APIs above - these support a wide variety of in-memory formats
+and a wide variety of sophisticated transformations to those formats as well
+as a wide variety of APIs to manipulate ancilliary information.
+
+To read a PNG file using the simplified API:
+
+  1) Declare a 'png_image' structure (see below) on the
+     stack and memset() it to all zero.
+
+  2) Call the appropriate png_image_begin_read... function.
+
+  3) Set the png_image 'format' member to the required
+     format and allocate a buffer for the image.
+
+  4) Call png_image_finish_read to read the image into
+     your buffer.
+
+There are no restrictions on the format of the PNG input itself; all valid
+color types, bit depths, and interlace methods are acceptable, and the
+input image is transformed as necessary to the requested in-memory format
+during the png_image_finish_read() step.
+
+To write a PNG file using the simplified API:
+
+  1) Declare a 'png_image' structure on the stack and memset()
+     it to all zero.
+
+  2) Initialize the members of the structure that describe the
+     image, setting the 'format' member to the format of the
+     image in memory.
+
+  3) Call the appropriate png_image_write... function with a
+     pointer to the image to write the PNG data.
+
+png_image is a structure that describes the in-memory format of an image
+when it is being read or define the in-memory format of an image that you
+need to write.  The "png_image" structure contains the following members:
+
+   png_uint_32  version Set to PNG_IMAGE_VERSION
+   png_uint_32  width   Image width in pixels (columns)
+   png_uint_32  height  Image height in pixels (rows)
+   png_uint_32  format  Image format as defined below
+   png_uint_32  flags   A bit mask containing informational flags
+   png_controlp opaque  Initialize to NULL, free with png_image_free
+   png_uint_32  colormap_entries; Number of entries in the color-map
+   png_uint_32  warning_or_error;
+   char         message[64];
+
+In the event of an error or warning the following field warning_or_error
+field will be set to a non-zero value and the 'message' field will contain
+a '\0' terminated string with the libpng error or warning message.  If both
+warnings and an error were encountered, only the error is recorded.  If there
+are multiple warnings, only the first one is recorded.
+
+The upper 30 bits of this value are reserved; the low two bits contain
+a two bit code such that a value more than 1 indicates a failure in the API
+just called:
+
+   0 - no warning or error
+   1 - warning
+   2 - error
+   3 - error preceded by warning
+
+The pixels (samples) of the image have one to four channels whose components
+have original values in the range 0 to 1.0:
+
+  1: A single gray or luminance channel (G).
+  2: A gray/luminance channel and an alpha channel (GA).
+  3: Three red, green, blue color channels (RGB).
+  4: Three color channels and an alpha channel (RGBA).
+
+The channels are encoded in one of two ways:
+
+  a) As a small integer, value 0..255, contained in a single byte.  For the
+alpha channel the original value is simply value/255.  For the color or
+luminance channels the value is encoded according to the sRGB specification
+and matches the 8-bit format expected by typical display devices.
+
+The color/gray channels are not scaled (pre-multiplied) by the alpha
+channel and are suitable for passing to color management software.
+
+  b) As a value in the range 0..65535, contained in a 2-byte integer.  All
+channels can be converted to the original value by dividing by 65535; all
+channels are linear.  Color channels use the RGB encoding (RGB end-points) of
+the sRGB specification.  This encoding is identified by the
+PNG_FORMAT_FLAG_LINEAR flag below.
+
+When an alpha channel is present it is expected to denote pixel coverage
+of the color or luminance channels and is returned as an associated alpha
+channel: the color/gray channels are scaled (pre-multiplied) by the alpha
+value.
+
+When a color-mapped image is used as a result of calling
+png_image_read_colormap or png_image_write_colormap the channels are encoded
+in the color-map and the descriptions above apply to the color-map entries.
+The image data is encoded as small integers, value 0..255, that index the
+entries in the color-map.  One integer (one byte) is stored for each pixel.
+
+PNG_FORMAT_*
+
+The #defines to be used in png_image::format.  Each #define identifies a
+particular layout of channel data and, if present, alpha values.  There are
+separate defines for each of the two channel encodings.
+
+A format is built up using single bit flag values.  Not all combinations are
+valid: use the bit flag values below for testing a format returned by the
+read APIs, but set formats from the derived values.
+
+When reading or writing color-mapped images the format should be set to the
+format of the entries in the color-map then png_image_{read,write}_colormap
+called to read or write the color-map and set the format correctly for the
+image data.  Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly!
+
+NOTE: libpng can be built with particular features disabled, if you see
+compiler errors because the definition of one of the following flags has been
+compiled out it is because libpng does not have the required support.  It is
+possible, however, for the libpng configuration to enable the format on just
+read or just write; in that case you may see an error at run time.  You can
+guard against this by checking for the definition of:
+
+   PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED
+
+   PNG_FORMAT_FLAG_ALPHA    0x01 format with an alpha channel
+   PNG_FORMAT_FLAG_COLOR    0x02 color format: otherwise grayscale
+   PNG_FORMAT_FLAG_LINEAR   0x04 png_uint_16 channels else png_byte
+   PNG_FORMAT_FLAG_COLORMAP 0x08 libpng use only
+   PNG_FORMAT_FLAG_BGR      0x10 BGR colors, else order is RGB
+   PNG_FORMAT_FLAG_AFIRST   0x20 alpha channel comes first
+
+Supported formats are as follows.  Future versions of libpng may support more
+formats; for compatibility with older versions simply check if the format
+macro is defined using #ifdef.  These defines describe the in-memory layout
+of the components of the pixels of the image.
+
+First the single byte formats:
+
+   PNG_FORMAT_GRAY 0
+   PNG_FORMAT_GA   PNG_FORMAT_FLAG_ALPHA
+   PNG_FORMAT_AG   (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST)
+   PNG_FORMAT_RGB  PNG_FORMAT_FLAG_COLOR
+   PNG_FORMAT_BGR  (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR)
+   PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA)
+   PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST)
+   PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA)
+   PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST)
+
+Then the linear 2-byte formats.  When naming these "Y" is used to
+indicate a luminance (gray) channel.  The component order within the pixel
+is always the same - there is no provision for swapping the order of the
+components in the linear format.
+
+   PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR
+   PNG_FORMAT_LINEAR_Y_ALPHA
+      (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA)
+   PNG_FORMAT_LINEAR_RGB
+      (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR)
+   PNG_FORMAT_LINEAR_RGB_ALPHA
+      (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|
+      PNG_FORMAT_FLAG_ALPHA)
+
+Color-mapped formats are obtained by calling png_image_{read,write}_colormap,
+as appropriate after setting png_image::format to the format of the color-map
+to be read or written.  Applications may check the value of
+PNG_FORMAT_FLAG_COLORMAP to see if they have called the colormap API.  The
+format of the color-map may be extracted using the following macro.
+
+   PNG_FORMAT_OF_COLORMAP(fmt) ((fmt) & ~PNG_FORMAT_FLAG_COLORMAP)
+
+PNG_IMAGE macros
+
+These are convenience macros to derive information from a png_image
+structure.  The PNG_IMAGE_SAMPLE_ macros return values appropriate to the
+actual image sample values - either the entries in the color-map or the
+pixels in the image.  The PNG_IMAGE_PIXEL_ macros return corresponding values
+for the pixels and will always return 1 after a call to
+png_image_{read,write}_colormap.  The remaining macros return information
+about the rows in the image and the complete image.
+
+NOTE: All the macros that take a png_image::format parameter are compile time
+constants if the format parameter is, itself, a constant.  Therefore these
+macros can be used in array declarations and case labels where required.
+Similarly the macros are also pre-processor constants (sizeof is not used) so
+they can be used in #if tests.
+
+First the information about the samples.
+
+  PNG_IMAGE_SAMPLE_CHANNELS(fmt)
+    Returns the total number of channels in a given format: 1..4
+
+  PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)
+    Returns the size in bytes of a single component of a pixel or color-map
+    entry (as appropriate) in the image.
+
+  PNG_IMAGE_SAMPLE_SIZE(fmt)
+    This is the size of the sample data for one sample.  If the image is
+    color-mapped it is the size of one color-map entry (and image pixels are
+    one byte in size), otherwise it is the size of one image pixel.
+
+  PNG_IMAGE_COLORMAP_SIZE(fmt)
+   The size of the color-map required by the format; this is the size of the
+   color-map buffer passed to the png_image_{read,write}_colormap APIs, it is
+   a fixed number determined by the format so can easily be allocated on the
+   stack if necessary.
+
+#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\
+   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256)
+   /* The maximum size of the color-map required by the format expressed in a
+    * count of components.  This can be used to compile-time allocate a
+    * color-map:
+    *
+    * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)];
+    *
+    * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)];
+    *
+    * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the
+    * information from one of the png_image_begin_read_ APIs and dynamically
+    * allocate the required memory.
+    */
+
+
+Corresponding information about the pixels
+
+  PNG_IMAGE_PIXEL_(test,fmt)
+
+  PNG_IMAGE_PIXEL_CHANNELS(fmt)
+   The number of separate channels (components) in a pixel; 1 for a
+   color-mapped image.
+
+  PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\
+   The size, in bytes, of each component in a pixel; 1 for a color-mapped
+   image.
+
+  PNG_IMAGE_PIXEL_SIZE(fmt)
+   The size, in bytes, of a complete pixel; 1 for a color-mapped image.
+
+Information about the whole row, or whole image
+
+  PNG_IMAGE_ROW_STRIDE(image)
+   Returns the total number of components in a single row of the image; this
+   is the minimum 'row stride', the minimum count of components between each
+   row.  For a color-mapped image this is the minimum number of bytes in a
+   row.
+
+  PNG_IMAGE_BUFFER_SIZE(image, row_stride)
+    Returns the size, in bytes, of an image buffer given a png_image and a row
+    stride - the number of components to leave space for in each row.
+
+  PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB == 0x01
+    This indicates the the RGB values of the in-memory bitmap do not
+    correspond to the red, green and blue end-points defined by sRGB.
+
+  PNG_IMAGE_FLAG_COLORMAP == 0x02
+    The PNG is color-mapped.  If this flag is set png_image_read_colormap
+    can be used without further loss of image information.  If it is not set
+    png_image_read_colormap will cause significant loss if the image has any
+
+READ APIs
+
+   The png_image passed to the read APIs must have been initialized by setting
+   the png_controlp field 'opaque' to NULL (or, better, memset the whole thing.)
+
+   int png_image_begin_read_from_file( png_imagep image,
+     const char *file_name)
+
+     The named file is opened for read and the image header
+     is filled in from the PNG header in the file.
+
+   int png_image_begin_read_from_stdio (png_imagep image,
+     FILE* file)
+
+      The PNG header is read from the stdio FILE object.
+
+   int png_image_begin_read_from_memory(png_imagep image,
+      png_const_voidp memory, png_size_t size)
+
+      The PNG header is read from the given memory buffer.
+
+   int png_image_finish_read(png_imagep image,
+      png_colorp background, void *buffer,
+      png_int_32 row_stride, void *colormap));
+
+      Finish reading the image into the supplied buffer and
+      clean up the png_image structure.
+
+      row_stride is the step, in png_byte or png_uint_16 units
+      as appropriate, between adjacent rows.  A positive stride
+      indicates that the top-most row is first in the buffer -
+      the normal top-down arrangement.  A negative stride
+      indicates that the bottom-most row is first in the buffer.
+
+      background need only be supplied if an alpha channel must
+      be removed from a png_byte format and the removal is to be
+      done by compositing on a solid color; otherwise it may be
+      NULL and any composition will be done directly onto the
+      buffer.  The value is an sRGB color to use for the
+      background, for grayscale output the green channel is used.
+
+      For linear output removing the alpha channel is always done
+      by compositing on black.
+
+   void png_image_free(png_imagep image)
+
+      Free any data allocated by libpng in image->opaque,
+      setting the pointer to NULL.  May be called at any time
+      after the structure is initialized.
+
+When the simplified API needs to convert between sRGB and linear colorspaces,
+the actual sRGB transfer curve defined in the sRGB specification (see the
+article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+approximation used elsewhere in libpng.
+
+WRITE APIS
+
+For write you must initialize a png_image structure to describe the image to
+be written:
+
+   version: must be set to PNG_IMAGE_VERSION
+   opaque: must be initialized to NULL
+   width: image width in pixels
+   height: image height in rows
+   format: the format of the data you wish to write
+   flags: set to 0 unless one of the defined flags applies; set
+      PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images
+      where the RGB values do not correspond to the colors in sRGB.
+   colormap_entries: set to the number of entries in the color-map (0 to 256)
+
+   int png_image_write_to_file, (png_imagep image,
+      const char *file, int convert_to_8bit, const void *buffer,
+      png_int_32 row_stride, const void *colormap));
+
+      Write the image to the named file.
+
+   int png_image_write_to_stdio(png_imagep image, FILE *file,
+      int convert_to_8_bit, const void *buffer,
+      png_int_32 row_stride, const void *colormap)
+
+      Write the image to the given (FILE*).
+
+With all write APIs if image is in one of the linear formats with
+(png_uint_16) data then setting convert_to_8_bit will cause the output to be
+a (png_byte) PNG gamma encoded according to the sRGB specification, otherwise
+a 16-bit linear encoded PNG file is written.
+
+With all APIs row_stride is handled as in the read APIs - it is the spacing
+from one row to the next in component sized units (float) and if negative
+indicates a bottom-up row layout in the buffer.
+
+Note that the write API does not support interlacing, sub-8-bit pixels,
+and indexed (paletted) images.
+
+.SH VI. Modifying/Customizing libpng
 
 There are two issues here.  The first is changing how libpng does
 standard things like memory allocation, input/output, and error handling.
@@ -4064,6 +4485,15 @@ compiler documentation for more details.  For an alternative approach, you
 may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net),
 which is illustrated in pngvalid.c and in contrib/visupng.
 
+Beginning in libpng-1.4.0, the png_set_benign_errors() API became available.
+You can use this to handle certain errors (normally handled as errors)
+as warnings.
+
+    png_set_benign_errors (png_ptr, int allowed);
+
+    allowed: 0: (default) treat png_benign_error() an error.
+             1: treat png_benign_error() as a warning.
+
 .SS Custom chunks
 
 If you need to read or write custom chunks, you may need to get deeper
@@ -4353,7 +4783,18 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements
 having level = 0 will be printed.  There aren't any such statements in
 this version of libpng, but if you insert some they will be printed.
 
-.SH VI.  MNG support
+.SS Prepending a prefix to exported symbols
+
+Starting with libpng-1.6.0, you can configure libpng (when using the
+"configure" script) to prefix all exported symbols by means of the
+configuration option "--with-libpng-prefix=FOO_", where FOO_ can be any
+string beginning with a letter and containing only uppercase
+and lowercase letters, digits, and the underscore (i.e., a C language
+identifier).  This creates a set of macros in pnglibconf.h, so this is
+transparent to applications; their function calls get transformed by
+the macros to use the modified names.
+
+.SH VII.  MNG support
 
 The MNG specification (available at http://www.libpng.org/pub/mng) allows
 certain extensions to PNG for PNG images that are embedded in MNG datastreams.
@@ -4380,7 +4821,7 @@ or any other MNG chunks; your application must provide its own support for
 them.  You may wish to consider using libmng (available at
 http://www.libmng.com) instead.
 
-.SH VII.  Changes to Libpng from version 0.88
+.SH VIII.  Changes to Libpng from version 0.88
 
 It should be noted that versions of libpng later than 0.96 are not
 distributed by the original libpng author, Guy Schalnat, nor by
@@ -4432,7 +4873,7 @@ application:
 
    png_uint_32 application_vn = PNG_LIBPNG_VER;
 
-.SH VIII.  Changes to Libpng from version 1.0.x to 1.2.x
+.SH IX.  Changes to Libpng from version 1.0.x to 1.2.x
 
 Support for user memory management was enabled by default.  To
 accomplish this, the functions png_create_read_struct_2(),
@@ -4529,7 +4970,7 @@ which also expands tRNS to alpha was replaced with
     png_set_expand_gray_1_2_4_to_8()
 which does not. It has been deprecated since libpng-1.0.18 and 1.2.9.
 
-.SH IX.  Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
+.SH X.  Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
 
 Private libpng prototypes and macro definitions were moved from
 png.h and pngconf.h into a new pngpriv.h header file.
@@ -4584,8 +5025,8 @@ png_get_mmx_bitdepth_threshold(), png_get_mmx_rowbytes_threshold(),
 png_set_asm_flags(), and png_mmx_supported()
 
 We removed the obsolete png_check_sig(), png_memcpy_check(), and
-png_memset_check() functions.  Instead use !png_sig_cmp(), png_memcpy(),
-and png_memset(), respectively.
+png_memset_check() functions.  Instead use !png_sig_cmp(), memcpy(),
+and memset(), respectively.
 
 The function png_set_gray_1_2_4_to_8() was removed. It has been
 deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with
@@ -4639,20 +5080,41 @@ was renamed to PNG_READ_QUANTIZE_SUPPORTED.
 
 We removed the trailing '.' from the warning and error messages.
 
-.SH X.  Changes to Libpng from version 1.4.x to 1.5.x
+.SH XI.  Changes to Libpng from version 1.4.x to 1.5.x
 
 From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
 function) incorrectly returned a value of type png_uint_32.
 
 Checking for invalid palette index on read or write was added at libpng
 1.5.10.  When an invalid index is found, libpng issues a benign error.
-This is enabled by default but can be disabled in each png_ptr with
+This is enabled by default because this condition is an error according
+to the PNG specification, Clause 11.3.2, but the error can be ignored in
+each png_ptr with
 
    png_set_check_for_invalid_index(png_ptr, allowed);
 
       allowed  - one of
-                 0: disable
-                 1: enable
+                 0: disable benign error (accept the
+                    invalid data without warning).
+                 1: enable benign error (treat the
+                    invalid data as an error or a
+                    warning).
+
+If the error is ignored, or if png_benign_error() treats it as a warning,
+any invalid pixels are decoded as opaque black by the decoder and written
+as-is by the encoder.
+
+Retrieving the maximum palette index found was added at libpng-1.5.15.
+This statement must appear after png_read_png() or png_read_image() while
+reading, and after png_write_png() or png_write_image() while writing.
+
+   int max_palette = png_get_palette_max(png_ptr, info_ptr);
+
+This will return the maximum palette index found in the image, or "-1" if
+the palette was not checked, or "0" if no palette was found.  Note that this
+does not account for any palette index used by ancillary chunks such as the
+bKGD chunk; you must check those separately to determine the maximum
+palette index actually used.
 
 A. Changes that affect users of libpng
 
@@ -4662,9 +5124,10 @@ members of the main libpng control structures, png_struct and png_info,
 deprecated in earlier versions of libpng, has been completely removed from
 libpng 1.5.
 
-We no longer include zlib.h in png.h.  Applications that need access
-to information in zlib.h will need to add the '#include "zlib.h"'
-directive.  It does not matter whether it is placed prior to or after
+We no longer include zlib.h in png.h.  The include statement has been moved
+to pngstruct.h, where it is not accessible by applications. Applications that
+need access to information in zlib.h will need to add the '#include "zlib.h"'
+directive.  It does not matter whether this is placed prior to or after
 the '"#include png.h"' directive.
 
 The png_sprintf(), png_strcpy(), and png_strncpy() macros are no longer used
@@ -4955,7 +5418,83 @@ pngusr.h a system builder may also define equivalent options in pngusr.dfa
 DFA_XTRA to the file name.  The makefiles in contrib/pngminim illustrate
 how to do this, and a case where pngusr.h is still required.
 
-.SH XI. Detecting libpng
+.SH XII.  Changes to Libpng from version 1.5.x to 1.6.x
+
+A "simplified API" has been added (see documentation in png.h and a simple
+example in contrib/examples/pngtopng.c).  The new publicly visible API
+includes the following:
+
+   macros:
+     PNG_FORMAT_*
+     PNG_IMAGE_*
+   structures:
+     png_control
+     png_image
+   read functions
+     png_image_begin_read_from_file()
+     png_image_begin_read_from_stdio()
+     png_image_begin_read_from_memory()
+     png_image_finish_read()
+     png_image_free()
+   write functions
+     png_image_write_to_file()
+     png_image_write_to_stdio()
+
+Starting with libpng-1.6.0, you can configure libpng to prefix all exported
+symbols, using the PNG_PREFIX macro.
+
+We no longer include string.h in png.h.  The include statement has been moved
+to pngpriv.h, where it is not accessible by applications.  Applications that
+need access to information in string.h must add an '#include "string.h"'
+directive.  It does not matter whether this is placed prior to or after
+the '"#include png.h"' directive.
+
+The following API are now DEPRECATED:
+   png_info_init_3()
+   png_convert_to_rfc1123() which has been replaced
+     with png_convert_to_rfc1123_buffer()
+   png_data_freer()
+   png_malloc_default()
+   png_free_default()
+   png_reset_zstream()
+
+The following has been removed:
+   png_get_io_chunk_name(), which has been replaced
+     with png_get_io_chunk_type().  The new
+     function returns a 32-bit integer instead of
+     a string.
+   The png_sizeof(), png_strlen(), png_memcpy(), png_memcmp(), and
+     png_memset() macros are no longer used in the libpng sources and
+     have been removed.  These had already been made invisible to applications
+     (i.e., defined in the private pngpriv.h header file) since libpng-1.5.0.
+
+The signatures of many exported functions were changed, such that
+   png_structp became png_structrp or png_const_structrp
+   png_infop became png_inforp or png_const_inforp
+where "rp" indicates a "restricted pointer".
+
+Error detection in some chunks has improved; in particular the iCCP chunk
+reader now does pretty complete validation of the basic format.  Some bad
+profiles that were previously accepted are now rejected, in particular the
+very old broken Microsoft/HP sRGB profile.
+
+The library now issues a warning if both background processing and RGB to
+gray are used when gamma correction happens. As with previous versions of
+the library the results are numerically very incorrect in this case.
+
+There are some minor arithmetic changes in some transforms such as
+png_set_background(), that might be detected by certain regression tests.
+
+Unknown chunk handling has been improved internally, without any API change.
+This adds more correct option control of the unknown handling, corrects
+a pre-existing bug where the per-chunk 'keep' setting is ignored, and makes
+it possible to skip IDAT chunks in the sequential reader.
+
+The machine-generated configure files are no longer included in branches
+libpng16 and later of the GIT repository.  They continue to be included
+in the tarball releases, however.
+
+.SH XIII.  Detecting libpng
 
 The png_get_io_ptr() function has been present since libpng-0.88, has never
 changed, and is unaffected by conditional compilation macros.  It is the
@@ -4964,7 +5503,7 @@ libpng version since 0.88.  In an autoconf "configure.in" you could use
 
     AC_CHECK_LIB(png, png_get_io_ptr, ...
 
-.SH XII. Source code repository
+.SH XV. Source code repository
 
 Since about February 2009, version 1.2.34, libpng has been under "git" source
 control.  The git repository was built from old libpng-x.y.z.tar.gz files
@@ -4988,7 +5527,7 @@ simple verbal discriptions of bug fixes, reported either to the
 SourceForge bug tracker, to the png-mng-implement at lists.sf.net
 mailing list, or directly to glennrp.
 
-.SH XIII. Coding style
+.SH XV. Coding style
 
 Our coding style is similar to the "Allman" style, with curly
 braces on separate lines:
@@ -5073,6 +5612,17 @@ above the comment that says
 
   /* Maintainer: Put new private prototypes here ^ */
 
+We put a space after the "sizeof" operator and we omit the
+optional parentheses around its argument when the argument
+is an expression, not a type name, and we always enclose the
+sizeof operator, with its argument, in parentheses:
+
+  (sizeof (png_uint_32))
+  (sizeof array)
+
+Prior to libpng-1.6.0 we used a "png_sizeof()" macro, formatted as
+though it were a function.
+
 To avoid polluting the global namespace, the names of all exported
 functions and variables begin with "png_", and all publicly visible C
 preprocessor macros begin with "PNG".  We request that applications that
@@ -5094,33 +5644,36 @@ when there is only one macro being tested.
 We prefer to express integers that are used as bit masks in hex format,
 with an even number of lower-case hex digits (e.g., 0x00, 0xff, 0x0100).
 
+We prefer to use underscores in variable names rather than camelCase, except
+for a few type names that we inherit from zlib.h.
+
 We do not use the TAB character for indentation in the C sources.
 
 Lines do not exceed 80 characters.
 
 Other rules can be inferred by inspecting the libpng source.
 
-.SH XIV. Y2K Compliance in libpng
+.SH XVI. Y2K Compliance in libpng
 
-January 24, 2013
+February 14, 2013
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
 
 This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.5.14 are Y2K compliant.  It is my belief that earlier
+upward through 1.6.0 are Y2K compliant.  It is my belief that earlier
 versions were also Y2K compliant.
 
-Libpng only has two year fields.  One is a 2-byte unsigned integer that
-will hold years up to 65535.  The other holds the date in text
-format, and will hold years up to 9999.
+Libpng only has two year fields.  One is a 2-byte unsigned integer
+that will hold years up to 65535.  The other, which is deprecated,
+holds the date in text format, and will hold years up to 9999.
 
 The integer is
     "png_uint_16 year" in png_time_struct.
 
 The string is
-    "char time_buffer[29]" in png_struct.  This will no
-longer be used in libpng-1.6.x and will be removed from libpng-1.7.0.
+    "char time_buffer[29]" in png_struct.  This is no longer used
+in libpng-1.6.x and will be removed from libpng-1.7.0.
 
 There are seven time-related functions:
 
@@ -5313,24 +5866,9 @@ the first widely used release:
  1.5.7beta01-05      15    10507  15.so.15.7[.0]
  1.5.7rc01-03        15    10507  15.so.15.7[.0]
  1.5.7               15    10507  15.so.15.7[.0]
- 1.5.8beta01         15    10508  15.so.15.8[.0]
- 1.5.8rc01           15    10508  15.so.15.8[.0]
- 1.5.8               15    10508  15.so.15.8[.0]
- 1.5.9beta01-02      15    10509  15.so.15.9[.0]
- 1.5.9rc01           15    10509  15.so.15.9[.0]
- 1.5.9               15    10509  15.so.15.9[.0]
- 1.5.10beta01-05     15    10510  15.so.15.10[.0]
- 1.5.10              15    10510  15.so.15.10[.0]
- 1.5.11beta01        15    10511  15.so.15.11[.0]
- 1.5.11rc01-05       15    10511  15.so.15.11[.0]
- 1.5.11              15    10511  15.so.15.11[.0]
- 1.5.12              15    10512  15.so.15.12[.0]
- 1.5.13beta01-02     15    10513  15.so.15.13[.0]
- 1.5.13rc01          15    10513  15.so.15.13[.0]
- 1.5.13              15    10513  15.so.15.13[.0]
- 1.5.14beta01-08     15    10514  15.so.15.14[.0]
- 1.5.14rc01-03       15    10514  15.so.15.14[.0]
- 1.5.14              15    10514  15.so.15.14[.0]
+ 1.6.0beta01-40      16    10600  16.so.16.0[.0]
+ 1.6.0rc01-08        16    10600  16.so.16.0[.0]
+ 1.6.0               16    10600  16.so.16.0[.0]
 
 Henceforth the source version will match the shared-library minor
 and patch numbers; the shared-library major version number will be
@@ -5387,7 +5925,7 @@ possible without all of you.
 
 Thanks to Frank J. T. Wojcik for helping with the documentation.
 
-Libpng version 1.5.14 - January 24, 2013:
+Libpng version 1.6.0 - February 14, 2013:
 Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
 Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
 
@@ -5410,7 +5948,7 @@ this sentence.
 
 This code is released under the libpng license.
 
-libpng versions 1.2.6, August 15, 2004, through 1.5.14, January 24, 2013, are
+libpng versions 1.2.6, August 15, 2004, through 1.6.0, February 14, 2013, are
 Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
 distributed according to the same disclaimer and license as libpng-1.2.5
 with the following individual added to the list of Contributing Authors
@@ -5509,7 +6047,7 @@ certification mark of the Open Source Initiative.
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-January 24, 2013
+February 14, 2013
 
 .\" end of man page
 
index 835cc0de86283b9c3f8f10b6d6a30f0ae714984e..f06520c67d94d7403c8d450a30675ffd80350476 100644 (file)
@@ -1,6 +1,6 @@
-.TH LIBPNGPF 3 "January 24, 2013"
+.TH LIBPNGPF 3 "February 14, 2013"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.5.14
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.0
 (private functions)
 .SH SYNOPSIS
 \fB#include \fI"pngpriv.h"
@@ -8,9 +8,9 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.5.14
 \fBAs of libpng version \fP\fI1.5.1\fP\fB, this section is no longer \fP\fImaintained\fP\fB, now that the private function prototypes are hidden in pngpriv.h and not accessible to applications. Look in pngpriv.h for the prototypes and a short description of each \fIfunction.
 
 .SH DESCRIPTION
-The functions previously listed here are used privately by libpng
-and are not recommended for use by applications.  They are
-not "exported" to applications using shared libraries.
+The functions previously listed here are used privately by libpng and are not
+available for use by applications.  They are not "exported" to applications
+using shared libraries.
 
 .SH SEE ALSO
 .BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
index 9a5564823de4c47d7825a85adea87328123cb6ff..ed429b4dd9b20255062952dc782df0492d17fc2c 100755 (executable)
@@ -1,10 +1,10 @@
 #! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2012-01-06.18; # UTC
+scriptversion=2012-06-26.16; # UTC
 
 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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
@@ -29,61 +29,33 @@ if test $# -eq 0; then
   exit 1
 fi
 
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, 'missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
-  configure_ac=configure.ac
-else
-  configure_ac=configure.in
-fi
+case $1 in
 
-msg="missing on your system"
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
 
-case $1 in
---run)
-  # Try to run requested program, and just exit if it succeeds.
-  run=
-  shift
-  "$@" && exit 0
-  # Exit code 63 means version mismatch.  This often happens
-  # when the user try to use an ancient version of a tool on
-  # a file that requires a minimum version.  In this case we
-  # we should proceed has if the program had been absent, or
-  # if --run hadn't been passed.
-  if test $? = 63; then
-    run=:
-    msg="probably too old"
-  fi
-  ;;
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
 
   -h|--h|--he|--hel|--help)
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
 
 Options:
   -h, --help      display this help and exit
   -v, --version   output version information and exit
-  --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file 'aclocal.m4'
-  autoconf     touch file 'configure'
-  autoheader   touch file 'config.h.in'
-  autom4te     touch the output file, or create a stub one
-  automake     touch all 'Makefile.in' files
-  bison        create 'y.tab.[ch]', if possible, from existing .[ch]
-  flex         create 'lex.yy.c', if possible, from existing .c
-  help2man     touch the output file
-  lex          create 'lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  yacc         create 'y.tab.[ch]', if possible, from existing .[ch]
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
 
 Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
 'g' are ignored when checking the name.
@@ -98,228 +70,141 @@ Send bug reports to <bug-automake@gnu.org>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown '$1' option"
+    echo 1>&2 "$0: unknown '$1' option"
     echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
 esac
 
-# normalize program name to check for.
-program=`echo "$1" | sed '
-  s/^gnu-//; t
-  s/^gnu//; t
-  s/^g//; t'`
-
-# Now exit if we have it, but it failed.  Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).  This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
-  lex*|yacc*)
-    # Not GNU programs, they don't have --version.
-    ;;
-
-  *)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       # Could not run --version or --help.  This is probably someone
-       # running '$TOOL --version' or '$TOOL --help' to check whether
-       # $TOOL exists and not knowing $TOOL uses missing.
-       exit 1
-    fi
-    ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
-  aclocal*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified 'acinclude.m4' or '${configure_ac}'.  You might want
-         to install the Automake and Perl packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified '${configure_ac}'.  You might want to install the
-         Autoconf and GNU m4 packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified 'acconfig.h' or '${configure_ac}'.  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_ac}`
-    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*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
-         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$/.in/' |
-          while read f; do touch "$f"; done
-    ;;
-
-  autom4te*)
-    echo 1>&2 "\
-WARNING: '$1' is needed, but is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.
-         You can get '$1' as part of Autoconf from any GNU
-         archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-       touch $file
-    else
-       test -z "$file" || exec >$file
-       echo "#! /bin/sh"
-       echo "# Created by GNU Automake missing as a replacement of"
-       echo "#  $ $@"
-       echo "exit 0"
-       chmod +x $file
-       exit 1
-    fi
-    ;;
-
-  bison*|yacc*)
-    echo 1>&2 "\
-WARNING: '$1' $msg.  You should only need it if
-         you modified a '.y' file.  You may need the Bison package
-         in order for those modifications to take effect.  You can get
-         Bison from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
-        eval LASTARG=\${$#}
-       case $LASTARG in
-       *.y)
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" y.tab.c
-           fi
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" y.tab.h
-           fi
-         ;;
-       esac
-    fi
-    if test ! -f y.tab.h; then
-       echo >y.tab.h
-    fi
-    if test ! -f y.tab.c; then
-       echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex*|flex*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified a '.l' file.  You may need the Flex package
-         in order for those modifications to take effect.  You can get
-         Flex from any GNU archive site."
-    rm -f lex.yy.c
-    if test $# -ne 1; then
-        eval LASTARG=\${$#}
-       case $LASTARG in
-       *.l)
-           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" lex.yy.c
-           fi
-         ;;
-       esac
-    fi
-    if test ! -f lex.yy.c; then
-       echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  help2man*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-        you modified a dependency of a manual page.  You may need the
-        Help2man package in order for those modifications to take
-        effect.  You can get Help2man from any GNU archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-       touch $file
-    else
-       test -z "$file" || exec >$file
-       echo ".ab help2man is required to generate this page"
-       exit $?
-    fi
-    ;;
-
-  makeinfo*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified a '.texi' or '.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy 'make' (AIX,
-         DU, IRIX).  You might want to install the Texinfo package or
-         the GNU make package.  Grab either from any GNU archive site."
-    # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -z "$file"; then
-      # ... or it is the one specified with @setfilename ...
-      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-       /^@setfilename/{
-         s/.* \([^ ]*\) *$/\1/
-         p
-         q
-       }' $infile`
-      # ... or it is derived from the source name (dir/f.texi becomes f.info)
-      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
-    fi
-    # If the file does not exist, the user really needs makeinfo;
-    # let's fail without touching anything.
-    test -f $file || exit 1
-    touch $file
-    ;;
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
 
-  *)
-    echo 1>&2 "\
-WARNING: '$1' is needed, and is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.  Check the 'README' file,
-         it often tells you about the needed prerequisites for installing
-         this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing '$1' program."
-    exit 1
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'automa4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
     ;;
-esac
-
-exit 0
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
index 5d0fea06a917f8f0a1bbcdcc483bd3d7fa0741a5..8832f8cae80d27a5f03a4650e2e4bc92f818b833 100644 (file)
@@ -1,4 +1,4 @@
-.TH PNG 5 "January 24, 2013"
+.TH PNG 5 "February 14, 2013"
 .SH NAME
 png \- Portable Network Graphics (PNG) format
 .SH DESCRIPTION
index 2fbcf45995bbee305f709513f11a1fc701df9807..59d747d9947ad43c4354f535ad58d5bbd06a1dfd 100644 (file)
@@ -1,7 +1,7 @@
 
 /* png.c - location for general purpose libpng functions
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
+ * Last changed in libpng 1.6.0 [February 14, 2013]
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -14,7 +14,7 @@
 #include "pngpriv.h"
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_5_14 Your_png_h_is_not_version_1_5_14;
+typedef png_libpng_version_1_6_0 Your_png_h_is_not_version_1_6_0;
 
 /* Tells libpng that we have already handled the first "num_bytes" bytes
  * of the PNG file signature.  If the PNG data is embedded into another
@@ -24,7 +24,7 @@ typedef png_libpng_version_1_5_14 Your_png_h_is_not_version_1_5_14;
 
 #ifdef PNG_READ_SUPPORTED
 void PNGAPI
-png_set_sig_bytes(png_structp png_ptr, int num_bytes)
+png_set_sig_bytes(png_structrp png_ptr, int num_bytes)
 {
    png_debug(1, "in png_set_sig_bytes");
 
@@ -62,7 +62,7 @@ png_sig_cmp(png_const_bytep sig, png_size_t start, png_size_t num_to_check)
    if (start + num_to_check > 8)
       num_to_check = 8 - start;
 
-   return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check)));
+   return ((int)(memcmp(&sig[start], &png_signature[start], num_to_check)));
 }
 
 #endif /* PNG_READ_SUPPORTED */
@@ -72,43 +72,34 @@ png_sig_cmp(png_const_bytep sig, png_size_t start, png_size_t num_to_check)
 PNG_FUNCTION(voidpf /* PRIVATE */,
 png_zalloc,(voidpf png_ptr, uInt items, uInt size),PNG_ALLOCATED)
 {
-   png_voidp ptr;
-   png_structp p;
-   png_uint_32 save_flags;
-   png_alloc_size_t num_bytes;
+   png_alloc_size_t num_bytes = size;
 
    if (png_ptr == NULL)
-      return (NULL);
-
-   p=(png_structp)png_ptr;
-   save_flags=p->flags;
+      return NULL;
 
-   if (items > PNG_UINT_32_MAX/size)
+   if (items >= (~(png_alloc_size_t)0)/size)
    {
-     png_warning (p, "Potential overflow in png_zalloc()");
-     return (NULL);
+      png_warning (png_voidcast(png_structrp, png_ptr),
+         "Potential overflow in png_zalloc()");
+      return NULL;
    }
-   num_bytes = (png_alloc_size_t)items * size;
 
-   p->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
-   ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes);
-   p->flags=save_flags;
-
-   return ((voidpf)ptr);
+   num_bytes *= items;
+   return png_malloc_warn(png_voidcast(png_structrp, png_ptr), num_bytes);
 }
 
 /* Function to free memory for zlib */
 void /* PRIVATE */
 png_zfree(voidpf png_ptr, voidpf ptr)
 {
-   png_free((png_structp)png_ptr, (png_voidp)ptr);
+   png_free(png_voidcast(png_const_structrp,png_ptr), ptr);
 }
 
 /* Reset the CRC variable to 32 bits of 1's.  Care must be taken
  * in case CRC is > 32 bits to leave the top bits 0.
  */
 void /* PRIVATE */
-png_reset_crc(png_structp png_ptr)
+png_reset_crc(png_structrp png_ptr)
 {
    /* The cast is safe because the crc is a 32 bit value. */
    png_ptr->crc = (png_uint_32)crc32(0, Z_NULL, 0);
@@ -120,7 +111,7 @@ png_reset_crc(png_structp png_ptr)
  * trouble of calculating it.
  */
 void /* PRIVATE */
-png_calculate_crc(png_structp png_ptr, png_const_bytep ptr, png_size_t length)
+png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length)
 {
    int need_crc = 1;
 
@@ -137,10 +128,10 @@ png_calculate_crc(png_structp png_ptr, png_const_bytep ptr, png_size_t length)
          need_crc = 0;
    }
 
-   /* 'uLong' is defined as unsigned long, this means that on some systems it is
-    * a 64 bit value.  crc32, however, returns 32 bits so the following cast is
-    * safe.  'uInt' may be no more than 16 bits, so it is necessary to perform a
-    * loop here.
+   /* 'uLong' is defined in zlib.h as unsigned long; this means that on some
+    * systems it is a 64 bit value.  crc32, however, returns 32 bits so the
+    * following cast is safe.  'uInt' may be no more than 16 bits, so it is
+    * necessary to perform a loop here.
     */
    if (need_crc && length > 0)
    {
@@ -148,18 +139,18 @@ png_calculate_crc(png_structp png_ptr, png_const_bytep ptr, png_size_t length)
 
       do
       {
-         uInt safeLength = (uInt)length;
-         if (safeLength == 0)
-            safeLength = (uInt)-1; /* evil, but safe */
+         uInt safe_length = (uInt)length;
+         if (safe_length == 0)
+            safe_length = (uInt)-1; /* evil, but safe */
 
-         crc = crc32(crc, ptr, safeLength);
+         crc = crc32(crc, ptr, safe_length);
 
-         /* The following should never issue compiler warnings, if they do the
+         /* The following should never issue compiler warnings; if they do the
           * target system has characteristics that will probably violate other
           * assumptions within the libpng code.
           */
-         ptr += safeLength;
-         length -= safeLength;
+         ptr += safe_length;
+         length -= safe_length;
       }
       while (length > 0);
 
@@ -169,10 +160,10 @@ png_calculate_crc(png_structp png_ptr, png_const_bytep ptr, png_size_t length)
 }
 
 /* Check a user supplied version number, called from both read and write
- * functions that create a png_struct
+ * functions that create a png_struct.
  */
 int
-png_user_version_check(png_structp png_ptr, png_const_charp user_png_ver)
+png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver)
 {
    if (user_png_ver)
    {
@@ -193,20 +184,23 @@ png_user_version_check(png_structp png_ptr, png_const_charp user_png_ver)
      /* Libpng 0.90 and later are binary incompatible with libpng 0.89, so
       * we must recompile any applications that use any older library version.
       * For versions after libpng 1.0, we will be compatible, so we need
-      * only check the first digit.
+      * only check the first and third digits (note that when we reach version
+      * 1.10 we will need to check the fourth symbol, namely user_png_ver[3]).
       */
       if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] ||
-          (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
+          (user_png_ver[0] == '1' && (user_png_ver[2] != png_libpng_ver[2] ||
+          user_png_ver[3] != png_libpng_ver[3])) ||
           (user_png_ver[0] == '0' && user_png_ver[2] < '9'))
       {
 #ifdef PNG_WARNINGS_SUPPORTED
          size_t pos = 0;
          char m[128];
 
-         pos = png_safecat(m, sizeof m, pos, "Application built with libpng-");
-         pos = png_safecat(m, sizeof m, pos, user_png_ver);
-         pos = png_safecat(m, sizeof m, pos, " but running with ");
-         pos = png_safecat(m, sizeof m, pos, png_libpng_ver);
+         pos = png_safecat(m, (sizeof m), pos,
+             "Application built with libpng-");
+         pos = png_safecat(m, (sizeof m), pos, user_png_ver);
+         pos = png_safecat(m, (sizeof m), pos, " but running with ");
+         pos = png_safecat(m, (sizeof m), pos, png_libpng_ver);
 
          png_warning(png_ptr, m);
 #endif
@@ -223,43 +217,145 @@ png_user_version_check(png_structp png_ptr, png_const_charp user_png_ver)
    return 1;
 }
 
-/* Allocate the memory for an info_struct for the application.  We don't
- * really need the png_ptr, but it could potentially be useful in the
- * future.  This should be used in favour of malloc(png_sizeof(png_info))
- * and png_info_init() so that applications that want to use a shared
- * libpng don't have to be recompiled if png_info changes size.
+/* Generic function to create a png_struct for either read or write - this
+ * contains the common initialization.
  */
+PNG_FUNCTION(png_structp /* PRIVATE */,
+png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr,
+    png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
+    png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED)
+{
+   png_struct create_struct;
+#  ifdef PNG_SETJMP_SUPPORTED
+      jmp_buf create_jmp_buf;
+#  endif
+
+   /* This temporary stack-allocated structure is used to provide a place to
+    * build enough context to allow the user provided memory allocator (if any)
+    * to be called.
+    */
+   memset(&create_struct, 0, (sizeof create_struct));
+
+   /* Added at libpng-1.2.6 */
+#  ifdef PNG_USER_LIMITS_SUPPORTED
+      create_struct.user_width_max = PNG_USER_WIDTH_MAX;
+      create_struct.user_height_max = PNG_USER_HEIGHT_MAX;
+
+#     ifdef PNG_USER_CHUNK_CACHE_MAX
+         /* Added at libpng-1.2.43 and 1.4.0 */
+         create_struct.user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX;
+#     endif
+
+#     ifdef PNG_USER_CHUNK_MALLOC_MAX
+         /* Added at libpng-1.2.43 and 1.4.1, required only for read but exists
+          * in png_struct regardless.
+          */
+         create_struct.user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX;
+#     endif
+#  endif
+
+   /* The following two API calls simply set fields in png_struct, so it is safe
+    * to do them now even though error handling is not yet set up.
+    */
+#  ifdef PNG_USER_MEM_SUPPORTED
+      png_set_mem_fn(&create_struct, mem_ptr, malloc_fn, free_fn);
+#  endif
+
+   /* (*error_fn) can return control to the caller after the error_ptr is set,
+    * this will result in a memory leak unless the error_fn does something
+    * extremely sophisticated.  The design lacks merit but is implicit in the
+    * API.
+    */
+   png_set_error_fn(&create_struct, error_ptr, error_fn, warn_fn);
+
+#  ifdef PNG_SETJMP_SUPPORTED
+      if (!setjmp(create_jmp_buf))
+      {
+         /* Temporarily fake out the longjmp information until we have
+          * successfully completed this function.  This only works if we have
+          * setjmp() support compiled in, but it is safe - this stuff should
+          * never happen.
+          */
+         create_struct.jmp_buf_ptr = &create_jmp_buf;
+         create_struct.jmp_buf_size = 0; /*stack allocation*/
+         create_struct.longjmp_fn = longjmp;
+#  else
+      {
+#  endif
+         /* Call the general version checker (shared with read and write code):
+          */
+         if (png_user_version_check(&create_struct, user_png_ver))
+         {
+            png_structrp png_ptr = png_voidcast(png_structrp,
+               png_malloc_warn(&create_struct, (sizeof *png_ptr)));
+
+            if (png_ptr != NULL)
+            {
+               /* png_ptr->zstream holds a back-pointer to the png_struct, so
+                * this can only be done now:
+                */
+               create_struct.zstream.zalloc = png_zalloc;
+               create_struct.zstream.zfree = png_zfree;
+               create_struct.zstream.opaque = png_ptr;
+
+#              ifdef PNG_SETJMP_SUPPORTED
+                  /* Eliminate the local error handling: */
+                  create_struct.jmp_buf_ptr = NULL;
+                  create_struct.jmp_buf_size = 0;
+                  create_struct.longjmp_fn = 0;
+#              endif
+
+               *png_ptr = create_struct;
+
+               /* This is the successful return point */
+               return png_ptr;
+            }
+         }
+      }
+
+   /* A longjmp because of a bug in the application storage allocator or a
+    * simple failure to allocate the png_struct.
+    */
+   return NULL;
+}
+
+/* Allocate the memory for an info_struct for the application. */
 PNG_FUNCTION(png_infop,PNGAPI
-png_create_info_struct,(png_structp png_ptr),PNG_ALLOCATED)
+png_create_info_struct,(png_const_structrp png_ptr),PNG_ALLOCATED)
 {
-   png_infop info_ptr;
+   png_inforp info_ptr;
 
    png_debug(1, "in png_create_info_struct");
 
    if (png_ptr == NULL)
-      return (NULL);
+      return NULL;
+
+   /* Use the internal API that does not (or at least should not) error out, so
+    * that this call always returns ok.  The application typically sets up the
+    * error handling *after* creating the info_struct because this is the way it
+    * has always been done in 'example.c'.
+    */
+   info_ptr = png_voidcast(png_inforp, png_malloc_base(png_ptr,
+      (sizeof *info_ptr)));
 
-#ifdef PNG_USER_MEM_SUPPORTED
-   info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO,
-      png_ptr->malloc_fn, png_ptr->mem_ptr);
-#else
-   info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
-#endif
    if (info_ptr != NULL)
-      png_info_init_3(&info_ptr, png_sizeof(png_info));
+      memset(info_ptr, 0, (sizeof *info_ptr));
 
-   return (info_ptr);
+   return info_ptr;
 }
 
 /* This function frees the memory associated with a single info struct.
  * Normally, one would use either png_destroy_read_struct() or
  * png_destroy_write_struct() to free an info struct, but this may be
- * useful for some applications.
+ * useful for some applications.  From libpng 1.6.0 this function is also used
+ * internally to implement the png_info release part of the 'struct' destroy
+ * APIs.  This ensures that all possible approaches free the same data (all of
+ * it).
  */
 void PNGAPI
-png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
+png_destroy_info_struct(png_const_structrp png_ptr, png_infopp info_ptr_ptr)
 {
-   png_infop info_ptr = NULL;
+   png_inforp info_ptr = NULL;
 
    png_debug(1, "in png_destroy_info_struct");
 
@@ -271,46 +367,57 @@ png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
 
    if (info_ptr != NULL)
    {
-      png_info_destroy(png_ptr, info_ptr);
-
-#ifdef PNG_USER_MEM_SUPPORTED
-      png_destroy_struct_2((png_voidp)info_ptr, png_ptr->free_fn,
-          png_ptr->mem_ptr);
-#else
-      png_destroy_struct((png_voidp)info_ptr);
-#endif
+      /* Do this first in case of an error below; if the app implements its own
+       * memory management this can lead to png_free calling png_error, which
+       * will abort this routine and return control to the app error handler.
+       * An infinite loop may result if it then tries to free the same info
+       * ptr.
+       */
       *info_ptr_ptr = NULL;
+
+      png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
+      memset(info_ptr, 0, (sizeof *info_ptr));
+      png_free(png_ptr, info_ptr);
    }
 }
 
 /* Initialize the info structure.  This is now an internal function (0.89)
  * and applications using it are urged to use png_create_info_struct()
- * instead.
+ * instead.  Use deprecated in 1.6.0, internal use removed (used internally it
+ * is just a memset).
+ *
+ * NOTE: it is almost inconceivable that this API is used because it bypasses
+ * the user-memory mechanism and the user error handling/warning mechanisms in
+ * those cases where it does anything other than a memset.
  */
-
-void PNGAPI
-png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
+PNG_FUNCTION(void,PNGAPI
+png_info_init_3,(png_infopp ptr_ptr, png_size_t png_info_struct_size),
+   PNG_DEPRECATED)
 {
-   png_infop info_ptr = *ptr_ptr;
+   png_inforp info_ptr = *ptr_ptr;
 
    png_debug(1, "in png_info_init_3");
 
    if (info_ptr == NULL)
       return;
 
-   if (png_sizeof(png_info) > png_info_struct_size)
+   if ((sizeof (png_info)) > png_info_struct_size)
    {
-      png_destroy_struct(info_ptr);
-      info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
+      *ptr_ptr = NULL;
+      /* The following line is why this API should not be used: */
+      free(info_ptr);
+      info_ptr = png_voidcast(png_inforp, png_malloc_base(NULL,
+         (sizeof *info_ptr)));
       *ptr_ptr = info_ptr;
    }
 
    /* Set everything to 0 */
-   png_memset(info_ptr, 0, png_sizeof(png_info));
+   memset(info_ptr, 0, (sizeof *info_ptr));
 }
 
+/* The following API is not called internally */
 void PNGAPI
-png_data_freer(png_structp png_ptr, png_infop info_ptr,
+png_data_freer(png_const_structrp png_ptr, png_inforp info_ptr,
    int freer, png_uint_32 mask)
 {
    png_debug(1, "in png_data_freer");
@@ -325,12 +432,11 @@ png_data_freer(png_structp png_ptr, png_infop info_ptr,
       info_ptr->free_me &= ~mask;
 
    else
-      png_warning(png_ptr,
-         "Unknown freer parameter in png_data_freer");
+      png_error(png_ptr, "Unknown freer parameter in png_data_freer");
 }
 
 void PNGAPI
-png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
+png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
    int num)
 {
    png_debug(1, "in png_free_data");
@@ -395,8 +501,8 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
       info_ptr->pcal_units = NULL;
       if (info_ptr->pcal_params != NULL)
          {
-            int i;
-            for (i = 0; i < (int)info_ptr->pcal_nparams; i++)
+            unsigned int i;
+            for (i = 0; i < info_ptr->pcal_nparams; i++)
             {
                png_free(png_ptr, info_ptr->pcal_params[i]);
                info_ptr->pcal_params[i] = NULL;
@@ -409,7 +515,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
 #endif
 
 #ifdef PNG_iCCP_SUPPORTED
-   /* Free any iCCP entry */
+   /* Free any profile entry */
    if ((mask & PNG_FREE_ICCP) & info_ptr->free_me)
    {
       png_free(png_ptr, info_ptr->iccp_name);
@@ -440,8 +546,8 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
          if (info_ptr->splt_palettes_num)
          {
             int i;
-            for (i = 0; i < (int)info_ptr->splt_palettes_num; i++)
-               png_free_data(png_ptr, info_ptr, PNG_FREE_SPLT, i);
+            for (i = 0; i < info_ptr->splt_palettes_num; i++)
+               png_free_data(png_ptr, info_ptr, PNG_FREE_SPLT, (int)i);
 
             png_free(png_ptr, info_ptr->splt_palettes);
             info_ptr->splt_palettes = NULL;
@@ -452,13 +558,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
    }
 #endif
 
-#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
-   if (png_ptr->unknown_chunk.data)
-   {
-      png_free(png_ptr, png_ptr->unknown_chunk.data);
-      png_ptr->unknown_chunk.data = NULL;
-   }
-
+#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
    if ((mask & PNG_FREE_UNKN) & info_ptr->free_me)
    {
       if (num != -1)
@@ -477,7 +577,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
          if (info_ptr->unknown_chunks_num)
          {
             for (i = 0; i < info_ptr->unknown_chunks_num; i++)
-               png_free_data(png_ptr, info_ptr, PNG_FREE_UNKN, i);
+               png_free_data(png_ptr, info_ptr, PNG_FREE_UNKN, (int)i);
 
             png_free(png_ptr, info_ptr->unknown_chunks);
             info_ptr->unknown_chunks = NULL;
@@ -500,7 +600,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
    /* Free any PLTE entry that was internally allocated */
    if ((mask & PNG_FREE_PLTE) & info_ptr->free_me)
    {
-      png_zfree(png_ptr, info_ptr->palette);
+      png_free(png_ptr, info_ptr->palette);
       info_ptr->palette = NULL;
       info_ptr->valid &= ~PNG_INFO_PLTE;
       info_ptr->num_palette = 0;
@@ -512,8 +612,8 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
    {
       if (info_ptr->row_pointers)
       {
-         int row;
-         for (row = 0; row < (int)info_ptr->height; row++)
+         png_uint_32 row;
+         for (row = 0; row < info_ptr->height; row++)
          {
             png_free(png_ptr, info_ptr->row_pointers[row]);
             info_ptr->row_pointers[row] = NULL;
@@ -530,29 +630,6 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
 
    info_ptr->free_me &= ~mask;
 }
-
-/* This is an internal routine to free any memory that the info struct is
- * pointing to before re-using it or freeing the struct itself.  Recall
- * that png_free() checks for NULL pointers for us.
- */
-void /* PRIVATE */
-png_info_destroy(png_structp png_ptr, png_infop info_ptr)
-{
-   png_debug(1, "in png_info_destroy");
-
-   png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
-
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-   if (png_ptr->num_chunk_list)
-   {
-      png_free(png_ptr, png_ptr->chunk_list);
-      png_ptr->chunk_list = NULL;
-      png_ptr->num_chunk_list = 0;
-   }
-#endif
-
-   png_info_init_3(&info_ptr, png_sizeof(png_info));
-}
 #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
 
 /* This function returns a pointer to the io_ptr associated with the user
@@ -560,7 +637,7 @@ png_info_destroy(png_structp png_ptr, png_infop info_ptr)
  * pointer before png_write_destroy() or png_read_destroy() are called.
  */
 png_voidp PNGAPI
-png_get_io_ptr(png_structp png_ptr)
+png_get_io_ptr(png_const_structrp png_ptr)
 {
    if (png_ptr == NULL)
       return (NULL);
@@ -577,7 +654,7 @@ png_get_io_ptr(png_structp png_ptr)
  * function of your own because "FILE *" isn't necessarily available.
  */
 void PNGAPI
-png_init_io(png_structp png_ptr, png_FILE_p fp)
+png_init_io(png_structrp png_ptr, png_FILE_p fp)
 {
    png_debug(1, "in png_init_io");
 
@@ -588,42 +665,52 @@ png_init_io(png_structp png_ptr, png_FILE_p fp)
 }
 #  endif
 
+#ifdef PNG_SAVE_INT_32_SUPPORTED
+/* The png_save_int_32 function assumes integers are stored in two's
+ * complement format.  If this isn't the case, then this routine needs to
+ * be modified to write data in two's complement format.  Note that,
+ * the following works correctly even if png_int_32 has more than 32 bits
+ * (compare the more complex code required on read for sign extension.)
+ */
+void PNGAPI
+png_save_int_32(png_bytep buf, png_int_32 i)
+{
+   buf[0] = (png_byte)((i >> 24) & 0xff);
+   buf[1] = (png_byte)((i >> 16) & 0xff);
+   buf[2] = (png_byte)((i >> 8) & 0xff);
+   buf[3] = (png_byte)(i & 0xff);
+}
+#endif
+
 #  ifdef PNG_TIME_RFC1123_SUPPORTED
 /* Convert the supplied time into an RFC 1123 string suitable for use in
  * a "Creation Time" or other text-based time string.
  */
-png_const_charp PNGAPI
-png_convert_to_rfc1123(png_structp png_ptr, png_const_timep ptime)
+int PNGAPI
+png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime)
 {
    static PNG_CONST char short_months[12][4] =
         {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
          "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
 
-   if (png_ptr == NULL)
-      return (NULL);
+   if (out == NULL)
+      return 0;
 
    if (ptime->year > 9999 /* RFC1123 limitation */ ||
        ptime->month == 0    ||  ptime->month > 12  ||
        ptime->day   == 0    ||  ptime->day   > 31  ||
        ptime->hour  > 23    ||  ptime->minute > 59 ||
        ptime->second > 60)
-   {
-      png_warning(png_ptr, "Ignoring invalid time value");
-      return (NULL);
-   }
+      return 0;
 
    {
       size_t pos = 0;
       char number_buf[5]; /* enough for a four-digit year */
 
-#     define APPEND_STRING(string)\
-         pos = png_safecat(png_ptr->time_buffer, sizeof png_ptr->time_buffer,\
-            pos, (string))
+#     define APPEND_STRING(string) pos = png_safecat(out, 29, pos, (string))
 #     define APPEND_NUMBER(format, value)\
          APPEND_STRING(PNG_FORMAT_NUMBER(number_buf, format, (value)))
-#     define APPEND(ch)\
-         if (pos < (sizeof png_ptr->time_buffer)-1)\
-            png_ptr->time_buffer[pos++] = (ch)
+#     define APPEND(ch) if (pos < 28) out[pos++] = (ch)
 
       APPEND_NUMBER(PNG_NUMBER_FORMAT_u, (unsigned)ptime->day);
       APPEND(' ');
@@ -643,14 +730,37 @@ png_convert_to_rfc1123(png_structp png_ptr, png_const_timep ptime)
 #     undef APPEND_STRING
    }
 
-   return png_ptr->time_buffer;
+   return 1;
+}
+
+#     if PNG_LIBPNG_VER < 10700
+/* To do: remove the following from libpng-1.7 */
+/* Original API that uses a private buffer in png_struct.
+ * Deprecated because it causes png_struct to carry a spurious temporary
+ * buffer (png_struct::time_buffer), better to have the caller pass this in.
+ */
+png_const_charp PNGAPI
+png_convert_to_rfc1123(png_structrp png_ptr, png_const_timep ptime)
+{
+   if (png_ptr != NULL)
+   {
+      /* The only failure above if png_ptr != NULL is from an invalid ptime */
+      if (!png_convert_to_rfc1123_buffer(png_ptr->time_buffer, ptime))
+         png_warning(png_ptr, "Ignoring invalid time value");
+
+      else
+         return png_ptr->time_buffer;
+   }
+
+   return NULL;
 }
+#     endif
 #  endif /* PNG_TIME_RFC1123_SUPPORTED */
 
 #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
 
 png_const_charp PNGAPI
-png_get_copyright(png_const_structp png_ptr)
+png_get_copyright(png_const_structrp png_ptr)
 {
    PNG_UNUSED(png_ptr)  /* Silence compiler warning about unused png_ptr */
 #ifdef PNG_STRING_COPYRIGHT
@@ -658,13 +768,13 @@ png_get_copyright(png_const_structp png_ptr)
 #else
 #  ifdef __STDC__
    return PNG_STRING_NEWLINE \
-     "libpng version 1.5.14 - January 24, 2013" PNG_STRING_NEWLINE \
+     "libpng version 1.6.0 - February 14, 2013" PNG_STRING_NEWLINE \
      "Copyright (c) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
      "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
      "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
      PNG_STRING_NEWLINE;
 #  else
-      return "libpng version 1.5.14 - January 24, 2013\
+      return "libpng version 1.6.0 - February 14, 2013\
       Copyright (c) 1998-2013 Glenn Randers-Pehrson\
       Copyright (c) 1996-1997 Andreas Dilger\
       Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -681,14 +791,14 @@ png_get_copyright(png_const_structp png_ptr)
  * it is guaranteed that png.c uses the correct version of png.h.
  */
 png_const_charp PNGAPI
-png_get_libpng_ver(png_const_structp png_ptr)
+png_get_libpng_ver(png_const_structrp png_ptr)
 {
    /* Version of *.c files used when building libpng */
    return png_get_header_ver(png_ptr);
 }
 
 png_const_charp PNGAPI
-png_get_header_ver(png_const_structp png_ptr)
+png_get_header_ver(png_const_structrp png_ptr)
 {
    /* Version of *.h files used when building libpng */
    PNG_UNUSED(png_ptr)  /* Silence compiler warning about unused png_ptr */
@@ -696,7 +806,7 @@ png_get_header_ver(png_const_structp png_ptr)
 }
 
 png_const_charp PNGAPI
-png_get_header_version(png_const_structp png_ptr)
+png_get_header_version(png_const_structrp png_ptr)
 {
    /* Returns longer string containing both version and date */
    PNG_UNUSED(png_ptr)  /* Silence compiler warning about unused png_ptr */
@@ -711,52 +821,61 @@ png_get_header_version(png_const_structp png_ptr)
 #endif
 }
 
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
 int PNGAPI
-png_handle_as_unknown(png_structp png_ptr, png_const_bytep chunk_name)
+png_handle_as_unknown(png_const_structrp png_ptr, png_const_bytep chunk_name)
 {
    /* Check chunk_name and return "keep" value if it's on the list, else 0 */
    png_const_bytep p, p_end;
 
-   if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list <= 0)
+   if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list == 0)
       return PNG_HANDLE_CHUNK_AS_DEFAULT;
 
    p_end = png_ptr->chunk_list;
    p = p_end + png_ptr->num_chunk_list*5; /* beyond end */
 
    /* The code is the fifth byte after each four byte string.  Historically this
-    * code was always searched from the end of the list, so it should continue
-    * to do so in case there are duplicated entries.
+    * code was always searched from the end of the list, this is no longer
+    * necessary because the 'set' routine handles duplicate entries correcty.
     */
    do /* num_chunk_list > 0, so at least one */
    {
       p -= 5;
-      if (!png_memcmp(chunk_name, p, 4))
+
+      if (!memcmp(chunk_name, p, 4))
          return p[4];
    }
    while (p > p_end);
 
+   /* This means that known chunks should be processed and unknown chunks should
+    * be handled according to the value of png_ptr->unknown_default; this can be
+    * confusing because, as a result, there are two levels of defaulting for
+    * unknown chunks.
+    */
    return PNG_HANDLE_CHUNK_AS_DEFAULT;
 }
 
+#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
 int /* PRIVATE */
-png_chunk_unknown_handling(png_structp png_ptr, png_uint_32 chunk_name)
+png_chunk_unknown_handling(png_const_structrp png_ptr, png_uint_32 chunk_name)
 {
    png_byte chunk_string[5];
 
    PNG_CSTRING_FROM_CHUNK(chunk_string, chunk_name);
    return png_handle_as_unknown(png_ptr, chunk_string);
 }
-#endif
+#endif /* READ_UNKNOWN_CHUNKS */
+#endif /* SET_UNKNOWN_CHUNKS */
 
 #ifdef PNG_READ_SUPPORTED
 /* This function, added to libpng-1.0.6g, is untested. */
 int PNGAPI
-png_reset_zstream(png_structp png_ptr)
+png_reset_zstream(png_structrp png_ptr)
 {
    if (png_ptr == NULL)
       return Z_STREAM_ERROR;
 
+   /* WARNING: this resets the window bits to the maximum! */
    return (inflateReset(&png_ptr->zstream));
 }
 #endif /* PNG_READ_SUPPORTED */
@@ -772,114 +891,271 @@ png_access_version_number(void)
 
 
 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
+/* Ensure that png_ptr->zstream.msg holds some appropriate error message string.
+ * If it doesn't 'ret' is used to set it to something appropriate, even in cases
+ * like Z_OK or Z_STREAM_END where the error code is apparently a success code.
+ */
+void /* PRIVATE */
+png_zstream_error(png_structrp png_ptr, int ret)
+{
+   /* Translate 'ret' into an appropriate error string, priority is given to the
+    * one in zstream if set.  This always returns a string, even in cases like
+    * Z_OK or Z_STREAM_END where the error code is a success code.
+    */
+   if (png_ptr->zstream.msg == NULL) switch (ret)
+   {
+      default:
+      case Z_OK:
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("unexpected zlib return code");
+         break;
+
+      case Z_STREAM_END:
+         /* Normal exit */
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("unexpected end of LZ stream");
+         break;
+
+      case Z_NEED_DICT:
+         /* This means the deflate stream did not have a dictionary; this
+          * indicates a bogus PNG.
+          */
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("missing LZ dictionary");
+         break;
+
+      case Z_ERRNO:
+         /* gz APIs only: should not happen */
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("zlib IO error");
+         break;
+
+      case Z_STREAM_ERROR:
+         /* internal libpng error */
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("bad parameters to zlib");
+         break;
+
+      case Z_DATA_ERROR:
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("damaged LZ stream");
+         break;
+
+      case Z_MEM_ERROR:
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("insufficient memory");
+         break;
+
+      case Z_BUF_ERROR:
+         /* End of input or output; not a problem if the caller is doing
+          * incremental read or write.
+          */
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("truncated");
+         break;
+
+      case Z_VERSION_ERROR:
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("unsupported zlib version");
+         break;
+
+      case PNG_UNEXPECTED_ZLIB_RETURN:
+         /* Compile errors here mean that zlib now uses the value co-opted in
+          * pngpriv.h for PNG_UNEXPECTED_ZLIB_RETURN; update the switch above
+          * and change pngpriv.h.  Note that this message is "... return",
+          * whereas the default/Z_OK one is "... return code".
+          */
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("unexpected zlib return");
+         break;
+   }
+}
+
 /* png_convert_size: a PNGAPI but no longer in png.h, so deleted
  * at libpng 1.5.5!
  */
 
 /* Added at libpng version 1.2.34 and 1.4.0 (moved from pngset.c) */
-#  ifdef PNG_CHECK_cHRM_SUPPORTED
-
-int /* PRIVATE */
-png_check_cHRM_fixed(png_structp png_ptr,
-   png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x,
-   png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y,
-   png_fixed_point blue_x, png_fixed_point blue_y)
+#ifdef PNG_GAMMA_SUPPORTED /* always set if COLORSPACE */
+static int
+png_colorspace_check_gamma(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, png_fixed_point gAMA, int from)
+   /* This is called to check a new gamma value against an existing one.  The
+    * routine returns false if the new gamma value should not be written.
+    *
+    * 'from' says where the new gamma value comes from:
+    *
+    *    0: the new gamma value is the libpng estimate for an ICC profile
+    *    1: the new gamma value comes from a gAMA chunk
+    *    2: the new gamma value comes from an sRGB chunk
+    */
 {
-   int ret = 1;
-   unsigned long xy_hi,xy_lo,yx_hi,yx_lo;
+   png_fixed_point gtest;
 
-   png_debug(1, "in function png_check_cHRM_fixed");
+   if ((colorspace->flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 &&
+      (!png_muldiv(&gtest, colorspace->gamma, PNG_FP_1, gAMA) ||
+      png_gamma_significant(gtest)))
+   {
+      /* Either this is an sRGB image, in which case the calculated gamma
+       * approximation should match, or this is an image with a profile and the
+       * value libpng calculates for the gamma of the profile does not match the
+       * value recorded in the file.  The former, sRGB, case is an error, the
+       * latter is just a warning.
+       */
+      if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0 || from == 2)
+      {
+         png_chunk_report(png_ptr, "gamma value does not match sRGB",
+            PNG_CHUNK_ERROR);
+         /* Do not overwrite an sRGB value */
+         return from == 2;
+      }
 
-   if (png_ptr == NULL)
-      return 0;
+      else /* sRGB tag not involved */
+      {
+         png_chunk_report(png_ptr, "gamma value does not match libpng estimate",
+            PNG_CHUNK_WARNING);
+         return from == 1;
+      }
+   }
+
+   return 1;
+}
 
-   /* (x,y,z) values are first limited to 0..100000 (PNG_FP_1), the white
-    * y must also be greater than 0.  To test for the upper limit calculate
-    * (PNG_FP_1-y) - x must be <= to this for z to be >= 0 (and the expression
-    * cannot overflow.)  At this point we know x and y are >= 0 and (x+y) is
-    * <= PNG_FP_1.  The previous test on PNG_MAX_UINT_31 is removed because it
-    * pointless (and it produces compiler warnings!)
+void /* PRIVATE */
+png_colorspace_set_gamma(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, png_fixed_point gAMA)
+{
+   /* Changed in libpng-1.5.4 to limit the values to ensure overflow can't
+    * occur.  Since the fixed point representation is assymetrical it is
+    * possible for 1/gamma to overflow the limit of 21474 and this means the
+    * gamma value must be at least 5/100000 and hence at most 20000.0.  For
+    * safety the limits here are a little narrower.  The values are 0.00016 to
+    * 6250.0, which are truly ridiculous gamma values (and will produce
+    * displays that are all black or all white.)
+    *
+    * In 1.6.0 this test replaces the ones in pngrutil.c, in the gAMA chunk
+    * handling code, which only required the value to be >0.
     */
-   if (white_x < 0 || white_y <= 0 ||
-         red_x < 0 ||   red_y <  0 ||
-       green_x < 0 || green_y <  0 ||
-        blue_x < 0 ||  blue_y <  0)
-   {
-      png_warning(png_ptr,
-        "Ignoring attempt to set negative chromaticity value");
-      ret = 0;
-   }
-   /* And (x+y) must be <= PNG_FP_1 (so z is >= 0) */
-   if (white_x > PNG_FP_1 - white_y)
-   {
-      png_warning(png_ptr, "Invalid cHRM white point");
-      ret = 0;
-   }
+   png_const_charp errmsg;
+
+   if (gAMA < 16 || gAMA > 625000000)
+      errmsg = "gamma value out of range";
+
+#  ifdef PNG_READ_gAMA_SUPPORTED
+      /* Allow the application to set the gamma value more than once */
+      else if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
+         (colorspace->flags & PNG_COLORSPACE_FROM_gAMA) != 0)
+         errmsg = "duplicate";
+#  endif
+
+   /* Do nothing if the colorspace is already invalid */
+   else if (colorspace->flags & PNG_COLORSPACE_INVALID)
+      return;
 
-   if (red_x > PNG_FP_1 - red_y)
+   else
    {
-      png_warning(png_ptr, "Invalid cHRM red point");
-      ret = 0;
+      if (png_colorspace_check_gamma(png_ptr, colorspace, gAMA, 1/*from gAMA*/))
+      {
+         /* Store this gamma value. */
+         colorspace->gamma = gAMA;
+         colorspace->flags |=
+            (PNG_COLORSPACE_HAVE_GAMMA | PNG_COLORSPACE_FROM_gAMA);
+      }
+
+      /* At present if the check_gamma test fails the gamma of the colorspace is
+       * not updated however the colorspace is not invalidated.  This
+       * corresponds to the case where the existing gamma comes from an sRGB
+       * chunk or profile.  An error message has already been output.
+       */
+      return;
    }
 
-   if (green_x > PNG_FP_1 - green_y)
+   /* Error exit - errmsg has been set. */
+   colorspace->flags |= PNG_COLORSPACE_INVALID;
+   png_chunk_report(png_ptr, errmsg, PNG_CHUNK_WRITE_ERROR);
+}
+
+void /* PRIVATE */
+png_colorspace_sync_info(png_const_structrp png_ptr, png_inforp info_ptr)
+{
+   if (info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID)
    {
-      png_warning(png_ptr, "Invalid cHRM green point");
-      ret = 0;
+      /* Everything is invalid */
+      info_ptr->valid &= ~(PNG_INFO_gAMA|PNG_INFO_cHRM|PNG_INFO_sRGB|
+         PNG_INFO_iCCP);
+
+#     ifdef PNG_COLORSPACE_SUPPORTED
+         /* Clean up the iCCP profile now if it won't be used. */
+         png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, -1/*not used*/);
+#     else
+         PNG_UNUSED(png_ptr)
+#     endif
    }
 
-   if (blue_x > PNG_FP_1 - blue_y)
+   else
    {
-      png_warning(png_ptr, "Invalid cHRM blue point");
-      ret = 0;
-   }
+#     ifdef PNG_COLORSPACE_SUPPORTED
+         /* Leave the INFO_iCCP flag set if the pngset.c code has already set
+          * it; this allows a PNG to contain a profile which matches sRGB and
+          * yet still have that profile retrievable by the application.
+          */
+         if (info_ptr->colorspace.flags & PNG_COLORSPACE_MATCHES_sRGB)
+            info_ptr->valid |= PNG_INFO_sRGB;
 
-   png_64bit_product(green_x - red_x, blue_y - red_y, &xy_hi, &xy_lo);
-   png_64bit_product(green_y - red_y, blue_x - red_x, &yx_hi, &yx_lo);
+         else
+            info_ptr->valid &= ~PNG_INFO_sRGB;
 
-   if (xy_hi == yx_hi && xy_lo == yx_lo)
-   {
-      png_warning(png_ptr,
-         "Ignoring attempt to set cHRM RGB triangle with zero area");
-      ret = 0;
+         if (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS)
+            info_ptr->valid |= PNG_INFO_cHRM;
+
+         else
+            info_ptr->valid &= ~PNG_INFO_cHRM;
+#     endif
+
+      if (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA)
+         info_ptr->valid |= PNG_INFO_gAMA;
+
+      else
+         info_ptr->valid &= ~PNG_INFO_gAMA;
    }
+}
+
+#ifdef PNG_READ_SUPPORTED
+void /* PRIVATE */
+png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr)
+{
+   if (info_ptr == NULL) /* reduce code size; check here not in the caller */
+      return;
 
-   return ret;
+   info_ptr->colorspace = png_ptr->colorspace;
+   png_colorspace_sync_info(png_ptr, info_ptr);
 }
-#  endif /* PNG_CHECK_cHRM_SUPPORTED */
+#endif
+#endif
 
-#ifdef PNG_cHRM_SUPPORTED
+#ifdef PNG_COLORSPACE_SUPPORTED
 /* Added at libpng-1.5.5 to support read and write of true CIEXYZ values for
  * cHRM, as opposed to using chromaticities.  These internal APIs return
  * non-zero on a parameter error.  The X, Y and Z values are required to be
  * positive and less than 1.0.
  */
-int png_xy_from_XYZ(png_xy *xy, png_XYZ XYZ)
+static int
+png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
 {
    png_int_32 d, dwhite, whiteX, whiteY;
 
-   d = XYZ.redX + XYZ.redY + XYZ.redZ;
-   if (!png_muldiv(&xy->redx, XYZ.redX, PNG_FP_1, d)) return 1;
-   if (!png_muldiv(&xy->redy, XYZ.redY, PNG_FP_1, d)) return 1;
+   d = XYZ->red_X + XYZ->red_Y + XYZ->red_Z;
+   if (!png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d)) return 1;
+   if (!png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d)) return 1;
    dwhite = d;
-   whiteX = XYZ.redX;
-   whiteY = XYZ.redY;
+   whiteX = XYZ->red_X;
+   whiteY = XYZ->red_Y;
 
-   d = XYZ.greenX + XYZ.greenY + XYZ.greenZ;
-   if (!png_muldiv(&xy->greenx, XYZ.greenX, PNG_FP_1, d)) return 1;
-   if (!png_muldiv(&xy->greeny, XYZ.greenY, PNG_FP_1, d)) return 1;
+   d = XYZ->green_X + XYZ->green_Y + XYZ->green_Z;
+   if (!png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, d)) return 1;
+   if (!png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d)) return 1;
    dwhite += d;
-   whiteX += XYZ.greenX;
-   whiteY += XYZ.greenY;
+   whiteX += XYZ->green_X;
+   whiteY += XYZ->green_Y;
 
-   d = XYZ.blueX + XYZ.blueY + XYZ.blueZ;
-   if (!png_muldiv(&xy->bluex, XYZ.blueX, PNG_FP_1, d)) return 1;
-   if (!png_muldiv(&xy->bluey, XYZ.blueY, PNG_FP_1, d)) return 1;
+   d = XYZ->blue_X + XYZ->blue_Y + XYZ->blue_Z;
+   if (!png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, d)) return 1;
+   if (!png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d)) return 1;
    dwhite += d;
-   whiteX += XYZ.blueX;
-   whiteY += XYZ.blueY;
+   whiteX += XYZ->blue_X;
+   whiteY += XYZ->blue_Y;
 
-   /* The reference white is simply the same of the end-point (X,Y,Z) vectors,
+   /* The reference white is simply the sum of the end-point (X,Y,Z) vectors,
     * thus:
     */
    if (!png_muldiv(&xy->whitex, whiteX, PNG_FP_1, dwhite)) return 1;
@@ -888,7 +1164,8 @@ int png_xy_from_XYZ(png_xy *xy, png_XYZ XYZ)
    return 0;
 }
 
-int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy)
+static int
+png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
 {
    png_fixed_point red_inverse, green_inverse, blue_scale;
    png_fixed_point left, right, denominator;
@@ -897,14 +1174,14 @@ int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy)
     * have end points with 0 tristimulus values (these are impossible end
     * points, but they are used to cover the possible colors.)
     */
-   if (xy.redx < 0 || xy.redx > PNG_FP_1) return 1;
-   if (xy.redy < 0 || xy.redy > PNG_FP_1-xy.redx) return 1;
-   if (xy.greenx < 0 || xy.greenx > PNG_FP_1) return 1;
-   if (xy.greeny < 0 || xy.greeny > PNG_FP_1-xy.greenx) return 1;
-   if (xy.bluex < 0 || xy.bluex > PNG_FP_1) return 1;
-   if (xy.bluey < 0 || xy.bluey > PNG_FP_1-xy.bluex) return 1;
-   if (xy.whitex < 0 || xy.whitex > PNG_FP_1) return 1;
-   if (xy.whitey < 0 || xy.whitey > PNG_FP_1-xy.whitex) return 1;
+   if (xy->redx < 0 || xy->redx > PNG_FP_1) return 1;
+   if (xy->redy < 0 || xy->redy > PNG_FP_1-xy->redx) return 1;
+   if (xy->greenx < 0 || xy->greenx > PNG_FP_1) return 1;
+   if (xy->greeny < 0 || xy->greeny > PNG_FP_1-xy->greenx) return 1;
+   if (xy->bluex < 0 || xy->bluex > PNG_FP_1) return 1;
+   if (xy->bluey < 0 || xy->bluey > PNG_FP_1-xy->bluex) return 1;
+   if (xy->whitex < 0 || xy->whitex > PNG_FP_1) return 1;
+   if (xy->whitey < 0 || xy->whitey > PNG_FP_1-xy->whitex) return 1;
 
    /* The reverse calculation is more difficult because the original tristimulus
     * value had 9 independent values (red,green,blue)x(X,Y,Z) however only 8
@@ -1085,91 +1362,996 @@ int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy)
    /* By the argument, above overflow should be impossible here. The return
     * value of 2 indicates an internal error to the caller.
     */
-   if (!png_muldiv(&left, xy.greenx-xy.bluex, xy.redy - xy.bluey, 7)) return 2;
-   if (!png_muldiv(&right, xy.greeny-xy.bluey, xy.redx - xy.bluex, 7)) return 2;
-   denominator = left - right;
+   if (!png_muldiv(&left, xy->greenx-xy->bluex, xy->redy - xy->bluey, 7))
+      return 2;
+   if (!png_muldiv(&right, xy->greeny-xy->bluey, xy->redx - xy->bluex, 7))
+      return 2;
+   denominator = left - right;
+
+   /* Now find the red numerator. */
+   if (!png_muldiv(&left, xy->greenx-xy->bluex, xy->whitey-xy->bluey, 7))
+      return 2;
+   if (!png_muldiv(&right, xy->greeny-xy->bluey, xy->whitex-xy->bluex, 7))
+      return 2;
+
+   /* Overflow is possible here and it indicates an extreme set of PNG cHRM
+    * chunk values.  This calculation actually returns the reciprocal of the
+    * scale value because this allows us to delay the multiplication of white-y
+    * into the denominator, which tends to produce a small number.
+    */
+   if (!png_muldiv(&red_inverse, xy->whitey, denominator, left-right) ||
+       red_inverse <= xy->whitey /* r+g+b scales = white scale */)
+      return 1;
+
+   /* Similarly for green_inverse: */
+   if (!png_muldiv(&left, xy->redy-xy->bluey, xy->whitex-xy->bluex, 7))
+      return 2;
+   if (!png_muldiv(&right, xy->redx-xy->bluex, xy->whitey-xy->bluey, 7))
+      return 2;
+   if (!png_muldiv(&green_inverse, xy->whitey, denominator, left-right) ||
+       green_inverse <= xy->whitey)
+      return 1;
+
+   /* And the blue scale, the checks above guarantee this can't overflow but it
+    * can still produce 0 for extreme cHRM values.
+    */
+   blue_scale = png_reciprocal(xy->whitey) - png_reciprocal(red_inverse) -
+      png_reciprocal(green_inverse);
+   if (blue_scale <= 0) return 1;
+
+
+   /* And fill in the png_XYZ: */
+   if (!png_muldiv(&XYZ->red_X, xy->redx, PNG_FP_1, red_inverse)) return 1;
+   if (!png_muldiv(&XYZ->red_Y, xy->redy, PNG_FP_1, red_inverse)) return 1;
+   if (!png_muldiv(&XYZ->red_Z, PNG_FP_1 - xy->redx - xy->redy, PNG_FP_1,
+      red_inverse))
+      return 1;
+
+   if (!png_muldiv(&XYZ->green_X, xy->greenx, PNG_FP_1, green_inverse)) return 1;
+   if (!png_muldiv(&XYZ->green_Y, xy->greeny, PNG_FP_1, green_inverse)) return 1;
+   if (!png_muldiv(&XYZ->green_Z, PNG_FP_1 - xy->greenx - xy->greeny, PNG_FP_1,
+      green_inverse))
+      return 1;
+
+   if (!png_muldiv(&XYZ->blue_X, xy->bluex, blue_scale, PNG_FP_1)) return 1;
+   if (!png_muldiv(&XYZ->blue_Y, xy->bluey, blue_scale, PNG_FP_1)) return 1;
+   if (!png_muldiv(&XYZ->blue_Z, PNG_FP_1 - xy->bluex - xy->bluey, blue_scale,
+      PNG_FP_1))
+      return 1;
+
+   return 0; /*success*/
+}
+
+static int
+png_XYZ_normalize(png_XYZ *XYZ)
+{
+   png_int_32 Y;
+
+   if (XYZ->red_Y < 0 || XYZ->green_Y < 0 || XYZ->blue_Y < 0 ||
+      XYZ->red_X < 0 || XYZ->green_X < 0 || XYZ->blue_X < 0 ||
+      XYZ->red_Z < 0 || XYZ->green_Z < 0 || XYZ->blue_Z < 0)
+      return 1;
+
+   /* Normalize by scaling so the sum of the end-point Y values is PNG_FP_1.
+    * IMPLEMENTATION NOTE: ANSI requires signed overflow not to occur, therefore
+    * relying on addition of two positive values producing a negative one is not
+    * safe.
+    */
+   Y = XYZ->red_Y;
+   if (0x7fffffff - Y < XYZ->green_X) return 1;
+   Y += XYZ->green_Y;
+   if (0x7fffffff - Y < XYZ->blue_X) return 1;
+   Y += XYZ->blue_Y;
+
+   if (Y != PNG_FP_1)
+   {
+      if (!png_muldiv(&XYZ->red_X, XYZ->red_X, PNG_FP_1, Y)) return 1;
+      if (!png_muldiv(&XYZ->red_Y, XYZ->red_Y, PNG_FP_1, Y)) return 1;
+      if (!png_muldiv(&XYZ->red_Z, XYZ->red_Z, PNG_FP_1, Y)) return 1;
+
+      if (!png_muldiv(&XYZ->green_X, XYZ->green_X, PNG_FP_1, Y)) return 1;
+      if (!png_muldiv(&XYZ->green_Y, XYZ->green_Y, PNG_FP_1, Y)) return 1;
+      if (!png_muldiv(&XYZ->green_Z, XYZ->green_Z, PNG_FP_1, Y)) return 1;
+
+      if (!png_muldiv(&XYZ->blue_X, XYZ->blue_X, PNG_FP_1, Y)) return 1;
+      if (!png_muldiv(&XYZ->blue_Y, XYZ->blue_Y, PNG_FP_1, Y)) return 1;
+      if (!png_muldiv(&XYZ->blue_Z, XYZ->blue_Z, PNG_FP_1, Y)) return 1;
+   }
+
+   return 0;
+}
+
+static int
+png_colorspace_endpoints_match(const png_xy *xy1, const png_xy *xy2, int delta)
+{
+   /* Allow an error of +/-0.01 (absolute value) on each chromaticity */
+   return !(PNG_OUT_OF_RANGE(xy1->whitex, xy2->whitex,delta) ||
+      PNG_OUT_OF_RANGE(xy1->whitey, xy2->whitey,delta) ||
+      PNG_OUT_OF_RANGE(xy1->redx,   xy2->redx,  delta) ||
+      PNG_OUT_OF_RANGE(xy1->redy,   xy2->redy,  delta) ||
+      PNG_OUT_OF_RANGE(xy1->greenx, xy2->greenx,delta) ||
+      PNG_OUT_OF_RANGE(xy1->greeny, xy2->greeny,delta) ||
+      PNG_OUT_OF_RANGE(xy1->bluex,  xy2->bluex, delta) ||
+      PNG_OUT_OF_RANGE(xy1->bluey,  xy2->bluey, delta));
+}
+
+/* Added in libpng-1.6.0, a different check for the validity of a set of cHRM
+ * chunk chromaticities.  Earlier checks used to simply look for the overflow
+ * condition (where the determinant of the matrix to solve for XYZ ends up zero
+ * because the chromaticity values are not all distinct.)  Despite this it is
+ * theoretically possible to produce chromaticities that are apparently valid
+ * but that rapidly degrade to invalid, potentially crashing, sets because of
+ * arithmetic inaccuracies when calculations are performed on them.  The new
+ * check is to round-trip xy -> XYZ -> xy and then check that the result is
+ * within a small percentage of the original.
+ */
+static int
+png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy)
+{
+   int result;
+   png_xy xy_test;
+
+   /* As a side-effect this routine also returns the XYZ endpoints. */
+   result = png_XYZ_from_xy(XYZ, xy);
+   if (result) return result;
+
+   result = png_xy_from_XYZ(&xy_test, XYZ);
+   if (result) return result;
+
+   if (png_colorspace_endpoints_match(xy, &xy_test,
+      5/*actually, the math is pretty accurate*/))
+      return 0;
+
+   /* Too much slip */
+   return 1;
+}
+
+/* This is the check going the other way.  The XYZ is modified to normalize it
+ * (another side-effect) and the xy chromaticities are returned.
+ */
+static int
+png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ)
+{
+   int result;
+   png_XYZ XYZtemp;
+
+   result = png_XYZ_normalize(XYZ);
+   if (result) return result;
+
+   result = png_xy_from_XYZ(xy, XYZ);
+   if (result) return result;
+
+   XYZtemp = *XYZ;
+   return png_colorspace_check_xy(&XYZtemp, xy);
+}
+
+/* Used to check for an endpoint match against sRGB */
+static const png_xy sRGB_xy = /* From ITU-R BT.709-3 */
+{
+   /* color      x       y */
+   /* red   */ 64000, 33000,
+   /* green */ 30000, 60000,
+   /* blue  */ 15000,  6000,
+   /* white */ 31270, 32900
+};
+
+static int
+png_colorspace_set_xy_and_XYZ(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ,
+   int preferred)
+{
+   if (colorspace->flags & PNG_COLORSPACE_INVALID)
+      return 0;
+
+   /* The consistency check is performed on the chromaticities; this factors out
+    * variations because of the normalization (or not) of the end point Y
+    * values.
+    */
+   if (preferred < 2 && (colorspace->flags & PNG_COLORSPACE_HAVE_ENDPOINTS))
+   {
+      /* The end points must be reasonably close to any we already have.  The
+       * following allows an error of up to +/-.001
+       */
+      if (!png_colorspace_endpoints_match(xy, &colorspace->end_points_xy, 100))
+      {
+         colorspace->flags |= PNG_COLORSPACE_INVALID;
+         png_benign_error(png_ptr, "inconsistent chromaticities");
+         return 0; /* failed */
+      }
+
+      /* Only overwrite with preferred values */
+      if (!preferred)
+         return 1; /* ok, but no change */
+   }
+
+   colorspace->end_points_xy = *xy;
+   colorspace->end_points_XYZ = *XYZ;
+   colorspace->flags |= PNG_COLORSPACE_HAVE_ENDPOINTS;
+
+   /* The end points are normally quoted to two decimal digits, so allow +/-0.01
+    * on this test.
+    */
+   if (png_colorspace_endpoints_match(xy, &sRGB_xy, 1000))
+      colorspace->flags |= PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB;
+
+   else
+      colorspace->flags &= PNG_COLORSPACE_CANCEL(
+         PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB);
+
+   return 2; /* ok and changed */
+}
+
+int /* PRIVATE */
+png_colorspace_set_chromaticities(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, const png_xy *xy, int preferred)
+{
+   /* We must check the end points to ensure they are reasonable - in the past
+    * color management systems have crashed as a result of getting bogus
+    * colorant values, while this isn't the fault of libpng it is the
+    * responsibility of libpng because PNG carries the bomb and libpng is in a
+    * position to protect against it.
+    */
+   png_XYZ XYZ;
+
+   switch (png_colorspace_check_xy(&XYZ, xy))
+   {
+      case 0: /* success */
+         return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ,
+            preferred);
+
+      case 1:
+         /* We can't invert the chromaticities so we can't produce value XYZ
+          * values.  Likely as not a color management system will fail too.
+          */
+         colorspace->flags |= PNG_COLORSPACE_INVALID;
+         png_benign_error(png_ptr, "invalid chromaticities");
+         break;
+
+      default:
+         /* libpng is broken; this should be a warning but if it happens we
+          * want error reports so for the moment it is an error.
+          */
+         colorspace->flags |= PNG_COLORSPACE_INVALID;
+         png_error(png_ptr, "internal error checking chromaticities");
+         break;
+   }
+
+   return 0; /* failed */
+}
+
+int /* PRIVATE */
+png_colorspace_set_endpoints(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, const png_XYZ *XYZ_in, int preferred)
+{
+   png_XYZ XYZ = *XYZ_in;
+   png_xy xy;
+
+   switch (png_colorspace_check_XYZ(&xy, &XYZ))
+   {
+      case 0:
+         return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ,
+            preferred);
+
+      case 1:
+         /* End points are invalid. */
+         colorspace->flags |= PNG_COLORSPACE_INVALID;
+         png_benign_error(png_ptr, "invalid end points");
+         break;
+
+      default:
+         colorspace->flags |= PNG_COLORSPACE_INVALID;
+         png_error(png_ptr, "internal error checking chromaticities");
+         break;
+   }
+
+   return 0; /* failed */
+}
+
+#if defined PNG_sRGB_SUPPORTED || defined PNG_iCCP_SUPPORTED
+/* Error message generation */
+static char
+png_icc_tag_char(png_uint_32 byte)
+{
+   byte &= 0xff;
+   if (byte >= 32 && byte <= 126)
+      return (char)byte;
+   else
+      return '?';
+}
+
+static void
+png_icc_tag_name(char *name, png_uint_32 tag)
+{
+   name[0] = '\'';
+   name[1] = png_icc_tag_char(tag >> 24);
+   name[2] = png_icc_tag_char(tag >> 16);
+   name[3] = png_icc_tag_char(tag >>  8);
+   name[4] = png_icc_tag_char(tag      );
+   name[5] = '\'';
+}
+
+static int
+is_ICC_signature_char(png_alloc_size_t it)
+{
+   return it == 32 || (it >= 48 && it <= 57) || (it >= 65 && it <= 90) ||
+      (it >= 97 && it <= 122);
+}
+
+static int is_ICC_signature(png_alloc_size_t it)
+{
+   return is_ICC_signature_char(it >> 24) /* checks all the top bits */ &&
+      is_ICC_signature_char((it >> 16) & 0xff) &&
+      is_ICC_signature_char((it >> 8) & 0xff) &&
+      is_ICC_signature_char(it & 0xff);
+}
+
+static int
+png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace,
+   png_const_charp name, png_alloc_size_t value, png_const_charp reason)
+{
+   size_t pos;
+   char message[196]; /* see below for calculation */
+
+   if (colorspace != NULL)
+      colorspace->flags |= PNG_COLORSPACE_INVALID;
+
+   pos = png_safecat(message, (sizeof message), 0, "profile '"); /* 9 chars */
+   pos = png_safecat(message, pos+79, pos, name); /* Truncate to 79 chars */
+   pos = png_safecat(message, (sizeof message), pos, "': "); /* +2 = 90 */
+   if (is_ICC_signature(value))
+   {
+      /* So 'value' is at most 4 bytes and the following cast is safe */
+      png_icc_tag_name(message+pos, (png_uint_32)value);
+      pos += 6; /* total +8; less than the else clause */
+      message[pos++] = ':';
+      message[pos++] = ' ';
+   }
+#  ifdef PNG_WARNINGS_SUPPORTED
+   else
+      {
+         char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114*/
+
+         pos = png_safecat(message, (sizeof message), pos,
+            png_format_number(number, number+(sizeof number),
+               PNG_NUMBER_FORMAT_x, value));
+         pos = png_safecat(message, (sizeof message), pos, "h: "); /*+2 = 116*/
+      }
+#  endif
+   /* The 'reason' is an arbitrary message, allow +79 maximum 195 */
+   pos = png_safecat(message, (sizeof message), pos, reason);
+
+   /* This is recoverable, but make it unconditionally an app_error on write to
+    * avoid writing invalid ICC profiles into PNG files.  (I.e.  we handle them
+    * on read, with a warning, but on write unless the app turns off
+    * application errors the PNG won't be written.)
+    */
+   png_chunk_report(png_ptr, message,
+      (colorspace != NULL) ? PNG_CHUNK_ERROR : PNG_CHUNK_WRITE_ERROR);
+
+   return 0;
+}
+#endif /* sRGB || iCCP */
+
+#ifdef PNG_sRGB_SUPPORTED
+int /* PRIVATE */
+png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace,
+   int intent)
+{
+   /* sRGB sets known gamma, end points and (from the chunk) intent. */
+   /* IMPORTANT: these are not necessarily the values found in an ICC profile
+    * because ICC profiles store values adapted to a D50 environment; it is
+    * expected that the ICC profile mediaWhitePointTag will be D50, see the
+    * checks and code elsewhere to understand this better.
+    *
+    * These XYZ values, which are accurate to 5dp, produce rgb to gray
+    * coefficients of (6968,23435,2366), which are reduced (because they add up
+    * to 32769 not 32768) to (6968,23434,2366).  These are the values that
+    * libpng has traditionally used (and are the best values given the 15bit
+    * algorithm used by the rgb to gray code.)
+    */
+   static const png_XYZ sRGB_XYZ = /* D65 XYZ (*not* the D50 adapted values!) */
+   {
+      /* color      X      Y      Z */
+      /* red   */ 41239, 21264,  1933,
+      /* green */ 35758, 71517, 11919,
+      /* blue  */ 18048,  7219, 95053
+   };
+
+   /* Do nothing if the colorspace is already invalidated. */
+   if (colorspace->flags & PNG_COLORSPACE_INVALID)
+      return 0;
+
+   /* Check the intent, then check for existing settings.  It is valid for the
+    * PNG file to have cHRM or gAMA chunks along with sRGB, but the values must
+    * be consistent with the correct values.  If, however, this function is
+    * called below because an iCCP chunk matches sRGB then it is quite
+    * conceivable that an older app recorded incorrect gAMA and cHRM because of
+    * an incorrect calculation based on the values in the profile - this does
+    * *not* invalidate the profile (though it still produces an error, which can
+    * be ignored.)
+    */
+   if (intent < 0 || intent >= PNG_sRGB_INTENT_LAST)
+      return png_icc_profile_error(png_ptr, colorspace, "sRGB",
+         (unsigned)intent, "invalid sRGB rendering intent");
+
+   if ((colorspace->flags & PNG_COLORSPACE_HAVE_INTENT) != 0 &&
+      colorspace->rendering_intent != intent)
+      return png_icc_profile_error(png_ptr, colorspace, "sRGB",
+         (unsigned)intent, "inconsistent rendering intents");
+
+   if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0)
+   {
+      png_benign_error(png_ptr, "duplicate sRGB information ignored");
+      return 0;
+   }
+
+   /* If the standard sRGB cHRM chunk does not match the one from the PNG file
+    * warn but overwrite the value with the correct one.
+    */
+   if ((colorspace->flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0 &&
+      !png_colorspace_endpoints_match(&sRGB_xy, &colorspace->end_points_xy,
+         100))
+      png_chunk_report(png_ptr, "cHRM chunk does not match sRGB",
+         PNG_CHUNK_ERROR);
+
+   /* This check is just done for the error reporting - the routine always
+    * returns true when the 'from' argument corresponds to sRGB (2).
+    */
+   (void)png_colorspace_check_gamma(png_ptr, colorspace, PNG_GAMMA_sRGB_INVERSE,
+      2/*from sRGB*/);
+
+   /* intent: bugs in GCC force 'int' to be used as the parameter type. */
+   colorspace->rendering_intent = (png_uint_16)intent;
+   colorspace->flags |= PNG_COLORSPACE_HAVE_INTENT;
+
+   /* endpoints */
+   colorspace->end_points_xy = sRGB_xy;
+   colorspace->end_points_XYZ = sRGB_XYZ;
+   colorspace->flags |=
+      (PNG_COLORSPACE_HAVE_ENDPOINTS|PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB);
+
+   /* gamma */
+   colorspace->gamma = PNG_GAMMA_sRGB_INVERSE;
+   colorspace->flags |= PNG_COLORSPACE_HAVE_GAMMA;
+
+   /* Finally record that we have an sRGB profile */
+   colorspace->flags |=
+      (PNG_COLORSPACE_MATCHES_sRGB|PNG_COLORSPACE_FROM_sRGB);
+
+   return 1; /* set */
+}
+#endif /* sRGB */
+
+#ifdef PNG_iCCP_SUPPORTED
+/* Encoded value of D50 as an ICC XYZNumber.  From the ICC 2010 spec the value
+ * is XYZ(0.9642,1.0,0.8249), which scales to:
+ *
+ *    (63189.8112, 65536, 54060.6464)
+ */
+static const png_byte D50_nCIEXYZ[12] =
+   { 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d };
+
+int /* PRIVATE */
+png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
+   png_const_charp name, png_uint_32 profile_length)
+{
+   if (profile_length < 132)
+      return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
+         "too short");
+
+   if (profile_length & 3)
+      return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
+         "invalid length");
+
+   return 1;
+}
+
+int /* PRIVATE */
+png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
+   png_const_charp name, png_uint_32 profile_length,
+   png_const_bytep profile/* first 132 bytes only */, int color_type)
+{
+   png_uint_32 temp;
+
+   /* Length check; this cannot be ignored in this code because profile_length
+    * is used later to check the tag table, so even if the profile seems over
+    * long profile_length from the caller must be correct.  The caller can fix
+    * this up on read or write by just passing in the profile header length.
+    */
+   temp = png_get_uint_32(profile);
+   if (temp != profile_length)
+      return png_icc_profile_error(png_ptr, colorspace, name, temp,
+         "length does not match profile");
+
+   temp = png_get_uint_32(profile+128); /* tag count: 12 bytes/tag */
+   if (temp > 357913930 || /* (2^32-4-132)/12: maxium possible tag count */
+      profile_length < 132+12*temp) /* truncated tag table */
+      return png_icc_profile_error(png_ptr, colorspace, name, temp,
+         "tag count too large");
+
+   /* The 'intent' must be valid or we can't store it, ICC limits the intent to
+    * 16 bits.
+    */
+   temp = png_get_uint_32(profile+64);
+   if (temp >= 0xffff) /* The ICC limit */
+      return png_icc_profile_error(png_ptr, colorspace, name, temp,
+         "invalid rendering intent");
+
+   /* This is just a warning because the profile may be valid in future
+    * versions.
+    */
+   if (temp >= PNG_sRGB_INTENT_LAST)
+      (void)png_icc_profile_error(png_ptr, NULL, name, temp,
+         "intent outside defined range");
+
+   /* At this point the tag table can't be checked because it hasn't necessarily
+    * been loaded; however, various header fields can be checked.  These checks
+    * are for values permitted by the PNG spec in an ICC profile; the PNG spec
+    * restricts the profiles that can be passed in an iCCP chunk (they must be
+    * appropriate to processing PNG data!)
+    */
+
+   /* Data checks (could be skipped).  These checks must be independent of the
+    * version number; however, the version number doesn't accomodate changes in
+    * the header fields (just the known tags and the interpretation of the
+    * data.)
+    */
+   temp = png_get_uint_32(profile+36); /* signature 'ascp' */
+   if (temp != 0x61637370)
+      return png_icc_profile_error(png_ptr, colorspace, name, temp,
+         "invalid signature");
+
+   /* Currently the PCS illuminant/adopted white point (the computational
+    * white point) are required to be D50,
+    * however the profile contains a record of the illuminant so perhaps ICC
+    * expects to be able to change this in the future (despite the rationale in
+    * the introduction for using a fixed PCS adopted white.)  Consequently the
+    * following is just a warning.
+    */
+   if (memcmp(profile+68, D50_nCIEXYZ, 12) != 0)
+      (void)png_icc_profile_error(png_ptr, NULL, name, 0/*no tag value*/,
+         "PCS illuminant is not D50");
+
+   /* The PNG spec requires this:
+    * "If the iCCP chunk is present, the image samples conform to the colour
+    * space represented by the embedded ICC profile as defined by the
+    * International Color Consortium [ICC]. The colour space of the ICC profile
+    * shall be an RGB colour space for colour images (PNG colour types 2, 3, and
+    * 6), or a greyscale colour space for greyscale images (PNG colour types 0
+    * and 4)."
+    *
+    * This checking code ensures the embedded profile (on either read or write)
+    * conforms to the specification requirements.  Notice that an ICC 'gray'
+    * color-space profile contains the information to transform the monochrome
+    * data to XYZ or L*a*b (according to which PCS the profile uses) and this
+    * should be used in preference to the standard libpng K channel replication
+    * into R, G and B channels.
+    *
+    * Previously it was suggested that an RGB profile on grayscale data could be
+    * handled.  However it it is clear that using an RGB profile in this context
+    * must be an error - there is no specification of what it means.  Thus it is
+    * almost certainly more correct to ignore the profile.
+    */
+   temp = png_get_uint_32(profile+16); /* data colour space field */
+   switch (temp)
+   {
+      case 0x52474220: /* 'RGB ' */
+         if (!(color_type & PNG_COLOR_MASK_COLOR))
+            return png_icc_profile_error(png_ptr, colorspace, name, temp,
+               "RGB color space not permitted on grayscale PNG");
+         break;
 
-   /* Now find the red numerator. */
-   if (!png_muldiv(&left, xy.greenx-xy.bluex, xy.whitey-xy.bluey, 7)) return 2;
-   if (!png_muldiv(&right, xy.greeny-xy.bluey, xy.whitex-xy.bluex, 7)) return 2;
+      case 0x47524159: /* 'GRAY' */
+         if (color_type & PNG_COLOR_MASK_COLOR)
+            return png_icc_profile_error(png_ptr, colorspace, name, temp,
+               "Gray color space not permitted on RGB PNG");
+         break;
 
-   /* Overflow is possible here and it indicates an extreme set of PNG cHRM
-    * chunk values.  This calculation actually returns the reciprocal of the
-    * scale value because this allows us to delay the multiplication of white-y
-    * into the denominator, which tends to produce a small number.
+      default:
+         return png_icc_profile_error(png_ptr, colorspace, name, temp,
+            "invalid ICC profile color space");
+   }
+
+   /* It is up to the application to check that the profile class matches the
+    * application requirements; the spec provides no guidance, but it's pretty
+    * weird if the profile is not scanner ('scnr'), monitor ('mntr'), printer
+    * ('prtr') or 'spac' (for generic color spaces).  Issue a warning in these
+    * cases.  Issue an error for device link or abstract profiles - these don't
+    * contain the records necessary to transform the color-space to anything
+    * other than the target device (and not even that for an abstract profile).
+    * Profiles of these classes may not be embedded in images.
     */
-   if (!png_muldiv(&red_inverse, xy.whitey, denominator, left-right) ||
-       red_inverse <= xy.whitey /* r+g+b scales = white scale */)
-      return 1;
+   temp = png_get_uint_32(profile+12); /* profile/device class */
+   switch (temp)
+   {
+      case 0x73636E72: /* 'scnr' */
+      case 0x6D6E7472: /* 'mntr' */
+      case 0x70727472: /* 'prtr' */
+      case 0x73706163: /* 'spac' */
+         /* All supported */
+         break;
 
-   /* Similarly for green_inverse: */
-   if (!png_muldiv(&left, xy.redy-xy.bluey, xy.whitex-xy.bluex, 7)) return 2;
-   if (!png_muldiv(&right, xy.redx-xy.bluex, xy.whitey-xy.bluey, 7)) return 2;
-   if (!png_muldiv(&green_inverse, xy.whitey, denominator, left-right) ||
-       green_inverse <= xy.whitey)
-      return 1;
+      case 0x61627374: /* 'abst' */
+         /* May not be embedded in an image */
+         return png_icc_profile_error(png_ptr, colorspace, name, temp,
+            "invalid embedded Abstract ICC profile");
+
+      case 0x6C696E6B: /* 'link' */
+         /* DeviceLink profiles cannnot be interpreted in a non-device specific
+          * fashion, if an app uses the AToB0Tag in the profile the results are
+          * undefined unless the result is sent to the intended device,
+          * therefore a DeviceLink profile should not be found embedded in a
+          * PNG.
+          */
+         return png_icc_profile_error(png_ptr, colorspace, name, temp,
+            "unexpected DeviceLink ICC profile class");
 
-   /* And the blue scale, the checks above guarantee this can't overflow but it
-    * can still produce 0 for extreme cHRM values.
+      case 0x6E6D636C: /* 'nmcl' */
+         /* A NamedColor profile is also device specific, however it doesn't
+          * contain an AToB0 tag that is open to misintrepretation.  Almost
+          * certainly it will fail the tests below.
+          */
+         (void)png_icc_profile_error(png_ptr, NULL, name, temp,
+            "unexpected NamedColor ICC profile class");
+         break;
+
+      default:
+         /* To allow for future enhancements to the profile accept unrecognized
+          * profile classes with a warning, these then hit the test below on the
+          * tag content to ensure they are backward compatible with one of the
+          * understood profiles.
+          */
+         (void)png_icc_profile_error(png_ptr, NULL, name, temp,
+            "unrecognized ICC profile class");
+         break;
+   }
+
+   /* For any profile other than a device link one the PCS must be encoded
+    * either in XYZ or Lab.
     */
-   blue_scale = png_reciprocal(xy.whitey) - png_reciprocal(red_inverse) -
-      png_reciprocal(green_inverse);
-   if (blue_scale <= 0) return 1;
+   temp = png_get_uint_32(profile+20);
+   switch (temp)
+   {
+      case 0x58595A20: /* 'XYZ ' */
+      case 0x4C616220: /* 'Lab ' */
+         break;
 
+      default:
+         return png_icc_profile_error(png_ptr, colorspace, name, temp,
+            "unexpected ICC PCS encoding");
+   }
 
-   /* And fill in the png_XYZ: */
-   if (!png_muldiv(&XYZ->redX, xy.redx, PNG_FP_1, red_inverse)) return 1;
-   if (!png_muldiv(&XYZ->redY, xy.redy, PNG_FP_1, red_inverse)) return 1;
-   if (!png_muldiv(&XYZ->redZ, PNG_FP_1 - xy.redx - xy.redy, PNG_FP_1,
-      red_inverse))
-      return 1;
+   return 1;
+}
 
-   if (!png_muldiv(&XYZ->greenX, xy.greenx, PNG_FP_1, green_inverse)) return 1;
-   if (!png_muldiv(&XYZ->greenY, xy.greeny, PNG_FP_1, green_inverse)) return 1;
-   if (!png_muldiv(&XYZ->greenZ, PNG_FP_1 - xy.greenx - xy.greeny, PNG_FP_1,
-      green_inverse))
-      return 1;
+int /* PRIVATE */
+png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace,
+   png_const_charp name, png_uint_32 profile_length,
+   png_const_bytep profile /* header plus whole tag table */)
+{
+   png_uint_32 tag_count = png_get_uint_32(profile+128);
+   png_uint_32 itag;
+   png_const_bytep tag = profile+132; /* The first tag */
 
-   if (!png_muldiv(&XYZ->blueX, xy.bluex, blue_scale, PNG_FP_1)) return 1;
-   if (!png_muldiv(&XYZ->blueY, xy.bluey, blue_scale, PNG_FP_1)) return 1;
-   if (!png_muldiv(&XYZ->blueZ, PNG_FP_1 - xy.bluex - xy.bluey, blue_scale,
-      PNG_FP_1))
-      return 1;
+   /* First scan all the tags in the table and add bits to the icc_info value
+    * (temporarily in 'tags').
+    */
+   for (itag=0; itag < tag_count; ++itag, tag += 12)
+   {
+      png_uint_32 tag_id = png_get_uint_32(tag+0);
+      png_uint_32 tag_start = png_get_uint_32(tag+4); /* must be aligned */
+      png_uint_32 tag_length = png_get_uint_32(tag+8);/* not padded */
+
+      /* The ICC specification does not exclude zero length tags, therefore the
+       * start might actually be anywhere if there is no data, but this would be
+       * a clear abuse of the intent of the standard so the start is checked for
+       * being in range.  All defined tag types have an 8 byte header - a 4 byte
+       * type signature then 0.
+       */
+      if ((tag_start & 3) != 0)
+      {
+         /* CNHP730S.icc shipped with Microsoft Windows 64 violates this, it is
+          * only a warning here because libpng does not care about the
+          * alignment.
+          */
+         (void)png_icc_profile_error(png_ptr, NULL, name, tag_id,
+            "ICC profile tag start not a multiple of 4");
+      }
 
-   return 0; /*success*/
+      /* This is a hard error; potentially it can cause read outside the
+       * profile.
+       */
+      if (tag_start > profile_length || tag_length > profile_length - tag_start)
+         return png_icc_profile_error(png_ptr, colorspace, name, tag_id,
+            "ICC profile tag outside profile");
+   }
+
+   return 1; /* success, maybe with warnings */
 }
 
-int png_XYZ_from_xy_checked(png_structp png_ptr, png_XYZ *XYZ, png_xy xy)
+#ifdef PNG_sRGB_SUPPORTED
+/* Information about the known ICC sRGB profiles */
+static const struct
 {
-   switch (png_XYZ_from_xy(XYZ, xy))
-   {
-      case 0: /* success */
-         return 1;
+   png_uint_32 adler, crc, length;
+   png_uint_32 md5[4];
+   png_byte    have_md5;
+   png_byte    is_broken;
+   png_uint_16 intent;
 
-      case 1:
-         /* The chunk may be technically valid, but we got png_fixed_point
-          * overflow while trying to get XYZ values out of it.  This is
-          * entirely benign - the cHRM chunk is pretty extreme.
-          */
-         png_warning(png_ptr,
-            "extreme cHRM chunk cannot be converted to tristimulus values");
-         break;
+#  define PNG_MD5(a,b,c,d) { a, b, c, d }, (a!=0)||(b!=0)||(c!=0)||(d!=0)
+#  define PNG_ICC_CHECKSUM(adler, crc, md5, intent, broke, date, length, fname)\
+      { adler, crc, length, md5, broke, intent },
 
-      default:
-         /* libpng is broken; this should be a warning but if it happens we
-          * want error reports so for the moment it is an error.
+} png_sRGB_checks[] =
+{
+   /* This data comes from contrib/tools/checksum-icc run on downloads of
+    * all four ICC sRGB profiles from www.color.org.
+    */
+   /* adler32, crc32, MD5[4], intent, date, length, file-name */
+   PNG_ICC_CHECKSUM(0x0a3fd9f6, 0x3b8772b9,
+      PNG_MD5(0x29f83dde, 0xaff255ae, 0x7842fae4, 0xca83390d), 0, 0,
+      "2009/03/27 21:36:31", 3048, "sRGB_IEC61966-2-1_black_scaled.icc")
+
+   /* ICC sRGB v2 perceptual no black-compensation: */
+   PNG_ICC_CHECKSUM(0x4909e5e1, 0x427ebb21,
+      PNG_MD5(0xc95bd637, 0xe95d8a3b, 0x0df38f99, 0xc1320389), 1, 0,
+      "2009/03/27 21:37:45", 3052, "sRGB_IEC61966-2-1_no_black_scaling.icc")
+
+   PNG_ICC_CHECKSUM(0xfd2144a1, 0x306fd8ae,
+      PNG_MD5(0xfc663378, 0x37e2886b, 0xfd72e983, 0x8228f1b8), 0, 0,
+      "2009/08/10 17:28:01", 60988, "sRGB_v4_ICC_preference_displayclass.icc")
+
+   /* ICC sRGB v4 perceptual */
+   PNG_ICC_CHECKSUM(0x209c35d2, 0xbbef7812,
+      PNG_MD5(0x34562abf, 0x994ccd06, 0x6d2c5721, 0xd0d68c5d), 0, 0,
+      "2007/07/25 00:05:37", 60960, "sRGB_v4_ICC_preference.icc")
+
+   /* The following profiles have no known MD5 checksum. If there is a match
+    * on the (empty) MD5 the other fields are used to attempt a match and
+    * a warning is produced.  The first two of these profiles have a 'cprt' tag
+    * which suggests that they were also made by Hewlett Packard.
+    */
+   PNG_ICC_CHECKSUM(0xa054d762, 0x5d5129ce,
+      PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 0,
+      "2004/07/21 18:57:42", 3024, "sRGB_IEC61966-2-1_noBPC.icc")
+
+   /* This is a 'mntr' (display) profile with a mediaWhitePointTag that does not
+    * match the D50 PCS illuminant in the header (it is in fact the D65 values,
+    * so the white point is recorded as the un-adapted value.)  The profiles
+    * below only differ in one byte - the intent - and are basically the same as
+    * the previous profile except for the mediaWhitePointTag error and a missing
+    * chromaticAdaptationTag.
+    */
+   PNG_ICC_CHECKSUM(0xf784f3fb, 0x182ea552,
+      PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 0, 1/*broken*/,
+      "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 perceptual")
+
+   PNG_ICC_CHECKSUM(0x0398f3fcUL, 0xf29e526dUL,
+      PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 1/*broken*/,
+      "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 media-relative")
+};
+
+static int
+png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr,
+   png_const_bytep profile, uLong adler)
+{
+   /* The quick check is to verify just the MD5 signature and trust the
+    * rest of the data.  Because the profile has already been verified for
+    * correctness this is safe.  png_colorspace_set_sRGB will check the 'intent'
+    * field too, so if the profile has been edited with an intent not defined
+    * by sRGB (but maybe defined by a later ICC specification) the read of
+    * the profile will fail at that point.
+    */
+   png_uint_32 length = 0;
+   png_uint_32 intent = 0x10000; /* invalid */
+#if PNG_sRGB_PROFILE_CHECKS > 1
+   uLong crc = 0; /* the value for 0 length data */
+#endif
+   unsigned int i;
+
+   for (i=0; i < (sizeof png_sRGB_checks) / (sizeof png_sRGB_checks[0]); ++i)
+   {
+      if (png_get_uint_32(profile+84) == png_sRGB_checks[i].md5[0] &&
+         png_get_uint_32(profile+88) == png_sRGB_checks[i].md5[1] &&
+         png_get_uint_32(profile+92) == png_sRGB_checks[i].md5[2] &&
+         png_get_uint_32(profile+96) == png_sRGB_checks[i].md5[3])
+      {
+         /* This may be one of the old HP profiles without an MD5, in that
+          * case we can only use the length and Adler32 (note that these
+          * are not used by default if there is an MD5!)
           */
-         png_error(png_ptr, "internal error in png_XYZ_from_xy");
-         break;
+#        if PNG_sRGB_PROFILE_CHECKS == 0
+            if (png_sRGB_checks[i].have_md5)
+               return 1+png_sRGB_checks[i].is_broken;
+#        endif
+
+         /* Profile is unsigned or more checks have been configured in. */
+         if (length == 0)
+         {
+            length = png_get_uint_32(profile);
+            intent = png_get_uint_32(profile+64);
+         }
+
+         /* Length *and* intent must match */
+         if (length == png_sRGB_checks[i].length &&
+            intent == png_sRGB_checks[i].intent)
+         {
+            /* Now calculate the alder32 if not done already. */
+            if (adler == 0)
+            {
+               adler = adler32(0, NULL, 0);
+               adler = adler32(adler, profile, length);
+            }
+
+            if (adler == png_sRGB_checks[i].adler)
+            {
+               /* These basic checks suggest that the data has not been
+                * modified, but if the check level is more than 1 perform
+                * our own crc32 checksum on the data.
+                */
+#              if PNG_sRGB_PROFILE_CHECKS > 1
+                  if (crc == 0)
+                  {
+                     crc = crc32(0, NULL, 0);
+                     crc = crc32(crc, profile, length);
+                  }
+
+                  /* So this check must pass for the 'return' below to happen.
+                   */
+                  if (crc == png_sRGB_checks[i].crc)
+#              endif
+               {
+                  if (png_sRGB_checks[i].is_broken)
+                  {
+                     /* These profiles are known to have bad data that may cause
+                      * problems if they are used, therefore attempt to
+                      * discourage their use, skip the 'have_md5' warning below,
+                      * which is made irrelevant by this error.
+                      */
+                     png_chunk_report(png_ptr, "known incorrect sRGB profile",
+                        PNG_CHUNK_ERROR);
+                  }
+
+                  /* Warn that this being done; this isn't even an error since
+                   * the profile is perfectly valid, but it would be nice if
+                   * people used the up-to-date ones.
+                   */
+                  else if (!png_sRGB_checks[i].have_md5)
+                  {
+                     png_chunk_report(png_ptr,
+                        "out-of-date sRGB profile with no signature",
+                        PNG_CHUNK_WARNING);
+                  }
+
+                  return 1+png_sRGB_checks[i].is_broken;
+               }
+            }
+         }
+
+#        if PNG_sRGB_PROFILE_CHECKS > 0
+            /* The signature matched, but the profile had been changed in some
+             * way.  This is an apparent violation of the ICC terms of use and,
+             * anyway, probably indicates a data error or uninformed hacking.
+             */
+            if (png_sRGB_checks[i].have_md5)
+               png_benign_error(png_ptr,
+                  "copyright violation: edited ICC profile ignored");
+#        endif
+      }
+   }
+
+   return 0; /* no match */
+}
+#endif
+
+#ifdef PNG_sRGB_SUPPORTED
+void /* PRIVATE */
+png_icc_set_sRGB(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, png_const_bytep profile, uLong adler)
+{
+   /* Is this profile one of the known ICC sRGB profiles?  If it is, just set
+    * the sRGB information.
+    */
+   if (png_compare_ICC_profile_with_sRGB(png_ptr, profile, adler))
+      (void)png_colorspace_set_sRGB(png_ptr, colorspace,
+         (int)/*already checked*/png_get_uint_32(profile+64));
+}
+#endif /* PNG_READ_sRGB_SUPPORTED */
+
+int /* PRIVATE */
+png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace,
+   png_const_charp name, png_uint_32 profile_length, png_const_bytep profile,
+   int color_type)
+{
+   if (colorspace->flags & PNG_COLORSPACE_INVALID)
+      return 0;
+
+   if (png_icc_check_length(png_ptr, colorspace, name, profile_length) &&
+      png_icc_check_header(png_ptr, colorspace, name, profile_length, profile,
+         color_type) &&
+      png_icc_check_tag_table(png_ptr, colorspace, name, profile_length,
+         profile))
+   {
+      png_icc_set_sRGB(png_ptr, colorspace, profile, 0);
+      return 1;
    }
 
-   /* ERROR RETURN */
+   /* Failure case */
    return 0;
 }
+#endif /* iCCP */
+
+#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+void /* PRIVATE */
+png_colorspace_set_rgb_coefficients(png_structrp png_ptr)
+{
+   /* Set the rgb_to_gray coefficients from the colorspace. */
+   if (!png_ptr->rgb_to_gray_coefficients_set &&
+      (png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
+   {
+      /* png_set_background has not been called, get the coefficients from the Y
+       * values of the colorspace colorants.
+       */
+      png_fixed_point r = png_ptr->colorspace.end_points_XYZ.red_Y;
+      png_fixed_point g = png_ptr->colorspace.end_points_XYZ.green_Y;
+      png_fixed_point b = png_ptr->colorspace.end_points_XYZ.blue_Y;
+      png_fixed_point total = r+g+b;
+
+      if (total > 0 &&
+         r >= 0 && png_muldiv(&r, r, 32768, total) && r >= 0 && r <= 32768 &&
+         g >= 0 && png_muldiv(&g, g, 32768, total) && g >= 0 && g <= 32768 &&
+         b >= 0 && png_muldiv(&b, b, 32768, total) && b >= 0 && b <= 32768 &&
+         r+g+b <= 32769)
+      {
+         /* We allow 0 coefficients here.  r+g+b may be 32769 if two or
+          * all of the coefficients were rounded up.  Handle this by
+          * reducing the *largest* coefficient by 1; this matches the
+          * approach used for the default coefficients in pngrtran.c
+          */
+         int add = 0;
+
+         if (r+g+b > 32768)
+            add = -1;
+         else if (r+g+b < 32768)
+            add = 1;
+
+         if (add != 0)
+         {
+            if (g >= r && g >= b)
+               g += add;
+            else if (r >= g && r >= b)
+               r += add;
+            else
+               b += add;
+         }
+
+         /* Check for an internal error. */
+         if (r+g+b != 32768)
+            png_error(png_ptr,
+               "internal error handling cHRM coefficients");
+
+         else
+         {
+            png_ptr->rgb_to_gray_red_coeff   = (png_uint_16)r;
+            png_ptr->rgb_to_gray_green_coeff = (png_uint_16)g;
+         }
+      }
+
+      /* This is a png_error at present even though it could be ignored -
+       * it should never happen, but it is important that if it does, the
+       * bug is fixed.
+       */
+      else
+         png_error(png_ptr, "internal error handling cHRM->XYZ");
+   }
+}
 #endif
 
+#endif /* COLORSPACE */
+
 void /* PRIVATE */
-png_check_IHDR(png_structp png_ptr,
+png_check_IHDR(png_const_structrp png_ptr,
    png_uint_32 width, png_uint_32 height, int bit_depth,
    int color_type, int interlace_type, int compression_type,
    int filter_type)
@@ -1470,7 +2652,7 @@ static double
 png_pow10(int power)
 {
    int recip = 0;
-   double d = 1.0;
+   double d = 1;
 
    /* Handle negative exponent with a reciprocal at the end because
     * 10 is exact whereas .1 is inexact in base 2
@@ -1484,7 +2666,7 @@ png_pow10(int power)
    if (power > 0)
    {
       /* Decompose power bitwise. */
-      double mult = 10.0;
+      double mult = 10;
       do
       {
          if (power & 1) d *= mult;
@@ -1504,7 +2686,7 @@ png_pow10(int power)
  * precision.
  */
 void /* PRIVATE */
-png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
+png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
     double fp, unsigned int precision)
 {
    /* We use standard functions from math.h, but not printf because
@@ -1603,8 +2785,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
             {
                double d;
 
-               fp *= 10.0;
-
+               fp *= 10;
                /* Use modf here, not floor and subtract, so that
                 * the separation is done in one step.  At the end
                 * of the loop don't break the number into parts so
@@ -1617,7 +2798,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
                {
                   d = floor(fp + .5);
 
-                  if (d > 9.0)
+                  if (d > 9)
                   {
                      /* Rounding up to 10, handle that here. */
                      if (czero > 0)
@@ -1625,10 +2806,9 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
                         --czero, d = 1;
                         if (cdigits == 0) --clead;
                      }
-
                      else
                      {
-                        while (cdigits > 0 && d > 9.0)
+                        while (cdigits > 0 && d > 9)
                         {
                            int ch = *--ascii;
 
@@ -1653,7 +2833,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
                          * exponent but take into account the leading
                          * decimal point.
                          */
-                        if (d > 9.0)  /* cdigits == 0 */
+                        if (d > 9)  /* cdigits == 0 */
                         {
                            if (exp_b10 == (-1))
                            {
@@ -1674,19 +2854,18 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
                               ++exp_b10;
 
                            /* In all cases we output a '1' */
-                           d = 1.0;
+                           d = 1;
                         }
                      }
                   }
                   fp = 0; /* Guarantees termination below. */
                }
 
-               if (d == 0.0)
+               if (d == 0)
                {
                   ++czero;
                   if (cdigits == 0) ++clead;
                }
-
                else
                {
                   /* Included embedded zeros in the digit count. */
@@ -1714,7 +2893,6 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
                                                                  above */
                      --exp_b10;
                   }
-
                   *ascii++ = (char)(48 + (int)d), ++cdigits;
                }
             }
@@ -1822,8 +3000,8 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
 /* Function to format a fixed point value in ASCII.
  */
 void /* PRIVATE */
-png_ascii_from_fixed(png_structp png_ptr, png_charp ascii, png_size_t size,
-    png_fixed_point fp)
+png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
+    png_size_t size, png_fixed_point fp)
 {
    /* Require space for 10 decimal digits, a decimal point, a minus sign and a
     * trailing \0, 13 characters:
@@ -1893,9 +3071,14 @@ png_ascii_from_fixed(png_structp png_ptr, png_charp ascii, png_size_t size,
 #endif /* READ_SCAL */
 
 #if defined(PNG_FLOATING_POINT_SUPPORTED) && \
-   !defined(PNG_FIXED_POINT_MACRO_SUPPORTED)
+   !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \
+   (defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \
+   defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \
+   defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \
+   (defined(PNG_sCAL_SUPPORTED) && \
+   defined(PNG_FLOATING_ARITHMETIC_SUPPORTED))
 png_fixed_point
-png_fixed(png_structp png_ptr, double fp, png_const_charp text)
+png_fixed(png_const_structrp png_ptr, double fp, png_const_charp text)
 {
    double r = floor(100000 * fp + .5);
 
@@ -2034,7 +3217,7 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
  * result.
  */
 png_fixed_point
-png_muldiv_warn(png_structp png_ptr, png_fixed_point a, png_int_32 times,
+png_muldiv_warn(png_const_structrp png_ptr, png_fixed_point a, png_int_32 times,
     png_int_32 divisor)
 {
    png_fixed_point result;
@@ -2047,8 +3230,7 @@ png_muldiv_warn(png_structp png_ptr, png_fixed_point a, png_int_32 times,
 }
 #endif
 
-#if (defined PNG_READ_GAMMA_SUPPORTED) || (defined PNG_cHRM_SUPPORTED)
-/* more fixed point functions for gamma and cHRM (xy/XYZ) suport. */
+#ifdef PNG_GAMMA_SUPPORTED /* more fixed point functions for gamma */
 /* Calculate a reciprocal, return 0 on div-by-zero or overflow. */
 png_fixed_point
 png_reciprocal(png_fixed_point a)
@@ -2068,6 +3250,17 @@ png_reciprocal(png_fixed_point a)
    return 0; /* error/overflow */
 }
 
+/* This is the shared test on whether a gamma value is 'significant' - whether
+ * it is worth doing gamma correction.
+ */
+int /* PRIVATE */
+png_gamma_significant(png_fixed_point gamma_val)
+{
+   return gamma_val < PNG_FP_1 - PNG_GAMMA_THRESHOLD_FIXED ||
+       gamma_val > PNG_FP_1 + PNG_GAMMA_THRESHOLD_FIXED;
+}
+#endif
+
 #ifdef PNG_READ_GAMMA_SUPPORTED
 /* A local convenience routine. */
 static png_fixed_point
@@ -2090,7 +3283,6 @@ png_product2(png_fixed_point a, png_fixed_point b)
 
    return 0; /* overflow */
 }
-#endif /* READ_GAMMA */
 
 /* The inverse of the above. */
 png_fixed_point
@@ -2118,75 +3310,30 @@ png_reciprocal2(png_fixed_point a, png_fixed_point b)
 
    return 0; /* overflow */
 }
-#endif /* READ_GAMMA || cHRM */
-
-#ifdef PNG_CHECK_cHRM_SUPPORTED
-/* Added at libpng version 1.2.34 (Dec 8, 2008) and 1.4.0 (Jan 2,
- * 2010: moved from pngset.c) */
-/*
- *    Multiply two 32-bit numbers, V1 and V2, using 32-bit
- *    arithmetic, to produce a 64-bit result in the HI/LO words.
- *
- *                  A B
- *                x C D
- *               ------
- *              AD || BD
- *        AC || CB || 0
- *
- *    where A and B are the high and low 16-bit words of V1,
- *    C and D are the 16-bit words of V2, AD is the product of
- *    A and D, and X || Y is (X << 16) + Y.
-*/
-
-void /* PRIVATE */
-png_64bit_product (long v1, long v2, unsigned long *hi_product,
-    unsigned long *lo_product)
-{
-   int a, b, c, d;
-   long lo, hi, x, y;
-
-   a = (v1 >> 16) & 0xffff;
-   b = v1 & 0xffff;
-   c = (v2 >> 16) & 0xffff;
-   d = v2 & 0xffff;
-
-   lo = b * d;                   /* BD */
-   x = a * d + c * b;            /* AD + CB */
-   y = ((lo >> 16) & 0xffff) + x;
-
-   lo = (lo & 0xffff) | ((y & 0xffff) << 16);
-   hi = (y >> 16) & 0xffff;
-
-   hi += a * c;                  /* AC */
-
-   *hi_product = (unsigned long)hi;
-   *lo_product = (unsigned long)lo;
-}
-#endif /* CHECK_cHRM */
+#endif /* READ_GAMMA */
 
 #ifdef PNG_READ_GAMMA_SUPPORTED /* gamma table code */
 #ifndef PNG_FLOATING_ARITHMETIC_SUPPORTED
 /* Fixed point gamma.
+ *
+ * The code to calculate the tables used below can be found in the shell script
+ * contrib/tools/intgamma.sh
  *
  * To calculate gamma this code implements fast log() and exp() calls using only
  * fixed point arithmetic.  This code has sufficient precision for either 8-bit
  * or 16-bit sample values.
  *
  * The tables used here were calculated using simple 'bc' programs, but C double
- * precision floating point arithmetic would work fine.  The programs are given
- * at the head of each table.
+ * precision floating point arithmetic would work fine.
  *
  * 8-bit log table
  *   This is a table of -log(value/255)/log(2) for 'value' in the range 128 to
  *   255, so it's the base 2 logarithm of a normalized 8-bit floating point
  *   mantissa.  The numbers are 32-bit fractions.
  */
-static png_uint_32
+static const png_uint_32
 png_8bit_l2[128] =
 {
-#  ifdef PNG_DO_BC
-      for (i=128;i<256;++i) { .5 - l(i/255)/l(2)*65536*65536; }
-#  else
    4270715492U, 4222494797U, 4174646467U, 4127164793U, 4080044201U, 4033279239U,
    3986864580U, 3940795015U, 3895065449U, 3849670902U, 3804606499U, 3759867474U,
    3715449162U, 3671346997U, 3627556511U, 3584073329U, 3540893168U, 3498011834U,
@@ -2209,7 +3356,6 @@ png_8bit_l2[128] =
    324227938U, 298676034U, 273229066U, 247886176U, 222646516U, 197509248U,
    172473545U, 147538590U, 122703574U, 97967701U, 73330182U, 48790236U,
    24347096U, 0U
-#  endif
 
 #if 0
    /* The following are the values for 16-bit tables - these work fine for the
@@ -2232,18 +3378,18 @@ png_8bit_l2[128] =
 #endif
 };
 
-PNG_STATIC png_int_32
+static png_int_32
 png_log8bit(unsigned int x)
 {
    unsigned int lg2 = 0;
    /* Each time 'x' is multiplied by 2, 1 must be subtracted off the final log,
     * because the log is actually negate that means adding 1.  The final
     * returned value thus has the range 0 (for 255 input) to 7.994 (for 1
-    * input), return 7.99998 for the overflow (log 0) case - so the result is
+    * input), return -1 for the overflow (log 0) case, - so the result is
     * always at most 19 bits.
     */
    if ((x &= 0xff) == 0)
-      return 0xffffffff;
+      return -1;
 
    if ((x & 0xf0) == 0)
       lg2  = 4, x <<= 4;
@@ -2288,14 +3434,14 @@ png_log8bit(unsigned int x)
  * Zero  (257):      0
  * End   (258):  23499
  */
-PNG_STATIC png_int_32
+static png_int_32
 png_log16bit(png_uint_32 x)
 {
    unsigned int lg2 = 0;
 
    /* As above, but now the input has 16 bits. */
    if ((x &= 0xffff) == 0)
-      return 0xffffffff;
+      return -1;
 
    if ((x & 0xff00) == 0)
       lg2  = 8, x <<= 8;
@@ -2345,7 +3491,7 @@ png_log16bit(png_uint_32 x)
  * integer bits (the top 4) simply determine a shift.
  *
  * The worst case is the 16-bit distinction between 65535 and 65534, this
- * requires perhaps spurious accuracy in the decoding of the logarithm to
+ * requires perhaps spurious accuracty in the decoding of the logarithm to
  * distinguish log2(65535/65534.5) - 10^-5 or 17 bits.  There is little chance
  * of getting this accuracy in practice.
  *
@@ -2353,21 +3499,17 @@ png_log16bit(png_uint_32 x)
  * frational part of the logarithm by using an accurate 32-bit value from the
  * top four fractional bits then multiplying in the remaining bits.
  */
-static png_uint_32
+static const png_uint_32
 png_32bit_exp[16] =
 {
-#  ifdef PNG_DO_BC
-      for (i=0;i<16;++i) { .5 + e(-i/16*l(2))*2^32; }
-#  else
    /* NOTE: the first entry is deliberately set to the maximum 32-bit value. */
    4294967295U, 4112874773U, 3938502376U, 3771522796U, 3611622603U, 3458501653U,
    3311872529U, 3171459999U, 3037000500U, 2908241642U, 2784941738U, 2666869345U,
    2553802834U, 2445529972U, 2341847524U, 2242560872U
-#  endif
 };
 
 /* Adjustment table; provided to explain the numbers in the code below. */
-#ifdef PNG_DO_BC
+#if 0
 for (i=11;i>=0;--i){ print i, " ", (1 - e(-(2^i)/65536*l(2))) * 2^(32-i), "\n"}
    11 44937.64284865548751208448
    10 45180.98734845585101160448
@@ -2383,7 +3525,7 @@ for (i=11;i>=0;--i){ print i, " ", (1 - e(-(2^i)/65536*l(2))) * 2^(32-i), "\n"}
     0 45425.85339951654943850496
 #endif
 
-PNG_STATIC png_uint_32
+static png_uint_32
 png_exp(png_fixed_point x)
 {
    if (x > 0 && x <= 0xfffff) /* Else overflow or zero (underflow) */
@@ -2431,7 +3573,7 @@ png_exp(png_fixed_point x)
    return 0;
 }
 
-PNG_STATIC png_byte
+static png_byte
 png_exp8bit(png_fixed_point lg2)
 {
    /* Get a 32-bit value: */
@@ -2445,7 +3587,7 @@ png_exp8bit(png_fixed_point lg2)
    return (png_byte)((x + 0x7fffffU) >> 24);
 }
 
-PNG_STATIC png_uint_16
+static png_uint_16
 png_exp16bit(png_fixed_point lg2)
 {
    /* Get a 32-bit value: */
@@ -2509,7 +3651,7 @@ png_gamma_16bit_correct(unsigned int value, png_fixed_point gamma_val)
  * 8-bit (as are the arguments.)
  */
 png_uint_16 /* PRIVATE */
-png_gamma_correct(png_structp png_ptr, unsigned int value,
+png_gamma_correct(png_structrp png_ptr, unsigned int value,
     png_fixed_point gamma_val)
 {
    if (png_ptr->bit_depth == 8)
@@ -2519,18 +3661,8 @@ png_gamma_correct(png_structp png_ptr, unsigned int value,
       return png_gamma_16bit_correct(value, gamma_val);
 }
 
-/* This is the shared test on whether a gamma value is 'significant' - whether
- * it is worth doing gamma correction.
- */
-int /* PRIVATE */
-png_gamma_significant(png_fixed_point gamma_val)
-{
-   return gamma_val < PNG_FP_1 - PNG_GAMMA_THRESHOLD_FIXED ||
-       gamma_val > PNG_FP_1 + PNG_GAMMA_THRESHOLD_FIXED;
-}
-
 /* Internal function to build a single 16-bit table - the table consists of
- * 'num' 256-entry subtables, where 'num' is determined by 'shift' - the amount
+ * 'num' 256 entry subtables, where 'num' is determined by 'shift' - the amount
  * to shift the input values right (or 16-number_of_signifiant_bits).
  *
  * The caller is responsible for ensuring that the table gets cleaned up on
@@ -2538,7 +3670,7 @@ png_gamma_significant(png_fixed_point gamma_val)
  * should be somewhere that will be cleaned.
  */
 static void
-png_build_16bit_table(png_structp png_ptr, png_uint_16pp *ptable,
+png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable,
    PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val)
 {
    /* Various values derived from 'shift': */
@@ -2548,12 +3680,12 @@ png_build_16bit_table(png_structp png_ptr, png_uint_16pp *ptable,
    unsigned int i;
 
    png_uint_16pp table = *ptable =
-       (png_uint_16pp)png_calloc(png_ptr, num * png_sizeof(png_uint_16p));
+       (png_uint_16pp)png_calloc(png_ptr, num * (sizeof (png_uint_16p)));
 
    for (i = 0; i < num; i++)
    {
       png_uint_16p sub_table = table[i] =
-          (png_uint_16p)png_malloc(png_ptr, 256 * png_sizeof(png_uint_16));
+          (png_uint_16p)png_malloc(png_ptr, 256 * (sizeof (png_uint_16)));
 
       /* The 'threshold' test is repeated here because it can arise for one of
        * the 16-bit tables even if the others don't hit it.
@@ -2606,7 +3738,7 @@ png_build_16bit_table(png_structp png_ptr, png_uint_16pp *ptable,
  * required.
  */
 static void
-png_build_16to8_table(png_structp png_ptr, png_uint_16pp *ptable,
+png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable,
    PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val)
 {
    PNG_CONST unsigned int num = 1U << (8U - shift);
@@ -2615,15 +3747,15 @@ png_build_16to8_table(png_structp png_ptr, png_uint_16pp *ptable,
    png_uint_32 last;
 
    png_uint_16pp table = *ptable =
-       (png_uint_16pp)png_calloc(png_ptr, num * png_sizeof(png_uint_16p));
+       (png_uint_16pp)png_calloc(png_ptr, num * (sizeof (png_uint_16p)));
 
-   /* 'num' is the number of tables and also the number of low bits of the
-    * input 16-bit value used to select a table.  Each table is itself indexed
-    * by the high 8 bits of the value.
+   /* 'num' is the number of tables and also the number of low bits of low
+    * bits of the input 16-bit value used to select a table.  Each table is
+    * itself index by the high 8 bits of the value.
     */
    for (i = 0; i < num; i++)
       table[i] = (png_uint_16p)png_malloc(png_ptr,
-          256 * png_sizeof(png_uint_16));
+          256 * (sizeof (png_uint_16)));
 
    /* 'gamma_val' is set to the reciprocal of the value calculated above, so
     * pow(out,g) is an *input* value.  'last' is the last input value set.
@@ -2670,10 +3802,10 @@ png_build_16to8_table(png_structp png_ptr, png_uint_16pp *ptable,
 
 /* Build a single 8-bit table: same as the 16-bit case but much simpler (and
  * typically much faster).  Note that libpng currently does no sBIT processing
- * (apparently contrary to the spec) so a 256-entry table is always generated.
+ * (apparently contrary to the spec) so a 256 entry table is always generated.
  */
 static void
-png_build_8bit_table(png_structp png_ptr, png_bytepp ptable,
+png_build_8bit_table(png_structrp png_ptr, png_bytepp ptable,
    PNG_CONST png_fixed_point gamma_val)
 {
    unsigned int i;
@@ -2690,7 +3822,7 @@ png_build_8bit_table(png_structp png_ptr, png_bytepp ptable,
  * tables.
  */
 void /* PRIVATE */
-png_destroy_gamma_table(png_structp png_ptr)
+png_destroy_gamma_table(png_structrp png_ptr)
 {
    png_free(png_ptr, png_ptr->gamma_table);
    png_ptr->gamma_table = NULL;
@@ -2746,7 +3878,7 @@ png_destroy_gamma_table(png_structp png_ptr)
  * we don't need to allocate > 64K chunks for a full 16-bit table.
  */
 void /* PRIVATE */
-png_build_gamma_table(png_structp png_ptr, int bit_depth)
+png_build_gamma_table(png_structrp png_ptr, int bit_depth)
 {
   png_debug(1, "in png_build_gamma_table");
 
@@ -2765,7 +3897,7 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
   if (bit_depth <= 8)
   {
      png_build_8bit_table(png_ptr, &png_ptr->gamma_table,
-         png_ptr->screen_gamma > 0 ?  png_reciprocal2(png_ptr->gamma,
+         png_ptr->screen_gamma > 0 ?  png_reciprocal2(png_ptr->colorspace.gamma,
          png_ptr->screen_gamma) : PNG_FP_1);
 
 #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
@@ -2774,11 +3906,11 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
      if (png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY))
      {
         png_build_8bit_table(png_ptr, &png_ptr->gamma_to_1,
-            png_reciprocal(png_ptr->gamma));
+            png_reciprocal(png_ptr->colorspace.gamma));
 
         png_build_8bit_table(png_ptr, &png_ptr->gamma_from_1,
             png_ptr->screen_gamma > 0 ?  png_reciprocal(png_ptr->screen_gamma) :
-            png_ptr->gamma/* Probably doing rgb_to_gray */);
+            png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */);
      }
 #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */
   }
@@ -2806,7 +3938,7 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
       * Where 'iv' is the input color value and 'ov' is the output value -
       * pow(iv, gamma).
       *
-      * Thus the gamma table consists of up to 256 256-entry tables.  The table
+      * Thus the gamma table consists of up to 256 256 entry tables.  The table
       * is selected by the (8-gamma_shift) most significant of the low 8 bits of
       * the color value then indexed by the upper 8 bits:
       *
@@ -2847,13 +3979,13 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
      if (png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8))
 #endif
          png_build_16to8_table(png_ptr, &png_ptr->gamma_16_table, shift,
-         png_ptr->screen_gamma > 0 ? png_product2(png_ptr->gamma,
+         png_ptr->screen_gamma > 0 ? png_product2(png_ptr->colorspace.gamma,
          png_ptr->screen_gamma) : PNG_FP_1);
 
 #ifdef PNG_16BIT_SUPPORTED
      else
          png_build_16bit_table(png_ptr, &png_ptr->gamma_16_table, shift,
-         png_ptr->screen_gamma > 0 ? png_reciprocal2(png_ptr->gamma,
+         png_ptr->screen_gamma > 0 ? png_reciprocal2(png_ptr->colorspace.gamma,
          png_ptr->screen_gamma) : PNG_FP_1);
 #endif
 
@@ -2863,7 +3995,7 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
      if (png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY))
      {
         png_build_16bit_table(png_ptr, &png_ptr->gamma_16_to_1, shift,
-            png_reciprocal(png_ptr->gamma));
+            png_reciprocal(png_ptr->colorspace.gamma));
 
         /* Notice that the '16 from 1' table should be full precision, however
          * the lookup on this table still uses gamma_shift, so it can't be.
@@ -2871,10 +4003,270 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
          */
         png_build_16bit_table(png_ptr, &png_ptr->gamma_16_from_1, shift,
             png_ptr->screen_gamma > 0 ? png_reciprocal(png_ptr->screen_gamma) :
-            png_ptr->gamma/* Probably doing rgb_to_gray */);
+            png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */);
      }
 #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */
   }
 }
 #endif /* READ_GAMMA */
+
+/* sRGB support */
+#if defined PNG_SIMPLIFIED_READ_SUPPORTED ||\
+   defined PNG_SIMPLIFIED_WRITE_SUPPORTED
+/* sRGB conversion tables; these are machine generated with the code in
+ * contrib/tools/makesRGB.c.  The actual sRGB transfer curve defined in the
+ * specification (see the article at http://en.wikipedia.org/wiki/SRGB)
+ * is used, not the gamma=1/2.2 approximation use elsewhere in libpng.
+ * The sRGB to linear table is exact (to the nearest 16 bit linear fraction).
+ * The inverse (linear to sRGB) table has accuracies as follows:
+ *
+ * For all possible (255*65535+1) input values:
+ *
+ *    error: -0.515566 - 0.625971, 79441 (0.475369%) of readings inexact
+ *
+ * For the input values corresponding to the 65536 16-bit values:
+ *
+ *    error: -0.513727 - 0.607759, 308 (0.469978%) of readings inexact
+ *
+ * In all cases the inexact readings are off by one.
+ */
+
+#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
+/* The convert-to-sRGB table is only currently required for read. */
+const png_uint_16 png_sRGB_table[256] =
+{
+   0,20,40,60,80,99,119,139,
+   159,179,199,219,241,264,288,313,
+   340,367,396,427,458,491,526,562,
+   599,637,677,718,761,805,851,898,
+   947,997,1048,1101,1156,1212,1270,1330,
+   1391,1453,1517,1583,1651,1720,1790,1863,
+   1937,2013,2090,2170,2250,2333,2418,2504,
+   2592,2681,2773,2866,2961,3058,3157,3258,
+   3360,3464,3570,3678,3788,3900,4014,4129,
+   4247,4366,4488,4611,4736,4864,4993,5124,
+   5257,5392,5530,5669,5810,5953,6099,6246,
+   6395,6547,6700,6856,7014,7174,7335,7500,
+   7666,7834,8004,8177,8352,8528,8708,8889,
+   9072,9258,9445,9635,9828,10022,10219,10417,
+   10619,10822,11028,11235,11446,11658,11873,12090,
+   12309,12530,12754,12980,13209,13440,13673,13909,
+   14146,14387,14629,14874,15122,15371,15623,15878,
+   16135,16394,16656,16920,17187,17456,17727,18001,
+   18277,18556,18837,19121,19407,19696,19987,20281,
+   20577,20876,21177,21481,21787,22096,22407,22721,
+   23038,23357,23678,24002,24329,24658,24990,25325,
+   25662,26001,26344,26688,27036,27386,27739,28094,
+   28452,28813,29176,29542,29911,30282,30656,31033,
+   31412,31794,32179,32567,32957,33350,33745,34143,
+   34544,34948,35355,35764,36176,36591,37008,37429,
+   37852,38278,38706,39138,39572,40009,40449,40891,
+   41337,41785,42236,42690,43147,43606,44069,44534,
+   45002,45473,45947,46423,46903,47385,47871,48359,
+   48850,49344,49841,50341,50844,51349,51858,52369,
+   52884,53401,53921,54445,54971,55500,56032,56567,
+   57105,57646,58190,58737,59287,59840,60396,60955,
+   61517,62082,62650,63221,63795,64372,64952,65535
+};
+
+#endif /* simplified read only */
+
+/* The base/delta tables are required for both read and write (but currently
+ * only the simplified versions.)
+ */
+const png_uint_16 png_sRGB_base[512] =
+{
+   128,1782,3383,4644,5675,6564,7357,8074,
+   8732,9346,9921,10463,10977,11466,11935,12384,
+   12816,13233,13634,14024,14402,14769,15125,15473,
+   15812,16142,16466,16781,17090,17393,17690,17981,
+   18266,18546,18822,19093,19359,19621,19879,20133,
+   20383,20630,20873,21113,21349,21583,21813,22041,
+   22265,22487,22707,22923,23138,23350,23559,23767,
+   23972,24175,24376,24575,24772,24967,25160,25352,
+   25542,25730,25916,26101,26284,26465,26645,26823,
+   27000,27176,27350,27523,27695,27865,28034,28201,
+   28368,28533,28697,28860,29021,29182,29341,29500,
+   29657,29813,29969,30123,30276,30429,30580,30730,
+   30880,31028,31176,31323,31469,31614,31758,31902,
+   32045,32186,32327,32468,32607,32746,32884,33021,
+   33158,33294,33429,33564,33697,33831,33963,34095,
+   34226,34357,34486,34616,34744,34873,35000,35127,
+   35253,35379,35504,35629,35753,35876,35999,36122,
+   36244,36365,36486,36606,36726,36845,36964,37083,
+   37201,37318,37435,37551,37668,37783,37898,38013,
+   38127,38241,38354,38467,38580,38692,38803,38915,
+   39026,39136,39246,39356,39465,39574,39682,39790,
+   39898,40005,40112,40219,40325,40431,40537,40642,
+   40747,40851,40955,41059,41163,41266,41369,41471,
+   41573,41675,41777,41878,41979,42079,42179,42279,
+   42379,42478,42577,42676,42775,42873,42971,43068,
+   43165,43262,43359,43456,43552,43648,43743,43839,
+   43934,44028,44123,44217,44311,44405,44499,44592,
+   44685,44778,44870,44962,45054,45146,45238,45329,
+   45420,45511,45601,45692,45782,45872,45961,46051,
+   46140,46229,46318,46406,46494,46583,46670,46758,
+   46846,46933,47020,47107,47193,47280,47366,47452,
+   47538,47623,47709,47794,47879,47964,48048,48133,
+   48217,48301,48385,48468,48552,48635,48718,48801,
+   48884,48966,49048,49131,49213,49294,49376,49458,
+   49539,49620,49701,49782,49862,49943,50023,50103,
+   50183,50263,50342,50422,50501,50580,50659,50738,
+   50816,50895,50973,51051,51129,51207,51285,51362,
+   51439,51517,51594,51671,51747,51824,51900,51977,
+   52053,52129,52205,52280,52356,52432,52507,52582,
+   52657,52732,52807,52881,52956,53030,53104,53178,
+   53252,53326,53400,53473,53546,53620,53693,53766,
+   53839,53911,53984,54056,54129,54201,54273,54345,
+   54417,54489,54560,54632,54703,54774,54845,54916,
+   54987,55058,55129,55199,55269,55340,55410,55480,
+   55550,55620,55689,55759,55828,55898,55967,56036,
+   56105,56174,56243,56311,56380,56448,56517,56585,
+   56653,56721,56789,56857,56924,56992,57059,57127,
+   57194,57261,57328,57395,57462,57529,57595,57662,
+   57728,57795,57861,57927,57993,58059,58125,58191,
+   58256,58322,58387,58453,58518,58583,58648,58713,
+   58778,58843,58908,58972,59037,59101,59165,59230,
+   59294,59358,59422,59486,59549,59613,59677,59740,
+   59804,59867,59930,59993,60056,60119,60182,60245,
+   60308,60370,60433,60495,60558,60620,60682,60744,
+   60806,60868,60930,60992,61054,61115,61177,61238,
+   61300,61361,61422,61483,61544,61605,61666,61727,
+   61788,61848,61909,61969,62030,62090,62150,62211,
+   62271,62331,62391,62450,62510,62570,62630,62689,
+   62749,62808,62867,62927,62986,63045,63104,63163,
+   63222,63281,63340,63398,63457,63515,63574,63632,
+   63691,63749,63807,63865,63923,63981,64039,64097,
+   64155,64212,64270,64328,64385,64443,64500,64557,
+   64614,64672,64729,64786,64843,64900,64956,65013,
+   65070,65126,65183,65239,65296,65352,65409,65465
+};
+
+const png_byte png_sRGB_delta[512] =
+{
+   207,201,158,129,113,100,90,82,77,72,68,64,61,59,56,54,
+   52,50,49,47,46,45,43,42,41,40,39,39,38,37,36,36,
+   35,34,34,33,33,32,32,31,31,30,30,30,29,29,28,28,
+   28,27,27,27,27,26,26,26,25,25,25,25,24,24,24,24,
+   23,23,23,23,23,22,22,22,22,22,22,21,21,21,21,21,
+   21,20,20,20,20,20,20,20,20,19,19,19,19,19,19,19,
+   19,18,18,18,18,18,18,18,18,18,18,17,17,17,17,17,
+   17,17,17,17,17,17,16,16,16,16,16,16,16,16,16,16,
+   16,16,16,16,15,15,15,15,15,15,15,15,15,15,15,15,
+   15,15,15,15,14,14,14,14,14,14,14,14,14,14,14,14,
+   14,14,14,14,14,14,14,13,13,13,13,13,13,13,13,13,
+   13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,12,
+   12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+   12,12,12,12,12,12,12,12,12,12,12,12,11,11,11,11,
+   11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+   11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+   11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+   10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+   10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+   10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+   9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+   9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+   9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+   9,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+   8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+   8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+   8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+   8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+   8,8,8,8,8,8,8,8,8,7,7,7,7,7,7,7,
+   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
+};
+#endif /* SIMPLIFIED READ/WRITE sRGB support */
+
+/* SIMPLIFIED READ/WRITE SUPPORT */
+#if defined PNG_SIMPLIFIED_READ_SUPPORTED ||\
+   defined PNG_SIMPLIFIED_WRITE_SUPPORTED
+static int
+png_image_free_function(png_voidp argument)
+{
+   png_imagep image = png_voidcast(png_imagep, argument);
+   png_controlp cp = image->opaque;
+   png_control c;
+
+   /* Double check that we have a png_ptr - it should be impossible to get here
+    * without one.
+    */
+   if (cp->png_ptr == NULL)
+      return 0;
+
+   /* First free any data held in the control structure. */
+#  ifdef PNG_STDIO_SUPPORTED
+      if (cp->owned_file)
+      {
+         FILE *fp = png_voidcast(FILE*, cp->png_ptr->io_ptr);
+         cp->owned_file = 0;
+
+         /* Ignore errors here. */
+         if (fp != NULL)
+         {
+            cp->png_ptr->io_ptr = NULL;
+            (void)fclose(fp);
+         }
+      }
+#  endif
+
+   /* Copy the control structure so that the original, allocated, version can be
+    * safely freed.  Notice that a png_error here stops the remainder of the
+    * cleanup, but this is probably fine because that would indicate bad memory
+    * problems anyway.
+    */
+   c = *cp;
+   image->opaque = &c;
+   png_free(c.png_ptr, cp);
+
+   /* Then the structures, calling the correct API. */
+   if (c.for_write)
+   {
+#     ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED
+         png_destroy_write_struct(&c.png_ptr, &c.info_ptr);
+#     else
+         png_error(c.png_ptr, "simplified write not supported");
+#     endif
+   }
+   else
+   {
+#     ifdef PNG_SIMPLIFIED_READ_SUPPORTED
+         png_destroy_read_struct(&c.png_ptr, &c.info_ptr, NULL);
+#     else
+         png_error(c.png_ptr, "simplified read not supported");
+#     endif
+   }
+
+   /* Success. */
+   return 1;
+}
+
+void PNGAPI
+png_image_free(png_imagep image)
+{
+   /* Safely call the real function, but only if doing so is safe at this point
+    * (if not inside an error handling context).  Otherwise assume
+    * png_safe_execute will call this API after the return.
+    */
+   if (image != NULL && image->opaque != NULL &&
+      image->opaque->error_buf == NULL)
+   {
+      /* Ignore errors here: */
+      (void)png_safe_execute(image, png_image_free_function, image);
+      image->opaque = NULL;
+   }
+}
+
+int /* PRIVATE */
+png_image_error(png_imagep image, png_const_charp error_message)
+{
+   /* Utility to log an error. */
+   png_safecat(image->message, (sizeof image->message), 0, error_message);
+   image->warning_or_error |= PNG_IMAGE_ERROR;
+   png_image_free(image);
+   return 0;
+}
+
+#endif /* SIMPLIFIED READ/WRITE */
 #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
index a08966476112c86b50571152b5ba22c59280cd7b..448fe88cdb572af0e73ace74a1fc9ecb3f88b088 100644 (file)
@@ -1,7 +1,7 @@
 
 /* png.h - header file for PNG reference library
  *
- * libpng version 1.5.14 - January 24, 2013
+ * libpng version 1.6.0 - February 14, 2013
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -11,7 +11,7 @@
  * Authors and maintainers:
  *   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
  *   libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
- *   libpng versions 0.97, January 1998, through 1.5.14 - January 24, 2013: Glenn
+ *   libpng versions 0.97, January 1998, through 1.6.0 - February 14, 2013: Glenn
  *   See also "Contributing Authors", below.
  *
  * Note about libpng version numbers:
  *    1.5.7beta01-05          15    10507  15.so.15.7[.0]
  *    1.5.7rc01-03            15    10507  15.so.15.7[.0]
  *    1.5.7                   15    10507  15.so.15.7[.0]
- *    1.5.8beta01             15    10508  15.so.15.8[.0]
- *    1.5.8rc01               15    10508  15.so.15.8[.0]
- *    1.5.8                   15    10508  15.so.15.8[.0]
- *    1.5.9beta01-02          15    10509  15.so.15.9[.0]
- *    1.5.9rc01               15    10509  15.so.15.9[.0]
- *    1.5.9                   15    10509  15.so.15.9[.0]
- *    1.5.10beta01-05         15    10510  15.so.15.10[.0]
- *    1.5.10                  15    10510  15.so.15.10[.0]
- *    1.5.11beta01            15    10511  15.so.15.11[.0]
- *    1.5.11rc01-05           15    10511  15.so.15.11[.0]
- *    1.5.11                  15    10511  15.so.15.11[.0]
- *    1.5.12                  15    10512  15.so.15.12[.0]
- *    1.5.13beta01-02         15    10513  15.so.15.13[.0]
- *    1.5.13rc01              15    10513  15.so.15.13[.0]
- *    1.5.13                  15    10513  15.so.15.13[.0]
- *    1.5.14beta01-08         15    10514  15.so.15.14[.0]
- *    1.5.14rc01-03           15    10514  15.so.15.14[.0]
- *    1.5.14                  15    10514  15.so.15.14[.0]
+ *    1.6.0beta01-40          16    10600  16.so.16.0[.0]
+ *    1.6.0rc01-08            16    10600  16.so.16.0[.0]
+ *    1.6.0                   16    10600  16.so.16.0[.0]
  *
  *   Henceforth the source version will match the shared-library major
  *   and minor numbers; the shared-library major version number will be
  *
  * This code is released under the libpng license.
  *
- * libpng versions 1.2.6, August 15, 2004, through 1.5.14, January 24, 2013, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.6.0, February 14, 2013, are
  * Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
  * distributed according to the same disclaimer and license as libpng-1.2.5
  * with the following individual added to the list of Contributing Authors:
  * Y2K compliance in libpng:
  * =========================
  *
- *    January 24, 2013
+ *    February 14, 2013
  *
  *    Since the PNG Development group is an ad-hoc body, we can't make
  *    an official declaration.
  *
  *    This is your unofficial assurance that libpng from version 0.71 and
- *    upward through 1.5.14 are Y2K compliant.  It is my belief that
+ *    upward through 1.6.0 are Y2K compliant.  It is my belief that
  *    earlier versions were also Y2K compliant.
  *
  *    Libpng only has two year fields.  One is a 2-byte unsigned integer
- *    that will hold years up to 65535.  The other holds the date in text
- *    format, and will hold years up to 9999.
+ *    that will hold years up to 65535.  The other, which is deprecated,
+ *    holds the date in text format, and will hold years up to 9999.
  *
  *    The integer is
  *        "png_uint_16 year" in png_time_struct.
  *
  *    The string is
- *        "char time_buffer[29]" in png_struct.  This will be no
- *    longer used in libpng-1.6.0 and will be removed from libpng-1.7.0.
+ *        "char time_buffer[29]" in png_struct.  This is no longer used
+ *    in libpng-1.6.x and will be removed from libpng-1.7.0.
  *
  *    There are seven time-related functions:
- *        png.c: png_convert_to_rfc_1123() in png.c
- *          (formerly png_convert_to_rfc_1152() in error)
+ *        png.c: png_convert_to_rfc_1123_buffer() in png.c
+ *          (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and
+ *          png_convert_to_rfc_1152() in error prior to libpng-0.98)
  *        png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
  *        png_convert_from_time_t() in pngwrite.c
  *        png_get_tIME() in pngget.c
  *    All handle dates properly in a Y2K environment.  The
  *    png_convert_from_time_t() function calls gmtime() to convert from system
  *    clock time, which returns (year - 1900), which we properly convert to
- *    the full 4-digit year.  There is a possibility that applications using
- *    libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
+ *    the full 4-digit year.  There is a possibility that libpng applications
+ *    are not passing 4-digit years into the png_convert_to_rfc_1123_buffer()
  *    function, or that they are incorrectly passing only a 2-digit year
  *    instead of "year - 1900" into the png_convert_from_struct_tm() function,
  *    but this is not under our control.  The libpng documentation has always
  */
 
 /* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.5.14"
+#define PNG_LIBPNG_VER_STRING "1.6.0"
 #define PNG_HEADER_VERSION_STRING \
-     " libpng version 1.5.14 - January 24, 2013\n"
+     " libpng version 1.6.0 - February 14, 2013\n"
 
-#define PNG_LIBPNG_VER_SONUM   15
-#define PNG_LIBPNG_VER_DLLNUM  15
+#define PNG_LIBPNG_VER_SONUM   16
+#define PNG_LIBPNG_VER_DLLNUM  16
 
 /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
 #define PNG_LIBPNG_VER_MAJOR   1
-#define PNG_LIBPNG_VER_MINOR   5
-#define PNG_LIBPNG_VER_RELEASE 14
+#define PNG_LIBPNG_VER_MINOR   6
+#define PNG_LIBPNG_VER_RELEASE 0
 
 /* This should match the numeric part of the final component of
  * PNG_LIBPNG_VER_STRING, omitting any leading zero:
  * version 1.0.0 was mis-numbered 100 instead of 10000).  From
  * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release
  */
-#define PNG_LIBPNG_VER 10514 /* 1.5.14 */
+#define PNG_LIBPNG_VER 10600 /* 1.6.0 */
 
 /* Library configuration: these options cannot be changed after
  * the library has been built.
 #endif
 
 #ifndef PNG_VERSION_INFO_ONLY
-#  ifndef PNG_BUILDING_SYMBOL_TABLE
-  /*
-   *   Standard header files (not needed for the version info or while
-   *   building symbol table -- see scripts/pnglibconf.dfa)
-   */
-#    ifdef PNG_SETJMP_SUPPORTED
-#      include <setjmp.h>
-#    endif
-
-    /* Need the time information for converting tIME chunks, it
-     * defines struct tm:
-     */
-#    ifdef PNG_CONVERT_tIME_SUPPORTED
-       /* "time.h" functions are not supported on all operating systems */
-#      include <time.h>
-#    endif
-#  endif
-
-/* Machine specific configuration. */
+   /* Machine specific configuration. */
 #  include "pngconf.h"
 #endif
 
@@ -513,6 +481,7 @@ extern "C" {
  * 2. Type definitions (base types are defined in pngconf.h), structure
  *    definitions.
  * 3. Exported library functions.
+ * 4. Simplified API.
  *
  * The library source code has additional files (principally pngpriv.h) that
  * allow configuration of the library.
@@ -555,7 +524,48 @@ extern "C" {
 /* This triggers a compiler error in png.c, if png.c and png.h
  * do not agree upon the version number.
  */
-typedef char* png_libpng_version_1_5_14;
+typedef char* png_libpng_version_1_6_0;
+
+/* Basic control structions.  Read libpng-manual.txt or libpng.3 for more info.
+ *
+ * png_struct is the cache of information used while reading or writing a single
+ * PNG file.  One of these is always required, although the simplified API
+ * (below) hides the creation and destruction of it.
+ */
+typedef struct png_struct_def png_struct;
+typedef const png_struct * png_const_structp;
+typedef png_struct * png_structp;
+typedef png_struct * * png_structpp;
+
+/* png_info contains information read from or to be written to a PNG file.  One
+ * or more of these must exist while reading or creating a PNG file.  The
+ * information is not used by libpng during read but is used to control what
+ * gets written when a PNG file is created.  "png_get_" function calls read
+ * information during read and "png_set_" functions calls write information
+ * when creating a PNG.
+ * been moved into a separate header file that is not accessible to
+ * applications.  Read libpng-manual.txt or libpng.3 for more info.
+ */
+typedef struct png_info_def png_info;
+typedef png_info * png_infop;
+typedef const png_info * png_const_infop;
+typedef png_info * * png_infopp;
+
+/* Types with names ending 'p' are pointer types.  The corresponding types with
+ * names ending 'rp' are identical pointer types except that the pointer is
+ * marked 'restrict', which means that it is the only pointer to the object
+ * passed to the function.  Applications should not use the 'restrict' types;
+ * it is always valid to pass 'p' to a pointer with a function argument of the
+ * corresponding 'rp' type.  Different compilers have different rules with
+ * regard to type matching in the presence of 'restrict'.  For backward
+ * compatibility libpng callbacks never have 'restrict' in their parameters and,
+ * consequentially, writing portable application code is extremely difficult if
+ * an attempt is made to use 'restrict'.
+ */
+typedef png_struct * PNG_RESTRICT png_structrp;
+typedef const png_struct * PNG_RESTRICT png_const_structrp;
+typedef png_info * PNG_RESTRICT png_inforp;
+typedef const png_info * PNG_RESTRICT png_const_inforp;
 
 /* Three color definitions.  The order of the red, green, and blue, (and the
  * exact size) is not important, although the size of the fields need to
@@ -567,9 +577,9 @@ typedef struct png_color_struct
    png_byte green;
    png_byte blue;
 } png_color;
-typedef png_color FAR * png_colorp;
-typedef PNG_CONST png_color FAR * png_const_colorp;
-typedef png_color FAR * FAR * png_colorpp;
+typedef png_color * png_colorp;
+typedef const png_color * png_const_colorp;
+typedef png_color * * png_colorpp;
 
 typedef struct png_color_16_struct
 {
@@ -579,9 +589,9 @@ typedef struct png_color_16_struct
    png_uint_16 blue;
    png_uint_16 gray;  /* for use in grayscale files */
 } png_color_16;
-typedef png_color_16 FAR * png_color_16p;
-typedef PNG_CONST png_color_16 FAR * png_const_color_16p;
-typedef png_color_16 FAR * FAR * png_color_16pp;
+typedef png_color_16 * png_color_16p;
+typedef const png_color_16 * png_const_color_16p;
+typedef png_color_16 * * png_color_16pp;
 
 typedef struct png_color_8_struct
 {
@@ -591,9 +601,9 @@ typedef struct png_color_8_struct
    png_byte gray;  /* for use in grayscale files */
    png_byte alpha; /* for alpha channel files */
 } png_color_8;
-typedef png_color_8 FAR * png_color_8p;
-typedef PNG_CONST png_color_8 FAR * png_const_color_8p;
-typedef png_color_8 FAR * FAR * png_color_8pp;
+typedef png_color_8 * png_color_8p;
+typedef const png_color_8 * png_const_color_8p;
+typedef png_color_8 * * png_color_8pp;
 
 /*
  * The following two structures are used for the in-core representation
@@ -607,9 +617,9 @@ typedef struct png_sPLT_entry_struct
    png_uint_16 alpha;
    png_uint_16 frequency;
 } png_sPLT_entry;
-typedef png_sPLT_entry FAR * png_sPLT_entryp;
-typedef PNG_CONST png_sPLT_entry FAR * png_const_sPLT_entryp;
-typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp;
+typedef png_sPLT_entry * png_sPLT_entryp;
+typedef const png_sPLT_entry * png_const_sPLT_entryp;
+typedef png_sPLT_entry * * png_sPLT_entrypp;
 
 /*  When the depth of the sPLT palette is 8 bits, the color and alpha samples
  *  occupy the LSB of their respective members, and the MSB of each member
@@ -623,9 +633,9 @@ typedef struct png_sPLT_struct
    png_sPLT_entryp entries;  /* palette entries */
    png_int_32 nentries;      /* number of palette entries */
 } png_sPLT_t;
-typedef png_sPLT_t FAR * png_sPLT_tp;
-typedef PNG_CONST png_sPLT_t FAR * png_const_sPLT_tp;
-typedef png_sPLT_t FAR * FAR * png_sPLT_tpp;
+typedef png_sPLT_t * png_sPLT_tp;
+typedef const png_sPLT_t * png_const_sPLT_tp;
+typedef png_sPLT_t * * png_sPLT_tpp;
 
 #ifdef PNG_TEXT_SUPPORTED
 /* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,
@@ -662,9 +672,9 @@ typedef struct png_text_struct
    png_charp lang_key;     /* keyword translated UTF-8 string, 0 or more
                               chars or a NULL pointer */
 } png_text;
-typedef png_text FAR * png_textp;
-typedef PNG_CONST png_text FAR * png_const_textp;
-typedef png_text FAR * FAR * png_textpp;
+typedef png_text * png_textp;
+typedef const png_text * png_const_textp;
+typedef png_text * * png_textpp;
 #endif
 
 /* Supported compression types for text in PNG files (tEXt, and zTXt).
@@ -692,49 +702,44 @@ typedef struct png_time_struct
    png_byte minute;  /* minute of hour, 0 - 59 */
    png_byte second;  /* second of minute, 0 - 60 (for leap seconds) */
 } png_time;
-typedef png_time FAR * png_timep;
-typedef PNG_CONST png_time FAR * png_const_timep;
-typedef png_time FAR * FAR * png_timepp;
+typedef png_time * png_timep;
+typedef const png_time * png_const_timep;
+typedef png_time * * png_timepp;
 
-#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
-    defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
+#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
 /* png_unknown_chunk is a structure to hold queued chunks for which there is
  * no specific support.  The idea is that we can use this to queue
  * up private chunks for output even though the library doesn't actually
  * know about their semantics.
+ *
+ * The data in the structure is set by libpng on read and used on write.
  */
 typedef struct png_unknown_chunk_t
 {
-    png_byte name[5];
-    png_byte *data;
+    png_byte name[5]; /* Textual chunk name with '\0' terminator */
+    png_byte *data;   /* Data, should not be modified on read! */
     png_size_t size;
 
-    /* libpng-using applications should NOT directly modify this byte. */
+    /* On write 'location' must be set using the flag values listed below.
+     * Notice that on read it is set by libpng however the values stored have
+     * more bits set than are listed below.  Always treat the value as a
+     * bitmask.  On write set only one bit - setting multiple bits may cause the
+     * chunk to be written in multiple places.
+     */
     png_byte location; /* mode of operation at read time */
 }
-
-
 png_unknown_chunk;
-typedef png_unknown_chunk FAR * png_unknown_chunkp;
-typedef PNG_CONST png_unknown_chunk FAR * png_const_unknown_chunkp;
-typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp;
-#endif
 
-/* Values for the unknown chunk location byte */
+typedef png_unknown_chunk * png_unknown_chunkp;
+typedef const png_unknown_chunk * png_const_unknown_chunkp;
+typedef png_unknown_chunk * * png_unknown_chunkpp;
+#endif
 
+/* Flag values for the unknown chunk location byte. */
 #define PNG_HAVE_IHDR  0x01
 #define PNG_HAVE_PLTE  0x02
 #define PNG_AFTER_IDAT 0x08
 
-/* The complete definition of png_info has, as of libpng-1.5.0,
- * been moved into a separate header file that is not accessible to
- * applications.  Read libpng-manual.txt or libpng.3 for more info.
- */
-typedef struct png_info_def png_info;
-typedef png_info FAR * png_infop;
-typedef PNG_CONST png_info FAR * png_const_infop;
-typedef png_info FAR * FAR * png_infopp;
-
 /* Maximum positive integer used in PNG is (2^31)-1 */
 #define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
 #define PNG_UINT_32_MAX ((png_uint_32)(-1))
@@ -850,16 +855,8 @@ typedef struct png_row_info_struct
    png_byte pixel_depth; /* bits per pixel (depth * channels) */
 } png_row_info;
 
-typedef png_row_info FAR * png_row_infop;
-typedef png_row_info FAR * FAR * png_row_infopp;
-
-/* The complete definition of png_struct has, as of libpng-1.5.0,
- * been moved into a separate header file that is not accessible to
- * applications.  Read libpng-manual.txt or libpng.3 for more info.
- */
-typedef struct png_struct_def png_struct;
-typedef PNG_CONST png_struct FAR * png_const_structp;
-typedef png_struct FAR * png_structp;
+typedef png_row_info * png_row_infop;
+typedef png_row_info * * png_row_infopp;
 
 /* These are the function types for the I/O functions and for the functions
  * that allow the user to override the default I/O functions with his or her
@@ -906,7 +903,8 @@ typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,
     png_unknown_chunkp));
 #endif
 #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
-typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp));
+/* not used anywhere */
+/* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */
 #endif
 
 #ifdef PNG_SETJMP_SUPPORTED
@@ -962,8 +960,6 @@ typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp,
     png_alloc_size_t));
 typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp));
 
-typedef png_struct FAR * FAR * png_structpp;
-
 /* Section 3: exported functions
  * Here are the function definitions most commonly used.  This is not
  * the place to find out how to use libpng.  See libpng-manual.txt for the
@@ -999,7 +995,7 @@ PNG_EXPORT(1, png_uint_32, png_access_version_number, (void));
 /* Tell lib we have already handled the first <num_bytes> magic bytes.
  * Handling more than 8 bytes from the beginning of the file is an error.
  */
-PNG_EXPORT(2, void, png_set_sig_bytes, (png_structp png_ptr, int num_bytes));
+PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));
 
 /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
  * PNG file.  Returns zero if the supplied bytes match the 8-byte PNG
@@ -1027,9 +1023,9 @@ PNG_EXPORTA(5, png_structp, png_create_write_struct,
     PNG_ALLOCATED);
 
 PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 
-PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structp png_ptr,
+PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr,
     png_size_t size));
 
 /* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp
@@ -1043,10 +1039,10 @@ PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structp png_ptr,
  * allocated by the library - the call will return NULL on a mismatch
  * indicating an ABI mismatch.
  */
-PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structp png_ptr,
+PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr,
     png_longjmp_ptr longjmp_fn, size_t jmp_buf_size));
 #  define png_jmpbuf(png_ptr) \
-      (*png_set_longjmp_fn((png_ptr), longjmp, sizeof (jmp_buf)))
+      (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf))))
 #else
 #  define png_jmpbuf(png_ptr) \
       (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP)
@@ -1056,12 +1052,12 @@ PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structp png_ptr,
  * will use it; otherwise it will call PNG_ABORT().  This function was
  * added in libpng-1.5.0.
  */
-PNG_EXPORTA(9, void, png_longjmp, (png_structp png_ptr, int val),
+PNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val),
     PNG_NORETURN);
 
 #ifdef PNG_READ_SUPPORTED
 /* Reset the compression stream */
-PNG_EXPORT(10, int, png_reset_zstream, (png_structp png_ptr));
+PNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED);
 #endif
 
 /* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */
@@ -1079,81 +1075,92 @@ PNG_EXPORTA(12, png_structp, png_create_write_struct_2,
 #endif
 
 /* Write the PNG file signature. */
-PNG_EXPORT(13, void, png_write_sig, (png_structp png_ptr));
+PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr));
 
 /* Write a PNG chunk - size, type, (optional) data, CRC. */
-PNG_EXPORT(14, void, png_write_chunk, (png_structp png_ptr, png_const_bytep
+PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep
     chunk_name, png_const_bytep data, png_size_t length));
 
 /* Write the start of a PNG chunk - length and chunk name. */
-PNG_EXPORT(15, void, png_write_chunk_start, (png_structp png_ptr,
+PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,
     png_const_bytep chunk_name, png_uint_32 length));
 
 /* Write the data of a PNG chunk started with png_write_chunk_start(). */
-PNG_EXPORT(16, void, png_write_chunk_data, (png_structp png_ptr,
+PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr,
     png_const_bytep data, png_size_t length));
 
 /* Finish a chunk started with png_write_chunk_start() (includes CRC). */
-PNG_EXPORT(17, void, png_write_chunk_end, (png_structp png_ptr));
+PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr));
 
 /* Allocate and initialize the info structure */
-PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_structp png_ptr),
+PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr),
     PNG_ALLOCATED);
 
-PNG_EXPORT(19, void, png_info_init_3, (png_infopp info_ptr,
-    png_size_t png_info_struct_size));
+/* DEPRECATED: this function allowed init structures to be created using the
+ * default allocation method (typically malloc).  Use is deprecated in 1.6.0 and
+ * the API will be removed in the future.
+ */
+PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr,
+    png_size_t png_info_struct_size), PNG_DEPRECATED);
 
 /* Writes all the PNG information before the image. */
 PNG_EXPORT(20, void, png_write_info_before_PLTE,
-    (png_structp png_ptr, png_infop info_ptr));
+    (png_structrp png_ptr, png_const_inforp info_ptr));
 PNG_EXPORT(21, void, png_write_info,
-    (png_structp png_ptr, png_infop info_ptr));
+    (png_structrp png_ptr, png_const_inforp info_ptr));
 
 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 /* Read the information before the actual image data. */
 PNG_EXPORT(22, void, png_read_info,
-    (png_structp png_ptr, png_infop info_ptr));
+    (png_structrp png_ptr, png_inforp info_ptr));
 #endif
 
 #ifdef PNG_TIME_RFC1123_SUPPORTED
-PNG_EXPORT(23, png_const_charp, png_convert_to_rfc1123,
-    (png_structp png_ptr,
+   /* Convert to a US string format: there is no localization support in this
+    * routine.  The original implementation used a 29 character buffer in
+    * png_struct, this will be removed in future versions.
+    */
+#if PNG_LIBPNG_VER < 10700
+/* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */
+PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr,
+    png_const_timep ptime),PNG_DEPRECATED);
+#endif
+PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29],
     png_const_timep ptime));
 #endif
 
 #ifdef PNG_CONVERT_tIME_SUPPORTED
 /* Convert from a struct tm to png_time */
 PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime,
-    PNG_CONST struct tm FAR * ttime));
+    const struct tm * ttime));
 
 /* Convert from time_t to png_time.  Uses gmtime() */
-PNG_EXPORT(25, void, png_convert_from_time_t,
-    (png_timep ptime, time_t ttime));
+PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime));
 #endif /* PNG_CONVERT_tIME_SUPPORTED */
 
 #ifdef PNG_READ_EXPAND_SUPPORTED
 /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
-PNG_EXPORT(26, void, png_set_expand, (png_structp png_ptr));
-PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structp png_ptr));
-PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structp png_ptr));
-PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structp png_ptr));
+PNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr));
+PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr));
+PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr));
+PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr));
 #endif
 
 #ifdef PNG_READ_EXPAND_16_SUPPORTED
 /* Expand to 16-bit channels, forces conversion of palette to RGB and expansion
  * of a tRNS chunk if present.
  */
-PNG_EXPORT(221, void, png_set_expand_16, (png_structp png_ptr));
+PNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr));
 #endif
 
 #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
 /* Use blue, green, red order for pixels. */
-PNG_EXPORT(30, void, png_set_bgr, (png_structp png_ptr));
+PNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr));
 #endif
 
 #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
 /* Expand the grayscale to 24-bit RGB if necessary. */
-PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structp png_ptr));
+PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr));
 #endif
 
 #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
@@ -1163,12 +1170,12 @@ PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structp png_ptr));
 #define PNG_ERROR_ACTION_ERROR 3
 #define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/
 
-PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structp png_ptr,
+PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr,
     int error_action, double red, double green))
-PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structp png_ptr,
+PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr,
     int error_action, png_fixed_point red, png_fixed_point green))
 
-PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structp
+PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp
     png_ptr));
 #endif
 
@@ -1233,13 +1240,13 @@ PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
 #define PNG_ALPHA_OPTIMIZED     2 /* 'PNG' for opaque pixels, else 'STANDARD' */
 #define PNG_ALPHA_BROKEN        3 /* the alpha channel is gamma encoded */
 
-PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structp png_ptr, int mode,
+PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode,
     double output_gamma))
-PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structp png_ptr,
+PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,
     int mode, png_fixed_point output_gamma))
 #endif
 
-#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)
+#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)
 /* The output_gamma value is a screen gamma in libpng terminology: it expresses
  * how to decode the output values, not how they are encoded.  The values used
  * correspond to the normal numbers used to describe the overall gamma of a
@@ -1387,51 +1394,50 @@ PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structp png_ptr,
  */
 
 #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
-PNG_EXPORT(36, void, png_set_strip_alpha, (png_structp png_ptr));
+PNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr));
 #endif
 
 #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
     defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
-PNG_EXPORT(37, void, png_set_swap_alpha, (png_structp png_ptr));
+PNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr));
 #endif
 
 #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
     defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
-PNG_EXPORT(38, void, png_set_invert_alpha, (png_structp png_ptr));
+PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr));
 #endif
 
 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
 /* Add a filler byte to 8-bit Gray or 24-bit RGB images. */
-PNG_EXPORT(39, void, png_set_filler, (png_structp png_ptr, png_uint_32 filler,
+PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler,
     int flags));
 /* The values of the PNG_FILLER_ defines should NOT be changed */
 #  define PNG_FILLER_BEFORE 0
 #  define PNG_FILLER_AFTER 1
 /* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */
-PNG_EXPORT(40, void, png_set_add_alpha,
-    (png_structp png_ptr, png_uint_32 filler,
-    int flags));
+PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr,
+    png_uint_32 filler, int flags));
 #endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */
 
 #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
 /* Swap bytes in 16-bit depth files. */
-PNG_EXPORT(41, void, png_set_swap, (png_structp png_ptr));
+PNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr));
 #endif
 
 #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
 /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
-PNG_EXPORT(42, void, png_set_packing, (png_structp png_ptr));
+PNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr));
 #endif
 
 #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \
     defined(PNG_WRITE_PACKSWAP_SUPPORTED)
 /* Swap packing order of pixels in bytes. */
-PNG_EXPORT(43, void, png_set_packswap, (png_structp png_ptr));
+PNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr));
 #endif
 
 #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
 /* Converts files to legal bit depths. */
-PNG_EXPORT(44, void, png_set_shift, (png_structp png_ptr, png_const_color_8p
+PNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p
     true_bits));
 #endif
 
@@ -1443,12 +1449,12 @@ PNG_EXPORT(44, void, png_set_shift, (png_structp png_ptr, png_const_color_8p
  * necessary to call png_read_row or png_read_rows png_get_image_height
  * times for each pass.
 */
-PNG_EXPORT(45, int, png_set_interlace_handling, (png_structp png_ptr));
+PNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr));
 #endif
 
 #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
 /* Invert monochrome files */
-PNG_EXPORT(46, void, png_set_invert_mono, (png_structp png_ptr));
+PNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr));
 #endif
 
 #ifdef PNG_READ_BACKGROUND_SUPPORTED
@@ -1457,10 +1463,10 @@ PNG_EXPORT(46, void, png_set_invert_mono, (png_structp png_ptr));
  * read.  Doing so will result in unexpected behavior and possible warnings or
  * errors if the PNG file contains a bKGD chunk.
  */
-PNG_FP_EXPORT(47, void, png_set_background, (png_structp png_ptr,
+PNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr,
     png_const_color_16p background_color, int background_gamma_code,
     int need_expand, double background_gamma))
-PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structp png_ptr,
+PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr,
     png_const_color_16p background_color, int background_gamma_code,
     int need_expand, png_fixed_point background_gamma))
 #endif
@@ -1473,23 +1479,22 @@ PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structp png_ptr,
 
 #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
 /* Scale a 16-bit depth file down to 8-bit, accurately. */
-PNG_EXPORT(229, void, png_set_scale_16, (png_structp png_ptr));
+PNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr));
 #endif
 
 #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
 #define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */
 /* Strip the second byte of information from a 16-bit depth file. */
-PNG_EXPORT(48, void, png_set_strip_16, (png_structp png_ptr));
+PNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr));
 #endif
 
 #ifdef PNG_READ_QUANTIZE_SUPPORTED
 /* Turn on quantizing, and reduce the palette to the number of colors
  * available.
  */
-PNG_EXPORT(49, void, png_set_quantize,
-    (png_structp png_ptr, png_colorp palette,
-    int num_palette, int maximum_colors, png_const_uint_16p histogram,
-    int full_quantize));
+PNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr,
+    png_colorp palette, int num_palette, int maximum_colors,
+    png_const_uint_16p histogram, int full_quantize));
 #endif
 
 #ifdef PNG_READ_GAMMA_SUPPORTED
@@ -1509,71 +1514,69 @@ PNG_EXPORT(49, void, png_set_quantize,
  * API (floating point or fixed.)  Notice, however, that the 'file_gamma' value
  * is the inverse of a 'screen gamma' value.
  */
-PNG_FP_EXPORT(50, void, png_set_gamma,
-    (png_structp png_ptr, double screen_gamma,
-    double override_file_gamma))
-PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structp png_ptr,
+PNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr,
+    double screen_gamma, double override_file_gamma))
+PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr,
     png_fixed_point screen_gamma, png_fixed_point override_file_gamma))
 #endif
 
 #ifdef PNG_WRITE_FLUSH_SUPPORTED
 /* Set how many lines between output flushes - 0 for no flushing */
-PNG_EXPORT(51, void, png_set_flush, (png_structp png_ptr, int nrows));
+PNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows));
 /* Flush the current PNG output buffer */
-PNG_EXPORT(52, void, png_write_flush, (png_structp png_ptr));
+PNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr));
 #endif
 
 /* Optional update palette with requested transformations */
-PNG_EXPORT(53, void, png_start_read_image, (png_structp png_ptr));
+PNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr));
 
 /* Optional call to update the users info structure */
-PNG_EXPORT(54, void, png_read_update_info,
-    (png_structp png_ptr, png_infop info_ptr));
+PNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr,
+    png_inforp info_ptr));
 
 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 /* Read one or more rows of image data. */
-PNG_EXPORT(55, void, png_read_rows, (png_structp png_ptr, png_bytepp row,
+PNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row,
     png_bytepp display_row, png_uint_32 num_rows));
 #endif
 
 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 /* Read a row of data. */
-PNG_EXPORT(56, void, png_read_row, (png_structp png_ptr, png_bytep row,
+PNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row,
     png_bytep display_row));
 #endif
 
 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 /* Read the whole image into memory at once. */
-PNG_EXPORT(57, void, png_read_image, (png_structp png_ptr, png_bytepp image));
+PNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image));
 #endif
 
 /* Write a row of image data */
-PNG_EXPORT(58, void, png_write_row,
-    (png_structp png_ptr, png_const_bytep row));
+PNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr,
+    png_const_bytep row));
 
 /* Write a few rows of image data: (*row) is not written; however, the type
  * is declared as writeable to maintain compatibility with previous versions
  * of libpng and to allow the 'display_row' array from read_rows to be passed
  * unchanged to write_rows.
  */
-PNG_EXPORT(59, void, png_write_rows, (png_structp png_ptr, png_bytepp row,
+PNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row,
     png_uint_32 num_rows));
 
 /* Write the image data */
-PNG_EXPORT(60, void, png_write_image,
-    (png_structp png_ptr, png_bytepp image));
+PNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image));
 
 /* Write the end of the PNG file. */
-PNG_EXPORT(61, void, png_write_end,
-    (png_structp png_ptr, png_infop info_ptr));
+PNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr,
+    png_inforp info_ptr));
 
 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 /* Read the end of the PNG file. */
-PNG_EXPORT(62, void, png_read_end, (png_structp png_ptr, png_infop info_ptr));
+PNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr));
 #endif
 
 /* Free any memory associated with the png_info_struct */
-PNG_EXPORT(63, void, png_destroy_info_struct, (png_structp png_ptr,
+PNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr,
     png_infopp info_ptr_ptr));
 
 /* Free any memory associated with the png_struct and the png_info_structs */
@@ -1585,8 +1588,8 @@ PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr,
     png_infopp info_ptr_ptr));
 
 /* Set the libpng method of handling chunk CRC errors */
-PNG_EXPORT(66, void, png_set_crc_action,
-    (png_structp png_ptr, int crit_action, int ancil_action));
+PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,
+    int ancil_action));
 
 /* Values for png_set_crc_action() say how to handle CRC errors in
  * ancillary and critical chunks, and whether to use the data contained
@@ -1615,8 +1618,8 @@ PNG_EXPORT(66, void, png_set_crc_action,
 /* Set the filtering method(s) used by libpng.  Currently, the only valid
  * value for "method" is 0.
  */
-PNG_EXPORT(67, void, png_set_filter,
-    (png_structp png_ptr, int method, int filters));
+PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method,
+    int filters));
 
 /* Flags for png_set_filter() to say which filters to use.  The flags
  * are chosen so that they don't conflict with real filter types
@@ -1671,13 +1674,13 @@ PNG_EXPORT(67, void, png_set_filter,
  * the weights and costs are set to 1.0, this degenerates the WEIGHTED method
  * to the UNWEIGHTED method, but with added encoding time/computation.
  */
-PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structp png_ptr,
+PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr,
     int heuristic_method, int num_weights, png_const_doublep filter_weights,
     png_const_doublep filter_costs))
 PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
-    (png_structp png_ptr,
-    int heuristic_method, int num_weights, png_const_fixed_point_p
-    filter_weights, png_const_fixed_point_p filter_costs))
+    (png_structrp png_ptr, int heuristic_method, int num_weights,
+    png_const_fixed_point_p filter_weights,
+    png_const_fixed_point_p filter_costs))
 #endif /*  PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
 
 /* Heuristic used for row filter selection.  These defines should NOT be
@@ -1696,43 +1699,43 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
  * for PNG images, and do considerably fewer caclulations.  In the future,
  * these values may not correspond directly to the zlib compression levels.
  */
-PNG_EXPORT(69, void, png_set_compression_level,
-    (png_structp png_ptr, int level));
+PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr,
+    int level));
 
-PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structp png_ptr,
+PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr,
     int mem_level));
 
-PNG_EXPORT(71, void, png_set_compression_strategy, (png_structp png_ptr,
+PNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr,
     int strategy));
 
 /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a
  * smaller value of window_bits if it can do so safely.
  */
-PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structp png_ptr,
+PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr,
     int window_bits));
 
-PNG_EXPORT(73, void, png_set_compression_method, (png_structp png_ptr,
+PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr,
     int method));
 #endif
 
 #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
 /* Also set zlib parameters for compressing non-IDAT chunks */
-PNG_EXPORT(222, void, png_set_text_compression_level,
-    (png_structp png_ptr, int level));
+PNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr,
+    int level));
 
-PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structp png_ptr,
+PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr,
     int mem_level));
 
-PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structp png_ptr,
+PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr,
     int strategy));
 
 /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a
  * smaller value of window_bits if it can do so safely.
  */
-PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structp
-    png_ptr, int window_bits));
+PNG_EXPORT(225, void, png_set_text_compression_window_bits,
+    (png_structrp png_ptr, int window_bits));
 
-PNG_EXPORT(226, void, png_set_text_compression_method, (png_structp png_ptr,
+PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr,
     int method));
 #endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
 
@@ -1747,7 +1750,7 @@ PNG_EXPORT(226, void, png_set_text_compression_method, (png_structp png_ptr,
 
 #ifdef PNG_STDIO_SUPPORTED
 /* Initialize the input/output for the PNG file to the default functions. */
-PNG_EXPORT(74, void, png_init_io, (png_structp png_ptr, png_FILE_p fp));
+PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp));
 #endif
 
 /* Replace the (error and abort), and warning functions with user
@@ -1758,12 +1761,11 @@ PNG_EXPORT(74, void, png_init_io, (png_structp png_ptr, png_FILE_p fp));
  * default function will be used.
  */
 
-PNG_EXPORT(75, void, png_set_error_fn,
-    (png_structp png_ptr, png_voidp error_ptr,
-    png_error_ptr error_fn, png_error_ptr warning_fn));
+PNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr,
+    png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));
 
 /* Return the user pointer associated with the error functions */
-PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structp png_ptr));
+PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr));
 
 /* Replace the default data output functions with a user supplied one(s).
  * If buffered output is not used, then output_flush_fn can be set to NULL.
@@ -1775,47 +1777,47 @@ PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structp png_ptr));
  * default flush function, which uses the standard *FILE structure, will
  * be used.
  */
-PNG_EXPORT(77, void, png_set_write_fn, (png_structp png_ptr, png_voidp io_ptr,
+PNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr,
     png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));
 
 /* Replace the default data input function with a user supplied one. */
-PNG_EXPORT(78, void, png_set_read_fn, (png_structp png_ptr, png_voidp io_ptr,
+PNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr,
     png_rw_ptr read_data_fn));
 
 /* Return the user pointer associated with the I/O functions */
-PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_structp png_ptr));
+PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr));
 
-PNG_EXPORT(80, void, png_set_read_status_fn, (png_structp png_ptr,
+PNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr,
     png_read_status_ptr read_row_fn));
 
-PNG_EXPORT(81, void, png_set_write_status_fn, (png_structp png_ptr,
+PNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr,
     png_write_status_ptr write_row_fn));
 
 #ifdef PNG_USER_MEM_SUPPORTED
 /* Replace the default memory allocation functions with user supplied one(s). */
-PNG_EXPORT(82, void, png_set_mem_fn, (png_structp png_ptr, png_voidp mem_ptr,
+PNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr,
     png_malloc_ptr malloc_fn, png_free_ptr free_fn));
 /* Return the user pointer associated with the memory functions */
-PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structp png_ptr));
+PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr));
 #endif
 
 #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
-PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structp png_ptr,
+PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr,
     png_user_transform_ptr read_user_transform_fn));
 #endif
 
 #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
-PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structp png_ptr,
+PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr,
     png_user_transform_ptr write_user_transform_fn));
 #endif
 
 #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
-PNG_EXPORT(86, void, png_set_user_transform_info, (png_structp png_ptr,
+PNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr,
     png_voidp user_transform_ptr, int user_transform_depth,
     int user_transform_channels));
 /* Return the user pointer associated with the user transform functions */
 PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 #endif
 
 #ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED
@@ -1830,31 +1832,53 @@ PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,
  * find the output pixel (x,y) given an interlaced sub-image pixel
  * (row,col,pass).  (See below for these macros.)
  */
-PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structp));
-PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structp));
+PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp));
+PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp));
 #endif
 
-#ifdef PNG_USER_CHUNKS_SUPPORTED
-PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structp png_ptr,
+#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
+/* This callback is called only for *unknown* chunks, if
+ * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known
+ * chunks to be treated as unknown, however in this case the callback must do
+ * any processing required by the chunk (e.g. by calling the appropriate
+ * png_set_ APIs.)
+ *
+ * There is no write support - on write, by default, all the chunks in the
+ * 'unknown' list are written in the specified position.
+ *
+ * The integer return from the callback function is interpreted thus:
+ *
+ * negative: An error occured, png_chunk_error will be called.
+ *     zero: The chunk was not handled, the chunk will be discarded unless
+ *           png_set_keep_unknown_chunks has been used to set a 'keep' behavior
+ *           for this particular chunk, in which case that will be used.  A
+ *           critical chunk will cause an error at this point unless it is to be
+ *           saved.
+ * positive: The chunk was handled, libpng will ignore/discard it.
+ */
+PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr,
     png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));
-PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structp png_ptr));
+#endif
+
+#ifdef PNG_USER_CHUNKS_SUPPORTED
+PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr));
 #endif
 
 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 /* Sets the function callbacks for the push reader, and a pointer to a
  * user-defined structure available to the callback functions.
  */
-PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structp png_ptr,
+PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr,
     png_voidp progressive_ptr, png_progressive_info_ptr info_fn,
     png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn));
 
 /* Returns the user pointer associated with the push read functions */
-PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, (png_const_structp png_ptr));
+PNG_EXPORT(91, png_voidp, png_get_progressive_ptr,
+    (png_const_structrp png_ptr));
 
 /* Function to be called when data becomes available */
-PNG_EXPORT(92, void, png_process_data,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_bytep buffer, png_size_t buffer_size));
+PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,
+    png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size));
 
 /* A function which may be called *only* within png_process_data to stop the
  * processing of any more data.  The function returns the number of bytes
@@ -1863,7 +1887,7 @@ PNG_EXPORT(92, void, png_process_data,
  * 'save' is set to true the routine will first save all the pending data and
  * will always return 0.
  */
-PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structp, int save));
+PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save));
 
 /* A function which may be called *only* outside (after) a call to
  * png_process_data.  It returns the number of bytes of data to skip in the
@@ -1871,7 +1895,7 @@ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structp, int save));
  * application must skip than number of bytes of input data and pass the
  * following data to the next call to png_process_data.
  */
-PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structp));
+PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp));
 
 #ifdef PNG_READ_INTERLACING_SUPPORTED
 /* Function that combines rows.  'new_row' is a flag that should come from
@@ -1879,34 +1903,37 @@ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structp));
  * stores its own version of the new data internally and ignores the passed
  * in value.
  */
-PNG_EXPORT(93, void, png_progressive_combine_row, (png_structp png_ptr,
+PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr,
     png_bytep old_row, png_const_bytep new_row));
 #endif /* PNG_READ_INTERLACING_SUPPORTED */
 #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 
-PNG_EXPORTA(94, png_voidp, png_malloc,
-    (png_structp png_ptr, png_alloc_size_t size),
-    PNG_ALLOCATED);
+PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr,
+    png_alloc_size_t size), PNG_ALLOCATED);
 /* Added at libpng version 1.4.0 */
-PNG_EXPORTA(95, png_voidp, png_calloc,
-    (png_structp png_ptr, png_alloc_size_t size),
-    PNG_ALLOCATED);
+PNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr,
+    png_alloc_size_t size), PNG_ALLOCATED);
 
 /* Added at libpng version 1.2.4 */
-PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_structp png_ptr,
+PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr,
     png_alloc_size_t size), PNG_ALLOCATED);
 
 /* Frees a pointer allocated by png_malloc() */
-PNG_EXPORT(97, void, png_free, (png_structp png_ptr, png_voidp ptr));
+PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr));
 
 /* Free data that was allocated internally */
-PNG_EXPORT(98, void, png_free_data,
-    (png_structp png_ptr, png_infop info_ptr, png_uint_32 free_me, int num));
+PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 free_me, int num));
 
 /* Reassign responsibility for freeing existing data, whether allocated
- * by libpng or by the application */
-PNG_EXPORT(99, void, png_data_freer,
-    (png_structp png_ptr, png_infop info_ptr, int freer, png_uint_32 mask));
+ * by libpng or by the application; this works on the png_info structure passed
+ * in, it does not change the state for other png_info structures.
+ *
+ * It is unlikely that this function works correctly as of 1.6.0 and using it
+ * may result either in memory leaks or double free of allocated data.
+ */
+PNG_EXPORTA(99, void, png_data_freer, (png_const_structrp png_ptr,
+    png_inforp info_ptr, int freer, png_uint_32 mask), PNG_DEPRECATED);
 
 /* Assignments for png_data_freer */
 #define PNG_DESTROY_WILL_FREE_DATA 1
@@ -1919,8 +1946,10 @@ PNG_EXPORT(99, void, png_data_freer,
 #define PNG_FREE_ROWS 0x0040
 #define PNG_FREE_PCAL 0x0080
 #define PNG_FREE_SCAL 0x0100
-#define PNG_FREE_UNKN 0x0200
-#define PNG_FREE_LIST 0x0400
+#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
+#  define PNG_FREE_UNKN 0x0200
+#endif
+/*      PNG_FREE_LIST 0x0400    removed in 1.6.0 because it is ignored */
 #define PNG_FREE_PLTE 0x1000
 #define PNG_FREE_TRNS 0x2000
 #define PNG_FREE_TEXT 0x4000
@@ -1928,50 +1957,50 @@ PNG_EXPORT(99, void, png_data_freer,
 #define PNG_FREE_MUL  0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
 
 #ifdef PNG_USER_MEM_SUPPORTED
-PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_structp png_ptr,
-    png_alloc_size_t size), PNG_ALLOCATED);
-PNG_EXPORT(101, void, png_free_default, (png_structp png_ptr, png_voidp ptr));
+PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr,
+    png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED);
+PNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr,
+    png_voidp ptr), PNG_DEPRECATED);
 #endif
 
 #ifdef PNG_ERROR_TEXT_SUPPORTED
 /* Fatal error in PNG image of libpng - can't continue */
-PNG_EXPORTA(102, void, png_error,
-    (png_structp png_ptr, png_const_charp error_message),
-    PNG_NORETURN);
+PNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr,
+    png_const_charp error_message), PNG_NORETURN);
 
 /* The same, but the chunk name is prepended to the error string. */
-PNG_EXPORTA(103, void, png_chunk_error, (png_structp png_ptr,
+PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr,
     png_const_charp error_message), PNG_NORETURN);
 
 #else
 /* Fatal error in PNG image of libpng - can't continue */
-PNG_EXPORTA(104, void, png_err, (png_structp png_ptr), PNG_NORETURN);
+PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN);
 #endif
 
 #ifdef PNG_WARNINGS_SUPPORTED
 /* Non-fatal error in libpng.  Can continue, but may have a problem. */
-PNG_EXPORT(105, void, png_warning, (png_structp png_ptr,
+PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr,
     png_const_charp warning_message));
 
 /* Non-fatal error in libpng, chunk name is prepended to message. */
-PNG_EXPORT(106, void, png_chunk_warning, (png_structp png_ptr,
+PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr,
     png_const_charp warning_message));
 #endif
 
 #ifdef PNG_BENIGN_ERRORS_SUPPORTED
 /* Benign error in libpng.  Can continue, but may have a problem.
  * User can choose whether to handle as a fatal error or as a warning. */
-#  undef png_benign_error
-PNG_EXPORT(107, void, png_benign_error, (png_structp png_ptr,
+PNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr,
     png_const_charp warning_message));
 
-/* Same, chunk name is prepended to message. */
-#  undef png_chunk_benign_error
-PNG_EXPORT(108, void, png_chunk_benign_error, (png_structp png_ptr,
+#ifdef PNG_READ_SUPPORTED
+/* Same, chunk name is prepended to message (only during read) */
+PNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr,
     png_const_charp warning_message));
+#endif
 
 PNG_EXPORT(109, void, png_set_benign_errors,
-    (png_structp png_ptr, int allowed));
+    (png_structrp png_ptr, int allowed));
 #else
 #  ifdef PNG_ALLOW_BENIGN_ERRORS
 #    define png_benign_error png_warning
@@ -1995,121 +2024,119 @@ PNG_EXPORT(109, void, png_set_benign_errors,
  * png_info_struct.
  */
 /* Returns "flag" if chunk data is valid in info_ptr. */
-PNG_EXPORT(110, png_uint_32, png_get_valid,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_uint_32 flag));
+PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, png_uint_32 flag));
 
 /* Returns number of bytes needed to hold a transformed row. */
-PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structp png_ptr,
-    png_const_infop info_ptr));
+PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
 
 #ifdef PNG_INFO_IMAGE_SUPPORTED
 /* Returns row_pointers, which is an array of pointers to scanlines that was
  * returned from png_read_png().
  */
-PNG_EXPORT(112, png_bytepp, png_get_rows,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
+
 /* Set row_pointers, which is an array of pointers to scanlines for use
  * by png_write_png().
  */
-PNG_EXPORT(113, void, png_set_rows, (png_structp png_ptr,
-    png_infop info_ptr, png_bytepp row_pointers));
+PNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_bytepp row_pointers));
 #endif
 
 /* Returns number of color channels in image. */
-PNG_EXPORT(114, png_byte, png_get_channels,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
 
 #ifdef PNG_EASY_ACCESS_SUPPORTED
 /* Returns image width in pixels. */
-PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structp png_ptr,
-    png_const_infop info_ptr));
+PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
 
 /* Returns image height in pixels. */
-PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structp png_ptr,
-    png_const_infop info_ptr));
+PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
 
 /* Returns image bit_depth. */
-PNG_EXPORT(117, png_byte, png_get_bit_depth,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
 
 /* Returns image color_type. */
-PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structp png_ptr,
-    png_const_infop info_ptr));
+PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
 
 /* Returns image filter_type. */
-PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structp png_ptr,
-    png_const_infop info_ptr));
+PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
 
 /* Returns image interlace_type. */
-PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structp png_ptr,
-    png_const_infop info_ptr));
+PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
 
 /* Returns image compression_type. */
-PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structp png_ptr,
-    png_const_infop info_ptr));
+PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
 
 /* Returns image resolution in pixels per meter, from pHYs chunk data. */
 PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 
 /* Returns pixel aspect ratio, computed from pHYs chunk data.  */
 PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio,
-    (png_const_structp png_ptr, png_const_infop info_ptr))
+    (png_const_structrp png_ptr, png_const_inforp info_ptr))
 PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed,
-    (png_const_structp png_ptr, png_const_infop info_ptr))
+    (png_const_structrp png_ptr, png_const_inforp info_ptr))
 
 /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
 PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 PNG_EXPORT(128, png_int_32, png_get_x_offset_microns,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 PNG_EXPORT(129, png_int_32, png_get_y_offset_microns,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 
 #endif /* PNG_EASY_ACCESS_SUPPORTED */
 
+#ifdef PNG_READ_SUPPORTED
 /* Returns pointer to signature string read from PNG header */
-PNG_EXPORT(130, png_const_bytep, png_get_signature,
-    (png_const_structp png_ptr, png_infop info_ptr));
+PNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr));
+#endif
 
 #ifdef PNG_bKGD_SUPPORTED
-PNG_EXPORT(131, png_uint_32, png_get_bKGD,
-    (png_const_structp png_ptr, png_infop info_ptr,
-    png_color_16p *background));
+PNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_color_16p *background));
 #endif
 
 #ifdef PNG_bKGD_SUPPORTED
-PNG_EXPORT(132, void, png_set_bKGD, (png_structp png_ptr, png_infop info_ptr,
-    png_const_color_16p background));
+PNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_color_16p background));
 #endif
 
 #ifdef PNG_cHRM_SUPPORTED
-PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structp png_ptr,
-   png_const_infop info_ptr, double *white_x, double *white_y, double *red_x,
+PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x,
     double *red_y, double *green_x, double *green_y, double *blue_x,
     double *blue_y))
-PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_structp png_ptr,
-    png_const_infop info_ptr, double *red_X, double *red_Y, double *red_Z,
+PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z,
     double *green_X, double *green_Y, double *green_Z, double *blue_X,
     double *blue_Y, double *blue_Z))
-#ifdef PNG_FIXED_POINT_SUPPORTED /* Otherwise not implemented */
 PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,
-    (png_const_structp png_ptr,
-    png_const_infop info_ptr, png_fixed_point *int_white_x,
-    png_fixed_point *int_white_y, png_fixed_point *int_red_x,
-    png_fixed_point *int_red_y, png_fixed_point *int_green_x,
-    png_fixed_point *int_green_y, png_fixed_point *int_blue_x,
-    png_fixed_point *int_blue_y))
-#endif
+    (png_const_structrp png_ptr, png_const_inforp info_ptr,
+    png_fixed_point *int_white_x, png_fixed_point *int_white_y,
+    png_fixed_point *int_red_x, png_fixed_point *int_red_y,
+    png_fixed_point *int_green_x, png_fixed_point *int_green_y,
+    png_fixed_point *int_blue_x, png_fixed_point *int_blue_y))
 PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,
-    (png_structp png_ptr, png_const_infop info_ptr,
+    (png_const_structrp png_ptr, png_const_inforp info_ptr,
     png_fixed_point *int_red_X, png_fixed_point *int_red_Y,
     png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
     png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
@@ -2118,22 +2145,22 @@ PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,
 #endif
 
 #ifdef PNG_cHRM_SUPPORTED
-PNG_FP_EXPORT(135, void, png_set_cHRM,
-    (png_structp png_ptr, png_infop info_ptr,
+PNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr,
+    png_inforp info_ptr,
     double white_x, double white_y, double red_x, double red_y, double green_x,
     double green_y, double blue_x, double blue_y))
-PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_structp png_ptr,
-    png_infop info_ptr, double red_X, double red_Y, double red_Z,
+PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr,
+    png_inforp info_ptr, double red_X, double red_Y, double red_Z,
     double green_X, double green_Y, double green_Z, double blue_X,
     double blue_Y, double blue_Z))
-PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_structp png_ptr,
-    png_infop info_ptr, png_fixed_point int_white_x,
+PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_fixed_point int_white_x,
     png_fixed_point int_white_y, png_fixed_point int_red_x,
     png_fixed_point int_red_y, png_fixed_point int_green_x,
     png_fixed_point int_green_y, png_fixed_point int_blue_x,
     png_fixed_point int_blue_y))
-PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_structp png_ptr,
-    png_infop info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,
+PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,
     png_fixed_point int_red_Z, png_fixed_point int_green_X,
     png_fixed_point int_green_Y, png_fixed_point int_green_Z,
     png_fixed_point int_blue_X, png_fixed_point int_blue_Y,
@@ -2141,143 +2168,130 @@ PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_structp png_ptr,
 #endif
 
 #ifdef PNG_gAMA_SUPPORTED
-PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    double *file_gamma))
+PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, double *file_gamma))
 PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
+    (png_const_structrp png_ptr, png_const_inforp info_ptr,
     png_fixed_point *int_file_gamma))
 #endif
 
 #ifdef PNG_gAMA_SUPPORTED
-PNG_FP_EXPORT(139, void, png_set_gAMA, (png_structp png_ptr,
-    png_infop info_ptr, double file_gamma))
-PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_structp png_ptr,
-    png_infop info_ptr, png_fixed_point int_file_gamma))
+PNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr,
+    png_inforp info_ptr, double file_gamma))
+PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_fixed_point int_file_gamma))
 #endif
 
 #ifdef PNG_hIST_SUPPORTED
-PNG_EXPORT(141, png_uint_32, png_get_hIST,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_uint_16p *hist));
+PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_uint_16p *hist));
 #endif
 
 #ifdef PNG_hIST_SUPPORTED
-PNG_EXPORT(142, void, png_set_hIST, (png_structp png_ptr,
-    png_infop info_ptr, png_const_uint_16p hist));
+PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_uint_16p hist));
 #endif
 
-PNG_EXPORT(143, png_uint_32, png_get_IHDR,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type,
-    int *interlace_method, int *compression_method, int *filter_method));
+PNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height,
+    int *bit_depth, int *color_type, int *interlace_method,
+    int *compression_method, int *filter_method));
 
-PNG_EXPORT(144, void, png_set_IHDR,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 width, png_uint_32 height, int bit_depth, int color_type,
-    int interlace_method, int compression_method, int filter_method));
+PNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,
+    int color_type, int interlace_method, int compression_method,
+    int filter_method));
 
 #ifdef PNG_oFFs_SUPPORTED
-PNG_EXPORT(145, png_uint_32, png_get_oFFs,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type));
+PNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr,
+   png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
+   int *unit_type));
 #endif
 
 #ifdef PNG_oFFs_SUPPORTED
-PNG_EXPORT(146, void, png_set_oFFs,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_int_32 offset_x, png_int_32 offset_y, int unit_type));
+PNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y,
+    int unit_type));
 #endif
 
 #ifdef PNG_pCAL_SUPPORTED
-PNG_EXPORT(147, png_uint_32, png_get_pCAL,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type,
-    int *nparams,
-    png_charp *units, png_charpp *params));
+PNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_charp *purpose, png_int_32 *X0,
+    png_int_32 *X1, int *type, int *nparams, png_charp *units,
+    png_charpp *params));
 #endif
 
 #ifdef PNG_pCAL_SUPPORTED
-PNG_EXPORT(148, void, png_set_pCAL, (png_structp png_ptr,
-    png_infop info_ptr,
-    png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type,
-    int nparams, png_const_charp units, png_charpp params));
+PNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1,
+    int type, int nparams, png_const_charp units, png_charpp params));
 #endif
 
 #ifdef PNG_pHYs_SUPPORTED
-PNG_EXPORT(149, png_uint_32, png_get_pHYs,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
+PNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
+    int *unit_type));
 #endif
 
 #ifdef PNG_pHYs_SUPPORTED
-PNG_EXPORT(150, void, png_set_pHYs,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 res_x, png_uint_32 res_y, int unit_type));
+PNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));
 #endif
 
-PNG_EXPORT(151, png_uint_32, png_get_PLTE,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_colorp *palette, int *num_palette));
+PNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr,
+   png_inforp info_ptr, png_colorp *palette, int *num_palette));
 
-PNG_EXPORT(152, void, png_set_PLTE,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_const_colorp palette, int num_palette));
+PNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr,
+    png_inforp info_ptr, png_const_colorp palette, int num_palette));
 
 #ifdef PNG_sBIT_SUPPORTED
-PNG_EXPORT(153, png_uint_32, png_get_sBIT,
-    (png_const_structp png_ptr, png_infop info_ptr,
-    png_color_8p *sig_bit));
+PNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_color_8p *sig_bit));
 #endif
 
 #ifdef PNG_sBIT_SUPPORTED
-PNG_EXPORT(154, void, png_set_sBIT,
-    (png_structp png_ptr, png_infop info_ptr, png_const_color_8p sig_bit));
+PNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_color_8p sig_bit));
 #endif
 
 #ifdef PNG_sRGB_SUPPORTED
-PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structp png_ptr,
-    png_const_infop info_ptr, int *file_srgb_intent));
+PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, int *file_srgb_intent));
 #endif
 
 #ifdef PNG_sRGB_SUPPORTED
-PNG_EXPORT(156, void, png_set_sRGB,
-    (png_structp png_ptr, png_infop info_ptr, int srgb_intent));
-PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_structp png_ptr,
-    png_infop info_ptr, int srgb_intent));
+PNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr,
+    png_inforp info_ptr, int srgb_intent));
+PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr,
+    png_inforp info_ptr, int srgb_intent));
 #endif
 
 #ifdef PNG_iCCP_SUPPORTED
-PNG_EXPORT(158, png_uint_32, png_get_iCCP,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_charpp name, int *compression_type, png_bytepp profile,
-    png_uint_32 *proflen));
+PNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_charpp name, int *compression_type,
+    png_bytepp profile, png_uint_32 *proflen));
 #endif
 
 #ifdef PNG_iCCP_SUPPORTED
-PNG_EXPORT(159, void, png_set_iCCP,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_const_charp name, int compression_type, png_const_bytep profile,
-    png_uint_32 proflen));
+PNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_charp name, int compression_type,
+    png_const_bytep profile, png_uint_32 proflen));
 #endif
 
 #ifdef PNG_sPLT_SUPPORTED
-PNG_EXPORT(160, png_uint_32, png_get_sPLT,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_sPLT_tpp entries));
+PNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_sPLT_tpp entries));
 #endif
 
 #ifdef PNG_sPLT_SUPPORTED
-PNG_EXPORT(161, void, png_set_sPLT,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_const_sPLT_tp entries, int nentries));
+PNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_sPLT_tp entries, int nentries));
 #endif
 
 #ifdef PNG_TEXT_SUPPORTED
 /* png_get_text also returns the number of text chunks in *num_text */
-PNG_EXPORT(162, png_uint_32, png_get_text,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_textp *text_ptr, int *num_text));
+PNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_textp *text_ptr, int *num_text));
 #endif
 
 /* Note while png_set_text() will accept a structure whose text,
@@ -2288,122 +2302,207 @@ PNG_EXPORT(162, png_uint_32, png_get_text,
  */
 
 #ifdef PNG_TEXT_SUPPORTED
-PNG_EXPORT(163, void, png_set_text,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_const_textp text_ptr, int num_text));
+PNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_textp text_ptr, int num_text));
 #endif
 
 #ifdef PNG_tIME_SUPPORTED
-PNG_EXPORT(164, png_uint_32, png_get_tIME,
-    (png_const_structp png_ptr, png_infop info_ptr, png_timep *mod_time));
+PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_timep *mod_time));
 #endif
 
 #ifdef PNG_tIME_SUPPORTED
-PNG_EXPORT(165, void, png_set_tIME,
-    (png_structp png_ptr, png_infop info_ptr, png_const_timep mod_time));
+PNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_timep mod_time));
 #endif
 
 #ifdef PNG_tRNS_SUPPORTED
-PNG_EXPORT(166, png_uint_32, png_get_tRNS,
-    (png_const_structp png_ptr, png_infop info_ptr,
-    png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color));
+PNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans,
+    png_color_16p *trans_color));
 #endif
 
 #ifdef PNG_tRNS_SUPPORTED
-PNG_EXPORT(167, void, png_set_tRNS,
-    (png_structp png_ptr, png_infop info_ptr,
-    png_const_bytep trans_alpha, int num_trans,
+PNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr,
+    png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans,
     png_const_color_16p trans_color));
 #endif
 
 #ifdef PNG_sCAL_SUPPORTED
-PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    int *unit, double *width, double *height))
-#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
+PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, int *unit, double *width, double *height))
+#if (defined PNG_FLOATING_ARITHMETIC_SUPPORTED) || \
+   (defined PNG_FLOATING_POINT_SUPPORTED)
 /* NOTE: this API is currently implemented using floating point arithmetic,
  * consequently it can only be used on systems with floating point support.
  * In any case the range of values supported by png_fixed_point is small and it
  * is highly recommended that png_get_sCAL_s be used instead.
  */
 PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed,
-    (png_structp png_ptr, png_const_infop info_ptr, int *unit,
-    png_fixed_point *width,
-    png_fixed_point *height))
+    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,
+    png_fixed_point *width, png_fixed_point *height))
 #endif
 PNG_EXPORT(169, png_uint_32, png_get_sCAL_s,
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    int *unit, png_charpp swidth, png_charpp sheight));
-
-PNG_FP_EXPORT(170, void, png_set_sCAL,
-    (png_structp png_ptr, png_infop info_ptr,
-    int unit, double width, double height))
-PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_structp png_ptr,
-   png_infop info_ptr, int unit, png_fixed_point width,
+    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,
+    png_charpp swidth, png_charpp sheight));
+
+PNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr,
+    png_inforp info_ptr, int unit, double width, double height))
+PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr,
+   png_inforp info_ptr, int unit, png_fixed_point width,
    png_fixed_point height))
-PNG_EXPORT(171, void, png_set_sCAL_s,
-    (png_structp png_ptr, png_infop info_ptr,
-    int unit, png_const_charp swidth, png_const_charp sheight));
+PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,
+    png_inforp info_ptr, int unit,
+    png_const_charp swidth, png_const_charp sheight));
 #endif /* PNG_sCAL_SUPPORTED */
 
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-/* Provide a list of chunks and how they are to be handled, if the built-in
-   handling or default unknown chunk handling is not desired.  Any chunks not
-   listed will be handled in the default manner.  The IHDR and IEND chunks
-   must not be listed.  Because this turns off the default handling for chunks
-   that would otherwise be recognized the behavior of libpng transformations may
-   well become incorrect!
-      keep = 0: PNG_HANDLE_CHUNK_AS_DEFAULT: follow default behavior
-           = 1: PNG_HANDLE_CHUNK_NEVER:      do not keep
-           = 2: PNG_HANDLE_CHUNK_IF_SAFE:    keep only if safe-to-copy
-           = 3: PNG_HANDLE_CHUNK_ALWAYS:     keep even if unsafe-to-copy
-*/
-PNG_EXPORT(172, void, png_set_keep_unknown_chunks,
-    (png_structp png_ptr, int keep,
-    png_const_bytep chunk_list, int num_chunks));
-
-/* The handling code is returned; the result is therefore true (non-zero) if
- * special handling is required, false for the default handling.
- */
-PNG_EXPORT(173, int, png_handle_as_unknown, (png_structp png_ptr,
+#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+/* Provide the default handling for all unknown chunks or, optionally, for
+ * specific unknown chunks.
+ *
+ * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was
+ * ignored and the default was used, the per-chunk setting only had an effect on
+ * write.  If you wish to have chunk-specific handling on read in code that must
+ * work on earlier versions you must use a user chunk callback to specify the
+ * desired handling (keep or discard.)
+ *
+ * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below.  The
+ * parameter is interpreted as follows:
+ *
+ * READ:
+ *    PNG_HANDLE_CHUNK_AS_DEFAULT:
+ *       Known chunks: do normal libpng processing, do not keep the chunk (but
+ *          set the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
+ *       Unknown chunks: for a specific chunk use the global default, when used
+ *          as the default discard the chunk data.
+ *    PNG_HANDLE_CHUNK_NEVER:
+ *       Discard the chunk data.
+ *    PNG_HANDLE_CHUNK_IF_SAFE:
+ *       Keep the chunk data if the chunk is not critical else raise a chunk
+ *       error.
+ *    PNG_HANDLE_CHUNK_ALWAYS:
+ *       Keep the chunk data.
+ *
+ * If the chunk data is saved it can be retrieved using png_get_unknown_chunks,
+ * below.  Notice that specifying "AS_DEFAULT" as a global default is equivalent
+ * to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks
+ * it simply resets the behavior to the libpng default.
+ *
+ * The per-chunk handling is always used when there is a png_user_chunk_ptr
+ * callback and the callback returns 0; the chunk is then always stored *unless*
+ * it is critical and the per-chunk setting is other than ALWAYS.  Notice that
+ * the global default is *not* used in this case.  (In effect the per-chunk
+ * value is incremented to at least IF_SAFE.)
+ *
+ * PNG_HANDLE_AS_UNKNOWN_SUPPORTED:
+ *    If this is *not* set known chunks will always be handled by libpng and
+ *    will never be stored in the unknown chunk list.  Known chunks listed to
+ *    png_set_keep_unknown_chunks will have no effect.  If it is set then known
+ *    chunks listed with a keep other than AS_DEFAULT will *never* be processed
+ *    by libpng, in addition critical chunks must either be processed by the
+ *    callback or saved.
+ *
+ *    The IHDR and IEND chunks must not be listed.  Because this turns off the
+ *    default handling for chunks that would otherwise be recognized the
+ *    behavior of libpng transformations may well become incorrect!
+ *
+ * WRITE:
+ *    When writing chunks the options only apply to the chunks specified by
+ *    png_set_unknown_chunks (below), libpng will *always* write known chunks
+ *    required by png_set_ calls and will always write the core critical chunks
+ *    (as required for PLTE).
+ *
+ *    Each chunk in the png_set_unknown_chunks list is looked up in the
+ *    png_set_keep_unknown_chunks list to find the keep setting, this is then
+ *    interpreted as follows:
+ *
+ *    PNG_HANDLE_CHUNK_AS_DEFAULT:
+ *       Write safe-to-copy chunks and write other chunks if the global
+ *       default is set to _ALWAYS, otherwise don't write this chunk.
+ *    PNG_HANDLE_CHUNK_NEVER:
+ *       Do not write the chunk.
+ *    PNG_HANDLE_CHUNK_IF_SAFE:
+ *       Write the chunk if it is safe-to-copy, otherwise do not write it.
+ *    PNG_HANDLE_CHUNK_ALWAYS:
+ *       Write the chunk.
+ *
+ * Note that the default behavior is effectively the opposite of the read case -
+ * in read unknown chunks are not stored by default, in write they are written
+ * by default.  Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different
+ * - on write the safe-to-copy bit is checked, on read the critical bit is
+ * checked and on read if the chunk is critical an error will be raised.
+ *
+ * num_chunks:
+ * ===========
+ *    If num_chunks is positive, then the "keep" parameter specifies the manner
+ *    for handling only those chunks appearing in the chunk_list array,
+ *    otherwise the chunk list array is ignored.
+ *
+ *    If num_chunks is 0 the "keep" parameter specifies the default behavior for
+ *    unknown chunks, as described above.
+ *
+ *    If num_chunks is negative, then the "keep" parameter specifies the manner
+ *    for handling all unknown chunks plus all chunks recognized by libpng
+ *    except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to
+ *    be processed by libpng.
+ */
+PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr,
+    int keep, png_const_bytep chunk_list, int num_chunks));
+
+/* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned;
+ * the result is therefore true (non-zero) if special handling is required,
+ * false for the default handling.
+ */
+PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr,
     png_const_bytep chunk_name));
 #endif
-#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
-PNG_EXPORT(174, void, png_set_unknown_chunks, (png_structp png_ptr,
-    png_infop info_ptr, png_const_unknown_chunkp unknowns,
+
+#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
+PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_unknown_chunkp unknowns,
     int num_unknowns));
+   /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added
+    * unknowns to the location currently stored in the png_struct.  This is
+    * invariably the wrong value on write.  To fix this call the following API
+    * for each chunk in the list with the correct location.  If you know your
+    * code won't be compiled on earlier versions you can rely on
+    * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing
+    * the correct thing.
+    */
+
 PNG_EXPORT(175, void, png_set_unknown_chunk_location,
-    (png_structp png_ptr, png_infop info_ptr, int chunk, int location));
-PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structp png_ptr,
-    png_const_infop info_ptr, png_unknown_chunkpp entries));
+    (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location));
+
+PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_unknown_chunkpp entries));
 #endif
 
 /* Png_free_data() will turn off the "valid" flag for anything it frees.
  * If you need to turn it off for a chunk that your application has freed,
  * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);
  */
-PNG_EXPORT(177, void, png_set_invalid,
-    (png_structp png_ptr, png_infop info_ptr, int mask));
+PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr,
+    png_inforp info_ptr, int mask));
 
 #ifdef PNG_INFO_IMAGE_SUPPORTED
 /* The "params" pointer is currently not used and is for future expansion. */
-PNG_EXPORT(178, void, png_read_png, (png_structp png_ptr, png_infop info_ptr,
+PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr,
     int transforms, png_voidp params));
-PNG_EXPORT(179, void, png_write_png, (png_structp png_ptr, png_infop info_ptr,
+PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr,
     int transforms, png_voidp params));
 #endif
 
 PNG_EXPORT(180, png_const_charp, png_get_copyright,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 PNG_EXPORT(181, png_const_charp, png_get_header_ver,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 PNG_EXPORT(182, png_const_charp, png_get_header_version,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 PNG_EXPORT(183, png_const_charp, png_get_libpng_ver,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 
 #ifdef PNG_MNG_FEATURES_SUPPORTED
-PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structp png_ptr,
+PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr,
     png_uint_32 mng_features_permitted));
 #endif
 
@@ -2412,75 +2511,77 @@ PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structp png_ptr,
 #define PNG_HANDLE_CHUNK_NEVER        1
 #define PNG_HANDLE_CHUNK_IF_SAFE      2
 #define PNG_HANDLE_CHUNK_ALWAYS       3
+#define PNG_HANDLE_CHUNK_LAST         4
 
 /* Strip the prepended error numbers ("#nnn ") from error and warning
  * messages before passing them to the error or warning handler.
  */
 #ifdef PNG_ERROR_NUMBERS_SUPPORTED
-PNG_EXPORT(185, void, png_set_strip_error_numbers,
-    (png_structp png_ptr,
+PNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr,
     png_uint_32 strip_mode));
 #endif
 
 /* Added in libpng-1.2.6 */
 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
-PNG_EXPORT(186, void, png_set_user_limits, (png_structp png_ptr,
+PNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr,
     png_uint_32 user_width_max, png_uint_32 user_height_max));
 PNG_EXPORT(187, png_uint_32, png_get_user_width_max,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 PNG_EXPORT(188, png_uint_32, png_get_user_height_max,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 /* Added in libpng-1.4.0 */
-PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structp png_ptr,
+PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr,
     png_uint_32 user_chunk_cache_max));
 PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 /* Added in libpng-1.4.1 */
-PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structp png_ptr,
+PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr,
     png_alloc_size_t user_chunk_cache_max));
 PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 #endif
 
 #if defined(PNG_INCH_CONVERSIONS_SUPPORTED)
 PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 
 PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 
 PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch,
-    (png_const_structp png_ptr, png_const_infop info_ptr));
+    (png_const_structrp png_ptr, png_const_inforp info_ptr));
 
 PNG_FP_EXPORT(196, float, png_get_x_offset_inches,
-    (png_const_structp png_ptr, png_const_infop info_ptr))
+    (png_const_structrp png_ptr, png_const_inforp info_ptr))
 #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
 PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed,
-    (png_structp png_ptr, png_const_infop info_ptr))
+    (png_const_structrp png_ptr, png_const_inforp info_ptr))
 #endif
 
-PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structp png_ptr,
-    png_const_infop info_ptr))
+PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr))
 #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
 PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,
-    (png_structp png_ptr, png_const_infop info_ptr))
+    (png_const_structrp png_ptr, png_const_inforp info_ptr))
 #endif
 
 #  ifdef PNG_pHYs_SUPPORTED
-PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structp png_ptr,
-    png_const_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
+PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
     int *unit_type));
 #  endif /* PNG_pHYs_SUPPORTED */
 #endif  /* PNG_INCH_CONVERSIONS_SUPPORTED */
 
 /* Added in libpng-1.4.0 */
 #ifdef PNG_IO_STATE_SUPPORTED
-PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_structp png_ptr));
+PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr));
+
+/* Removed from libpng 1.6; use png_get_io_chunk_type. */
+PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr),
+    PNG_DEPRECATED)
 
-PNG_EXPORTA(200, png_const_bytep, png_get_io_chunk_name,
-    (png_structp png_ptr), PNG_DEPRECATED);
 PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,
-    (png_const_structp png_ptr));
+    (png_const_structrp png_ptr));
 
 /* The flags returned by png_get_io_state() are the following: */
 #  define PNG_IO_NONE        0x0000   /* no I/O at this moment */
@@ -2536,10 +2637,10 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,
  * necessary to find the row in the output image given a row in an interlaced
  * image, so two more macros:
  */
-#define PNG_ROW_FROM_PASS_ROW(yIn, pass) \
-   (((yIn)<<PNG_PASS_ROW_SHIFT(pass))+PNG_PASS_START_ROW(pass))
-#define PNG_COL_FROM_PASS_COL(xIn, pass) \
-   (((xIn)<<PNG_PASS_COL_SHIFT(pass))+PNG_PASS_START_COL(pass))
+#define PNG_ROW_FROM_PASS_ROW(y_in, pass) \
+   (((y_in)<<PNG_PASS_ROW_SHIFT(pass))+PNG_PASS_START_ROW(pass))
+#define PNG_COL_FROM_PASS_COL(x_in, pass) \
+   (((x_in)<<PNG_PASS_COL_SHIFT(pass))+PNG_PASS_START_COL(pass))
 
 /* Two macros which return a boolean (0 or 1) saying whether the given row
  * or column is in a particular pass.  These use a common utility macro that
@@ -2604,7 +2705,7 @@ PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf));
 PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf));
 #endif
 
-PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_structp png_ptr,
+PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr,
     png_const_bytep buf));
 /* No png_get_int_16 -- may be added if there's a real need for it. */
 
@@ -2630,7 +2731,7 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
  * The png_get_int_32() routine assumes we are using two's complement
  * format for negative values, which is almost certainly true.
  */
-#  define png_get_uint_32(buf) \
+#  define PNG_get_uint_32(buf) \
      (((png_uint_32)(*(buf)) << 24) + \
       ((png_uint_32)(*((buf) + 1)) << 16) + \
       ((png_uint_32)(*((buf) + 2)) << 8) + \
@@ -2639,25 +2740,477 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
    /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
     * function) incorrectly returned a value of type png_uint_32.
     */
-#  define png_get_uint_16(buf) \
+#  define PNG_get_uint_16(buf) \
      ((png_uint_16) \
       (((unsigned int)(*(buf)) << 8) + \
        ((unsigned int)(*((buf) + 1)))))
 
-#  define png_get_int_32(buf) \
+#  define PNG_get_int_32(buf) \
      ((png_int_32)((*(buf) & 0x80) \
       ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \
       : (png_int_32)png_get_uint_32(buf)))
-#endif
 
-#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
-    defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
-PNG_EXPORT(234, void, png_set_check_for_invalid_index, (png_structp png_ptr,
-    int allowed));
+   /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h,
+    * but defining a macro name prefixed with PNG_PREFIX.
+    */
+#  ifndef PNG_PREFIX
+#     define png_get_uint_32(buf) PNG_get_uint_32(buf)
+#     define png_get_uint_16(buf) PNG_get_uint_16(buf)
+#     define png_get_int_32(buf)  PNG_get_int_32(buf)
+#  endif
+#else
+#  ifdef PNG_PREFIX
+      /* No macros; revert to the (redefined) function */
+#     define PNG_get_uint_32 (png_get_uint_32)
+#     define PNG_get_uint_16 (png_get_uint_16)
+#     define PNG_get_int_32  (png_get_int_32)
+#  endif
 #endif
 
+/*******************************************************************************
+ *  SIMPLIFIED API
+ *******************************************************************************
+ *
+ * Please read the documentation in libpng-manual.txt (TODO: write said
+ * documentation) if you don't understand what follows.
+ *
+ * The simplified API hides the details of both libpng and the PNG file format
+ * itself.  It allows PNG files to be read into a very limited number of
+ * in-memory bitmap formats or to be written from the same formats.  If these
+ * formats do not accomodate your needs then you can, and should, use the more
+ * sophisticated APIs above - these support a wide variety of in-memory formats
+ * and a wide variety of sophisticated transformations to those formats as well
+ * as a wide variety of APIs to manipulate ancillary information.
+ *
+ * To read a PNG file using the simplified API:
+ *
+ * 1) Declare a 'png_image' structure (see below) on the stack and set the
+ *    version field to PNG_IMAGE_VERSION.
+ * 2) Call the appropriate png_image_begin_read... function.
+ * 3) Set the png_image 'format' member to the required sample format.
+ * 4) Allocate a buffer for the image and, if required, the color-map.
+ * 5) Call png_image_finish_read to read the image and, if required, the
+ *    color-map into your buffers.
+ *
+ * There are no restrictions on the format of the PNG input itself; all valid
+ * color types, bit depths, and interlace methods are acceptable, and the
+ * input image is transformed as necessary to the requested in-memory format
+ * during the png_image_finish_read() step.  The only caveat is that if you
+ * request a color-mapped image from a PNG that is full-color or makes
+ * complex use of an alpha channel the transformation is extremely lossy and the
+ * result may look terrible.
+ *
+ * To write a PNG file using the simplified API:
+ *
+ * 1) Declare a 'png_image' structure on the stack and memset() it to all zero.
+ * 2) Initialize the members of the structure that describe the image, setting
+ *    the 'format' member to the format of the image samples.
+ * 3) Call the appropriate png_image_write... function with a pointer to the
+ *    image and, if necessary, the color-map to write the PNG data.
+ *
+ * png_image is a structure that describes the in-memory format of an image
+ * when it is being read or defines the in-memory format of an image that you
+ * need to write:
+ */
+#define PNG_IMAGE_VERSION 1
+
+typedef struct png_control *png_controlp;
+typedef struct
+{
+   png_controlp opaque;    /* Initialize to NULL, free with png_image_free */
+   png_uint_32  version;   /* Set to PNG_IMAGE_VERSION */
+   png_uint_32  width;     /* Image width in pixels (columns) */
+   png_uint_32  height;    /* Image height in pixels (rows) */
+   png_uint_32  format;    /* Image format as defined below */
+   png_uint_32  flags;     /* A bit mask containing informational flags */
+   png_uint_32  colormap_entries;
+                           /* Number of entries in the color-map */
+
+   /* In the event of an error or warning the following field will be set to a
+    * non-zero value and the 'message' field will contain a '\0' terminated
+    * string with the libpng error or warning message.  If both warnings and
+    * an error were encountered, only the error is recorded.  If there
+    * are multiple warnings, only the first one is recorded.
+    *
+    * The upper 30 bits of this value are reserved, the low two bits contain
+    * a value as follows:
+    */
+#  define PNG_IMAGE_WARNING 1
+#  define PNG_IMAGE_ERROR 2
+   /*
+    * The result is a two bit code such that a value more than 1 indicates
+    * a failure in the API just called:
+    *
+    *    0 - no warning or error
+    *    1 - warning
+    *    2 - error
+    *    3 - error preceded by warning
+    */
+#  define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1)
+
+   png_uint_32  warning_or_error;
+
+   char         message[64];
+} png_image, *png_imagep;
+
+/* The samples of the image have one to four channels whose components have
+ * original values in the range 0 to 1.0:
+ *
+ * 1: A single gray or luminance channel (G).
+ * 2: A gray/luminance channel and an alpha channel (GA).
+ * 3: Three red, green, blue color channels (RGB).
+ * 4: Three color channels and an alpha channel (RGBA).
+ *
+ * The components are encoded in one of two ways:
+ *
+ * a) As a small integer, value 0..255, contained in a single byte.  For the
+ * alpha channel the original value is simply value/255.  For the color or
+ * luminance channels the value is encoded according to the sRGB specification
+ * and matches the 8-bit format expected by typical display devices.
+ *
+ * The color/gray channels are not scaled (pre-multiplied) by the alpha
+ * channel and are suitable for passing to color management software.
+ *
+ * b) As a value in the range 0..65535, contained in a 2-byte integer.  All
+ * channels can be converted to the original value by dividing by 65535; all
+ * channels are linear.  Color channels use the RGB encoding (RGB end-points) of
+ * the sRGB specification.  This encoding is identified by the
+ * PNG_FORMAT_FLAG_LINEAR flag below.
+ *
+ * When the simplified API needs to convert between sRGB and linear colorspaces,
+ * the actual sRGB transfer curve defined in the sRGB specification (see the
+ * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+ * approximation used elsewhere in libpng.
+ *
+ * When an alpha channel is present it is expected to denote pixel coverage
+ * of the color or luminance channels and is returned as an associated alpha
+ * channel: the color/gray channels are scaled (pre-multiplied) by the alpha
+ * value.
+ *
+ * The samples are either contained directly in the image data, between 1 and 8
+ * bytes per pixel according to the encoding, or are held in a color-map indexed
+ * by bytes in the image data.  In the case of a color-map the color-map entries
+ * are individual samples, encoded as above, and the image data has one byte per
+ * pixel to select the relevant sample from the color-map.
+ */
+
+/* PNG_FORMAT_*
+ *
+ * #defines to be used in png_image::format.  Each #define identifies a
+ * particular layout of sample data and, if present, alpha values.  There are
+ * separate defines for each of the two component encodings.
+ *
+ * A format is built up using single bit flag values.  All combinations are
+ * valid.  Formats can be built up from the flag values or you can use one of
+ * the predefined values below.  When testing formats always use the FORMAT_FLAG
+ * macros to test for individual features - future versions of the library may
+ * add new flags.
+ *
+ * When reading or writing color-mapped images the format should be set to the
+ * format of the entries in the color-map then png_image_{read,write}_colormap
+ * called to read or write the color-map and set the format correctly for the
+ * image data.  Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly!
+ *
+ * NOTE: libpng can be built with particular features disabled, if you see
+ * compiler errors because the definition of one of the following flags has been
+ * compiled out it is because libpng does not have the required support.  It is
+ * possible, however, for the libpng configuration to enable the format on just
+ * read or just write; in that case you may see an error at run time.  You can
+ * guard against this by checking for the definition of the appropriate
+ * "_SUPPORTED" macro, one of:
+ *
+ *    PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED
+ */
+#define PNG_FORMAT_FLAG_ALPHA    0x01U /* format with an alpha channel */
+#define PNG_FORMAT_FLAG_COLOR    0x02U /* color format: otherwise grayscale */
+#define PNG_FORMAT_FLAG_LINEAR   0x04U /* 2 byte channels else 1 byte */
+#define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */
+
+#ifdef PNG_FORMAT_BGR_SUPPORTED
+#  define PNG_FORMAT_FLAG_BGR    0x10U /* BGR colors, else order is RGB */
+#endif
+
+#ifdef PNG_FORMAT_AFIRST_SUPPORTED
+#  define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */
+#endif
+
+/* Commonly used formats have predefined macros.
+ *
+ * First the single byte (sRGB) formats:
+ */
+#define PNG_FORMAT_GRAY 0
+#define PNG_FORMAT_GA   PNG_FORMAT_FLAG_ALPHA
+#define PNG_FORMAT_AG   (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST)
+#define PNG_FORMAT_RGB  PNG_FORMAT_FLAG_COLOR
+#define PNG_FORMAT_BGR  (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR)
+#define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA)
+#define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST)
+#define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA)
+#define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST)
+
+/* Then the linear 2-byte formats.  When naming these "Y" is used to
+ * indicate a luminance (gray) channel.
+ */
+#define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR
+#define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA)
+#define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR)
+#define PNG_FORMAT_LINEAR_RGB_ALPHA \
+   (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA)
+
+/* With color-mapped formats the image data is one byte for each pixel, the byte
+ * is an index into the color-map which is formatted as above.  To obtain a
+ * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP
+ * to one of the above definitions, or you can use one of the definitions below.
+ */
+#define PNG_FORMAT_RGB_COLORMAP  (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP)
+#define PNG_FORMAT_BGR_COLORMAP  (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP)
+#define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP)
+#define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP)
+#define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP)
+#define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP)
+
+/* PNG_IMAGE macros
+ *
+ * These are convenience macros to derive information from a png_image
+ * structure.  The PNG_IMAGE_SAMPLE_ macros return values appropriate to the
+ * actual image sample values - either the entries in the color-map or the
+ * pixels in the image.  The PNG_IMAGE_PIXEL_ macros return corresponding values
+ * for the pixels and will always return 1 for color-mapped formats.  The
+ * remaining macros return information about the rows in the image and the
+ * complete image.
+ *
+ * NOTE: All the macros that take a png_image::format parameter are compile time
+ * constants if the format parameter is, itself, a constant.  Therefore these
+ * macros can be used in array declarations and case labels where required.
+ * Similarly the macros are also pre-processor constants (sizeof is not used) so
+ * they can be used in #if tests.
+ *
+ * First the information about the samples.
+ */
+#define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\
+   (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1)
+   /* Return the total number of channels in a given format: 1..4 */
+
+#define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\
+   ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1)
+   /* Return the size in bytes of a single component of a pixel or color-map
+    * entry (as appropriate) in the image: 1 or 2.
+    */
+
+#define PNG_IMAGE_SAMPLE_SIZE(fmt)\
+   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt))
+   /* This is the size of the sample data for one sample.  If the image is
+    * color-mapped it is the size of one color-map entry (and image pixels are
+    * one byte in size), otherwise it is the size of one image pixel.
+    */
+
+#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\
+   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256)
+   /* The maximum size of the color-map required by the format expressed in a
+    * count of components.  This can be used to compile-time allocate a
+    * color-map:
+    *
+    * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)];
+    *
+    * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)];
+    *
+    * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the
+    * information from one of the png_image_begin_read_ APIs and dynamically
+    * allocate the required memory.
+    */
+
+/* Corresponding information about the pixels */
+#define PNG_IMAGE_PIXEL_(test,fmt)\
+   (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt))
+
+#define PNG_IMAGE_PIXEL_CHANNELS(fmt)\
+   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt)
+   /* The number of separate channels (components) in a pixel; 1 for a
+    * color-mapped image.
+    */
+
+#define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\
+   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt)
+   /* The size, in bytes, of each component in a pixel; 1 for a color-mapped
+    * image.
+    */
+
+#define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt)
+   /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */
+
+/* Information about the whole row, or whole image */
+#define PNG_IMAGE_ROW_STRIDE(image)\
+   (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width)
+   /* Return the total number of components in a single row of the image; this
+    * is the minimum 'row stride', the minimum count of components between each
+    * row.  For a color-mapped image this is the minimum number of bytes in a
+    * row.
+    */
+
+#define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\
+   (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride))
+   /* Return the size, in bytes, of an image buffer given a png_image and a row
+    * stride - the number of components to leave space for in each row.
+    */
+
+#define PNG_IMAGE_SIZE(image)\
+   PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image))
+   /* Return the size, in bytes, of the image in memory given just a png_image;
+    * the row stride is the minimum stride required for the image.
+    */
+
+#define PNG_IMAGE_COLORMAP_SIZE(image)\
+   (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries)
+   /* Return the size, in bytes, of the color-map of this image.  If the image
+    * format is not a color-map format this will return a size sufficient for
+    * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if
+    * you don't want to allocate a color-map in this case.
+    */
+
+/* PNG_IMAGE_FLAG_*
+ *
+ * Flags containing additional information about the image are held in the
+ * 'flags' field of png_image.
+ */
+#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01
+   /* This indicates the the RGB values of the in-memory bitmap do not
+    * correspond to the red, green and blue end-points defined by sRGB.
+    */
+
+#define PNG_IMAGE_FLAG_FAST 0x02
+   /* On write emphasise speed over compression; the resultant PNG file will be
+    * larger but will be produced significantly faster, particular for large
+    * images.  Do not use this option for images which will be distributed, only
+    * used it when producing intermediate files that will be read back in
+    * repeatedly.  For a typical 24-bit image the option will double the read
+    * speed at the cost of increasing the image size by 25%, however for many
+    * more compressible images the PNG file can be 10 times larger with only a
+    * slight speed gain.
+    */
+
+#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
+/* READ APIs
+ * ---------
+ *
+ * The png_image passed to the read APIs must have been initialized by setting
+ * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.)
+ */
+#ifdef PNG_STDIO_SUPPORTED
+PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image,
+   const char *file_name));
+   /* The named file is opened for read and the image header is filled in
+    * from the PNG header in the file.
+    */
+
+PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,
+   FILE* file));
+   /* The PNG header is read from the stdio FILE object. */
+#endif /* PNG_STDIO_SUPPORTED */
+
+PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image,
+   png_const_voidp memory, png_size_t size));
+   /* The PNG header is read from the given memory buffer. */
+
+PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image,
+   png_const_colorp background, void *buffer, png_int_32 row_stride,
+   void *colormap));
+   /* Finish reading the image into the supplied buffer and clean up the
+    * png_image structure.
+    *
+    * row_stride is the step, in byte or 2-byte units as appropriate,
+    * between adjacent rows.  A positive stride indicates that the top-most row
+    * is first in the buffer - the normal top-down arrangement.  A negative
+    * stride indicates that the bottom-most row is first in the buffer.
+    *
+    * background need only be supplied if an alpha channel must be removed from
+    * a png_byte format and the removal is to be done by compositing on a solid
+    * color; otherwise it may be NULL and any composition will be done directly
+    * onto the buffer.  The value is an sRGB color to use for the background,
+    * for grayscale output the green channel is used.
+    *
+    * background must be supplied when an alpha channel must be removed from a
+    * single byte color-mapped output format, in other words if:
+    *
+    * 1) The original format from png_image_begin_read_from_* had
+    *    PNG_FORMAT_FLAG_ALPHA set.
+    * 2) The format set by the application does not.
+    * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and
+    *    PNG_FORMAT_FLAG_LINEAR *not* set.
+    *
+    * For linear output removing the alpha channel is always done by compositing
+    * on black and background is ignored.:
+    *
+    * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set.  It must
+    * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE.
+    * image->colormap_entries will be updated to the actual number of entries
+    * written to the colormap; this may be less than the original value.
+    */
+
+PNG_EXPORT(238, void, png_image_free, (png_imagep image));
+   /* Free any data allocated by libpng in image->opaque, setting the pointer to
+    * NULL.  May be called at any time after the structure is initialized.
+    */
+#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */
+
+#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED
+/* WRITE APIS
+ * ----------
+ * For write you must initialize a png_image structure to describe the image to
+ * be written.  To do this use memset to set the whole structure to 0 then
+ * initialize fields describing your image.
+ *
+ * version: must be set to PNG_IMAGE_VERSION
+ * opaque: must be initialized to NULL
+ * width: image width in pixels
+ * height: image height in rows
+ * format: the format of the data (image and color-map) you wish to write
+ * flags: set to 0 unless one of the defined flags applies; set
+ *    PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB
+ *    values do not correspond to the colors in sRGB.
+ * colormap_entries: set to the number of entries in the color-map (0 to 256)
+ */
+PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image,
+   const char *file, int convert_to_8bit, const void *buffer,
+   png_int_32 row_stride, const void *colormap));
+   /* Write the image to the named file. */
+
+PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,
+   int convert_to_8_bit, const void *buffer, png_int_32 row_stride,
+   const void *colormap));
+   /* Write the image to the given (FILE*). */
+
+/* With both write APIs if image is in one of the linear formats with 16-bit
+ * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG
+ * gamma encoded according to the sRGB specification, otherwise a 16-bit linear
+ * encoded PNG file is written.
+ *
+ * With color-mapped data formats the colormap parameter point to a color-map
+ * with at least image->colormap_entries encoded in the specified format.  If
+ * the format is linear the written PNG color-map will be converted to sRGB
+ * regardless of the convert_to_8_bit flag.
+ *
+ * With all APIs row_stride is handled as in the read APIs - it is the spacing
+ * from one row to the next in component sized units (1 or 2 bytes) and if
+ * negative indicates a bottom-up row layout in the buffer.
+ *
+ * Note that the write API does not support interlacing or sub-8-bit pixels.
+ */
+#endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */
+/*******************************************************************************
+ *  END OF SIMPLIFIED API
+ ******************************************************************************/
+
+#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
+PNG_EXPORT(242, void, png_set_check_for_invalid_index,
+    (png_structrp png_ptr, int allowed));
+#  ifdef PNG_GET_PALETTE_MAX_SUPPORTED
+PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,
+    png_const_infop info_ptr));
+#  endif
+#endif /* CHECK_FOR_INVALID_INDEX */
+
 /* Maintainer: Put new public prototypes here ^, in libpng.3, and project
- * defs
+ * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt
  */
 
 /* The last ordinal number (this is the *last* one already used; the next
@@ -2665,7 +3218,7 @@ PNG_EXPORT(234, void, png_set_check_for_invalid_index, (png_structp png_ptr,
  * scripts/symbols.def as well.
  */
 #ifdef PNG_EXPORT_LAST_ORDINAL
-  PNG_EXPORT_LAST_ORDINAL(234);
+  PNG_EXPORT_LAST_ORDINAL(243);
 #endif
 
 #ifdef __cplusplus
index f6b38a6a00d5d0e1763f95e064577b67204eaf75..cbfd517ddbc0c6e84bbf7194511484555a1d8e54 100644 (file)
@@ -1,7 +1,7 @@
 
 /* pngconf.h - machine configurable file for libpng
  *
- * libpng version 1.5.14 - January 24, 2013
+ * libpng version 1.6.0 - February 14, 2013
  *
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
 #ifndef PNGCONF_H
 #define PNGCONF_H
 
-#ifndef PNG_BUILDING_SYMBOL_TABLE
-/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
- * definition file for  machine specific limits, this may impact the
- * correctness of the definitions below (see uses of INT_MAX).
- */
-#  ifndef PNG_NO_LIMITS_H
-#    include <limits.h>
+/* To do: Do all of this in scripts/pnglibconf.dfa */
+#ifdef PNG_SAFE_LIMITS_SUPPORTED
+#  ifdef PNG_USER_WIDTH_MAX
+#    undef PNG_USER_WIDTH_MAX
+#    define PNG_USER_WIDTH_MAX 1000000L
 #  endif
-
-/* For the memory copy APIs (i.e. the standard definitions of these),
- * because this file defines png_memcpy and so on the base APIs must
- * be defined here.
- */
-#  ifdef BSD
-#    include <strings.h>
-#  else
-#    include <string.h>
+#  ifdef PNG_USER_HEIGHT_MAX
+#    undef PNG_USER_HEIGHT_MAX
+#    define PNG_USER_HEIGHT_MAX 1000000L
 #  endif
+#  ifdef PNG_USER_CHUNK_MALLOC_MAX
+#    undef PNG_USER_CHUNK_MALLOC_MAX
+#    define PNG_USER_CHUNK_MALLOC_MAX 4000000L
+#  endif
+#  ifdef PNG_USER_CHUNK_CACHE_MAX
+#    undef PNG_USER_CHUNK_CACHE_MAX
+#    define PNG_USER_CHUNK_CACHE_MAX 128
+#  endif
+#endif
+
+#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */
 
-/* For png_FILE_p - this provides the standard definition of a
- * FILE
+/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C
+ * compiler for correct compilation.  The following header files are required by
+ * the standard.  If your compiler doesn't provide these header files, or they
+ * do not match the standard, you will need to provide/improve them.
  */
-#  ifdef PNG_STDIO_SUPPORTED
-#    include <stdio.h>
-#  endif
+#include <limits.h>
+#include <stddef.h>
+
+/* Library header files.  These header files are all defined by ISOC90; libpng
+ * expects conformant implementations, however, an ISOC90 conformant system need
+ * not provide these header files if the functionality cannot be implemented.
+ * In this case it will be necessary to disable the relevant parts of libpng in
+ * the build of pnglibconf.h.
+ *
+ * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not
+ * include this unnecessary header file.
+ */
+
+#ifdef PNG_STDIO_SUPPORTED
+   /* Required for the definition of FILE: */
+#  include <stdio.h>
+#endif
+
+#ifdef PNG_SETJMP_SUPPORTED
+   /* Required for the definition of jmp_buf and the declaration of longjmp: */
+#  include <setjmp.h>
+#endif
+
+#ifdef PNG_CONVERT_tIME_SUPPORTED
+   /* Required for struct tm: */
+#  include <time.h>
 #endif
 
+#endif /* PNG_BUILDING_SYMBOL_TABLE */
+
+/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using
+ * PNG_NO_CONST; this is no longer supported except for data declarations which
+ * apparently still cause problems in 2011 on some compilers.
+ */
+#define PNG_CONST const /* backward compatibility only */
+
 /* This controls optimization of the reading of 16 and 32 bit values
  * from PNG files.  It can be set on a per-app-file basis - it
  * just changes whether a macro is used when the function is called.
  * may be changed on a per-file basis when compiling against libpng.
  */
 
-/* The PNGARG macro protects us against machines that don't have function
- * prototypes (ie K&R style headers).  If your compiler does not handle
- * function prototypes, define this macro and use the included ansi2knr.
- * I've always been able to use _NO_PROTO as the indicator, but you may
- * need to drag the empty declaration out in front of here, or change the
- * ifdef to suit your own needs.
+/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect
+ * against legacy (pre ISOC90) compilers that did not understand function
+ * prototypes.  It is not required for modern C compilers.
  */
 #ifndef PNGARG
-
-#  ifdef OF /* zlib prototype munger */
-#    define PNGARG(arglist) OF(arglist)
-#  else
-
-#    ifdef _NO_PROTO
-#      define PNGARG(arglist) ()
-#    else
-#      define PNGARG(arglist) arglist
-#    endif /* _NO_PROTO */
-
-#  endif /* OF */
-
-#endif /* PNGARG */
+#  define PNGARG(arglist) arglist
+#endif
 
 /* Function calling conventions.
  * =============================
   /* NOTE: PNGCBAPI always defaults to PNGCAPI. */
 
 #  if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
-   ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
+#     error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"
 #  endif
 
 #  if (defined(_MSC_VER) && _MSC_VER < 800) ||\
 
 #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
   /* Support for compiler specific function attributes.  These are used
-   * so that where compiler support is available incorrect use of API
+   * so that where compiler support is available, incorrect use of API
    * functions in png.h will generate compiler warnings.  Added at libpng
-   * version 1.2.41.
+   * version 1.2.41.  Disabling these removes the warnings but may also produce
+   * less efficient code.
    */
 #  if defined(__GNUC__)
 #    ifndef PNG_USE_RESULT
             __attribute__((__deprecated__))
 #        endif
 #      endif
+#      if ((__GNUC__ != 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))
+#        ifndef PNG_RESTRICT
+#          define PNG_RESTRICT __restrict
+#        endif
+#      endif /*  __GNUC__ == 3.0 */
 #    endif /*  __GNUC__ >= 3 */
-#  endif /* __GNUC__ */
 
-#  if defined(_MSC_VER)  && (_MSC_VER >= 1300)
+#  elif defined(_MSC_VER)  && (_MSC_VER >= 1300)
 #    ifndef PNG_USE_RESULT
 #      define PNG_USE_RESULT /* not supported */
 #    endif
 #    ifndef PNG_NORETURN
-#      define PNG_NORETURN __declspec(noreturn)
+#      define PNG_NORETURN   __declspec(noreturn)
 #    endif
 #    ifndef PNG_ALLOCATED
 #      if (_MSC_VER >= 1400)
 #    ifndef PNG_PRIVATE
 #      define PNG_PRIVATE __declspec(deprecated)
 #    endif
+#    ifndef PNG_RESTRICT
+#      if (_MSC_VER >= 1400)
+#        define PNG_RESTRICT __restrict
+#      endif
+#    endif
+
+#  elif defined(__WATCOMC__)
+#    ifndef PNG_RESTRICT
+#      define PNG_RESTRICT __restrict
+#    endif
 #  endif /* _MSC_VER */
 #endif /* PNG_PEDANTIC_WARNINGS */
 
 #ifndef PNG_PRIVATE
 #  define PNG_PRIVATE     /* This is a private libpng function */
 #endif
+#ifndef PNG_RESTRICT
+#  define PNG_RESTRICT    /* The C99 "restrict" feature */
+#endif
 #ifndef PNG_FP_EXPORT     /* A floating point API. */
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 #     define PNG_FP_EXPORT(ordinal, type, name, args)\
 #  endif
 #endif
 
-/* The following uses const char * instead of char * for error
- * and warning message functions, so some compilers won't complain.
- * If you do not want to use const, define PNG_NO_CONST here.
+#ifndef PNG_BUILDING_SYMBOL_TABLE
+/* Some typedefs to get us started.  These should be safe on most of the common
+ * platforms.
  *
- * This should not change how the APIs are called, so it can be done
- * on a per-file basis in the application.
+ * png_uint_32 and png_int_32 may, currently, be larger than required to hold a
+ * 32-bit value however this is not normally advisable.
+ *
+ * png_uint_16 and png_int_16 should always be two bytes in size - this is
+ * verified at library build time.
+ *
+ * png_byte must always be one byte in size.
+ *
+ * The checks below use constants from limits.h, as defined by the ISOC90
+ * standard.
  */
-#ifndef PNG_CONST
-#  ifndef PNG_NO_CONST
-#    define PNG_CONST const
-#  else
-#    define PNG_CONST
-#  endif
+#if CHAR_BIT == 8 && UCHAR_MAX == 255
+   typedef unsigned char png_byte;
+#else
+#  error "libpng requires 8 bit bytes"
 #endif
 
-/* Some typedefs to get us started.  These should be safe on most of the
- * common platforms.  The typedefs should be at least as large as the
- * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
- * don't have to be exactly that size.  Some compilers dislike passing
- * unsigned shorts as function parameters, so you may be better off using
- * unsigned int for png_uint_16.
- */
+#if INT_MIN == -32768 && INT_MAX == 32767
+   typedef int png_int_16;
+#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
+   typedef short png_int_16;
+#else
+#  error "libpng requires a signed 16 bit type"
+#endif
 
-#if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
-typedef unsigned int png_uint_32;
-typedef int png_int_32;
+#if UINT_MAX == 65535
+   typedef unsigned int png_uint_16;
+#elif USHRT_MAX == 65535
+   typedef unsigned short png_uint_16;
 #else
-typedef unsigned long png_uint_32;
-typedef long png_int_32;
+#  error "libpng requires an unsigned 16 bit type"
 #endif
-typedef unsigned short png_uint_16;
-typedef short png_int_16;
-typedef unsigned char png_byte;
 
-#ifdef PNG_NO_SIZE_T
-typedef unsigned int png_size_t;
+#if INT_MIN < -2147483646 && INT_MAX > 2147483646
+   typedef int png_int_32;
+#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
+   typedef long int png_int_32;
 #else
-typedef size_t png_size_t;
+#  error "libpng requires a signed 32 bit (or more) type"
 #endif
-#define png_sizeof(x) (sizeof (x))
 
-/* The following is needed for medium model support.  It cannot be in the
- * pngpriv.h header.  Needs modification for other compilers besides
- * MSC.  Model independent support declares all arrays and pointers to be
- * large using the far keyword.  The zlib version used must also support
- * model independent data.  As of version zlib 1.0.4, the necessary changes
- * have been made in zlib.  The USE_FAR_KEYWORD define triggers other
- * changes that are needed. (Tim Wegner)
- */
+#if UINT_MAX > 4294967294
+   typedef unsigned int png_uint_32;
+#elif ULONG_MAX > 4294967294
+   typedef unsigned long int png_uint_32;
+#else
+#  error "libpng requires an unsigned 32 bit (or more) type"
+#endif
 
-/* Separate compiler dependencies (problem here is that zlib.h always
- * defines FAR. (SJT)
- */
-#ifdef __BORLANDC__
-#  if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
-#    define LDATA 1
-#  else
-#    define LDATA 0
-#  endif
-  /* GRR:  why is Cygwin in here?  Cygwin is not Borland C... */
-#  if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
-#    define PNG_MAX_MALLOC_64K /* only used in build */
-#    if (LDATA != 1)
-#      ifndef FAR
-#        define FAR __far
-#      endif
-#      define USE_FAR_KEYWORD
-#    endif   /* LDATA != 1 */
-         /* Possibly useful for moving data out of default segment.
-          * Uncomment it if you want. Could also define FARDATA as
-          * const if your compiler supports it. (SJT)
-#        define FARDATA FAR
-          */
-#  endif  /* __WIN32__, __FLAT__, __CYGWIN__ */
-#endif   /* __BORLANDC__ */
-
-
-/* Suggest testing for specific compiler first before testing for
- * FAR.  The Watcom compiler defines both __MEDIUM__ and M_I86MM,
- * making reliance oncertain keywords suspect. (SJT)
+/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
+ * requires an ISOC90 compiler and relies on consistent behavior of sizeof.
  */
+typedef size_t png_size_t;
+typedef ptrdiff_t png_ptrdiff_t;
 
-/* MSC Medium model */
-#ifdef FAR
-#  ifdef M_I86MM
-#    define USE_FAR_KEYWORD
-#    define FARDATA FAR
-#    include <dos.h>
+/* libpng needs to know the maximum value of 'size_t' and this controls the
+ * definition of png_alloc_size_t, below.  This maximum value of size_t limits
+ * but does not control the maximum allocations the library makes - there is
+ * direct application control of this through png_set_user_limits().
+ */
+#ifndef PNG_SMALL_SIZE_T
+   /* Compiler specific tests for systems where size_t is known to be less than
+    * 32 bits (some of these systems may no longer work because of the lack of
+    * 'far' support; see above.)
+    */
+#  if (defined(__TURBOC__) && !defined(__FLAT__)) ||\
+   (defined(_MSC_VER) && defined(MAXSEG_64K))
+#     define PNG_SMALL_SIZE_T
 #  endif
 #endif
 
-/* SJT: default case */
-#ifndef FAR
-#  define FAR
+/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no
+ * smaller than png_uint_32.  Casts from png_size_t or png_uint_32 to
+ * png_alloc_size_t are not necessary; in fact, it is recommended not to use
+ * them at all so that the compiler can complain when something turns out to be
+ * problematic.
+ *
+ * Casts in the other direction (from png_alloc_size_t to png_size_t or
+ * png_uint_32) should be explicitly applied; however, we do not expect to
+ * encounter practical situations that require such conversions.
+ *
+ * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than
+ * 4294967295 - i.e. less than the maximum value of png_uint_32.
+ */
+#ifdef PNG_SMALL_SIZE_T
+   typedef png_uint_32 png_alloc_size_t;
+#else
+   typedef png_size_t png_alloc_size_t;
 #endif
 
-/* At this point FAR is always defined */
-#ifndef FARDATA
-#  define FARDATA
-#endif
+/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
+ * implementations of Intel CPU specific support of user-mode segmented address
+ * spaces, where 16-bit pointers address more than 65536 bytes of memory using
+ * separate 'segment' registers.  The implementation requires two different
+ * types of pointer (only one of which includes the segment value.)
+ *
+ * If required this support is available in version 1.2 of libpng and may be
+ * available in versions through 1.5, although the correctness of the code has
+ * not been verified recently.
+ */
 
-/* Typedef for floating-point numbers that are converted
- * to fixed-point with a multiple of 100,000, e.g., gamma
+/* Typedef for floating-point numbers that are converted to fixed-point with a
+ * multiple of 100,000, e.g., gamma
  */
 typedef png_int_32 png_fixed_point;
 
 /* Add typedefs for pointers */
-typedef void                      FAR * png_voidp;
-typedef PNG_CONST void            FAR * png_const_voidp;
-typedef png_byte                  FAR * png_bytep;
-typedef PNG_CONST png_byte        FAR * png_const_bytep;
-typedef png_uint_32               FAR * png_uint_32p;
-typedef PNG_CONST png_uint_32     FAR * png_const_uint_32p;
-typedef png_int_32                FAR * png_int_32p;
-typedef PNG_CONST png_int_32      FAR * png_const_int_32p;
-typedef png_uint_16               FAR * png_uint_16p;
-typedef PNG_CONST png_uint_16     FAR * png_const_uint_16p;
-typedef png_int_16                FAR * png_int_16p;
-typedef PNG_CONST png_int_16      FAR * png_const_int_16p;
-typedef char                      FAR * png_charp;
-typedef PNG_CONST char            FAR * png_const_charp;
-typedef png_fixed_point           FAR * png_fixed_point_p;
-typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
-typedef png_size_t                FAR * png_size_tp;
-typedef PNG_CONST png_size_t      FAR * png_const_size_tp;
+typedef void                  * png_voidp;
+typedef const void            * png_const_voidp;
+typedef png_byte              * png_bytep;
+typedef const png_byte        * png_const_bytep;
+typedef png_uint_32           * png_uint_32p;
+typedef const png_uint_32     * png_const_uint_32p;
+typedef png_int_32            * png_int_32p;
+typedef const png_int_32      * png_const_int_32p;
+typedef png_uint_16           * png_uint_16p;
+typedef const png_uint_16     * png_const_uint_16p;
+typedef png_int_16            * png_int_16p;
+typedef const png_int_16      * png_const_int_16p;
+typedef char                  * png_charp;
+typedef const char            * png_const_charp;
+typedef png_fixed_point       * png_fixed_point_p;
+typedef const png_fixed_point * png_const_fixed_point_p;
+typedef png_size_t            * png_size_tp;
+typedef const png_size_t      * png_const_size_tp;
 
 #ifdef PNG_STDIO_SUPPORTED
 typedef FILE            * png_FILE_p;
 #endif
 
 #ifdef PNG_FLOATING_POINT_SUPPORTED
-typedef double           FAR * png_doublep;
-typedef PNG_CONST double FAR * png_const_doublep;
+typedef double       * png_doublep;
+typedef const double * png_const_doublep;
 #endif
 
 /* Pointers to pointers; i.e. arrays */
-typedef png_byte        FAR * FAR * png_bytepp;
-typedef png_uint_32     FAR * FAR * png_uint_32pp;
-typedef png_int_32      FAR * FAR * png_int_32pp;
-typedef png_uint_16     FAR * FAR * png_uint_16pp;
-typedef png_int_16      FAR * FAR * png_int_16pp;
-typedef PNG_CONST char  FAR * FAR * png_const_charpp;
-typedef char            FAR * FAR * png_charpp;
-typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
+typedef png_byte        * * png_bytepp;
+typedef png_uint_32     * * png_uint_32pp;
+typedef png_int_32      * * png_int_32pp;
+typedef png_uint_16     * * png_uint_16pp;
+typedef png_int_16      * * png_int_16pp;
+typedef const char      * * png_const_charpp;
+typedef char            * * png_charpp;
+typedef png_fixed_point * * png_fixed_point_pp;
 #ifdef PNG_FLOATING_POINT_SUPPORTED
-typedef double          FAR * FAR * png_doublepp;
+typedef double          * * png_doublepp;
 #endif
 
 /* Pointers to pointers to pointers; i.e., pointer to array */
-typedef char            FAR * FAR * FAR * png_charppp;
+typedef char            * * * png_charppp;
 
-/* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
- * and no smaller than png_uint_32.  Casts from png_size_t or png_uint_32
- * to png_alloc_size_t are not necessary; in fact, it is recommended
- * not to use them at all so that the compiler can complain when something
- * turns out to be problematic.
- * Casts in the other direction (from png_alloc_size_t to png_size_t or
- * png_uint_32) should be explicitly applied; however, we do not expect
- * to encounter practical situations that require such conversions.
- */
-#if defined(__TURBOC__) && !defined(__FLAT__)
-   typedef unsigned long png_alloc_size_t;
-#else
-#  if defined(_MSC_VER) && defined(MAXSEG_64K)
-     typedef unsigned long    png_alloc_size_t;
-#  else
-     /* This is an attempt to detect an old Windows system where (int) is
-      * actually 16 bits, in that case png_malloc must have an argument with a
-      * bigger size to accomodate the requirements of the library.
-      */
-#    if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
-        (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
-       typedef DWORD         png_alloc_size_t;
-#    else
-       typedef png_size_t    png_alloc_size_t;
-#    endif
-#  endif
-#endif
+#endif /* PNG_BUILDING_SYMBOL_TABLE */
 
 #endif /* PNGCONF_H */
index ba3987977401b79910be08cdf5482e2dfc1c1320..18152d96c0be1e4a03ef595476047748081bfb6b 100644 (file)
@@ -1,7 +1,7 @@
 
 /* pngerror.c - stub functions for i/o and memory allocation
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
+ * Last changed in libpng 1.6.0 [February 14, 2013]
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
 
 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
 
-static PNG_FUNCTION(void, png_default_error,PNGARG((png_structp png_ptr,
+static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr,
     png_const_charp error_message)),PNG_NORETURN);
 
 #ifdef PNG_WARNINGS_SUPPORTED
 static void /* PRIVATE */
-png_default_warning PNGARG((png_structp png_ptr,
+png_default_warning PNGARG((png_const_structrp png_ptr,
    png_const_charp warning_message));
 #endif /* PNG_WARNINGS_SUPPORTED */
 
@@ -36,7 +36,8 @@ png_default_warning PNGARG((png_structp png_ptr,
  */
 #ifdef PNG_ERROR_TEXT_SUPPORTED
 PNG_FUNCTION(void,PNGAPI
-png_error,(png_structp png_ptr, png_const_charp error_message),PNG_NORETURN)
+png_error,(png_const_structrp png_ptr, png_const_charp error_message),
+   PNG_NORETURN)
 {
 #ifdef PNG_ERROR_NUMBERS_SUPPORTED
    char msg[16];
@@ -79,7 +80,8 @@ png_error,(png_structp png_ptr, png_const_charp error_message),PNG_NORETURN)
    }
 #endif
    if (png_ptr != NULL && png_ptr->error_fn != NULL)
-      (*(png_ptr->error_fn))(png_ptr, error_message);
+      (*(png_ptr->error_fn))(png_constcast(png_structrp,png_ptr),
+          error_message);
 
    /* If the custom handler doesn't exist, or if it returns,
       use the default handler, which will not return. */
@@ -87,7 +89,7 @@ png_error,(png_structp png_ptr, png_const_charp error_message),PNG_NORETURN)
 }
 #else
 PNG_FUNCTION(void,PNGAPI
-png_err,(png_structp png_ptr),PNG_NORETURN)
+png_err,(png_const_structrp png_ptr),PNG_NORETURN)
 {
    /* Prior to 1.5.2 the error_fn received a NULL pointer, expressed
     * erroneously as '\0', instead of the empty string "".  This was
@@ -95,7 +97,7 @@ png_err,(png_structp png_ptr),PNG_NORETURN)
     * will crash in this case.
     */
    if (png_ptr != NULL && png_ptr->error_fn != NULL)
-      (*(png_ptr->error_fn))(png_ptr, "");
+      (*(png_ptr->error_fn))(png_constcast(png_structrp,png_ptr), "");
 
    /* If the custom handler doesn't exist, or if it returns,
       use the default handler, which will not return. */
@@ -211,7 +213,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
  * png_set_error_fn() to replace the warning function at run-time.
  */
 void PNGAPI
-png_warning(png_structp png_ptr, png_const_charp warning_message)
+png_warning(png_const_structrp png_ptr, png_const_charp warning_message)
 {
    int offset = 0;
    if (png_ptr != NULL)
@@ -230,7 +232,8 @@ png_warning(png_structp png_ptr, png_const_charp warning_message)
       }
    }
    if (png_ptr != NULL && png_ptr->warning_fn != NULL)
-      (*(png_ptr->warning_fn))(png_ptr, warning_message + offset);
+      (*(png_ptr->warning_fn))(png_constcast(png_structrp,png_ptr),
+         warning_message + offset);
    else
       png_default_warning(png_ptr, warning_message + offset);
 }
@@ -278,7 +281,7 @@ png_warning_parameter_signed(png_warning_parameters p, int number, int format,
 }
 
 void
-png_formatted_warning(png_structp png_ptr, png_warning_parameters p,
+png_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p,
    png_const_charp message)
 {
    /* The internal buffer is just 192 bytes - enough for all our messages,
@@ -346,9 +349,9 @@ png_formatted_warning(png_structp png_ptr, png_warning_parameters p,
    /* i is always less than (sizeof msg), so: */
    msg[i] = '\0';
 
-   /* And this is the formatted message, it may be larger than
-    * PNG_MAX_ERROR_TEXT, but that is only used for 'chunk' errors and these are
-    * not (currently) formatted.
+   /* And this is the formatted message. It may be larger than
+    * PNG_MAX_ERROR_TEXT, but that is only used for 'chunk' errors and these
+    * are not (currently) formatted.
     */
    png_warning(png_ptr, msg);
 }
@@ -356,14 +359,49 @@ png_formatted_warning(png_structp png_ptr, png_warning_parameters p,
 
 #ifdef PNG_BENIGN_ERRORS_SUPPORTED
 void PNGAPI
-png_benign_error(png_structp png_ptr, png_const_charp error_message)
+png_benign_error(png_const_structrp png_ptr, png_const_charp error_message)
+{
+   if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN)
+   {
+#     ifdef PNG_READ_SUPPORTED
+         if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
+            png_ptr->chunk_name != 0)
+            png_chunk_warning(png_ptr, error_message);
+         else
+#     endif
+      png_warning(png_ptr, error_message);
+   }
+
+   else
+   {
+#     ifdef PNG_READ_SUPPORTED
+         if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
+            png_ptr->chunk_name != 0)
+            png_chunk_error(png_ptr, error_message);
+         else
+#     endif
+      png_error(png_ptr, error_message);
+   }
+}
+
+void /* PRIVATE */
+png_app_warning(png_const_structrp png_ptr, png_const_charp error_message)
 {
-  if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN)
+  if (png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN)
      png_warning(png_ptr, error_message);
   else
      png_error(png_ptr, error_message);
 }
-#endif
+
+void /* PRIVATE */
+png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
+{
+  if (png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN)
+     png_warning(png_ptr, error_message);
+  else
+     png_error(png_ptr, error_message);
+}
+#endif /* BENIGN_ERRORS */
 
 /* These utilities are used internally to build an error message that relates
  * to the current chunk.  The chunk name comes from png_ptr->chunk_name,
@@ -377,10 +415,10 @@ static PNG_CONST char png_digit[16] = {
    'A', 'B', 'C', 'D', 'E', 'F'
 };
 
-#define PNG_MAX_ERROR_TEXT 64
+#define PNG_MAX_ERROR_TEXT 196 /* Currently limited be profile_error in png.c */
 #if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_ERROR_TEXT_SUPPORTED)
 static void /* PRIVATE */
-png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
+png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp
     error_message)
 {
    png_uint_32 chunk_name = png_ptr->chunk_name;
@@ -426,7 +464,7 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
 
 #if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
 PNG_FUNCTION(void,PNGAPI
-png_chunk_error,(png_structp png_ptr, png_const_charp error_message),
+png_chunk_error,(png_const_structrp png_ptr, png_const_charp error_message),
    PNG_NORETURN)
 {
    char msg[18+PNG_MAX_ERROR_TEXT];
@@ -443,7 +481,7 @@ png_chunk_error,(png_structp png_ptr, png_const_charp error_message),
 
 #ifdef PNG_WARNINGS_SUPPORTED
 void PNGAPI
-png_chunk_warning(png_structp png_ptr, png_const_charp warning_message)
+png_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message)
 {
    char msg[18+PNG_MAX_ERROR_TEXT];
    if (png_ptr == NULL)
@@ -460,7 +498,8 @@ png_chunk_warning(png_structp png_ptr, png_const_charp warning_message)
 #ifdef PNG_READ_SUPPORTED
 #ifdef PNG_BENIGN_ERRORS_SUPPORTED
 void PNGAPI
-png_chunk_benign_error(png_structp png_ptr, png_const_charp error_message)
+png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp
+    error_message)
 {
    if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN)
       png_chunk_warning(png_ptr, error_message);
@@ -471,16 +510,51 @@ png_chunk_benign_error(png_structp png_ptr, png_const_charp error_message)
 #endif
 #endif /* PNG_READ_SUPPORTED */
 
+void /* PRIVATE */
+png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
+{
+   /* This is always supported, but for just read or just write it
+    * unconditionally does the right thing.
+    */
+#  if (defined PNG_READ_SUPPORTED) && (defined PNG_WRITE_SUPPORTED)
+      if (png_ptr->mode & PNG_IS_READ_STRUCT)
+#  endif
+
+#  ifdef PNG_READ_SUPPORTED
+      {
+         if (error < PNG_CHUNK_ERROR)
+            png_chunk_warning(png_ptr, message);
+
+         else
+            png_chunk_benign_error(png_ptr, message);
+      }
+#  endif
+
+#  if (defined PNG_READ_SUPPORTED) && (defined PNG_WRITE_SUPPORTED)
+      else if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
+#  endif
+
+#  ifdef PNG_WRITE_SUPPORTED
+      {
+         if (error < PNG_CHUNK_WRITE_ERROR)
+            png_app_warning(png_ptr, message);
+
+         else
+            png_app_error(png_ptr, message);
+      }
+#  endif
+}
+
 #ifdef PNG_ERROR_TEXT_SUPPORTED
 #ifdef PNG_FLOATING_POINT_SUPPORTED
 PNG_FUNCTION(void,
-png_fixed_error,(png_structp png_ptr, png_const_charp name),PNG_NORETURN)
+png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN)
 {
 #  define fixed_message "fixed point overflow in "
 #  define fixed_message_ln ((sizeof fixed_message)-1)
    int  iin;
    char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT];
-   png_memcpy(msg, fixed_message, fixed_message_ln);
+   memcpy(msg, fixed_message, fixed_message_ln);
    iin = 0;
    if (name != NULL) while (iin < (PNG_MAX_ERROR_TEXT-1) && name[iin] != 0)
    {
@@ -498,14 +572,111 @@ png_fixed_error,(png_structp png_ptr, png_const_charp name),PNG_NORETURN)
  * otherwise it is necessary for png_default_error to be overridden.
  */
 jmp_buf* PNGAPI
-png_set_longjmp_fn(png_structp png_ptr, png_longjmp_ptr longjmp_fn,
+png_set_longjmp_fn(png_structrp png_ptr, png_longjmp_ptr longjmp_fn,
     size_t jmp_buf_size)
 {
-   if (png_ptr == NULL || jmp_buf_size != png_sizeof(jmp_buf))
+   /* From libpng 1.6.0 the app gets one chance to set a 'jmpbuf_size' value
+    * and it must not change after that.  Libpng doesn't care how big the
+    * buffer is, just that it doesn't change.
+    *
+    * If the buffer size is no *larger* than the size of jmp_buf when libpng is
+    * compiled a built in jmp_buf is returned; this preserves the pre-1.6.0
+    * semantics that this call will not fail.  If the size is larger, however,
+    * the buffer is allocated and this may fail, causing the function to return
+    * NULL.
+    */
+   if (png_ptr == NULL)
       return NULL;
 
+   if (png_ptr->jmp_buf_ptr == NULL)
+   {
+      png_ptr->jmp_buf_size = 0; /* not allocated */
+
+      if (jmp_buf_size <= (sizeof png_ptr->jmp_buf_local))
+         png_ptr->jmp_buf_ptr = &png_ptr->jmp_buf_local;
+
+      else
+      {
+         png_ptr->jmp_buf_ptr = png_voidcast(jmp_buf *,
+            png_malloc_warn(png_ptr, jmp_buf_size));
+
+         if (png_ptr->jmp_buf_ptr == NULL)
+            return NULL; /* new NULL return on OOM */
+
+         png_ptr->jmp_buf_size = jmp_buf_size;
+      }
+   }
+
+   else /* Already allocated: check the size */
+   {
+      size_t size = png_ptr->jmp_buf_size;
+
+      if (size == 0)
+      {
+         size = (sizeof png_ptr->jmp_buf_local);
+         if (png_ptr->jmp_buf_ptr != &png_ptr->jmp_buf_local)
+         {
+            /* This is an internal error in libpng: somehow we have been left
+             * with a stack allocated jmp_buf when the application regained
+             * control.  It's always possible to fix this up, but for the moment
+             * this is a png_error because that makes it easy to detect.
+             */
+            png_error(png_ptr, "Libpng jmp_buf still allocated");
+            /* png_ptr->jmp_buf_ptr = &png_ptr->jmp_buf_local; */
+         }
+      }
+
+      if (size != jmp_buf_size)
+      {
+         png_warning(png_ptr, "Application jmp_buf size changed");
+         return NULL; /* caller will probably crash: no choice here */
+      }
+   }
+
+   /* Finally fill in the function, now we have a satisfactory buffer. It is
+    * valid to change the function on every call.
+    */
    png_ptr->longjmp_fn = longjmp_fn;
-   return &png_ptr->longjmp_buffer;
+   return png_ptr->jmp_buf_ptr;
+}
+
+void /* PRIVATE */
+png_free_jmpbuf(png_structrp png_ptr)
+{
+   if (png_ptr != NULL)
+   {
+      jmp_buf *jb = png_ptr->jmp_buf_ptr;
+
+      /* A size of 0 is used to indicate a local, stack, allocation of the
+       * pointer; used here and in png.c
+       */
+      if (jb != NULL && png_ptr->jmp_buf_size > 0)
+      {
+
+         /* This stuff is so that a failure to free the error control structure
+          * does not leave libpng in a state with no valid error handling: the
+          * free always succeeds, if there is an error it gets ignored.
+          */
+         if (jb != &png_ptr->jmp_buf_local)
+         {
+            /* Make an internal, libpng, jmp_buf to return here */
+            jmp_buf free_jmp_buf;
+
+            if (!setjmp(free_jmp_buf))
+            {
+               png_ptr->jmp_buf_ptr = &free_jmp_buf; /* come back here */
+               png_ptr->jmp_buf_size = 0; /* stack allocation */
+               png_ptr->longjmp_fn = longjmp;
+               png_free(png_ptr, jb); /* Return to setjmp on error */
+            }
+         }
+      }
+
+      /* *Always* cancel everything out: */
+      png_ptr->jmp_buf_size = 0;
+      png_ptr->jmp_buf_ptr = NULL;
+      png_ptr->longjmp_fn = 0;
+   }
 }
 #endif
 
@@ -515,7 +686,7 @@ png_set_longjmp_fn(png_structp png_ptr, png_longjmp_ptr longjmp_fn,
  * error function pointer in png_set_error_fn().
  */
 static PNG_FUNCTION(void /* PRIVATE */,
-png_default_error,(png_structp png_ptr, png_const_charp error_message),
+png_default_error,(png_const_structrp png_ptr, png_const_charp error_message),
    PNG_NORETURN)
 {
 #ifdef PNG_CONSOLE_IO_SUPPORTED
@@ -562,23 +733,13 @@ png_default_error,(png_structp png_ptr, png_const_charp error_message),
 }
 
 PNG_FUNCTION(void,PNGAPI
-png_longjmp,(png_structp png_ptr, int val),PNG_NORETURN)
+png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN)
 {
 #ifdef PNG_SETJMP_SUPPORTED
-   if (png_ptr && png_ptr->longjmp_fn)
-   {
-#  ifdef USE_FAR_KEYWORD
-      {
-         jmp_buf tmp_jmpbuf;
-         png_memcpy(tmp_jmpbuf, png_ptr->longjmp_buffer, png_sizeof(jmp_buf));
-         png_ptr->longjmp_fn(tmp_jmpbuf, val);
-      }
-
-#  else
-   png_ptr->longjmp_fn(png_ptr->longjmp_buffer, val);
-#  endif
-   }
+   if (png_ptr && png_ptr->longjmp_fn && png_ptr->jmp_buf_ptr)
+      png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val);
 #endif
+
    /* Here if not setjmp support or if png_ptr is null. */
    PNG_ABORT();
 }
@@ -590,7 +751,7 @@ png_longjmp,(png_structp png_ptr, int val),PNG_NORETURN)
  * not used, but it is passed in case it may be useful.
  */
 static void /* PRIVATE */
-png_default_warning(png_structp png_ptr, png_const_charp warning_message)
+png_default_warning(png_const_structrp png_ptr, png_const_charp warning_message)
 {
 #ifdef PNG_CONSOLE_IO_SUPPORTED
 #  ifdef PNG_ERROR_NUMBERS_SUPPORTED
@@ -637,10 +798,10 @@ png_default_warning(png_structp png_ptr, png_const_charp warning_message)
 /* This function is called when the application wants to use another method
  * of handling errors and warnings.  Note that the error function MUST NOT
  * return to the calling routine or serious problems will occur.  The return
- * method used in the default routine calls longjmp(png_ptr->longjmp_buffer, 1)
+ * method used in the default routine calls longjmp(png_ptr->jmp_buf_ptr, 1)
  */
 void PNGAPI
-png_set_error_fn(png_structp png_ptr, png_voidp error_ptr,
+png_set_error_fn(png_structrp png_ptr, png_voidp error_ptr,
     png_error_ptr error_fn, png_error_ptr warning_fn)
 {
    if (png_ptr == NULL)
@@ -661,7 +822,7 @@ png_set_error_fn(png_structp png_ptr, png_voidp error_ptr,
  * pointer before png_write_destroy and png_read_destroy are called.
  */
 png_voidp PNGAPI
-png_get_error_ptr(png_const_structp png_ptr)
+png_get_error_ptr(png_const_structrp png_ptr)
 {
    if (png_ptr == NULL)
       return NULL;
@@ -672,7 +833,7 @@ png_get_error_ptr(png_const_structp png_ptr)
 
 #ifdef PNG_ERROR_NUMBERS_SUPPORTED
 void PNGAPI
-png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode)
+png_set_strip_error_numbers(png_structrp png_ptr, png_uint_32 strip_mode)
 {
    if (png_ptr != NULL)
    {
@@ -682,4 +843,90 @@ png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode)
    }
 }
 #endif
+
+#if defined PNG_SIMPLIFIED_READ_SUPPORTED ||\
+   defined PNG_SIMPLIFIED_WRITE_SUPPORTED
+   /* Currently the above both depend on SETJMP_SUPPORTED, however it would be
+    * possible to implement without setjmp support just so long as there is some
+    * way to handle the error return here:
+    */
+PNG_FUNCTION(void /* PRIVATE */,
+png_safe_error,(png_structp png_nonconst_ptr, png_const_charp error_message),
+   PNG_NORETURN)
+{
+   const png_const_structrp png_ptr = png_nonconst_ptr;
+   png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
+
+   /* An error is always logged here, overwriting anything (typically a warning)
+    * that is already there:
+    */
+   if (image != NULL)
+   {
+      png_safecat(image->message, (sizeof image->message), 0, error_message);
+      image->warning_or_error |= PNG_IMAGE_ERROR;
+
+      /* Retrieve the jmp_buf from within the png_control, making this work for
+       * C++ compilation too is pretty tricky: C++ wants a pointer to the first
+       * element of a jmp_buf, but C doesn't tell us the type of that.
+       */
+      if (image->opaque != NULL && image->opaque->error_buf != NULL)
+         longjmp(png_control_jmp_buf(image->opaque), 1);
+
+      /* Missing longjmp buffer, the following is to help debugging: */
+      {
+         size_t pos = png_safecat(image->message, (sizeof image->message), 0,
+            "bad longjmp: ");
+         png_safecat(image->message, (sizeof image->message), pos,
+             error_message);
+      }
+   }
+
+   /* Here on an internal programming error. */
+   abort();
+}
+
+#ifdef PNG_WARNINGS_SUPPORTED
+void /* PRIVATE */
+png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)
+{
+   const png_const_structrp png_ptr = png_nonconst_ptr;
+   png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
+
+   /* A warning is only logged if there is no prior warning or error. */
+   if (image->warning_or_error == 0)
+   {
+      png_safecat(image->message, (sizeof image->message), 0, warning_message);
+      image->warning_or_error |= PNG_IMAGE_WARNING;
+   }
+}
+#endif
+
+int /* PRIVATE */
+png_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg)
+{
+   volatile png_imagep image = image_in;
+   volatile int result;
+   volatile png_voidp saved_error_buf;
+   jmp_buf safe_jmpbuf;
+
+   /* Safely execute function(arg) with png_error returning to this function. */
+   saved_error_buf = image->opaque->error_buf;
+   result = setjmp(safe_jmpbuf) == 0;
+
+   if (result)
+   {
+
+      image->opaque->error_buf = safe_jmpbuf;
+      result = function(arg);
+   }
+
+   image->opaque->error_buf = saved_error_buf;
+
+   /* And do the cleanup prior to any failure return. */
+   if (!result)
+      png_image_free(image);
+
+   return result;
+}
+#endif /* SIMPLIFIED READ/WRITE */
 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
index c9a663f29aaeb3f6e34a0e1eb24a4c03a46b78f8..03c8c1046959cf2861bafc099c5b5c63c66e91fa 100644 (file)
@@ -1,8 +1,8 @@
 
 /* pngget.c - retrieval of values from info struct
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
- * Copyright (c) 1998-2011 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.0 [February 14, 2013]
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -17,7 +17,7 @@
 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
 
 png_uint_32 PNGAPI
-png_get_valid(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_valid(png_const_structrp png_ptr, png_const_inforp info_ptr,
     png_uint_32 flag)
 {
    if (png_ptr != NULL && info_ptr != NULL)
@@ -27,7 +27,7 @@ png_get_valid(png_const_structp png_ptr, png_const_infop info_ptr,
 }
 
 png_size_t PNGAPI
-png_get_rowbytes(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_rowbytes(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return(info_ptr->rowbytes);
@@ -37,7 +37,7 @@ png_get_rowbytes(png_const_structp png_ptr, png_const_infop info_ptr)
 
 #ifdef PNG_INFO_IMAGE_SUPPORTED
 png_bytepp PNGAPI
-png_get_rows(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_rows(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return(info_ptr->row_pointers);
@@ -49,7 +49,7 @@ png_get_rows(png_const_structp png_ptr, png_const_infop info_ptr)
 #ifdef PNG_EASY_ACCESS_SUPPORTED
 /* Easy access to info, added in libpng-0.99 */
 png_uint_32 PNGAPI
-png_get_image_width(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_image_width(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return info_ptr->width;
@@ -58,7 +58,7 @@ png_get_image_width(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_uint_32 PNGAPI
-png_get_image_height(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_image_height(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return info_ptr->height;
@@ -67,7 +67,7 @@ png_get_image_height(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_byte PNGAPI
-png_get_bit_depth(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_bit_depth(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return info_ptr->bit_depth;
@@ -76,7 +76,7 @@ png_get_bit_depth(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_byte PNGAPI
-png_get_color_type(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_color_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return info_ptr->color_type;
@@ -85,7 +85,7 @@ png_get_color_type(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_byte PNGAPI
-png_get_filter_type(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_filter_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return info_ptr->filter_type;
@@ -94,7 +94,7 @@ png_get_filter_type(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_byte PNGAPI
-png_get_interlace_type(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_interlace_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return info_ptr->interlace_type;
@@ -103,7 +103,7 @@ png_get_interlace_type(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_byte PNGAPI
-png_get_compression_type(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_compression_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return info_ptr->compression_type;
@@ -112,7 +112,8 @@ png_get_compression_type(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_uint_32 PNGAPI
-png_get_x_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_x_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
+   info_ptr)
 {
 #ifdef PNG_pHYs_SUPPORTED
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
@@ -129,7 +130,8 @@ png_get_x_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_uint_32 PNGAPI
-png_get_y_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_y_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
+    info_ptr)
 {
 #ifdef PNG_pHYs_SUPPORTED
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
@@ -146,7 +148,7 @@ png_get_y_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_uint_32 PNGAPI
-png_get_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
 #ifdef PNG_pHYs_SUPPORTED
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
@@ -164,7 +166,8 @@ png_get_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
 
 #ifdef PNG_FLOATING_POINT_SUPPORTED
 float PNGAPI
-png_get_pixel_aspect_ratio(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_pixel_aspect_ratio(png_const_structrp png_ptr, png_const_inforp
+   info_ptr)
 {
 #ifdef PNG_READ_pHYs_SUPPORTED
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
@@ -186,8 +189,8 @@ png_get_pixel_aspect_ratio(png_const_structp png_ptr, png_const_infop info_ptr)
 
 #ifdef PNG_FIXED_POINT_SUPPORTED
 png_fixed_point PNGAPI
-png_get_pixel_aspect_ratio_fixed(png_const_structp png_ptr,
-    png_const_infop info_ptr)
+png_get_pixel_aspect_ratio_fixed(png_const_structrp png_ptr,
+    png_const_inforp info_ptr)
 {
 #ifdef PNG_READ_pHYs_SUPPORTED
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)
@@ -216,7 +219,7 @@ png_get_pixel_aspect_ratio_fixed(png_const_structp png_ptr,
 #endif
 
 png_int_32 PNGAPI
-png_get_x_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_x_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
 #ifdef PNG_oFFs_SUPPORTED
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
@@ -232,7 +235,7 @@ png_get_x_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_int_32 PNGAPI
-png_get_y_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_y_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
 #ifdef PNG_oFFs_SUPPORTED
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
@@ -248,7 +251,7 @@ png_get_y_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_int_32 PNGAPI
-png_get_x_offset_pixels(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_x_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
 #ifdef PNG_oFFs_SUPPORTED
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
@@ -264,7 +267,7 @@ png_get_x_offset_pixels(png_const_structp png_ptr, png_const_infop info_ptr)
 }
 
 png_int_32 PNGAPI
-png_get_y_offset_pixels(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_y_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
 #ifdef PNG_oFFs_SUPPORTED
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
@@ -313,26 +316,26 @@ ppi_from_ppm(png_uint_32 ppm)
 }
 
 png_uint_32 PNGAPI
-png_get_pixels_per_inch(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    return ppi_from_ppm(png_get_pixels_per_meter(png_ptr, info_ptr));
 }
 
 png_uint_32 PNGAPI
-png_get_x_pixels_per_inch(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_x_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    return ppi_from_ppm(png_get_x_pixels_per_meter(png_ptr, info_ptr));
 }
 
 png_uint_32 PNGAPI
-png_get_y_pixels_per_inch(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_y_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    return ppi_from_ppm(png_get_y_pixels_per_meter(png_ptr, info_ptr));
 }
 
 #ifdef PNG_FIXED_POINT_SUPPORTED
 static png_fixed_point
-png_fixed_inches_from_microns(png_structp png_ptr, png_int_32 microns)
+png_fixed_inches_from_microns(png_const_structrp png_ptr, png_int_32 microns)
 {
    /* Convert from metres * 1,000,000 to inches * 100,000, meters to
     * inches is simply *(100/2.54), so we want *(10/2.54) == 500/127.
@@ -343,8 +346,8 @@ png_fixed_inches_from_microns(png_structp png_ptr, png_int_32 microns)
 }
 
 png_fixed_point PNGAPI
-png_get_x_offset_inches_fixed(png_structp png_ptr,
-    png_const_infop info_ptr)
+png_get_x_offset_inches_fixed(png_const_structrp png_ptr,
+    png_const_inforp info_ptr)
 {
    return png_fixed_inches_from_microns(png_ptr,
        png_get_x_offset_microns(png_ptr, info_ptr));
@@ -353,8 +356,8 @@ png_get_x_offset_inches_fixed(png_structp png_ptr,
 
 #ifdef PNG_FIXED_POINT_SUPPORTED
 png_fixed_point PNGAPI
-png_get_y_offset_inches_fixed(png_structp png_ptr,
-    png_const_infop info_ptr)
+png_get_y_offset_inches_fixed(png_const_structrp png_ptr,
+    png_const_inforp info_ptr)
 {
    return png_fixed_inches_from_microns(png_ptr,
        png_get_y_offset_microns(png_ptr, info_ptr));
@@ -363,7 +366,7 @@ png_get_y_offset_inches_fixed(png_structp png_ptr,
 
 #ifdef PNG_FLOATING_POINT_SUPPORTED
 float PNGAPI
-png_get_x_offset_inches(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_x_offset_inches(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    /* To avoid the overflow do the conversion directly in floating
     * point.
@@ -374,7 +377,7 @@ png_get_x_offset_inches(png_const_structp png_ptr, png_const_infop info_ptr)
 
 #ifdef PNG_FLOATING_POINT_SUPPORTED
 float PNGAPI
-png_get_y_offset_inches(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_y_offset_inches(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    /* To avoid the overflow do the conversion directly in floating
     * point.
@@ -385,7 +388,7 @@ png_get_y_offset_inches(png_const_structp png_ptr, png_const_infop info_ptr)
 
 #ifdef PNG_pHYs_SUPPORTED
 png_uint_32 PNGAPI
-png_get_pHYs_dpi(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr,
     png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
 {
    png_uint_32 retval = 0;
@@ -428,8 +431,9 @@ png_get_pHYs_dpi(png_const_structp png_ptr, png_const_infop info_ptr,
 
 #endif  /* PNG_EASY_ACCESS_SUPPORTED */
 
+
 png_byte PNGAPI
-png_get_channels(png_const_structp png_ptr, png_const_infop info_ptr)
+png_get_channels(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return(info_ptr->channels);
@@ -437,18 +441,20 @@ png_get_channels(png_const_structp png_ptr, png_const_infop info_ptr)
    return (0);
 }
 
+#ifdef PNG_READ_SUPPORTED
 png_const_bytep PNGAPI
-png_get_signature(png_const_structp png_ptr, png_infop info_ptr)
+png_get_signature(png_const_structrp png_ptr, png_const_inforp info_ptr)
 {
    if (png_ptr != NULL && info_ptr != NULL)
       return(info_ptr->signature);
 
    return (NULL);
 }
+#endif
 
 #ifdef PNG_bKGD_SUPPORTED
 png_uint_32 PNGAPI
-png_get_bKGD(png_const_structp png_ptr, png_infop info_ptr,
+png_get_bKGD(png_const_structrp png_ptr, png_inforp info_ptr,
    png_color_16p *background)
 {
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)
@@ -469,87 +475,47 @@ png_get_bKGD(png_const_structp png_ptr, png_infop info_ptr,
  * same time to correct the rgb grayscale coefficient defaults obtained from the
  * cHRM chunk in 1.5.4
  */
-png_uint_32 PNGFAPI
-png_get_cHRM_XYZ_fixed(png_structp png_ptr, png_const_infop info_ptr,
-    png_fixed_point *int_red_X, png_fixed_point *int_red_Y,
-    png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
-    png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
-    png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
-    png_fixed_point *int_blue_Z)
-{
-   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
-   {
-      png_xy xy;
-      png_XYZ XYZ;
-
-      png_debug1(1, "in %s retrieval function", "cHRM_XYZ");
-
-      xy.whitex = info_ptr->x_white;
-      xy.whitey = info_ptr->y_white;
-      xy.redx = info_ptr->x_red;
-      xy.redy = info_ptr->y_red;
-      xy.greenx = info_ptr->x_green;
-      xy.greeny = info_ptr->y_green;
-      xy.bluex = info_ptr->x_blue;
-      xy.bluey = info_ptr->y_blue;
-
-      /* The *_checked function handles error reporting, so just return 0 if
-       * there is a failure here.
-       */
-      if (png_XYZ_from_xy_checked(png_ptr, &XYZ, xy))
-      {
-         if (int_red_X != NULL)
-            *int_red_X = XYZ.redX;
-         if (int_red_Y != NULL)
-            *int_red_Y = XYZ.redY;
-         if (int_red_Z != NULL)
-            *int_red_Z = XYZ.redZ;
-         if (int_green_X != NULL)
-            *int_green_X = XYZ.greenX;
-         if (int_green_Y != NULL)
-            *int_green_Y = XYZ.greenY;
-         if (int_green_Z != NULL)
-            *int_green_Z = XYZ.greenZ;
-         if (int_blue_X != NULL)
-            *int_blue_X = XYZ.blueX;
-         if (int_blue_Y != NULL)
-            *int_blue_Y = XYZ.blueY;
-         if (int_blue_Z != NULL)
-            *int_blue_Z = XYZ.blueZ;
-
-         return (PNG_INFO_cHRM);
-      }
-   }
-
-   return (0);
-}
-
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 png_uint_32 PNGAPI
-png_get_cHRM(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr,
     double *white_x, double *white_y, double *red_x, double *red_y,
     double *green_x, double *green_y, double *blue_x, double *blue_y)
 {
-   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
+   /* Quiet API change: this code used to only return the end points if a cHRM
+    * chunk was present, but the end points can also come from iCCP or sRGB
+    * chunks, so in 1.6.0 the png_get_ APIs return the end points regardless and
+    * the png_set_ APIs merely check that set end points are mutually
+    * consistent.
+    */
+   if (png_ptr != NULL && info_ptr != NULL &&
+      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS))
    {
       png_debug1(1, "in %s retrieval function", "cHRM");
 
       if (white_x != NULL)
-         *white_x = png_float(png_ptr, info_ptr->x_white, "cHRM white X");
+         *white_x = png_float(png_ptr,
+            info_ptr->colorspace.end_points_xy.whitex, "cHRM white X");
       if (white_y != NULL)
-         *white_y = png_float(png_ptr, info_ptr->y_white, "cHRM white Y");
+         *white_y = png_float(png_ptr,
+            info_ptr->colorspace.end_points_xy.whitey, "cHRM white Y");
       if (red_x != NULL)
-         *red_x = png_float(png_ptr, info_ptr->x_red, "cHRM red X");
+         *red_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redx,
+            "cHRM red X");
       if (red_y != NULL)
-         *red_y = png_float(png_ptr, info_ptr->y_red, "cHRM red Y");
+         *red_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redy,
+            "cHRM red Y");
       if (green_x != NULL)
-         *green_x = png_float(png_ptr, info_ptr->x_green, "cHRM green X");
+         *green_x = png_float(png_ptr,
+            info_ptr->colorspace.end_points_xy.greenx, "cHRM green X");
       if (green_y != NULL)
-         *green_y = png_float(png_ptr, info_ptr->y_green, "cHRM green Y");
+         *green_y = png_float(png_ptr,
+            info_ptr->colorspace.end_points_xy.greeny, "cHRM green Y");
       if (blue_x != NULL)
-         *blue_x = png_float(png_ptr, info_ptr->x_blue, "cHRM blue X");
+         *blue_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluex,
+            "cHRM blue X");
       if (blue_y != NULL)
-         *blue_y = png_float(png_ptr, info_ptr->y_blue, "cHRM blue Y");
+         *blue_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluey,
+            "cHRM blue Y");
       return (PNG_INFO_cHRM);
    }
 
@@ -557,35 +523,43 @@ png_get_cHRM(png_const_structp png_ptr, png_const_infop info_ptr,
 }
 
 png_uint_32 PNGAPI
-png_get_cHRM_XYZ(png_structp png_ptr, png_const_infop info_ptr,
+png_get_cHRM_XYZ(png_const_structrp png_ptr, png_const_inforp info_ptr,
    double *red_X, double *red_Y, double *red_Z, double *green_X,
    double *green_Y, double *green_Z, double *blue_X, double *blue_Y,
    double *blue_Z)
 {
-   png_XYZ XYZ;
-
-   if (png_get_cHRM_XYZ_fixed(png_ptr, info_ptr,
-      &XYZ.redX, &XYZ.redY, &XYZ.redZ, &XYZ.greenX, &XYZ.greenY, &XYZ.greenZ,
-      &XYZ.blueX, &XYZ.blueY, &XYZ.blueZ) & PNG_INFO_cHRM)
+   if (png_ptr != NULL && info_ptr != NULL &&
+      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS))
    {
+      png_debug1(1, "in %s retrieval function", "cHRM_XYZ(float)");
+
       if (red_X != NULL)
-         *red_X = png_float(png_ptr, XYZ.redX, "cHRM red X");
+         *red_X = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_X,
+            "cHRM red X");
       if (red_Y != NULL)
-         *red_Y = png_float(png_ptr, XYZ.redY, "cHRM red Y");
+         *red_Y = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Y,
+            "cHRM red Y");
       if (red_Z != NULL)
-         *red_Z = png_float(png_ptr, XYZ.redZ, "cHRM red Z");
+         *red_Z = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Z,
+            "cHRM red Z");
       if (green_X != NULL)
-         *green_X = png_float(png_ptr, XYZ.greenX, "cHRM green X");
+         *green_X = png_float(png_ptr,
+            info_ptr->colorspace.end_points_XYZ.green_X, "cHRM green X");
       if (green_Y != NULL)
-         *green_Y = png_float(png_ptr, XYZ.greenY, "cHRM green Y");
+         *green_Y = png_float(png_ptr,
+            info_ptr->colorspace.end_points_XYZ.green_Y, "cHRM green Y");
       if (green_Z != NULL)
-         *green_Z = png_float(png_ptr, XYZ.greenZ, "cHRM green Z");
+         *green_Z = png_float(png_ptr,
+            info_ptr->colorspace.end_points_XYZ.green_Z, "cHRM green Z");
       if (blue_X != NULL)
-         *blue_X = png_float(png_ptr, XYZ.blueX, "cHRM blue X");
+         *blue_X = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.blue_X,
+            "cHRM blue X");
       if (blue_Y != NULL)
-         *blue_Y = png_float(png_ptr, XYZ.blueY, "cHRM blue Y");
+         *blue_Y = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.blue_Y,
+            "cHRM blue Y");
       if (blue_Z != NULL)
-         *blue_Z = png_float(png_ptr, XYZ.blueZ, "cHRM blue Z");
+         *blue_Z = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.blue_Z,
+            "cHRM blue Z");
       return (PNG_INFO_cHRM);
    }
 
@@ -595,31 +569,69 @@ png_get_cHRM_XYZ(png_structp png_ptr, png_const_infop info_ptr,
 
 #  ifdef PNG_FIXED_POINT_SUPPORTED
 png_uint_32 PNGAPI
-png_get_cHRM_fixed(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_cHRM_XYZ_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
+    png_fixed_point *int_red_X, png_fixed_point *int_red_Y,
+    png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
+    png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
+    png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
+    png_fixed_point *int_blue_Z)
+{
+   if (png_ptr != NULL && info_ptr != NULL &&
+      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS))
+   {
+      png_debug1(1, "in %s retrieval function", "cHRM_XYZ");
+
+      if (int_red_X != NULL)
+         *int_red_X = info_ptr->colorspace.end_points_XYZ.red_X;
+      if (int_red_Y != NULL)
+         *int_red_Y = info_ptr->colorspace.end_points_XYZ.red_Y;
+      if (int_red_Z != NULL)
+         *int_red_Z = info_ptr->colorspace.end_points_XYZ.red_Z;
+      if (int_green_X != NULL)
+         *int_green_X = info_ptr->colorspace.end_points_XYZ.green_X;
+      if (int_green_Y != NULL)
+         *int_green_Y = info_ptr->colorspace.end_points_XYZ.green_Y;
+      if (int_green_Z != NULL)
+         *int_green_Z = info_ptr->colorspace.end_points_XYZ.green_Z;
+      if (int_blue_X != NULL)
+         *int_blue_X = info_ptr->colorspace.end_points_XYZ.blue_X;
+      if (int_blue_Y != NULL)
+         *int_blue_Y = info_ptr->colorspace.end_points_XYZ.blue_Y;
+      if (int_blue_Z != NULL)
+         *int_blue_Z = info_ptr->colorspace.end_points_XYZ.blue_Z;
+      return (PNG_INFO_cHRM);
+   }
+
+   return (0);
+}
+
+png_uint_32 PNGAPI
+png_get_cHRM_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
     png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x,
     png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y,
     png_fixed_point *blue_x, png_fixed_point *blue_y)
 {
    png_debug1(1, "in %s retrieval function", "cHRM");
 
-   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
+   if (png_ptr != NULL && info_ptr != NULL &&
+      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS))
    {
       if (white_x != NULL)
-         *white_x = info_ptr->x_white;
+         *white_x = info_ptr->colorspace.end_points_xy.whitex;
       if (white_y != NULL)
-         *white_y = info_ptr->y_white;
+         *white_y = info_ptr->colorspace.end_points_xy.whitey;
       if (red_x != NULL)
-         *red_x = info_ptr->x_red;
+         *red_x = info_ptr->colorspace.end_points_xy.redx;
       if (red_y != NULL)
-         *red_y = info_ptr->y_red;
+         *red_y = info_ptr->colorspace.end_points_xy.redy;
       if (green_x != NULL)
-         *green_x = info_ptr->x_green;
+         *green_x = info_ptr->colorspace.end_points_xy.greenx;
       if (green_y != NULL)
-         *green_y = info_ptr->y_green;
+         *green_y = info_ptr->colorspace.end_points_xy.greeny;
       if (blue_x != NULL)
-         *blue_x = info_ptr->x_blue;
+         *blue_x = info_ptr->colorspace.end_points_xy.bluex;
       if (blue_y != NULL)
-         *blue_y = info_ptr->y_blue;
+         *blue_y = info_ptr->colorspace.end_points_xy.bluey;
       return (PNG_INFO_cHRM);
    }
 
@@ -629,41 +641,49 @@ png_get_cHRM_fixed(png_const_structp png_ptr, png_const_infop info_ptr,
 #endif
 
 #ifdef PNG_gAMA_SUPPORTED
-png_uint_32 PNGFAPI
-png_get_gAMA_fixed(png_const_structp png_ptr, png_const_infop info_ptr,
+#  ifdef PNG_FIXED_POINT_SUPPORTED
+png_uint_32 PNGAPI
+png_get_gAMA_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
     png_fixed_point *file_gamma)
 {
    png_debug1(1, "in %s retrieval function", "gAMA");
 
-   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
-       && file_gamma != NULL)
+   if (png_ptr != NULL && info_ptr != NULL &&
+      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) &&
+      file_gamma != NULL)
    {
-      *file_gamma = info_ptr->gamma;
+      *file_gamma = info_ptr->colorspace.gamma;
       return (PNG_INFO_gAMA);
    }
 
    return (0);
 }
+#  endif
+
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 png_uint_32 PNGAPI
-png_get_gAMA(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_gAMA(png_const_structrp png_ptr, png_const_inforp info_ptr,
     double *file_gamma)
 {
-   png_fixed_point igamma;
-   png_uint_32 ok = png_get_gAMA_fixed(png_ptr, info_ptr, &igamma);
+   png_debug1(1, "in %s retrieval function", "gAMA(float)");
 
-   if (ok)
-      *file_gamma = png_float(png_ptr, igamma, "png_get_gAMA");
+   if (png_ptr != NULL && info_ptr != NULL &&
+      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) &&
+      file_gamma != NULL)
+   {
+      *file_gamma = png_float(png_ptr, info_ptr->colorspace.gamma,
+         "png_get_gAMA");
+      return (PNG_INFO_gAMA);
+   }
 
-   return ok;
+   return (0);
 }
-
 #  endif
 #endif
 
 #ifdef PNG_sRGB_SUPPORTED
 png_uint_32 PNGAPI
-png_get_sRGB(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_sRGB(png_const_structrp png_ptr, png_const_inforp info_ptr,
     int *file_srgb_intent)
 {
    png_debug1(1, "in %s retrieval function", "sRGB");
@@ -671,7 +691,7 @@ png_get_sRGB(png_const_structp png_ptr, png_const_infop info_ptr,
    if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)
        && file_srgb_intent != NULL)
    {
-      *file_srgb_intent = (int)info_ptr->srgb_intent;
+      *file_srgb_intent = info_ptr->colorspace.rendering_intent;
       return (PNG_INFO_sRGB);
    }
 
@@ -681,7 +701,7 @@ png_get_sRGB(png_const_structp png_ptr, png_const_infop info_ptr,
 
 #ifdef PNG_iCCP_SUPPORTED
 png_uint_32 PNGAPI
-png_get_iCCP(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
     png_charpp name, int *compression_type,
     png_bytepp profile, png_uint_32 *proflen)
 {
@@ -693,11 +713,11 @@ png_get_iCCP(png_const_structp png_ptr, png_const_infop info_ptr,
    {
       *name = info_ptr->iccp_name;
       *profile = info_ptr->iccp_profile;
-      /* Compression_type is a dummy so the API won't have to change
-       * if we introduce multiple compression types later.
+      *proflen = png_get_uint_32(info_ptr->iccp_profile);
+      /* This is somewhat irrelevant since the profile data returned has
+       * actually been uncompressed.
        */
-      *proflen = info_ptr->iccp_proflen;
-      *compression_type = info_ptr->iccp_compression;
+      *compression_type = PNG_COMPRESSION_TYPE_BASE;
       return (PNG_INFO_iCCP);
    }
 
@@ -706,14 +726,14 @@ png_get_iCCP(png_const_structp png_ptr, png_const_infop info_ptr,
 #endif
 
 #ifdef PNG_sPLT_SUPPORTED
-png_uint_32 PNGAPI
-png_get_sPLT(png_const_structp png_ptr, png_const_infop info_ptr,
+int PNGAPI
+png_get_sPLT(png_const_structrp png_ptr, png_inforp info_ptr,
     png_sPLT_tpp spalettes)
 {
    if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL)
    {
       *spalettes = info_ptr->splt_palettes;
-      return ((png_uint_32)info_ptr->splt_palettes_num);
+      return info_ptr->splt_palettes_num;
    }
 
    return (0);
@@ -722,7 +742,7 @@ png_get_sPLT(png_const_structp png_ptr, png_const_infop info_ptr,
 
 #ifdef PNG_hIST_SUPPORTED
 png_uint_32 PNGAPI
-png_get_hIST(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
     png_uint_16p *hist)
 {
    png_debug1(1, "in %s retrieval function", "hIST");
@@ -739,11 +759,10 @@ png_get_hIST(png_const_structp png_ptr, png_const_infop info_ptr,
 #endif
 
 png_uint_32 PNGAPI
-png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
+png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr,
     png_uint_32 *width, png_uint_32 *height, int *bit_depth,
     int *color_type, int *interlace_type, int *compression_type,
     int *filter_type)
-
 {
    png_debug1(1, "in %s retrieval function", "IHDR");
 
@@ -770,7 +789,7 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
     * application has ignored our advice not to mess with the members
     * of info_ptr directly.
     */
-   png_check_IHDR (png_ptr, info_ptr->width, info_ptr->height,
+   png_check_IHDR(png_ptr, info_ptr->width, info_ptr->height,
        info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type,
        info_ptr->compression_type, info_ptr->filter_type);
 
@@ -779,7 +798,7 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
 
 #ifdef PNG_oFFs_SUPPORTED
 png_uint_32 PNGAPI
-png_get_oFFs(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_oFFs(png_const_structrp png_ptr, png_const_inforp info_ptr,
     png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)
 {
    png_debug1(1, "in %s retrieval function", "oFFs");
@@ -799,7 +818,7 @@ png_get_oFFs(png_const_structp png_ptr, png_const_infop info_ptr,
 
 #ifdef PNG_pCAL_SUPPORTED
 png_uint_32 PNGAPI
-png_get_pCAL(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
     png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams,
     png_charp *units, png_charpp *params)
 {
@@ -825,16 +844,20 @@ png_get_pCAL(png_const_structp png_ptr, png_const_infop info_ptr,
 
 #ifdef PNG_sCAL_SUPPORTED
 #  ifdef PNG_FIXED_POINT_SUPPORTED
-#    ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
+#    if (defined PNG_FLOATING_ARITHMETIC_SUPPORTED) || \
+         (defined PNG_FLOATING_POINT_SUPPORTED)
 png_uint_32 PNGAPI
-png_get_sCAL_fixed(png_structp png_ptr, png_const_infop info_ptr,
+png_get_sCAL_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
     int *unit, png_fixed_point *width, png_fixed_point *height)
 {
    if (png_ptr != NULL && info_ptr != NULL &&
        (info_ptr->valid & PNG_INFO_sCAL))
    {
       *unit = info_ptr->scal_unit;
-      /*TODO: make this work without FP support */
+      /*TODO: make this work without FP support; the API is currently eliminated
+       * if neither floating point APIs nor internal floating point arithmetic
+       * are enabled.
+       */
       *width = png_fixed(png_ptr, atof(info_ptr->scal_s_width), "sCAL width");
       *height = png_fixed(png_ptr, atof(info_ptr->scal_s_height),
          "sCAL height");
@@ -847,7 +870,7 @@ png_get_sCAL_fixed(png_structp png_ptr, png_const_infop info_ptr,
 #  endif /* FIXED_POINT */
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 png_uint_32 PNGAPI
-png_get_sCAL(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_sCAL(png_const_structrp png_ptr, png_const_inforp info_ptr,
     int *unit, double *width, double *height)
 {
    if (png_ptr != NULL && info_ptr != NULL &&
@@ -863,7 +886,7 @@ png_get_sCAL(png_const_structp png_ptr, png_const_infop info_ptr,
 }
 #  endif /* FLOATING POINT */
 png_uint_32 PNGAPI
-png_get_sCAL_s(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_sCAL_s(png_const_structrp png_ptr, png_const_inforp info_ptr,
     int *unit, png_charpp width, png_charpp height)
 {
    if (png_ptr != NULL && info_ptr != NULL &&
@@ -881,7 +904,7 @@ png_get_sCAL_s(png_const_structp png_ptr, png_const_infop info_ptr,
 
 #ifdef PNG_pHYs_SUPPORTED
 png_uint_32 PNGAPI
-png_get_pHYs(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_pHYs(png_const_structrp png_ptr, png_const_inforp info_ptr,
     png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
 {
    png_uint_32 retval = 0;
@@ -915,7 +938,7 @@ png_get_pHYs(png_const_structp png_ptr, png_const_infop info_ptr,
 #endif /* pHYs */
 
 png_uint_32 PNGAPI
-png_get_PLTE(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_PLTE(png_const_structrp png_ptr, png_inforp info_ptr,
     png_colorp *palette, int *num_palette)
 {
    png_debug1(1, "in %s retrieval function", "PLTE");
@@ -934,7 +957,7 @@ png_get_PLTE(png_const_structp png_ptr, png_const_infop info_ptr,
 
 #ifdef PNG_sBIT_SUPPORTED
 png_uint_32 PNGAPI
-png_get_sBIT(png_const_structp png_ptr, png_infop info_ptr,
+png_get_sBIT(png_const_structrp png_ptr, png_inforp info_ptr,
     png_color_8p *sig_bit)
 {
    png_debug1(1, "in %s retrieval function", "sBIT");
@@ -951,8 +974,8 @@ png_get_sBIT(png_const_structp png_ptr, png_infop info_ptr,
 #endif
 
 #ifdef PNG_TEXT_SUPPORTED
-png_uint_32 PNGAPI
-png_get_text(png_const_structp png_ptr, png_const_infop info_ptr,
+int PNGAPI
+png_get_text(png_const_structrp png_ptr, png_inforp info_ptr,
     png_textp *text_ptr, int *num_text)
 {
    if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0)
@@ -966,7 +989,7 @@ png_get_text(png_const_structp png_ptr, png_const_infop info_ptr,
       if (num_text != NULL)
          *num_text = info_ptr->num_text;
 
-      return ((png_uint_32)info_ptr->num_text);
+      return info_ptr->num_text;
    }
 
    if (num_text != NULL)
@@ -978,7 +1001,8 @@ png_get_text(png_const_structp png_ptr, png_const_infop info_ptr,
 
 #ifdef PNG_tIME_SUPPORTED
 png_uint_32 PNGAPI
-png_get_tIME(png_const_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
+png_get_tIME(png_const_structrp png_ptr, png_inforp info_ptr,
+    png_timep *mod_time)
 {
    png_debug1(1, "in %s retrieval function", "tIME");
 
@@ -995,7 +1019,7 @@ png_get_tIME(png_const_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
 
 #ifdef PNG_tRNS_SUPPORTED
 png_uint_32 PNGAPI
-png_get_tRNS(png_const_structp png_ptr, png_infop info_ptr,
+png_get_tRNS(png_const_structrp png_ptr, png_inforp info_ptr,
     png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)
 {
    png_uint_32 retval = 0;
@@ -1038,9 +1062,9 @@ png_get_tRNS(png_const_structp png_ptr, png_infop info_ptr,
 }
 #endif
 
-#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
+#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
 int PNGAPI
-png_get_unknown_chunks(png_const_structp png_ptr, png_const_infop info_ptr,
+png_get_unknown_chunks(png_const_structrp png_ptr, png_inforp info_ptr,
     png_unknown_chunkpp unknowns)
 {
    if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL)
@@ -1055,7 +1079,7 @@ png_get_unknown_chunks(png_const_structp png_ptr, png_const_infop info_ptr,
 
 #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
 png_byte PNGAPI
-png_get_rgb_to_gray_status (png_const_structp png_ptr)
+png_get_rgb_to_gray_status (png_const_structrp png_ptr)
 {
    return (png_byte)(png_ptr ? png_ptr->rgb_to_gray_status : 0);
 }
@@ -1063,43 +1087,60 @@ png_get_rgb_to_gray_status (png_const_structp png_ptr)
 
 #ifdef PNG_USER_CHUNKS_SUPPORTED
 png_voidp PNGAPI
-png_get_user_chunk_ptr(png_const_structp png_ptr)
+png_get_user_chunk_ptr(png_const_structrp png_ptr)
 {
    return (png_ptr ? png_ptr->user_chunk_ptr : NULL);
 }
 #endif
 
 png_size_t PNGAPI
-png_get_compression_buffer_size(png_const_structp png_ptr)
+png_get_compression_buffer_size(png_const_structrp png_ptr)
 {
-   return (png_ptr ? png_ptr->zbuf_size : 0);
+   if (png_ptr == NULL)
+      return 0;
+
+#  ifdef PNG_WRITE_SUPPORTED
+      if (png_ptr->mode & PNG_IS_READ_STRUCT)
+#  endif
+   {
+#     ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+         return png_ptr->IDAT_read_size;
+#     else
+         return PNG_IDAT_READ_SIZE;
+#     endif
+   }
+
+#  ifdef PNG_WRITE_SUPPORTED
+      else
+         return png_ptr->zbuffer_size;
+#  endif
 }
 
 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
 /* These functions were added to libpng 1.2.6 and were enabled
  * by default in libpng-1.4.0 */
 png_uint_32 PNGAPI
-png_get_user_width_max (png_const_structp png_ptr)
+png_get_user_width_max (png_const_structrp png_ptr)
 {
    return (png_ptr ? png_ptr->user_width_max : 0);
 }
 
 png_uint_32 PNGAPI
-png_get_user_height_max (png_const_structp png_ptr)
+png_get_user_height_max (png_const_structrp png_ptr)
 {
    return (png_ptr ? png_ptr->user_height_max : 0);
 }
 
 /* This function was added to libpng 1.4.0 */
 png_uint_32 PNGAPI
-png_get_chunk_cache_max (png_const_structp png_ptr)
+png_get_chunk_cache_max (png_const_structrp png_ptr)
 {
    return (png_ptr ? png_ptr->user_chunk_cache_max : 0);
 }
 
 /* This function was added to libpng 1.4.1 */
 png_alloc_size_t PNGAPI
-png_get_chunk_malloc_max (png_const_structp png_ptr)
+png_get_chunk_malloc_max (png_const_structrp png_ptr)
 {
    return (png_ptr ? png_ptr->user_chunk_malloc_max : 0);
 }
@@ -1108,23 +1149,29 @@ png_get_chunk_malloc_max (png_const_structp png_ptr)
 /* These functions were added to libpng 1.4.0 */
 #ifdef PNG_IO_STATE_SUPPORTED
 png_uint_32 PNGAPI
-png_get_io_state (png_structp png_ptr)
+png_get_io_state (png_const_structrp png_ptr)
 {
    return png_ptr->io_state;
 }
 
 png_uint_32 PNGAPI
-png_get_io_chunk_type (png_const_structp png_ptr)
+png_get_io_chunk_type (png_const_structrp png_ptr)
 {
    return png_ptr->chunk_name;
 }
+#endif /* ?PNG_IO_STATE_SUPPORTED */
 
-png_const_bytep PNGAPI
-png_get_io_chunk_name (png_structp png_ptr)
+#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
+#  ifdef PNG_GET_PALETTE_MAX_SUPPORTED
+int PNGAPI
+png_get_palette_max(png_const_structp png_ptr, png_const_infop info_ptr)
 {
-   PNG_CSTRING_FROM_CHUNK(png_ptr->io_chunk_string, png_ptr->chunk_name);
-   return png_ptr->io_chunk_string;
+   if (png_ptr != NULL && info_ptr != NULL)
+      return png_ptr->num_palette_max;
+
+   return (-1);
 }
-#endif /* ?PNG_IO_STATE_SUPPORTED */
+#  endif
+#endif
 
 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
index 0e5c977dd9c874480705f2cf54ae456317fbfd78..90f11dabbf3f95e96d411e3eef356a2fe802be89 100644 (file)
@@ -55,7 +55,7 @@
 
 struct png_info_def
 {
-   /* the following are necessary for every PNG file */
+   /* The following are necessary for every PNG file */
    png_uint_32 width;  /* width of image in pixels (from IHDR) */
    png_uint_32 height; /* height of image in pixels (from IHDR) */
    png_uint_32 valid;  /* valid chunk data (see PNG_INFO_ below) */
@@ -70,11 +70,17 @@ struct png_info_def
    png_byte filter_type;    /* must be PNG_FILTER_TYPE_BASE (from IHDR) */
    png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
 
-   /* The following is informational only on read, and not used on writes. */
+   /* The following are set by png_set_IHDR, called from the application on
+    * write, but the are never actually used by the write code.
+    */
    png_byte channels;       /* number of data channels per pixel (1, 2, 3, 4) */
    png_byte pixel_depth;    /* number of bits per pixel */
    png_byte spare_byte;     /* to align the data, and for future use */
+
+#ifdef PNG_READ_SUPPORTED
+   /* This is never set during write */
    png_byte signature[8];   /* magic bytes read by libpng from start of file */
+#endif
 
    /* The rest of the data is optional.  If you are reading, check the
     * valid field to see if the information in these are valid.  If you
@@ -82,18 +88,25 @@ struct png_info_def
     * and initialize the appropriate fields below.
     */
 
-#if defined(PNG_gAMA_SUPPORTED)
-   /* The gAMA chunk describes the gamma characteristics of the system
-    * on which the image was created, normally in the range [1.0, 2.5].
-    * Data is valid if (valid & PNG_INFO_gAMA) is non-zero.
+#if defined PNG_COLORSPACE_SUPPORTED || defined PNG_GAMMA_SUPPORTED
+   /* png_colorspace only contains 'flags' if neither GAMMA or COLORSPACE are
+    * defined.  When COLORSPACE is switched on all the colorspace-defining
+    * chunks should be enabled, when GAMMA is switched on all the gamma-defining
+    * chunks should be enabled.  If this is not done it becomes possible to read
+    * inconsistent PNG files and assign a probably incorrect interpretation to
+    * the information.  (In other words, by carefully choosing which chunks to
+    * recognize the system configuration can select an interpretation for PNG
+    * files containing ambiguous data and this will result in inconsistent
+    * behavior between different libpng builds!)
     */
-   png_fixed_point gamma;
+   png_colorspace colorspace;
 #endif
 
-#ifdef PNG_sRGB_SUPPORTED
-    /* GR-P, 0.96a */
-    /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */
-   png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */
+#ifdef PNG_iCCP_SUPPORTED
+   /* iCCP chunk data. */
+   png_charp iccp_name;     /* profile name */
+   png_bytep iccp_profile;  /* International Color Consortium profile data */
+   png_uint_32 iccp_proflen;  /* ICC profile data length */
 #endif
 
 #ifdef PNG_TEXT_SUPPORTED
@@ -183,23 +196,6 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
    png_uint_16p hist;
 #endif
 
-#ifdef PNG_cHRM_SUPPORTED
-   /* The cHRM chunk describes the CIE color characteristics of the monitor
-    * on which the PNG was created.  This data allows the viewer to do gamut
-    * mapping of the input image to ensure that the viewer sees the same
-    * colors in the image as the creator.  Values are in the range
-    * [0.0, 0.8].  Data valid if (valid & PNG_INFO_cHRM) non-zero.
-    */
-   png_fixed_point x_white;
-   png_fixed_point y_white;
-   png_fixed_point x_red;
-   png_fixed_point y_red;
-   png_fixed_point x_green;
-   png_fixed_point y_green;
-   png_fixed_point x_blue;
-   png_fixed_point y_blue;
-#endif
-
 #ifdef PNG_pCAL_SUPPORTED
    /* The pCAL chunk describes a transformation between the stored pixel
     * values and original physical data values used to create the image.
@@ -224,25 +220,20 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
 /* New members added in libpng-1.0.6 */
    png_uint_32 free_me;     /* flags items libpng is responsible for freeing */
 
-#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
- defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
+#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
    /* Storage for unknown chunks that the library doesn't recognize. */
    png_unknown_chunkp unknown_chunks;
-   int unknown_chunks_num;
-#endif
 
-#ifdef PNG_iCCP_SUPPORTED
-   /* iCCP chunk data. */
-   png_charp iccp_name;     /* profile name */
-   png_bytep iccp_profile;  /* International Color Consortium profile data */
-   png_uint_32 iccp_proflen;  /* ICC profile data length */
-   png_byte iccp_compression; /* Always zero */
+   /* The type of this field is limited by the type of 
+    * png_struct::user_chunk_cache_max, else overflow can occur.
+    */
+   int                unknown_chunks_num;
 #endif
 
 #ifdef PNG_sPLT_SUPPORTED
    /* Data on sPLT chunks (there may be more than one). */
    png_sPLT_tp splt_palettes;
-   int splt_palettes_num;
+   int         splt_palettes_num; /* Match type returned by png_get API */
 #endif
 
 #ifdef PNG_sCAL_SUPPORTED
index f885533fbb0b263eb2250305aa2f02c905364578..b9b3efb442282e62f11bb4c003dd21cf05b8f873 100644 (file)
@@ -1,8 +1,8 @@
 
 /* pngmem.c - stub functions for memory allocation
  *
- * Last changed in libpng 1.5.13 [September 27, 2012]
- * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.0 [February 14, 2013]
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
 #include "pngpriv.h"
 
 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
-
-/* Borland DOS special memory handler */
-#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
-/* If you change this, be sure to change the one in png.h also */
-
-/* Allocate memory for a png_struct.  The malloc and memset can be replaced
-   by a single call to calloc() if this is thought to improve performance. */
-PNG_FUNCTION(png_voidp /* PRIVATE */,
-png_create_struct,(int type),PNG_ALLOCATED)
-{
-#  ifdef PNG_USER_MEM_SUPPORTED
-   return (png_create_struct_2(type, NULL, NULL));
-}
-
-/* Alternate version of png_create_struct, for use with user-defined malloc. */
-PNG_FUNCTION(png_voidp /* PRIVATE */,
-png_create_struct_2,(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr),
-   PNG_ALLOCATED)
-{
-#  endif /* PNG_USER_MEM_SUPPORTED */
-   png_size_t size;
-   png_voidp struct_ptr;
-
-   if (type == PNG_STRUCT_INFO)
-      size = png_sizeof(png_info);
-
-   else if (type == PNG_STRUCT_PNG)
-      size = png_sizeof(png_struct);
-
-   else
-      return (png_get_copyright(NULL));
-
-#  ifdef PNG_USER_MEM_SUPPORTED
-   if (malloc_fn != NULL)
-   {
-      png_struct dummy_struct;
-      png_memset(&dummy_struct, 0, sizeof dummy_struct);
-      dummy_struct.mem_ptr=mem_ptr;
-      struct_ptr = (*(malloc_fn))(&dummy_struct, (png_alloc_size_t)size);
-   }
-
-   else
-#  endif /* PNG_USER_MEM_SUPPORTED */
-   struct_ptr = (png_voidp)farmalloc(size);
-   if (struct_ptr != NULL)
-      png_memset(struct_ptr, 0, size);
-
-   return (struct_ptr);
-}
-
-/* Free memory allocated by a png_create_struct() call */
-void /* PRIVATE */
-png_destroy_struct(png_voidp struct_ptr)
-{
-#  ifdef PNG_USER_MEM_SUPPORTED
-   png_destroy_struct_2(struct_ptr, NULL, NULL);
-}
-
-/* Free memory allocated by a png_create_struct() call */
+/* Free a png_struct */
 void /* PRIVATE */
-png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
-    png_voidp mem_ptr)
+png_destroy_png_struct(png_structrp png_ptr)
 {
-#  endif
-   if (struct_ptr != NULL)
+   if (png_ptr != NULL)
    {
-#  ifdef PNG_USER_MEM_SUPPORTED
-      if (free_fn != NULL)
-      {
-         png_struct dummy_struct;
-         png_memset(&dummy_struct, 0, sizeof dummy_struct);
-         dummy_struct.mem_ptr=mem_ptr;
-         (*(free_fn))(&dummy_struct, struct_ptr);
-         return;
-      }
-
-#  endif /* PNG_USER_MEM_SUPPORTED */
-      farfree (struct_ptr);
+      /* png_free might call png_error and may certainly call
+       * png_get_mem_ptr, so fake a temporary png_struct to support this.
+       */
+      png_struct dummy_struct = *png_ptr;
+      memset(png_ptr, 0, (sizeof *png_ptr));
+      png_free(&dummy_struct, png_ptr);
+
+#     ifdef PNG_SETJMP_SUPPORTED
+         /* We may have a jmp_buf left to deallocate. */
+         png_free_jmpbuf(&dummy_struct);
+#     endif
    }
 }
 
 /* Allocate memory.  For reasonable files, size should never exceed
  * 64K.  However, zlib may allocate more then 64K if you don't tell
- * it not to.  See zconf.h and png.h for more information. zlib does
+ * it not to.  See zconf.h and png.h for more information.  zlib does
  * need to allocate exactly 64K, so whatever you call here must
  * have the ability to do that.
- *
- * Borland seems to have a problem in DOS mode for exactly 64K.
- * It gives you a segment with an offset of 8 (perhaps to store its
- * memory stuff).  zlib doesn't like this at all, so we have to
- * detect and deal with it.  This code should not be needed in
- * Windows or OS/2 modes, and only in 16 bit mode.  This code has
- * been updated by Alexander Lehmann for version 0.89 to waste less
- * memory.
- *
- * Note that we can't use png_size_t for the "size" declaration,
- * since on some systems a png_size_t is a 16-bit quantity, and as a
- * result, we would be truncating potentially larger memory requests
- * (which should cause a fatal error) and introducing major problems.
  */
 PNG_FUNCTION(png_voidp,PNGAPI
-png_calloc,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
+png_calloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
 {
    png_voidp ret;
 
-   ret = (png_malloc(png_ptr, size));
+   ret = png_malloc(png_ptr, size);
 
    if (ret != NULL)
-      png_memset(ret,0,(png_size_t)size);
-
-   return (ret);
-}
-
-PNG_FUNCTION(png_voidp,PNGAPI
-png_malloc,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
-{
-   png_voidp ret;
-
-   if (png_ptr == NULL || size == 0)
-      return (NULL);
+      memset(ret, 0, size);
 
-#  ifdef PNG_USER_MEM_SUPPORTED
-   if (png_ptr->malloc_fn != NULL)
-      ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, size));
-
-   else
-      ret = (png_malloc_default(png_ptr, size));
-
-   if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
-       png_error(png_ptr, "Out of memory");
-
-   return (ret);
+   return ret;
 }
 
-PNG_FUNCTION(png_voidp,PNGAPI
-png_malloc_default,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
+/* png_malloc_base, an internal function added at libpng 1.6.0, does the work of
+ * allocating memory, taking into account limits and PNG_USER_MEM_SUPPORTED.
+ * Checking and error handling must happen outside this routine; it returns NULL
+ * if the allocation cannot be done (for any reason.)
+ */
+PNG_FUNCTION(png_voidp /* PRIVATE */,
+png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),
+   PNG_ALLOCATED)
 {
-   png_voidp ret;
-#  endif /* PNG_USER_MEM_SUPPORTED */
-
-   if (png_ptr == NULL || size == 0)
-      return (NULL);
-
-#  ifdef PNG_MAX_MALLOC_64K
-   if (size > (png_uint_32)65536L)
-   {
-      png_warning(png_ptr, "Cannot Allocate > 64K");
-      ret = NULL;
-   }
-
-   else
-#  endif
-
-   if (size != (size_t)size)
-      ret = NULL;
-
-   else if (size == (png_uint_32)65536L)
-   {
-      if (png_ptr->offset_table == NULL)
-      {
-         /* Try to see if we need to do any of this fancy stuff */
-         ret = farmalloc(size);
-         if (ret == NULL || ((png_size_t)ret & 0xffff))
-         {
-            int num_blocks;
-            png_uint_32 total_size;
-            png_bytep table;
-            int i, mem_level, window_bits;
-            png_byte huge * hptr;
-            int window_bits
-
-            if (ret != NULL)
-            {
-               farfree(ret);
-               ret = NULL;
-            }
-
-            window_bits =
-                png_ptr->zlib_window_bits >= png_ptr->zlib_text_window_bits ?
-                png_ptr->zlib_window_bits : png_ptr->zlib_text_window_bits;
-
-            if (window_bits > 14)
-               num_blocks = (int)(1 << (window_bits - 14));
-
-            else
-               num_blocks = 1;
-
-            mem_level =
-                png_ptr->zlib_mem_level >= png_ptr->zlib_text_mem_level ?
-                png_ptr->zlib_mem_level : png_ptr->zlib_text_mem_level;
-
-            if (mem_level >= 7)
-               num_blocks += (int)(1 << (mem_level - 7));
-
-            else
-               num_blocks++;
-
-            total_size = ((png_uint_32)65536L) * (png_uint_32)num_blocks+16;
-
-            table = farmalloc(total_size);
-
-            if (table == NULL)
-            {
-#  ifndef PNG_USER_MEM_SUPPORTED
-               if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
-                  png_error(png_ptr, "Out Of Memory"); /* Note "O", "M" */
-
-               else
-                  png_warning(png_ptr, "Out Of Memory");
-#  endif
-               return (NULL);
-            }
-
-            if ((png_size_t)table & 0xfff0)
-            {
-#  ifndef PNG_USER_MEM_SUPPORTED
-               if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
-                  png_error(png_ptr,
-                    "Farmalloc didn't return normalized pointer");
-
-               else
-                  png_warning(png_ptr,
-                    "Farmalloc didn't return normalized pointer");
-#  endif
-               return (NULL);
-            }
-
-            png_ptr->offset_table = table;
-            png_ptr->offset_table_ptr = farmalloc(num_blocks *
-               png_sizeof(png_bytep));
-
-            if (png_ptr->offset_table_ptr == NULL)
-            {
-#  ifndef PNG_USER_MEM_SUPPORTED
-               if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
-                  png_error(png_ptr, "Out Of memory"); /* Note "O", "m" */
-
-               else
-                  png_warning(png_ptr, "Out Of memory");
-#  endif
-               return (NULL);
-            }
-
-            hptr = (png_byte huge *)table;
-            if ((png_size_t)hptr & 0xf)
-            {
-               hptr = (png_byte huge *)((long)(hptr) & 0xfffffff0L);
-               hptr = hptr + 16L;  /* "hptr += 16L" fails on Turbo C++ 3.0 */
-            }
-
-            for (i = 0; i < num_blocks; i++)
-            {
-               png_ptr->offset_table_ptr[i] = (png_bytep)hptr;
-               hptr = hptr + (png_uint_32)65536L;  /* "+=" fails on TC++3.0 */
-            }
-
-            png_ptr->offset_table_number = num_blocks;
-            png_ptr->offset_table_count = 0;
-            png_ptr->offset_table_count_free = 0;
-         }
-      }
-
-      if (png_ptr->offset_table_count >= png_ptr->offset_table_number)
-      {
-#  ifndef PNG_USER_MEM_SUPPORTED
-         if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
-            png_error(png_ptr, "Out of Memory"); /* Note "O" and "M" */
-
-         else
-            png_warning(png_ptr, "Out of Memory");
-#  endif
-         return (NULL);
-      }
-
-      ret = png_ptr->offset_table_ptr[png_ptr->offset_table_count++];
-   }
-
-   else
-      ret = farmalloc(size);
-
-#  ifndef PNG_USER_MEM_SUPPORTED
-   if (ret == NULL)
+   /* Moved to png_malloc_base from png_malloc_default in 1.6.0; the DOS
+    * allocators have also been removed in 1.6.0, so any 16-bit system now has
+    * to implement a user memory handler.  This checks to be sure it isn't
+    * called with big numbers.
+    */
+#ifdef PNG_USER_MEM_SUPPORTED
+   PNG_UNUSED(png_ptr)
+#endif
+   if (size > 0 && size <= PNG_SIZE_MAX
+#     ifdef PNG_MAX_MALLOC_64K
+         && size <= 65536U
+#     endif
+      )
    {
-      if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
-         png_error(png_ptr, "Out of memory"); /* Note "o" and "m" */
+#ifdef PNG_USER_MEM_SUPPORTED
+      if (png_ptr != NULL && png_ptr->malloc_fn != NULL)
+         return png_ptr->malloc_fn(png_constcast(png_structrp,png_ptr), size);
 
       else
-         png_warning(png_ptr, "Out of memory"); /* Note "o" and "m" */
+#endif
+         return malloc((size_t)size); /* checked for truncation above */
    }
-#  endif
 
-   return (ret);
+   else
+      return NULL;
 }
 
-/* Free a pointer allocated by png_malloc().  In the default
- * configuration, png_ptr is not used, but is passed in case it
- * is needed.  If ptr is NULL, return without taking any action.
+/* This is really here only to work round a spurious warning in GCC 4.6 and 4.7
+ * that arises because of the checks in png_realloc_array that are repeated in
+ * png_malloc_array.
  */
-void PNGAPI
-png_free(png_structp png_ptr, png_voidp ptr)
+static png_voidp
+png_malloc_array_checked(png_const_structrp png_ptr, int nelements,
+   size_t element_size)
 {
-   if (png_ptr == NULL || ptr == NULL)
-      return;
+   png_alloc_size_t req = nelements; /* known to be > 0 */
 
-#  ifdef PNG_USER_MEM_SUPPORTED
-   if (png_ptr->free_fn != NULL)
-   {
-      (*(png_ptr->free_fn))(png_ptr, ptr);
-      return;
-   }
+   if (req <= PNG_SIZE_MAX/element_size)
+      return png_malloc_base(png_ptr, req * element_size);
 
-   else
-      png_free_default(png_ptr, ptr);
+   /* The failure case when the request is too large */
+   return NULL;
 }
 
-void PNGAPI
-png_free_default(png_structp png_ptr, png_voidp ptr)
-{
-#  endif /* PNG_USER_MEM_SUPPORTED */
-
-   if (png_ptr == NULL || ptr == NULL)
-      return;
-
-   if (png_ptr->offset_table != NULL)
-   {
-      int i;
-
-      for (i = 0; i < png_ptr->offset_table_count; i++)
-      {
-         if (ptr == png_ptr->offset_table_ptr[i])
-         {
-            ptr = NULL;
-            png_ptr->offset_table_count_free++;
-            break;
-         }
-      }
-      if (png_ptr->offset_table_count_free == png_ptr->offset_table_count)
-      {
-         farfree(png_ptr->offset_table);
-         farfree(png_ptr->offset_table_ptr);
-         png_ptr->offset_table = NULL;
-         png_ptr->offset_table_ptr = NULL;
-      }
-   }
-
-   if (ptr != NULL)
-      farfree(ptr);
-}
-
-#else /* Not the Borland DOS special memory handler */
-
-/* Allocate memory for a png_struct or a png_info.  The malloc and
-   memset can be replaced by a single call to calloc() if this is thought
-   to improve performance noticably. */
 PNG_FUNCTION(png_voidp /* PRIVATE */,
-png_create_struct,(int type),PNG_ALLOCATED)
+png_malloc_array,(png_const_structrp png_ptr, int nelements,
+   size_t element_size),PNG_ALLOCATED)
 {
-#  ifdef PNG_USER_MEM_SUPPORTED
-   return (png_create_struct_2(type, NULL, NULL));
+   if (nelements <= 0 || element_size == 0)
+      png_error(png_ptr, "internal error: array alloc");
+
+   return png_malloc_array_checked(png_ptr, nelements, element_size);
 }
 
-/* Allocate memory for a png_struct or a png_info.  The malloc and
-   memset can be replaced by a single call to calloc() if this is thought
-   to improve performance noticably. */
 PNG_FUNCTION(png_voidp /* PRIVATE */,
-png_create_struct_2,(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr),
-   PNG_ALLOCATED)
+png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array,
+   int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED)
 {
-#  endif /* PNG_USER_MEM_SUPPORTED */
-   png_size_t size;
-   png_voidp struct_ptr;
-
-   if (type == PNG_STRUCT_INFO)
-      size = png_sizeof(png_info);
-
-   else if (type == PNG_STRUCT_PNG)
-      size = png_sizeof(png_struct);
-
-   else
-      return (NULL);
-
-#  ifdef PNG_USER_MEM_SUPPORTED
-   if (malloc_fn != NULL)
+   /* These are internal errors: */
+   if (add_elements <= 0 || element_size == 0 || old_elements < 0 ||
+      (old_array == NULL && old_elements > 0))
+      png_error(png_ptr, "internal error: array realloc");
+
+   /* Check for overflow on the elements count (so the caller does not have to
+    * check.)
+    */
+   if (add_elements <= INT_MAX - old_elements)
    {
-      png_struct dummy_struct;
-      png_structp png_ptr = &dummy_struct;
-      png_ptr->mem_ptr=mem_ptr;
-      struct_ptr = (*(malloc_fn))(png_ptr, size);
-
-      if (struct_ptr != NULL)
-         png_memset(struct_ptr, 0, size);
-
-      return (struct_ptr);
-   }
-#  endif /* PNG_USER_MEM_SUPPORTED */
-
-#  if defined(__TURBOC__) && !defined(__FLAT__)
-   struct_ptr = (png_voidp)farmalloc(size);
-#  else
-#    if defined(_MSC_VER) && defined(MAXSEG_64K)
-   struct_ptr = (png_voidp)halloc(size, 1);
-#    else
-   struct_ptr = (png_voidp)malloc(size);
-#    endif
-#  endif
-
-   if (struct_ptr != NULL)
-      png_memset(struct_ptr, 0, size);
-
-   return (struct_ptr);
-}
-
-
-/* Free memory allocated by a png_create_struct() call */
-void /* PRIVATE */
-png_destroy_struct(png_voidp struct_ptr)
-{
-#  ifdef PNG_USER_MEM_SUPPORTED
-   png_destroy_struct_2(struct_ptr, NULL, NULL);
-}
+      png_voidp new_array = png_malloc_array_checked(png_ptr,
+         old_elements+add_elements, element_size);
 
-/* Free memory allocated by a png_create_struct() call */
-void /* PRIVATE */
-png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
-    png_voidp mem_ptr)
-{
-#  endif /* PNG_USER_MEM_SUPPORTED */
-   if (struct_ptr != NULL)
-   {
-#  ifdef PNG_USER_MEM_SUPPORTED
-      if (free_fn != NULL)
+      if (new_array != NULL)
       {
-         png_struct dummy_struct;
-         png_structp png_ptr = &dummy_struct;
-         png_ptr->mem_ptr=mem_ptr;
-         (*(free_fn))(png_ptr, struct_ptr);
-         return;
-      }
-#  endif /* PNG_USER_MEM_SUPPORTED */
-#  if defined(__TURBOC__) && !defined(__FLAT__)
-      farfree(struct_ptr);
-
-#  else
-#    if defined(_MSC_VER) && defined(MAXSEG_64K)
-      hfree(struct_ptr);
+         /* Because png_malloc_array worked the size calculations below cannot
+          * overflow.
+          */
+         if (old_elements > 0)
+            memcpy(new_array, old_array, element_size*(unsigned)old_elements);
 
-#    else
-      free(struct_ptr);
+         memset((char*)new_array + element_size*(unsigned)old_elements, 0,
+            element_size*(unsigned)add_elements);
 
-#    endif
-#  endif
+         return new_array;
+      }
    }
+
+   return NULL; /* error */
 }
 
-/* Allocate memory.  For reasonable files, size should never exceed
- * 64K.  However, zlib may allocate more then 64K if you don't tell
- * it not to.  See zconf.h and png.h for more information.  zlib does
- * need to allocate exactly 64K, so whatever you call here must
- * have the ability to do that.
+/* Various functions that have different error handling are derived from this.
+ * png_malloc always exists, but if PNG_USER_MEM_SUPPORTED is defined a separate
+ * function png_malloc_default is also provided.
  */
-
 PNG_FUNCTION(png_voidp,PNGAPI
-png_calloc,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
+png_malloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
 {
    png_voidp ret;
 
-   ret = (png_malloc(png_ptr, size));
+   if (png_ptr == NULL)
+      return NULL;
 
-   if (ret != NULL)
-      png_memset(ret,0,(png_size_t)size);
+   ret = png_malloc_base(png_ptr, size);
+
+   if (ret == NULL)
+       png_error(png_ptr, "Out of memory"); /* 'm' means png_malloc */
 
-   return (ret);
+   return ret;
 }
 
+#ifdef PNG_USER_MEM_SUPPORTED
 PNG_FUNCTION(png_voidp,PNGAPI
-png_malloc,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
+png_malloc_default,(png_const_structrp png_ptr, png_alloc_size_t size),
+   PNG_ALLOCATED PNG_DEPRECATED)
 {
    png_voidp ret;
 
-#  ifdef PNG_USER_MEM_SUPPORTED
-   if (png_ptr == NULL || size == 0)
-      return (NULL);
-
-   if (png_ptr->malloc_fn != NULL)
-      ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size));
+   if (png_ptr == NULL)
+      return NULL;
 
-   else
-      ret = (png_malloc_default(png_ptr, size));
+   /* Passing 'NULL' here bypasses the application provided memory handler. */
+   ret = png_malloc_base(NULL/*use malloc*/, size);
 
-   if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
-       png_error(png_ptr, "Out of Memory");
+   if (ret == NULL)
+      png_error(png_ptr, "Out of Memory"); /* 'M' means png_malloc_default */
 
-   return (ret);
+   return ret;
 }
+#endif /* PNG_USER_MEM_SUPPORTED */
 
+/* This function was added at libpng version 1.2.3.  The png_malloc_warn()
+ * function will issue a png_warning and return NULL instead of issuing a
+ * png_error, if it fails to allocate the requested memory.
+ */
 PNG_FUNCTION(png_voidp,PNGAPI
-png_malloc_default,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
+png_malloc_warn,(png_const_structrp png_ptr, png_alloc_size_t size),
+   PNG_ALLOCATED)
 {
-   png_voidp ret;
-#  endif /* PNG_USER_MEM_SUPPORTED */
-
-   if (png_ptr == NULL || size == 0)
-      return (NULL);
-
-#  ifdef PNG_MAX_MALLOC_64K
-   if (size > (png_uint_32)65536L)
+   if (png_ptr != NULL)
    {
-#    ifndef PNG_USER_MEM_SUPPORTED
-      if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
-         png_error(png_ptr, "Cannot Allocate > 64K");
+      png_voidp ret = png_malloc_base(png_ptr, size);
 
-      else
-#    endif
-         return NULL;
-   }
-#  endif
-
-   /* Check for overflow */
-#  if defined(__TURBOC__) && !defined(__FLAT__)
-
-   if (size != (unsigned long)size)
-      ret = NULL;
-
-   else
-      ret = farmalloc(size);
+      if (ret != NULL)
+         return ret;
 
-#  else
-#    if defined(_MSC_VER) && defined(MAXSEG_64K)
-   if (size != (unsigned long)size)
-      ret = NULL;
-
-   else
-      ret = halloc(size, 1);
-
-#    else
-   if (size != (size_t)size)
-      ret = NULL;
-
-   else
-      ret = malloc((size_t)size);
-#    endif
-#  endif
-
-#  ifndef PNG_USER_MEM_SUPPORTED
-   if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
-      png_error(png_ptr, "Out of Memory");
-#  endif
+      png_warning(png_ptr, "Out of memory");
+   }
 
-   return (ret);
+   return NULL;
 }
 
 /* Free a pointer allocated by png_malloc().  If ptr is NULL, return
  * without taking any action.
  */
 void PNGAPI
-png_free(png_structp png_ptr, png_voidp ptr)
+png_free(png_const_structrp png_ptr, png_voidp ptr)
 {
    if (png_ptr == NULL || ptr == NULL)
       return;
 
-#  ifdef PNG_USER_MEM_SUPPORTED
+#ifdef PNG_USER_MEM_SUPPORTED
    if (png_ptr->free_fn != NULL)
-   {
-      (*(png_ptr->free_fn))(png_ptr, ptr);
-      return;
-   }
+      png_ptr->free_fn(png_constcast(png_structrp,png_ptr), ptr);
 
    else
       png_free_default(png_ptr, ptr);
 }
 
-void PNGAPI
-png_free_default(png_structp png_ptr, png_voidp ptr)
+PNG_FUNCTION(void,PNGAPI
+png_free_default,(png_const_structrp png_ptr, png_voidp ptr),PNG_DEPRECATED)
 {
    if (png_ptr == NULL || ptr == NULL)
       return;
+#endif /* PNG_USER_MEM_SUPPORTED */
 
-#  endif /* PNG_USER_MEM_SUPPORTED */
-
-#  if defined(__TURBOC__) && !defined(__FLAT__)
-   farfree(ptr);
-
-#  else
-#    if defined(_MSC_VER) && defined(MAXSEG_64K)
-   hfree(ptr);
-
-#    else
    free(ptr);
-
-#    endif
-#  endif
-}
-#endif /* Not Borland DOS special memory handler */
-
-/* This function was added at libpng version 1.2.3.  The png_malloc_warn()
- * function will set up png_malloc() to issue a png_warning and return NULL
- * instead of issuing a png_error, if it fails to allocate the requested
- * memory.
- */
-PNG_FUNCTION(png_voidp,PNGAPI
-png_malloc_warn,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
-{
-   png_voidp ptr;
-   png_uint_32 save_flags;
-   if (png_ptr == NULL)
-      return (NULL);
-
-   save_flags = png_ptr->flags;
-   png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
-   ptr = (png_voidp)png_malloc((png_structp)png_ptr, size);
-   png_ptr->flags=save_flags;
-   return(ptr);
 }
 
-
 #ifdef PNG_USER_MEM_SUPPORTED
 /* This function is called when the application wants to use another method
  * of allocating and freeing memory.
  */
 void PNGAPI
-png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr
+png_set_mem_fn(png_structrp png_ptr, png_voidp mem_ptr, png_malloc_ptr
   malloc_fn, png_free_ptr free_fn)
 {
    if (png_ptr != NULL)
@@ -656,12 +266,12 @@ png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr
  * pointer before png_write_destroy and png_read_destroy are called.
  */
 png_voidp PNGAPI
-png_get_mem_ptr(png_const_structp png_ptr)
+png_get_mem_ptr(png_const_structrp png_ptr)
 {
    if (png_ptr == NULL)
-      return (NULL);
+      return NULL;
 
-   return ((png_voidp)png_ptr->mem_ptr);
+   return png_ptr->mem_ptr;
 }
 #endif /* PNG_USER_MEM_SUPPORTED */
 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
index 6b65ba8f4eb5e794464aff87688be6e7949ef138..f132ce6004c61872f2d1cbde6606644564675133 100644 (file)
@@ -1,8 +1,8 @@
 
 /* pngpread.c - read a png file in push mode
  *
- * Last changed in libpng 1.5.11 [June 14, 2012]
- * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.0 [February 14, 2013]
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -27,7 +27,7 @@
 #define PNG_ERROR_MODE      8
 
 void PNGAPI
-png_process_data(png_structp png_ptr, png_infop info_ptr,
+png_process_data(png_structrp png_ptr, png_inforp info_ptr,
     png_bytep buffer, png_size_t buffer_size)
 {
    if (png_ptr == NULL || info_ptr == NULL)
@@ -42,7 +42,7 @@ png_process_data(png_structp png_ptr, png_infop info_ptr,
 }
 
 png_size_t PNGAPI
-png_process_data_pause(png_structp png_ptr, int save)
+png_process_data_pause(png_structrp png_ptr, int save)
 {
    if (png_ptr != NULL)
    {
@@ -69,7 +69,7 @@ png_process_data_pause(png_structp png_ptr, int save)
 }
 
 png_uint_32 PNGAPI
-png_process_data_skip(png_structp png_ptr)
+png_process_data_skip(png_structrp png_ptr)
 {
    png_uint_32 remaining = 0;
 
@@ -103,7 +103,7 @@ png_process_data_skip(png_structp png_ptr)
  * doing before we ran out of data...
  */
 void /* PRIVATE */
-png_process_some_data(png_structp png_ptr, png_infop info_ptr)
+png_process_some_data(png_structrp png_ptr, png_inforp info_ptr)
 {
    if (png_ptr == NULL)
       return;
@@ -149,10 +149,10 @@ png_process_some_data(png_structp png_ptr, png_infop info_ptr)
  * routine.
  */
 void /* PRIVATE */
-png_push_read_sig(png_structp png_ptr, png_infop info_ptr)
+png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr)
 {
    png_size_t num_checked = png_ptr->sig_bytes,
-       num_to_check = 8 - num_checked;
+             num_to_check = 8 - num_checked;
 
    if (png_ptr->buffer_size < num_to_check)
    {
@@ -172,7 +172,6 @@ png_push_read_sig(png_structp png_ptr, png_infop info_ptr)
       else
          png_error(png_ptr, "PNG file corrupted by ASCII conversion");
    }
-
    else
    {
       if (png_ptr->sig_bytes >= 8)
@@ -183,9 +182,12 @@ png_push_read_sig(png_structp png_ptr, png_infop info_ptr)
 }
 
 void /* PRIVATE */
-png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
+png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
 {
    png_uint_32 chunk_name;
+#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+   int keep; /* unknown handling method */
+#endif
 
    /* First we make sure we have enough data for the 4 byte chunk name
     * and the 4 byte chunk length before proceeding with decoding the
@@ -217,14 +219,28 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
 
    if (chunk_name == png_IDAT)
    {
-      /* This is here above the if/else case statement below because if the
-       * unknown handling marks 'IDAT' as unknown then the IDAT handling case is
-       * completely skipped.
-       *
-       * TODO: there must be a better way of doing this.
-       */
       if (png_ptr->mode & PNG_AFTER_IDAT)
          png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
+
+      /* If we reach an IDAT chunk, this means we have read all of the
+       * header chunks, and we can start reading the image (or if this
+       * is called after the image has been read - we have an error).
+       */
+      if (!(png_ptr->mode & PNG_HAVE_IHDR))
+         png_error(png_ptr, "Missing IHDR before IDAT");
+
+      else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
+          !(png_ptr->mode & PNG_HAVE_PLTE))
+         png_error(png_ptr, "Missing PLTE before IDAT");
+
+      png_ptr->mode |= PNG_HAVE_IDAT;
+
+      if (!(png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
+         if (png_ptr->push_length == 0)
+            return;
+
+      if (png_ptr->mode & PNG_AFTER_IDAT)
+         png_benign_error(png_ptr, "Too many IDATs found");
    }
 
    if (chunk_name == png_IHDR)
@@ -256,7 +272,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
    }
 
 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-   else if (png_chunk_unknown_handling(png_ptr, chunk_name))
+   else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0)
    {
       if (png_ptr->push_length + 4 > png_ptr->buffer_size)
       {
@@ -264,26 +280,13 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
          return;
       }
 
-      if (chunk_name == png_IDAT)
-         png_ptr->mode |= PNG_HAVE_IDAT;
-
-      png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
+      png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, keep);
 
       if (chunk_name == png_PLTE)
          png_ptr->mode |= PNG_HAVE_PLTE;
-
-      else if (chunk_name == png_IDAT)
-      {
-         if (!(png_ptr->mode & PNG_HAVE_IHDR))
-            png_error(png_ptr, "Missing IHDR before IDAT");
-
-         else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
-             !(png_ptr->mode & PNG_HAVE_PLTE))
-            png_error(png_ptr, "Missing PLTE before IDAT");
-      }
    }
-#endif
 
+#endif
    else if (chunk_name == png_PLTE)
    {
       if (png_ptr->push_length + 4 > png_ptr->buffer_size)
@@ -296,30 +299,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
 
    else if (chunk_name == png_IDAT)
    {
-      /* If we reach an IDAT chunk, this means we have read all of the
-       * header chunks, and we can start reading the image (or if this
-       * is called after the image has been read - we have an error).
-       */
-
-      if (!(png_ptr->mode & PNG_HAVE_IHDR))
-         png_error(png_ptr, "Missing IHDR before IDAT");
-
-      else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
-          !(png_ptr->mode & PNG_HAVE_PLTE))
-         png_error(png_ptr, "Missing PLTE before IDAT");
-
-      if (png_ptr->mode & PNG_HAVE_IDAT)
-      {
-         if (!(png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
-            if (png_ptr->push_length == 0)
-               return;
-
-         if (png_ptr->mode & PNG_AFTER_IDAT)
-            png_benign_error(png_ptr, "Too many IDATs found");
-      }
-
       png_ptr->idat_size = png_ptr->push_length;
-      png_ptr->mode |= PNG_HAVE_IDAT;
       png_ptr->process_mode = PNG_READ_IDAT_MODE;
       png_push_have_info(png_ptr, info_ptr);
       png_ptr->zstream.avail_out =
@@ -550,7 +530,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
    }
 
 #endif
-
    else
    {
       if (png_ptr->push_length + 4 > png_ptr->buffer_size)
@@ -558,21 +537,22 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
          png_push_save_buffer(png_ptr);
          return;
       }
-      png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
+      png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length,
+         PNG_HANDLE_CHUNK_AS_DEFAULT);
    }
 
    png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
 }
 
 void /* PRIVATE */
-png_push_crc_skip(png_structp png_ptr, png_uint_32 skip)
+png_push_crc_skip(png_structrp png_ptr, png_uint_32 skip)
 {
    png_ptr->process_mode = PNG_SKIP_MODE;
    png_ptr->skip_length = skip;
 }
 
 void /* PRIVATE */
-png_push_crc_finish(png_structp png_ptr)
+png_push_crc_finish(png_structrp png_ptr)
 {
    if (png_ptr->skip_length && png_ptr->save_buffer_size)
    {
@@ -598,7 +578,6 @@ png_push_crc_finish(png_structp png_ptr)
       png_ptr->save_buffer_size -= save_size;
       png_ptr->save_buffer_ptr += save_size;
    }
-
    if (png_ptr->skip_length && png_ptr->current_buffer_size)
    {
       png_size_t save_size = png_ptr->current_buffer_size;
@@ -620,7 +599,6 @@ png_push_crc_finish(png_structp png_ptr)
       png_ptr->current_buffer_size -= save_size;
       png_ptr->current_buffer_ptr += save_size;
    }
-
    if (!png_ptr->skip_length)
    {
       if (png_ptr->buffer_size < 4)
@@ -643,7 +621,6 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
       return;
 
    ptr = buffer;
-
    if (png_ptr->save_buffer_size)
    {
       png_size_t save_size;
@@ -654,14 +631,13 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
       else
          save_size = png_ptr->save_buffer_size;
 
-      png_memcpy(ptr, png_ptr->save_buffer_ptr, save_size);
+      memcpy(ptr, png_ptr->save_buffer_ptr, save_size);
       length -= save_size;
       ptr += save_size;
       png_ptr->buffer_size -= save_size;
       png_ptr->save_buffer_size -= save_size;
       png_ptr->save_buffer_ptr += save_size;
    }
-
    if (length && png_ptr->current_buffer_size)
    {
       png_size_t save_size;
@@ -672,7 +648,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
       else
          save_size = png_ptr->current_buffer_size;
 
-      png_memcpy(ptr, png_ptr->current_buffer_ptr, save_size);
+      memcpy(ptr, png_ptr->current_buffer_ptr, save_size);
       png_ptr->buffer_size -= save_size;
       png_ptr->current_buffer_size -= save_size;
       png_ptr->current_buffer_ptr += save_size;
@@ -680,7 +656,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
 }
 
 void /* PRIVATE */
-png_push_save_buffer(png_structp png_ptr)
+png_push_save_buffer(png_structrp png_ptr)
 {
    if (png_ptr->save_buffer_size)
    {
@@ -691,7 +667,6 @@ png_push_save_buffer(png_structp png_ptr)
          png_bytep dp;
 
          istop = png_ptr->save_buffer_size;
-
          for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer;
              i < istop; i++, sp++, dp++)
          {
@@ -699,7 +674,6 @@ png_push_save_buffer(png_structp png_ptr)
          }
       }
    }
-
    if (png_ptr->save_buffer_size + png_ptr->current_buffer_size >
        png_ptr->save_buffer_max)
    {
@@ -714,7 +688,8 @@ png_push_save_buffer(png_structp png_ptr)
 
       new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256;
       old_buffer = png_ptr->save_buffer;
-      png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr, new_max);
+      png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr,
+          (png_size_t)new_max);
 
       if (png_ptr->save_buffer == NULL)
       {
@@ -722,25 +697,23 @@ png_push_save_buffer(png_structp png_ptr)
          png_error(png_ptr, "Insufficient memory for save_buffer");
       }
 
-      png_memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
+      memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
       png_free(png_ptr, old_buffer);
       png_ptr->save_buffer_max = new_max;
    }
-
    if (png_ptr->current_buffer_size)
    {
-      png_memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size,
+      memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size,
          png_ptr->current_buffer_ptr, png_ptr->current_buffer_size);
       png_ptr->save_buffer_size += png_ptr->current_buffer_size;
       png_ptr->current_buffer_size = 0;
    }
-
    png_ptr->save_buffer_ptr = png_ptr->save_buffer;
    png_ptr->buffer_size = 0;
 }
 
 void /* PRIVATE */
-png_push_restore_buffer(png_structp png_ptr, png_bytep buffer,
+png_push_restore_buffer(png_structrp png_ptr, png_bytep buffer,
    png_size_t buffer_length)
 {
    png_ptr->current_buffer = buffer;
@@ -750,7 +723,7 @@ png_push_restore_buffer(png_structp png_ptr, png_bytep buffer,
 }
 
 void /* PRIVATE */
-png_push_read_IDAT(png_structp png_ptr)
+png_push_read_IDAT(png_structrp png_ptr)
 {
    if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
    {
@@ -775,7 +748,7 @@ png_push_read_IDAT(png_structp png_ptr)
       {
          png_ptr->process_mode = PNG_READ_CHUNK_MODE;
 
-         if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
+         if (!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED))
             png_error(png_ptr, "Not enough compressed data");
 
          return;
@@ -836,7 +809,6 @@ png_push_read_IDAT(png_structp png_ptr)
       png_ptr->current_buffer_size -= save_size;
       png_ptr->current_buffer_ptr += save_size;
    }
-
    if (!png_ptr->idat_size)
    {
       if (png_ptr->buffer_size < 4)
@@ -848,11 +820,12 @@ png_push_read_IDAT(png_structp png_ptr)
       png_crc_finish(png_ptr, 0);
       png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
       png_ptr->mode |= PNG_AFTER_IDAT;
+      png_ptr->zowner = 0;
    }
 }
 
 void /* PRIVATE */
-png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
+png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
    png_size_t buffer_length)
 {
    /* The caller checks for a non-zero buffer length. */
@@ -864,13 +837,14 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
     * handle the uncompressed results.
     */
    png_ptr->zstream.next_in = buffer;
+   /* TODO: WARNING: TRUNCATION ERROR: DANGER WILL ROBINSON: */
    png_ptr->zstream.avail_in = (uInt)buffer_length;
 
    /* Keep going until the decompressed data is all processed
     * or the stream marked as finished.
     */
    while (png_ptr->zstream.avail_in > 0 &&
-          !(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
+      !(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED))
    {
       int ret;
 
@@ -881,9 +855,9 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
        */
       if (!(png_ptr->zstream.avail_out > 0))
       {
-         png_ptr->zstream.avail_out =
-             (uInt) PNG_ROWBYTES(png_ptr->pixel_depth,
-             png_ptr->iwidth) + 1;
+         /* TODO: WARNING: TRUNCATION ERROR: DANGER WILL ROBINSON: */
+         png_ptr->zstream.avail_out = (uInt)(PNG_ROWBYTES(png_ptr->pixel_depth,
+             png_ptr->iwidth) + 1);
 
          png_ptr->zstream.next_out = png_ptr->row_buf;
       }
@@ -901,7 +875,8 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
       if (ret != Z_OK && ret != Z_STREAM_END)
       {
          /* Terminate the decompression. */
-         png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
+         png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
+         png_ptr->zowner = 0;
 
          /* This may be a truncated stream (missing or
           * damaged end code).  Treat that as a warning.
@@ -929,7 +904,8 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
          {
             /* Extra data. */
             png_warning(png_ptr, "Extra compressed data in IDAT");
-            png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
+            png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
+            png_ptr->zowner = 0;
 
             /* Do no more processing; skip the unprocessed
              * input check below.
@@ -944,7 +920,7 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
 
       /* And check for the end of the stream. */
       if (ret == Z_STREAM_END)
-         png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
+         png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
    }
 
    /* All the data should have been processed, if anything
@@ -956,7 +932,7 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
 }
 
 void /* PRIVATE */
-png_push_process_row(png_structp png_ptr)
+png_push_process_row(png_structrp png_ptr)
 {
    /* 1.5.6: row_info moved out of png_struct to a local here. */
    png_row_info row_info;
@@ -982,7 +958,7 @@ png_push_process_row(png_structp png_ptr)
     * it may not be in the future, so this was changed just to copy the
     * interlaced row count:
     */
-   png_memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1);
+   memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1);
 
 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
    if (png_ptr->transformations)
@@ -1185,26 +1161,26 @@ png_push_process_row(png_structp png_ptr)
 }
 
 void /* PRIVATE */
-png_read_push_finish_row(png_structp png_ptr)
+png_read_push_finish_row(png_structrp png_ptr)
 {
 #ifdef PNG_READ_INTERLACING_SUPPORTED
    /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
 
    /* Start of interlace block */
-   static PNG_CONST png_byte FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
+   static PNG_CONST png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
 
    /* Offset to next interlace block */
-   static PNG_CONST png_byte FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
+   static PNG_CONST png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
 
    /* Start of interlace block in the y direction */
-   static PNG_CONST png_byte FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
+   static PNG_CONST png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
 
    /* Offset to next interlace block in the y direction */
-   static PNG_CONST png_byte FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
+   static PNG_CONST png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
 
    /* Height of interlace block.  This is not currently used - if you need
     * it, uncomment it here and in png.h
-   static PNG_CONST png_byte FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
+   static PNG_CONST png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
    */
 #endif
 
@@ -1216,7 +1192,7 @@ png_read_push_finish_row(png_structp png_ptr)
    if (png_ptr->interlaced)
    {
       png_ptr->row_number = 0;
-      png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
+      memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
 
       do
       {
@@ -1251,21 +1227,21 @@ png_read_push_finish_row(png_structp png_ptr)
 }
 
 void /* PRIVATE */
-png_push_have_info(png_structp png_ptr, png_infop info_ptr)
+png_push_have_info(png_structrp png_ptr, png_inforp info_ptr)
 {
    if (png_ptr->info_fn != NULL)
       (*(png_ptr->info_fn))(png_ptr, info_ptr);
 }
 
 void /* PRIVATE */
-png_push_have_end(png_structp png_ptr, png_infop info_ptr)
+png_push_have_end(png_structrp png_ptr, png_inforp info_ptr)
 {
    if (png_ptr->end_fn != NULL)
       (*(png_ptr->end_fn))(png_ptr, info_ptr);
 }
 
 void /* PRIVATE */
-png_push_have_row(png_structp png_ptr, png_bytep row)
+png_push_have_row(png_structrp png_ptr, png_bytep row)
 {
    if (png_ptr->row_fn != NULL)
       (*(png_ptr->row_fn))(png_ptr, row, png_ptr->row_number,
@@ -1274,7 +1250,7 @@ png_push_have_row(png_structp png_ptr, png_bytep row)
 
 #ifdef PNG_READ_INTERLACING_SUPPORTED
 void PNGAPI
-png_progressive_combine_row (png_structp png_ptr, png_bytep old_row,
+png_progressive_combine_row(png_const_structrp png_ptr, png_bytep old_row,
     png_const_bytep new_row)
 {
    if (png_ptr == NULL)
@@ -1290,7 +1266,7 @@ png_progressive_combine_row (png_structp png_ptr, png_bytep old_row,
 #endif /* PNG_READ_INTERLACING_SUPPORTED */
 
 void PNGAPI
-png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr,
+png_set_progressive_read_fn(png_structrp png_ptr, png_voidp progressive_ptr,
     png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn,
     png_progressive_end_ptr end_fn)
 {
@@ -1305,7 +1281,7 @@ png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr,
 }
 
 png_voidp PNGAPI
-png_get_progressive_ptr(png_const_structp png_ptr)
+png_get_progressive_ptr(png_const_structrp png_ptr)
 {
    if (png_ptr == NULL)
       return (NULL);
index b961bd3b2dd20343151be79cdcdd931de74b50e9..22f1919b0bbebdb561ee68e59efb55c61fc53007 100644 (file)
@@ -2,11 +2,11 @@
 /* pngpriv.h - private declarations for use inside libpng
  *
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
- * Last changed in libpng 1.5.10 [March 29, 2012]
+ * Last changed in libpng 1.6.0 [February 14, 2013]
  *
  * This code is released under the libpng license.
  * For conditions of distribution and use, see the disclaimer
@@ -14,7 +14,7 @@
  */
 
 /* The symbols declared in this file (including the functions declared
- * as PNG_EXTERN) are PRIVATE.  They are not part of the libpng public
+ * as extern) are PRIVATE.  They are not part of the libpng public
  * interface, and are not recommended for use by regular applications.
  * Some of them may become public in the future; others may stay private,
  * change in an incompatible way, or even disappear.
  */
 #define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
 
-/* This is required for the definition of abort(), used as a last ditch
- * error handler when all else fails.
- */
+/* Standard library headers not required by png.h: */
 #include <stdlib.h>
-
-/* This is used to find 'offsetof', used below for alignment tests. */
-#include <stddef.h>
+#include <string.h>
 
 #define PNGLIB_BUILD /*libpng is being built, not used*/
 
+/* If HAVE_CONFIG_H is defined during the build then the build system must
+ * provide an appropriate "config.h" file on the include path.  The header file
+ * must provide definitions as required below (search for "HAVE_CONFIG_H");
+ * see configure.ac for more details of the requirements.  The macro
+ * "PNG_NO_CONFIG_H" is provided for maintainers to test for dependencies on
+ * 'configure'; define this macro to prevent the configure build including the
+ * configure generated config.h.  Libpng is expected to compile without *any*
+ * special build system support on a reasonably ANSI-C compliant system.
+ */
+#if (defined HAVE_CONFIG_H) && !(defined PNG_NO_CONFIG_H)
+#  include <config.h>
+
+   /* Pick up the definition of 'restrict' from config.h if it was read: */
+#  define PNG_RESTRICT restrict
+#endif
+
+/* To support symbol prefixing it is necessary to know *before* including png.h
+ * whether the fixed point (and maybe other) APIs are exported, because if they
+ * are not internal definitions may be required.  This is handled below just
+ * before png.h is included, but load the configuration now if it is available.
+ */
+#ifndef PNGLCONF_H
+#  include "pnglibconf.h"
+#endif
+
+/* Local renames may change non-exported API functions from png.h */
+#if defined PNG_PREFIX && !defined PNGPREFIX_H
+#  include "pngprefix.h"
+#endif
+
 #ifdef PNG_USER_CONFIG
 #  include "pngusr.h"
    /* These should have been defined in pngusr.h */
 #  define PNG_PRIVATE
 #endif
 
+/* Symbol preprocessing support.
+ *
+ * To enable listing global, but internal, symbols the following macros should
+ * always be used to declare an extern data or function object in this file.
+ */
+#ifndef PNG_INTERNAL_DATA
+#  define PNG_INTERNAL_DATA(type, name, array) extern type name array
+#endif
+
+#ifndef PNG_INTERNAL_FUNCTION
+#  define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\
+      extern PNG_FUNCTION(type, name, args, PNG_EMPTY attributes)
+#endif
+
+/* If floating or fixed point APIs are disabled they may still be compiled
+ * internally.  To handle this make sure they are declared as the appropriate
+ * internal extern function (otherwise the symbol prefixing stuff won't work and
+ * the functions will be used without definitions.)
+ *
+ * NOTE: although all the API functions are declared here they are not all
+ * actually built!  Because the declarations are still made it is necessary to
+ * fake out types that they depend on.
+ */
+#ifndef PNG_FP_EXPORT
+#  ifndef PNG_FLOATING_POINT_SUPPORTED
+#     define PNG_FP_EXPORT(ordinal, type, name, args)\
+         PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY);
+      typedef struct png_incomplete png_double;
+      typedef png_double*           png_doublep;
+      typedef const png_double*     png_const_doublep;
+      typedef png_double**          png_doublepp;
+#  endif
+#endif
+#ifndef PNG_FIXED_EXPORT
+#  ifndef PNG_FIXED_POINT_SUPPORTED
+#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\
+         PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY);
+#  endif
+#endif
+
 #include "png.h"
-#include "pnginfo.h"
 #include "pngstruct.h"
+#include "pnginfo.h"
 
 /* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */
 #ifndef PNG_DLL_EXPORT
  * safe, but builders of secure systems should verify the values against the
  * real system capabilities.
  */
-
 #ifdef PNG_SAFE_LIMITS_SUPPORTED
    /* 'safe' limits */
 #  ifndef PNG_USER_WIDTH_MAX
 #  endif
 #endif
 
-/* This is used for 16 bit gamma tables - only the top level pointers are const,
- * this could be changed:
+/* This is used for 16 bit gamma tables -- only the top level pointers are
+ * const; this could be changed:
  */
-typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
-
-/* Added at libpng-1.2.9 */
-/* Moved to pngpriv.h at libpng-1.5.0 */
-
-/* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure"
- * script.  We may need it here to get the correct configuration on things
- * like limits.
- */
-#ifdef PNG_CONFIGURE_LIBPNG
-#  ifdef HAVE_CONFIG_H
-#    include "config.h"
-#  endif
-#endif
+typedef const png_uint_16p * png_const_uint_16pp;
 
 /* Moved to pngpriv.h at libpng-1.5.0 */
 /* NOTE: some of these may have been used in external applications as
@@ -229,30 +281,6 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
 #  define PNG_ZBUF_SIZE 65536L
 #endif
 
-/* PNG_STATIC is used to mark internal file scope functions if they need to be
- * accessed for implementation tests (see the code in tests/?*).
- */
-#ifndef PNG_STATIC
-#   define PNG_STATIC static
-#endif
-
-/* C99 restrict is used where possible, to do this 'restrict' is defined as
- * empty if we can't be sure it is supported.  configure builds have already
- * done this work.
- */
-#ifdef PNG_CONFIGURE_LIBPNG
-#  define PNG_RESTRICT restrict
-#else
-   /* Modern compilers support restrict, but assume not for anything not
-    * recognized here:
-    */
-#  if defined __GNUC__ || defined _MSC_VER || defined __WATCOMC__
-#     define PNG_RESTRICT restrict
-#  else
-#     define PNG_RESTRICT
-#  endif
-#endif
-
 /* If warnings or errors are turned off the code is disabled or redirected here.
  * From 1.5.4 functions have been added to allow very limited formatting of
  * error and warning messages - this code will also be disabled here.
@@ -281,23 +309,18 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
  */
 #ifdef __cplusplus
 #  define png_voidcast(type, value) static_cast<type>(value)
+#  define png_constcast(type, value) const_cast<type>(value)
+#  define png_aligncast(type, value) \
+   static_cast<type>(static_cast<void*>(value))
+#  define png_aligncastconst(type, value) \
+   static_cast<type>(static_cast<const void*>(value))
 #else
 #  define png_voidcast(type, value) (value)
+#  define png_constcast(type, value) ((type)(value))
+#  define png_aligncast(type, value) ((void*)(value))
+#  define png_aligncastconst(type, value) ((const void*)(value))
 #endif /* __cplusplus */
 
-#ifndef PNG_EXTERN
-/* The functions exported by PNG_EXTERN are internal functions, which
- * aren't usually used outside the library (as far as I know), so it is
- * debatable if they should be exported at all.  In the future, when it
- * is possible to have run-time registry of chunk-handling functions,
- * some of these might be made available again.
- *
- * 1.5.7: turned the use of 'extern' back on, since it is localized to pngpriv.h
- * it should be safe now (it is unclear why it was turned off.)
- */
-#  define PNG_EXTERN extern
-#endif
-
 /* Some fixed point APIs are still required even if not exported because
  * they get used by the corresponding floating point APIs.  This magic
  * deals with this:
@@ -367,34 +390,6 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
 #  endif
 #endif
 
-#ifdef USE_FAR_KEYWORD
-/* Use this to make far-to-near assignments */
-#  define CHECK   1
-#  define NOCHECK 0
-#  define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
-#  define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
-#  define png_strlen  _fstrlen
-#  define png_memcmp  _fmemcmp    /* SJT: added */
-#  define png_memcpy  _fmemcpy
-#  define png_memset  _fmemset
-#else
-#  ifdef _WINDOWS_  /* Favor Windows over C runtime fns */
-#    define CVT_PTR(ptr)         (ptr)
-#    define CVT_PTR_NOCHECK(ptr) (ptr)
-#    define png_strlen  lstrlenA
-#    define png_memcmp  memcmp
-#    define png_memcpy  CopyMemory
-#    define png_memset  memset
-#  else
-#    define CVT_PTR(ptr)         (ptr)
-#    define CVT_PTR_NOCHECK(ptr) (ptr)
-#    define png_strlen  strlen
-#    define png_memcmp  memcmp      /* SJT: added */
-#    define png_memcpy  memcpy
-#    define png_memset  memset
-#  endif
-#endif
-
 /* These macros may need to be architecture dependent. */
 #define PNG_ALIGN_NONE   0 /* do not use data alignment */
 #define PNG_ALIGN_ALWAYS 1 /* assume unaligned accesses are OK */
@@ -457,16 +452,17 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
 #define PNG_HAVE_IDAT               0x04
 /* #define PNG_AFTER_IDAT           0x08 (defined in png.h) */
 #define PNG_HAVE_IEND               0x10
-#define PNG_HAVE_gAMA               0x20
-#define PNG_HAVE_cHRM               0x40
-#define PNG_HAVE_sRGB               0x80
+                   /*               0x20 (unused) */
+                   /*               0x40 (unused) */
+                   /*               0x80 (unused) */
 #define PNG_HAVE_CHUNK_HEADER      0x100
 #define PNG_WROTE_tIME             0x200
 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400
 #define PNG_BACKGROUND_IS_GRAY     0x800
 #define PNG_HAVE_PNG_SIGNATURE    0x1000
 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
-#define PNG_HAVE_iCCP             0x4000
+                   /*             0x4000 (unused) */
+#define PNG_IS_READ_STRUCT        0x8000 /* Else is a write struct */
 
 /* Flags for the transformations the PNG library does on the image data */
 #define PNG_BGR                 0x0001
@@ -511,36 +507,36 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
 
 /* Flags for the png_ptr->flags rather than declaring a byte for each one */
 #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY     0x0001
-#define PNG_FLAG_ZLIB_CUSTOM_LEVEL        0x0002
-#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL    0x0004
-#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS  0x0008
-#define PNG_FLAG_ZLIB_CUSTOM_METHOD       0x0010
-#define PNG_FLAG_ZLIB_FINISHED            0x0020
+#define PNG_FLAG_ZSTREAM_INITIALIZED      0x0002 /* Added to libpng-1.6.0 */
+                                  /*      0x0004    unused */
+#define PNG_FLAG_ZSTREAM_ENDED            0x0008 /* Added to libpng-1.6.0 */
+                                  /*      0x0010    unused */
+                                  /*      0x0020    unused */
 #define PNG_FLAG_ROW_INIT                 0x0040
 #define PNG_FLAG_FILLER_AFTER             0x0080
 #define PNG_FLAG_CRC_ANCILLARY_USE        0x0100
 #define PNG_FLAG_CRC_ANCILLARY_NOWARN     0x0200
 #define PNG_FLAG_CRC_CRITICAL_USE         0x0400
 #define PNG_FLAG_CRC_CRITICAL_IGNORE      0x0800
-#define PNG_FLAG_ASSUME_sRGB              0x1000  /* Added to libpng-1.5.4 */
-#define PNG_FLAG_OPTIMIZE_ALPHA           0x2000  /* Added to libpng-1.5.4 */
-#define PNG_FLAG_DETECT_UNINITIALIZED     0x4000  /* Added to libpng-1.5.4 */
-#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS      0x8000
-#define PNG_FLAG_KEEP_UNSAFE_CHUNKS       0x10000
-#define PNG_FLAG_LIBRARY_MISMATCH         0x20000
-#define PNG_FLAG_STRIP_ERROR_NUMBERS      0x40000
-#define PNG_FLAG_STRIP_ERROR_TEXT         0x80000
-#define PNG_FLAG_MALLOC_NULL_MEM_OK       0x100000
-                                  /*      0x200000  unused */
-                                  /*      0x400000  unused */
-#define PNG_FLAG_BENIGN_ERRORS_WARN       0x800000  /* Added to libpng-1.4.0 */
-#define PNG_FLAG_ZTXT_CUSTOM_STRATEGY    0x1000000  /* 5 lines added */
-#define PNG_FLAG_ZTXT_CUSTOM_LEVEL       0x2000000  /* to libpng-1.5.4 */
-#define PNG_FLAG_ZTXT_CUSTOM_MEM_LEVEL   0x4000000
-#define PNG_FLAG_ZTXT_CUSTOM_WINDOW_BITS 0x8000000
-#define PNG_FLAG_ZTXT_CUSTOM_METHOD      0x10000000
-                                  /*     0x20000000  unused */
-                                  /*     0x40000000  unused */
+#define PNG_FLAG_ASSUME_sRGB              0x1000 /* Added to libpng-1.5.4 */
+#define PNG_FLAG_OPTIMIZE_ALPHA           0x2000 /* Added to libpng-1.5.4 */
+#define PNG_FLAG_DETECT_UNINITIALIZED     0x4000 /* Added to libpng-1.5.4 */
+/* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS      0x8000 */
+/* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS      0x10000 */
+#define PNG_FLAG_LIBRARY_MISMATCH        0x20000
+#define PNG_FLAG_STRIP_ERROR_NUMBERS     0x40000
+#define PNG_FLAG_STRIP_ERROR_TEXT        0x80000
+#define PNG_FLAG_BENIGN_ERRORS_WARN     0x100000 /* Added to libpng-1.4.0 */
+#define PNG_FLAG_APP_WARNINGS_WARN      0x200000 /* Added to libpng-1.6.0 */
+#define PNG_FLAG_APP_ERRORS_WARN        0x400000 /* Added to libpng-1.6.0 */
+                                  /*    0x800000    unused */
+                                  /*   0x1000000    unused */
+                                  /*   0x2000000    unused */
+                                  /*   0x4000000    unused */
+                                  /*   0x8000000    unused */
+                                  /*  0x10000000    unused */
+                                  /*  0x20000000    unused */
+                                  /*  0x40000000    unused */
 
 #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
                                      PNG_FLAG_CRC_ANCILLARY_NOWARN)
@@ -551,24 +547,43 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
 #define PNG_FLAG_CRC_MASK           (PNG_FLAG_CRC_ANCILLARY_MASK | \
                                      PNG_FLAG_CRC_CRITICAL_MASK)
 
-/* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib
- * can handle at once.  This type need be no larger than 16 bits (so maximum of
- * 65535), this define allows us to discover how big it is, but limited by the
- * maximuum for png_size_t.  The value can be overriden in a library build
- * (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably
- * lower value (e.g. 255 works).  A lower value may help memory usage (slightly)
- * and may even improve performance on some systems (and degrade it on others.)
- */
-#ifndef ZLIB_IO_MAX
-#  define ZLIB_IO_MAX ((uInt)-1)
-#endif
-
 /* Save typing and make code easier to understand */
 
 #define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
    abs((int)((c1).green) - (int)((c2).green)) + \
    abs((int)((c1).blue) - (int)((c2).blue)))
 
+/* Added to libpng-1.5.7: sRGB conversion tables */
+#if defined PNG_SIMPLIFIED_READ_SUPPORTED ||\
+   defined PNG_SIMPLIFIED_WRITE_SUPPORTED
+#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
+PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]);
+   /* Convert from an sRGB encoded value 0..255 to a 16-bit linear value,
+    * 0..65535.  This table gives the closest 16-bit answers (no errors).
+    */
+#endif
+
+PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]);
+PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]);
+
+#define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\
+   ((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8))
+   /* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB
+    * encoded value with maximum error 0.646365.  Note that the input is not a
+    * 16-bit value; it has been multiplied by 255! */
+#endif /* PNG_SIMPLIFIED_READ/WRITE */
+
+/* Added to libpng-1.6.0: scale a 16-bit value in the range 0..65535 to 0..255
+ * by dividing by 257 *with rounding*.  This macro is exact for the given range.
+ * See the discourse in pngrtran.c png_do_scale_16_to_8.  The values in the
+ * macro were established by experiment (modifying the added value).  The macro
+ * has a second variant that takes a value already scaled by 255 and divides by
+ * 65535 - this has a maximum error of .502.  Over the range 0..65535*65535 it
+ * only gives off-by-one errors and only for 0.5% (1 in 200) of the values.
+ */
+#define PNG_DIV65535(v24) (((v24) + 32895) >> 16)
+#define PNG_DIV257(v16) PNG_DIV65535((png_uint_32)(v16) * 255)
+
 /* Added to libpng-1.2.6 JB */
 #define PNG_ROWBYTES(pixel_bits, width) \
     ((pixel_bits) >= 8 ? \
@@ -616,10 +631,10 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
 #ifdef PNG_FIXED_POINT_MACRO_SUPPORTED
 #define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\
     ((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0))
-#else
-PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp,
-   png_const_charp text));
 #endif
+/* else the corresponding function is defined below, inside the scope of the
+ * cplusplus test.
+ */
 #endif
 
 /* Constants for known chunk types.  If you need to add a chunk, define the name
@@ -698,107 +713,154 @@ PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp,
 extern "C" {
 #endif /* __cplusplus */
 
-/* These functions are used internally in the code.  They generally
- * shouldn't be used unless you are writing code to add or replace some
- * functionality in libpng.  More information about most functions can
- * be found in the files where the functions are located.
+/* Internal functions; these are not exported from a DLL however because they
+ * are used within several of the C source files they have to be C extern.
+ *
+ * All of these functions must be declared with PNG_INTERNAL_FUNCTION.
  */
 
+/* Zlib support */
+#define PNG_UNEXPECTED_ZLIB_RETURN (-7)
+PNG_INTERNAL_FUNCTION(void, png_zstream_error,(png_structrp png_ptr, int ret),
+   PNG_EMPTY);
+   /* Used by the zlib handling functions to ensure that z_stream::msg is always
+    * set before they return.
+    */
+
+#ifdef PNG_WRITE_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_free_buffer_list,(png_structrp png_ptr,
+   png_compression_bufferp *list),PNG_EMPTY);
+   /* Free the buffer list used by the compressed write code. */
+#endif
+
+#if defined(PNG_FLOATING_POINT_SUPPORTED) && \
+   !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \
+   (defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \
+   defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \
+   defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \
+   (defined(PNG_sCAL_SUPPORTED) && \
+   defined(PNG_FLOATING_ARITHMETIC_SUPPORTED))
+PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr,
+   double fp, png_const_charp text),PNG_EMPTY);
+#endif
+
 /* Check the user version string for compatibility, returns false if the version
  * numbers aren't compatible.
  */
-PNG_EXTERN int png_user_version_check(png_structp png_ptr,
-   png_const_charp user_png_ver);
+PNG_INTERNAL_FUNCTION(int,png_user_version_check,(png_structrp png_ptr,
+   png_const_charp user_png_ver),PNG_EMPTY);
 
-/* Allocate memory for an internal libpng struct */
-PNG_EXTERN PNG_FUNCTION(png_voidp,png_create_struct,PNGARG((int type)),
-   PNG_ALLOCATED);
+/* Internal base allocator - no messages, NULL on failure to allocate.  This
+ * does, however, call the application provided allocator and that could call
+ * png_error (although that would be a bug in the application implementation.)
+ */
+PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_base,(png_const_structrp png_ptr,
+   png_alloc_size_t size),PNG_ALLOCATED);
 
-/* Free memory from internal libpng struct */
-PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr));
+#if defined PNG_TEXT_SUPPORTED || defined PNG_sPLT_SUPPORTED ||\
+   defined PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
+/* Internal array allocator, outputs no error or warning messages on failure,
+ * just returns NULL.  
+ */
+PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_array,(png_const_structrp png_ptr,
+   int nelements, size_t element_size),PNG_ALLOCATED);
 
-PNG_EXTERN PNG_FUNCTION(png_voidp,png_create_struct_2,
-   PNGARG((int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)),
-   PNG_ALLOCATED);
-PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
-    png_free_ptr free_fn, png_voidp mem_ptr));
+/* The same but an existing array is extended by add_elements.  This function
+ * also memsets the new elements to 0 and copies the old elements.  The old
+ * array is not freed or altered.
+ */
+PNG_INTERNAL_FUNCTION(png_voidp,png_realloc_array,(png_const_structrp png_ptr,
+   png_const_voidp array, int old_elements, int add_elements,
+   size_t element_size),PNG_ALLOCATED);
+#endif /* text, sPLT or unknown chunks */
+
+/* Magic to create a struct when there is no struct to call the user supplied
+ * memory allocators.  Because error handling has not been set up the memory
+ * handlers can't safely call png_error, but this is an obscure and undocumented
+ * restriction so libpng has to assume that the 'free' handler, at least, might
+ * call png_error.
+ */
+PNG_INTERNAL_FUNCTION(png_structp,png_create_png_struct,
+   (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
+    png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn,
+    png_free_ptr free_fn),PNG_ALLOCATED);
+
+/* Free memory from internal libpng struct */
+PNG_INTERNAL_FUNCTION(void,png_destroy_png_struct,(png_structrp png_ptr),
+   PNG_EMPTY);
 
-/* Free any memory that info_ptr points to and reset struct. */
-PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
-    png_infop info_ptr));
+/* Free an allocated jmp_buf (always succeeds) */
+PNG_INTERNAL_FUNCTION(void,png_free_jmpbuf,(png_structrp png_ptr),PNG_EMPTY);
 
 /* Function to allocate memory for zlib.  PNGAPI is disallowed. */
-PNG_EXTERN PNG_FUNCTION(voidpf,png_zalloc,PNGARG((voidpf png_ptr, uInt items,
-   uInt size)),PNG_ALLOCATED);
+PNG_INTERNAL_FUNCTION(voidpf,png_zalloc,(voidpf png_ptr, uInt items, uInt size),
+   PNG_ALLOCATED);
 
 /* Function to free memory for zlib.  PNGAPI is disallowed. */
-PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
+PNG_INTERNAL_FUNCTION(void,png_zfree,(voidpf png_ptr, voidpf ptr),PNG_EMPTY);
 
 /* Next four functions are used internally as callbacks.  PNGCBAPI is required
  * but not PNG_EXPORT.  PNGAPI added at libpng version 1.2.3, changed to
  * PNGCBAPI at 1.5.0
  */
 
-PNG_EXTERN void PNGCBAPI png_default_read_data PNGARG((png_structp png_ptr,
-    png_bytep data, png_size_t length));
+PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_read_data,(png_structp png_ptr,
+    png_bytep data, png_size_t length),PNG_EMPTY);
 
 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
-PNG_EXTERN void PNGCBAPI png_push_fill_buffer PNGARG((png_structp png_ptr,
-    png_bytep buffer, png_size_t length));
+PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_push_fill_buffer,(png_structp png_ptr,
+    png_bytep buffer, png_size_t length),PNG_EMPTY);
 #endif
 
-PNG_EXTERN void PNGCBAPI png_default_write_data PNGARG((png_structp png_ptr,
-    png_bytep data, png_size_t length));
+PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_write_data,(png_structp png_ptr,
+    png_bytep data, png_size_t length),PNG_EMPTY);
 
 #ifdef PNG_WRITE_FLUSH_SUPPORTED
 #  ifdef PNG_STDIO_SUPPORTED
-PNG_EXTERN void PNGCBAPI png_default_flush PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_flush,(png_structp png_ptr),
+   PNG_EMPTY);
 #  endif
 #endif
 
 /* Reset the CRC variable */
-PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_reset_crc,(png_structrp png_ptr),PNG_EMPTY);
 
 /* Write the "data" buffer to whatever output you are using */
-PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr,
-    png_const_bytep data, png_size_t length));
+PNG_INTERNAL_FUNCTION(void,png_write_data,(png_structrp png_ptr,
+    png_const_bytep data, png_size_t length),PNG_EMPTY);
 
 /* Read and check the PNG file signature */
-PNG_EXTERN void png_read_sig PNGARG((png_structp png_ptr, png_infop info_ptr));
+PNG_INTERNAL_FUNCTION(void,png_read_sig,(png_structrp png_ptr,
+   png_inforp info_ptr),PNG_EMPTY);
 
 /* Read the chunk header (length + type name) */
-PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(png_uint_32,png_read_chunk_header,(png_structrp png_ptr),
+   PNG_EMPTY);
 
 /* Read data from whatever input you are using into the "data" buffer */
-PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data,
-    png_size_t length));
+PNG_INTERNAL_FUNCTION(void,png_read_data,(png_structrp png_ptr, png_bytep data,
+    png_size_t length),PNG_EMPTY);
 
 /* Read bytes into buf, and update png_ptr->crc */
-PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf,
-    png_size_t length));
-
-/* Decompress data in a chunk that uses compression */
-#if defined(PNG_READ_COMPRESSED_TEXT_SUPPORTED)
-PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr,
-    int comp_type, png_size_t chunklength, png_size_t prefix_length,
-    png_size_t *data_length));
-#endif
+PNG_INTERNAL_FUNCTION(void,png_crc_read,(png_structrp png_ptr, png_bytep buf,
+    png_uint_32 length),PNG_EMPTY);
 
 /* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */
-PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip));
+PNG_INTERNAL_FUNCTION(int,png_crc_finish,(png_structrp png_ptr,
+   png_uint_32 skip),PNG_EMPTY);
 
 /* Read the CRC from the file and compare it to the libpng calculated CRC */
-PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(int,png_crc_error,(png_structrp png_ptr),PNG_EMPTY);
 
 /* Calculate the CRC over a section of data.  Note that we are only
  * passing a maximum of 64K on systems that have this as a memory limit,
  * since this is the maximum buffer size we can specify.
  */
-PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr,
-    png_const_bytep ptr, png_size_t length));
+PNG_INTERNAL_FUNCTION(void,png_calculate_crc,(png_structrp png_ptr,
+   png_const_bytep ptr, png_size_t length),PNG_EMPTY);
 
 #ifdef PNG_WRITE_FLUSH_SUPPORTED
-PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_flush,(png_structrp png_ptr),PNG_EMPTY);
 #endif
 
 /* Write various chunks */
@@ -806,143 +868,130 @@ PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
 /* Write the IHDR chunk, and update the png_struct with the necessary
  * information.
  */
-PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width,
-    png_uint_32 height,
-    int bit_depth, int color_type, int compression_method, int filter_method,
-    int interlace_method));
+PNG_INTERNAL_FUNCTION(void,png_write_IHDR,(png_structrp png_ptr,
+   png_uint_32 width, png_uint_32 height, int bit_depth, int color_type,
+   int compression_method, int filter_method, int interlace_method),PNG_EMPTY);
 
-PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr,
-    png_const_colorp palette, png_uint_32 num_pal));
+PNG_INTERNAL_FUNCTION(void,png_write_PLTE,(png_structrp png_ptr,
+   png_const_colorp palette, png_uint_32 num_pal),PNG_EMPTY);
 
-PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data,
-    png_size_t length));
+PNG_INTERNAL_FUNCTION(void,png_compress_IDAT,(png_structrp png_ptr,
+   png_const_bytep row_data, png_alloc_size_t row_data_length, int flush),
+   PNG_EMPTY);
 
-PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_write_IEND,(png_structrp png_ptr),PNG_EMPTY);
 
 #ifdef PNG_WRITE_gAMA_SUPPORTED
-#  ifdef PNG_FLOATING_POINT_SUPPORTED
-PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma));
-#  endif
-PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr,
-    png_fixed_point file_gamma));
+PNG_INTERNAL_FUNCTION(void,png_write_gAMA_fixed,(png_structrp png_ptr,
+    png_fixed_point file_gamma),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_sBIT_SUPPORTED
-PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr,
-    png_const_color_8p sbit, int color_type));
+PNG_INTERNAL_FUNCTION(void,png_write_sBIT,(png_structrp png_ptr,
+    png_const_color_8p sbit, int color_type),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_cHRM_SUPPORTED
-#  ifdef PNG_FLOATING_POINT_SUPPORTED
-PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr,
-    double white_x, double white_y,
-    double red_x, double red_y, double green_x, double green_y,
-    double blue_x, double blue_y));
-#  endif
-PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr,
-    png_fixed_point int_white_x, png_fixed_point int_white_y,
-    png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
-    int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
-    png_fixed_point int_blue_y));
+PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr,
+    const png_xy *xy), PNG_EMPTY);
+    /* The xy value must have been previously validated */
 #endif
 
 #ifdef PNG_WRITE_sRGB_SUPPORTED
-PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr,
-    int intent));
+PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr,
+    int intent),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_iCCP_SUPPORTED
-PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr,
-    png_const_charp name, int compression_type,
-    png_const_charp profile, int proflen));
-   /* Note to maintainer: profile should be png_bytep */
+PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr,
+   png_const_charp name, png_const_bytep profile), PNG_EMPTY);
+   /* The profile must have been previously validated for correctness, the
+    * length comes from the first four bytes.  Only the base, deflate,
+    * compression is supported.
+    */
 #endif
 
 #ifdef PNG_WRITE_sPLT_SUPPORTED
-PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr,
-    png_const_sPLT_tp palette));
+PNG_INTERNAL_FUNCTION(void,png_write_sPLT,(png_structrp png_ptr,
+    png_const_sPLT_tp palette),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_tRNS_SUPPORTED
-PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr,
+PNG_INTERNAL_FUNCTION(void,png_write_tRNS,(png_structrp png_ptr,
     png_const_bytep trans, png_const_color_16p values, int number,
-    int color_type));
+    int color_type),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_bKGD_SUPPORTED
-PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr,
-    png_const_color_16p values, int color_type));
+PNG_INTERNAL_FUNCTION(void,png_write_bKGD,(png_structrp png_ptr,
+    png_const_color_16p values, int color_type),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_hIST_SUPPORTED
-PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr,
-    png_const_uint_16p hist, int num_hist));
+PNG_INTERNAL_FUNCTION(void,png_write_hIST,(png_structrp png_ptr,
+    png_const_uint_16p hist, int num_hist),PNG_EMPTY);
 #endif
 
 /* Chunks that have keywords */
-#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
-    defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
-PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr,
-    png_const_charp key, png_charpp new_key));
-#endif
-
 #ifdef PNG_WRITE_tEXt_SUPPORTED
-PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_const_charp key,
-    png_const_charp text, png_size_t text_len));
+PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr,
+   png_const_charp key, png_const_charp text, png_size_t text_len),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_zTXt_SUPPORTED
-PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_const_charp key,
-    png_const_charp text, png_size_t text_len, int compression));
+PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp
+    key, png_const_charp text, png_size_t text_len, int compression),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_iTXt_SUPPORTED
-PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
+PNG_INTERNAL_FUNCTION(void,png_write_iTXt,(png_structrp png_ptr,
     int compression, png_const_charp key, png_const_charp lang,
-    png_const_charp lang_key, png_const_charp text));
+    png_const_charp lang_key, png_const_charp text),PNG_EMPTY);
 #endif
 
 #ifdef PNG_TEXT_SUPPORTED  /* Added at version 1.0.14 and 1.2.4 */
-PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr,
-    png_infop info_ptr, png_const_textp text_ptr, int num_text));
+PNG_INTERNAL_FUNCTION(int,png_set_text_2,(png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_textp text_ptr, int num_text),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_oFFs_SUPPORTED
-PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
-    png_int_32 x_offset, png_int_32 y_offset, int unit_type));
+PNG_INTERNAL_FUNCTION(void,png_write_oFFs,(png_structrp png_ptr,
+    png_int_32 x_offset, png_int_32 y_offset, int unit_type),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_pCAL_SUPPORTED
-PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose,
-    png_int_32 X0, png_int_32 X1, int type, int nparams,
-    png_const_charp units, png_charpp params));
+PNG_INTERNAL_FUNCTION(void,png_write_pCAL,(png_structrp png_ptr,
+    png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams,
+    png_const_charp units, png_charpp params),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_pHYs_SUPPORTED
-PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr,
+PNG_INTERNAL_FUNCTION(void,png_write_pHYs,(png_structrp png_ptr,
     png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit,
-    int unit_type));
+    int unit_type),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_tIME_SUPPORTED
-PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr,
-    png_const_timep mod_time));
+PNG_INTERNAL_FUNCTION(void,png_write_tIME,(png_structrp png_ptr,
+    png_const_timep mod_time),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_sCAL_SUPPORTED
-PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr,
-    int unit, png_const_charp width, png_const_charp height));
+PNG_INTERNAL_FUNCTION(void,png_write_sCAL_s,(png_structrp png_ptr,
+    int unit, png_const_charp width, png_const_charp height),PNG_EMPTY);
 #endif
 
 /* Called when finished processing a row of data */
-PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_write_finish_row,(png_structrp png_ptr),
+    PNG_EMPTY);
 
 /* Internal use only.   Called before first row of data */
-PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_write_start_row,(png_structrp png_ptr),
+    PNG_EMPTY);
 
 /* Combine a row of data, dealing with alpha, etc. if requested.  'row' is an
  * array of png_ptr->width pixels.  If the image is not interlaced or this
- * is the final pass this just does a png_memcpy, otherwise the "display" flag
+ * is the final pass this just does a memcpy, otherwise the "display" flag
  * is used to determine whether to copy pixels that are not in the current pass.
  *
  * Because 'png_do_read_interlace' (below) replicates pixels this allows this
@@ -966,8 +1015,8 @@ PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr));
 #ifndef PNG_USE_COMPILE_TIME_MASKS
 #  define PNG_USE_COMPILE_TIME_MASKS 1
 #endif
-PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
-    int display));
+PNG_INTERNAL_FUNCTION(void,png_combine_row,(png_const_structrp png_ptr,
+    png_bytep row, int display),PNG_EMPTY);
 
 #ifdef PNG_READ_INTERLACING_SUPPORTED
 /* Expand an interlaced row: the 'row_info' describes the pass data that has
@@ -976,188 +1025,204 @@ PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
  * the pixels are *replicated* to the intervening space.  This is essential for
  * the correct operation of png_combine_row, above.
  */
-PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info,
-    png_bytep row, int pass, png_uint_32 transformations));
+PNG_INTERNAL_FUNCTION(void,png_do_read_interlace,(png_row_infop row_info,
+    png_bytep row, int pass, png_uint_32 transformations),PNG_EMPTY);
 #endif
 
 /* GRR TO DO (2.0 or whenever):  simplify other internal calling interfaces */
 
 #ifdef PNG_WRITE_INTERLACING_SUPPORTED
 /* Grab pixels out of a row for an interlaced pass */
-PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
-    png_bytep row, int pass));
+PNG_INTERNAL_FUNCTION(void,png_do_write_interlace,(png_row_infop row_info,
+    png_bytep row, int pass),PNG_EMPTY);
 #endif
 
 /* Unfilter a row: check the filter value before calling this, there is no point
  * calling it for PNG_FILTER_VALUE_NONE.
  */
-PNG_EXTERN void png_read_filter_row PNGARG((png_structp pp, png_row_infop
-    row_info, png_bytep row, png_const_bytep prev_row, int filter));
-
-PNG_EXTERN void png_read_filter_row_up_neon PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_bytep prev_row));
-PNG_EXTERN void png_read_filter_row_sub3_neon PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_bytep prev_row));
-PNG_EXTERN void png_read_filter_row_sub4_neon PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_bytep prev_row));
-PNG_EXTERN void png_read_filter_row_avg3_neon PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_bytep prev_row));
-PNG_EXTERN void png_read_filter_row_avg4_neon PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_bytep prev_row));
-PNG_EXTERN void png_read_filter_row_paeth3_neon PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_bytep prev_row));
-PNG_EXTERN void png_read_filter_row_paeth4_neon PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_bytep prev_row));
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY);
+
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info,
+    png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_neon,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
 
 /* Choose the best filter to use and filter the row data */
-PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr,
-    png_row_infop row_info));
+PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
+    png_row_infop row_info),PNG_EMPTY);
+
+#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr,
+   png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY);
+   /* Read 'avail_out' bytes of data from the IDAT stream.  If the output buffer
+    * is NULL the function checks, instead, for the end of the stream.  In this
+    * case a benign error will be issued if the stream end is not found or if
+    * extra data has to be consumed.
+    */
+PNG_INTERNAL_FUNCTION(void,png_read_finish_IDAT,(png_structrp png_ptr),
+   PNG_EMPTY);
+   /* This cleans up when the IDAT LZ stream does not end when the last image
+    * byte is read; there is still some pending input.
+    */
 
-/* Finish a row while reading, dealing with interlacing passes, etc. */
-PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr),
+   PNG_EMPTY);
+   /* Finish a row while reading, dealing with interlacing passes, etc. */
+#endif
 
 /* Initialize the row buffers, etc. */
-PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY);
 
 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
 /* Optional call to update the users info structure */
-PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr,
-    png_infop info_ptr));
+PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr,
+    png_inforp info_ptr),PNG_EMPTY);
 #endif
 
 /* These are the functions that do the transformations */
 #ifdef PNG_READ_FILLER_SUPPORTED
-PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info,
-    png_bytep row, png_uint_32 filler, png_uint_32 flags));
+PNG_INTERNAL_FUNCTION(void,png_do_read_filler,(png_row_infop row_info,
+    png_bytep row, png_uint_32 filler, png_uint_32 flags),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
-PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_read_swap_alpha,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
-PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_write_swap_alpha,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
-PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_read_invert_alpha,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
-PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_write_invert_alpha,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #if defined(PNG_WRITE_FILLER_SUPPORTED) || \
     defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
-PNG_EXTERN void png_do_strip_channel PNGARG((png_row_infop row_info,
-    png_bytep row, int at_start));
+PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info,
+    png_bytep row, int at_start),PNG_EMPTY);
 #endif
 
 #ifdef PNG_16BIT_SUPPORTED
 #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
-PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_swap,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 #endif
 
 #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \
     defined(PNG_WRITE_PACKSWAP_SUPPORTED)
-PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_packswap,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
-PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr,
-    png_row_infop row_info, png_bytep row));
+PNG_INTERNAL_FUNCTION(int,png_do_rgb_to_gray,(png_structrp png_ptr,
+    png_row_infop row_info, png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
-PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_gray_to_rgb,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_PACK_SUPPORTED
-PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_unpack,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_SHIFT_SUPPORTED
-PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_color_8p sig_bits));
+PNG_INTERNAL_FUNCTION(void,png_do_unshift,(png_row_infop row_info,
+    png_bytep row, png_const_color_8p sig_bits),PNG_EMPTY);
 #endif
 
 #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
-PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
-PNG_EXTERN void png_do_scale_16_to_8 PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_scale_16_to_8,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
-PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_chop,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_QUANTIZE_SUPPORTED
-PNG_EXTERN void png_do_quantize PNGARG((png_row_infop row_info,
+PNG_INTERNAL_FUNCTION(void,png_do_quantize,(png_row_infop row_info,
     png_bytep row, png_const_bytep palette_lookup,
-    png_const_bytep quantize_lookup));
+    png_const_bytep quantize_lookup),PNG_EMPTY);
 
 #  ifdef PNG_CORRECT_PALETTE_SUPPORTED
-PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr,
-    png_colorp palette, int num_palette));
+PNG_INTERNAL_FUNCTION(void,png_correct_palette,(png_structrp png_ptr,
+    png_colorp palette, int num_palette),PNG_EMPTY);
 #  endif
 #endif
 
 #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
-PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_PACK_SUPPORTED
-PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info,
-   png_bytep row, png_uint_32 bit_depth));
+PNG_INTERNAL_FUNCTION(void,png_do_pack,(png_row_infop row_info,
+   png_bytep row, png_uint_32 bit_depth),PNG_EMPTY);
 #endif
 
 #ifdef PNG_WRITE_SHIFT_SUPPORTED
-PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_color_8p bit_depth));
+PNG_INTERNAL_FUNCTION(void,png_do_shift,(png_row_infop row_info,
+    png_bytep row, png_const_color_8p bit_depth),PNG_EMPTY);
 #endif
 
 #if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
     defined(PNG_READ_ALPHA_MODE_SUPPORTED)
-PNG_EXTERN void png_do_compose PNGARG((png_row_infop row_info,
-    png_bytep row, png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_do_compose,(png_row_infop row_info,
+    png_bytep row, png_structrp png_ptr),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_GAMMA_SUPPORTED
-PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info,
-    png_bytep row, png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_do_gamma,(png_row_infop row_info,
+    png_bytep row, png_structrp png_ptr),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_ALPHA_MODE_SUPPORTED
-PNG_EXTERN void png_do_encode_alpha PNGARG((png_row_infop row_info,
-   png_bytep row, png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_do_encode_alpha,(png_row_infop row_info,
+   png_bytep row, png_structrp png_ptr),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_EXPAND_SUPPORTED
-PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info,
+PNG_INTERNAL_FUNCTION(void,png_do_expand_palette,(png_row_infop row_info,
     png_bytep row, png_const_colorp palette, png_const_bytep trans,
-    int num_trans));
-PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info,
-    png_bytep row, png_const_color_16p trans_color));
+    int num_trans),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_expand,(png_row_infop row_info,
+    png_bytep row, png_const_color_16p trans_color),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_EXPAND_16_SUPPORTED
-PNG_EXTERN void png_do_expand_16 PNGARG((png_row_infop row_info,
-    png_bytep row));
+PNG_INTERNAL_FUNCTION(void,png_do_expand_16,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
 #endif
 
 /* The following decodes the appropriate chunks, and does error correction,
@@ -1165,254 +1230,293 @@ PNG_EXTERN void png_do_expand_16 PNGARG((png_row_infop row_info,
  */
 
 /* Decode the IHDR chunk */
-PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
-PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
-PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_IHDR,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_handle_PLTE,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_handle_IEND,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 
 #ifdef PNG_READ_bKGD_SUPPORTED
-PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_bKGD,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_cHRM_SUPPORTED
-PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_gAMA_SUPPORTED
-PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_hIST_SUPPORTED
-PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_hIST,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_iCCP_SUPPORTED
-PNG_EXTERN void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_iCCP,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif /* PNG_READ_iCCP_SUPPORTED */
 
 #ifdef PNG_READ_iTXt_SUPPORTED
-PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_iTXt,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_oFFs_SUPPORTED
-PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_oFFs,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_pCAL_SUPPORTED
-PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_pCAL,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_pHYs_SUPPORTED
-PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_pHYs,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_sBIT_SUPPORTED
-PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_sBIT,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_sCAL_SUPPORTED
-PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_sCAL,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_sPLT_SUPPORTED
-PNG_EXTERN void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_sPLT,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif /* PNG_READ_sPLT_SUPPORTED */
 
 #ifdef PNG_READ_sRGB_SUPPORTED
-PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_sRGB,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_tEXt_SUPPORTED
-PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_tEXt,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_tIME_SUPPORTED
-PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_tIME,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_tRNS_SUPPORTED
-PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_tRNS,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_zTXt_SUPPORTED
-PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
-    png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
-PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
-    png_infop info_ptr, png_uint_32 length));
+PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr,
+    png_uint_32 chunk_name),PNG_EMPTY);
 
-PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
-    png_uint_32 chunk_name));
+#ifdef PNG_READ_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
+   /* This is the function that gets called for unknown chunks.  The 'keep'
+    * argument is either non-zero for a known chunk that has been set to be
+    * handled as unknown or zero for an unknown chunk.  By default the function
+    * just skips the chunk or errors out if it is critical.
+    */
 
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-/* Exactly as png_handle_as_unknown() except that the argument is a 32-bit chunk
- * name, not a string.
- */
-PNG_EXTERN int png_chunk_unknown_handling PNGARG((png_structp png_ptr,
-    png_uint_32 chunk_name));
+#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
+#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+PNG_INTERNAL_FUNCTION(int,png_chunk_unknown_handling,
+    (png_const_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY);
+   /* Exactly as the API png_handle_as_unknown() except that the argument is a
+    * 32-bit chunk name, not a string.
+    */
 #endif
+#endif /* PNG_READ_UNKNOWN_CHUNKS_SUPPORTED */
+#endif /* PNG_READ_SUPPORTED */
 
 /* Handle the transformations for reading and writing */
 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
-PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr,
-   png_row_infop row_info));
+PNG_INTERNAL_FUNCTION(void,png_do_read_transformations,(png_structrp png_ptr,
+   png_row_infop row_info),PNG_EMPTY);
 #endif
 #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
-PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr,
-   png_row_infop row_info));
+PNG_INTERNAL_FUNCTION(void,png_do_write_transformations,(png_structrp png_ptr,
+   png_row_infop row_info),PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
-PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_init_read_transformations,(png_structrp png_ptr),
+    PNG_EMPTY);
 #endif
 
 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
-PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr,
-    png_infop info_ptr));
-PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr,
-    png_infop info_ptr));
-PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
-PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
-    png_uint_32 length));
-PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
-PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
-PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
-    png_bytep buffer, png_size_t buffer_length));
-PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr));
-PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr,
-    png_bytep buffer, png_size_t buffer_length));
-PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr));
-PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr,
-   png_infop info_ptr, png_uint_32 length));
-PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr,
-   png_infop info_ptr));
-PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr,
-   png_infop info_ptr));
-PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row));
-PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr,
-    png_infop info_ptr));
-PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr,
-    png_infop info_ptr));
-PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr));
+PNG_INTERNAL_FUNCTION(void,png_push_read_chunk,(png_structrp png_ptr,
+    png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_sig,(png_structrp png_ptr,
+    png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_crc_skip,(png_structrp png_ptr,
+    png_uint_32 length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_crc_finish,(png_structrp png_ptr),
+    PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr),
+    PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr,
+    png_bytep buffer, png_size_t buffer_length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_IDAT,(png_structrp png_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_process_IDAT_data,(png_structrp png_ptr,
+    png_bytep buffer, png_size_t buffer_length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr),
+    PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_handle_unknown,(png_structrp png_ptr,
+   png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr,
+   png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr,
+   png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr,
+     png_bytep row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr,
+    png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr,
+    png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr),
+    PNG_EMPTY);
 #  ifdef PNG_READ_tEXt_SUPPORTED
-PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr,
-    png_infop info_ptr, png_uint_32 length));
-PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr,
-    png_infop info_ptr));
+PNG_INTERNAL_FUNCTION(void,png_push_handle_tEXt,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_tEXt,(png_structrp png_ptr,
+    png_inforp info_ptr),PNG_EMPTY);
 #  endif
 #  ifdef PNG_READ_zTXt_SUPPORTED
-PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr,
-    png_infop info_ptr, png_uint_32 length));
-PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr,
-    png_infop info_ptr));
+PNG_INTERNAL_FUNCTION(void,png_push_handle_zTXt,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_zTXt,(png_structrp png_ptr,
+    png_inforp info_ptr),PNG_EMPTY);
 #  endif
 #  ifdef PNG_READ_iTXt_SUPPORTED
-PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr,
-    png_infop info_ptr, png_uint_32 length));
-PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr,
-    png_infop info_ptr));
+PNG_INTERNAL_FUNCTION(void,png_push_handle_iTXt,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr,
+    png_inforp info_ptr),PNG_EMPTY);
 #  endif
 
 #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 
 #ifdef PNG_MNG_FEATURES_SUPPORTED
-PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info,
-    png_bytep row));
-PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info,
-    png_bytep row));
-#endif
+PNG_INTERNAL_FUNCTION(void,png_do_read_intrapixel,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_write_intrapixel,(png_row_infop row_info,
+    png_bytep row),PNG_EMPTY);
+#endif
+
+/* Added at libpng version 1.6.0 */
+#ifdef PNG_GAMMA_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr,
+    png_colorspacerp colorspace, png_fixed_point gAMA), PNG_EMPTY);
+   /* Set the colorspace gamma with a value provided by the application or by
+    * the gAMA chunk on read.  The value will override anything set by an ICC
+    * profile.
+    */
 
-/* Added at libpng version 1.4.0 */
-#ifdef PNG_CHECK_cHRM_SUPPORTED
-PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr,
-    png_fixed_point int_white_x, png_fixed_point int_white_y,
-    png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
-    int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
-    png_fixed_point int_blue_y));
-#endif
+PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr,
+    png_inforp info_ptr), PNG_EMPTY);
+    /* Synchronize the info 'valid' flags with the colorspace */
 
-#ifdef PNG_CHECK_cHRM_SUPPORTED
-/* Added at libpng version 1.2.34 and 1.4.0 */
-/* Currently only used by png_check_cHRM_fixed */
-PNG_EXTERN void png_64bit_product PNGARG((long v1, long v2,
-    unsigned long *hi_product, unsigned long *lo_product));
+PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr,
+    png_inforp info_ptr), PNG_EMPTY);
+    /* Copy the png_struct colorspace to the info_struct and call the above to
+     * synchronize the flags.  Checks for NULL info_ptr and does nothing.
+     */
 #endif
 
-#ifdef PNG_cHRM_SUPPORTED
-/* Added at libpng version 1.5.5 */
-typedef struct png_xy
-{
-   png_fixed_point redx, redy;
-   png_fixed_point greenx, greeny;
-   png_fixed_point bluex, bluey;
-   png_fixed_point whitex, whitey;
-} png_xy;
-
-typedef struct png_XYZ
-{
-   png_fixed_point redX, redY, redZ;
-   png_fixed_point greenX, greenY, greenZ;
-   png_fixed_point blueX, blueY, blueZ;
-} png_XYZ;
-
-/* The conversion APIs return 0 on success, non-zero on a parameter error. They
- * allow conversion between the above representations of a color encoding.  When
- * converting from XYZ end points to chromaticities the absolute magnitude of
- * the end points is lost, when converting back the sum of the Y values of the
- * three end points will be 1.0
+/* Added at libpng version 1.4.0 */
+#ifdef PNG_COLORSPACE_SUPPORTED
+/* These internal functions are for maintaining the colorspace structure within
+ * a png_info or png_struct (or, indeed, both).
  */
-PNG_EXTERN int png_xy_from_XYZ PNGARG((png_xy *xy, png_XYZ XYZ));
-PNG_EXTERN int png_XYZ_from_xy PNGARG((png_XYZ *XYZ, png_xy xy));
-PNG_EXTERN int png_XYZ_from_xy_checked PNGARG((png_structp png_ptr,
-   png_XYZ *XYZ, png_xy xy));
+PNG_INTERNAL_FUNCTION(int,png_colorspace_set_chromaticities,
+   (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy,
+    int preferred), PNG_EMPTY);
+
+PNG_INTERNAL_FUNCTION(int,png_colorspace_set_endpoints,
+   (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_XYZ *XYZ,
+    int preferred), PNG_EMPTY);
+
+#ifdef PNG_sRGB_SUPPORTED
+PNG_INTERNAL_FUNCTION(int,png_colorspace_set_sRGB,(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, int intent), PNG_EMPTY);
+   /* This does set the colorspace gAMA and cHRM values too, but doesn't set the
+    * flags to write them, if it returns false there was a problem and an error
+    * message has already been output (but the colorspace may still need to be
+    * synced to record the invalid flag).
+    */
+#endif /* sRGB */
+
+#ifdef PNG_iCCP_SUPPORTED
+PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, png_const_charp name,
+   png_uint_32 profile_length, png_const_bytep profile, int color_type),
+   PNG_EMPTY);
+   /* The 'name' is used for information only */
+
+/* Routines for checking parts of an ICC profile. */
+PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, png_const_charp name,
+   png_uint_32 profile_length), PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, png_const_charp name,
+   png_uint_32 profile_length,
+   png_const_bytep profile /* first 132 bytes only */, int color_type),
+   PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_icc_check_tag_table,(png_const_structrp png_ptr,
+   png_colorspacerp colorspace, png_const_charp name,
+   png_uint_32 profile_length,
+   png_const_bytep profile /* header plus whole tag table */), PNG_EMPTY);
+#ifdef PNG_sRGB_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_icc_set_sRGB,(
+   png_const_structrp png_ptr, png_colorspacerp colorspace,
+   png_const_bytep profile, uLong adler), PNG_EMPTY);
+   /* 'adler' is the Adler32 checksum of the uncompressed profile data. It may
+    * be zero to indicate that it is not available.  It is used, if provided,
+    * as a fast check on the profile when checking to see if it is sRGB.
+    */
 #endif
+#endif /* iCCP */
+
+#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_colorspace_set_rgb_coefficients,
+   (png_structrp png_ptr), PNG_EMPTY);
+   /* Set the rgb_to_gray coefficients from the colorspace Y values */
+#endif /* READ_RGB_TO_GRAY */
+#endif /* COLORSPACE */
 
 /* Added at libpng version 1.4.0 */
-PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr,
+PNG_INTERNAL_FUNCTION(void,png_check_IHDR,(png_const_structrp png_ptr,
     png_uint_32 width, png_uint_32 height, int bit_depth,
     int color_type, int interlace_type, int compression_type,
-    int filter_type));
+    int filter_type),PNG_EMPTY);
 
 /* Added at libpng version 1.5.10 */
 #if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
     defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
-PNG_EXTERN void png_do_check_palette_indexes PNGARG((png_structp png_ptr,
-    png_row_infop row_info));
+PNG_INTERNAL_FUNCTION(void,png_do_check_palette_indexes,
+   (png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY);
 #endif
 
-/* Free all memory used by the read (old method - NOT DLL EXPORTED) */
-PNG_EXTERN void png_read_destroy PNGARG((png_structp png_ptr,
-    png_infop info_ptr, png_infop end_info_ptr));
-
-/* Free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
-PNG_EXTERN void png_write_destroy PNGARG((png_structp png_ptr));
-
-#ifdef USE_FAR_KEYWORD  /* memory model conversion function */
-PNG_EXTERN void *png_far_to_near PNGARG((png_structp png_ptr, png_voidp ptr,
-    int check));
-#endif /* USE_FAR_KEYWORD */
-
 #if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
-PNG_EXTERN PNG_FUNCTION(void, png_fixed_error, (png_structp png_ptr,
+PNG_INTERNAL_FUNCTION(void,png_fixed_error,(png_const_structrp png_ptr,
    png_const_charp name),PNG_NORETURN);
 #endif
 
@@ -1420,8 +1524,8 @@ PNG_EXTERN PNG_FUNCTION(void, png_fixed_error, (png_structp png_ptr,
  * the end.  Always leaves the buffer nul terminated.  Never errors out (and
  * there is no error code.)
  */
-PNG_EXTERN size_t png_safecat(png_charp buffer, size_t bufsize, size_t pos,
-    png_const_charp string);
+PNG_INTERNAL_FUNCTION(size_t,png_safecat,(png_charp buffer, size_t bufsize,
+   size_t pos, png_const_charp string),PNG_EMPTY);
 
 /* Various internal functions to handle formatted warning messages, currently
  * only implemented for warnings.
@@ -1432,8 +1536,8 @@ PNG_EXTERN size_t png_safecat(png_charp buffer, size_t bufsize, size_t pos,
  * Returns the pointer to the start of the formatted string.  This utility only
  * does unsigned values.
  */
-PNG_EXTERN png_charp png_format_number(png_const_charp start, png_charp end,
-   int format, png_alloc_size_t number);
+PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start,
+   png_charp end, int format, png_alloc_size_t number),PNG_EMPTY);
 
 /* Convenience macro that takes an array: */
 #define PNG_FORMAT_NUMBER(buffer,format,number) \
@@ -1457,7 +1561,7 @@ PNG_EXTERN png_charp png_format_number(png_const_charp start, png_charp end,
 #ifdef PNG_WARNINGS_SUPPORTED
 /* New defines and members adding in libpng-1.5.4 */
 #  define PNG_WARNING_PARAMETER_SIZE 32
-#  define PNG_WARNING_PARAMETER_COUNT 8
+#  define PNG_WARNING_PARAMETER_COUNT 8 /* Maximum 9; see pngerror.c */
 
 /* An l-value of this type has to be passed to the APIs below to cache the
  * values of the parameters to a formatted warning message.
@@ -1465,50 +1569,97 @@ PNG_EXTERN png_charp png_format_number(png_const_charp start, png_charp end,
 typedef char png_warning_parameters[PNG_WARNING_PARAMETER_COUNT][
    PNG_WARNING_PARAMETER_SIZE];
 
-PNG_EXTERN void png_warning_parameter(png_warning_parameters p, int number,
-    png_const_charp string);
-    /* Parameters are limited in size to PNG_WARNING_PARAMETER_SIZE characters,
-     * including the trailing '\0'.
-     */
-PNG_EXTERN void png_warning_parameter_unsigned(png_warning_parameters p,
-    int number, int format, png_alloc_size_t value);
-    /* Use png_alloc_size_t because it is an unsigned type as big as any we
-     * need to output.  Use the following for a signed value.
-     */
-PNG_EXTERN void png_warning_parameter_signed(png_warning_parameters p,
-    int number, int format, png_int_32 value);
-
-PNG_EXTERN void png_formatted_warning(png_structp png_ptr,
-    png_warning_parameters p, png_const_charp message);
-    /* 'message' follows the X/Open approach of using @1, @2 to insert
-     * parameters previously supplied using the above functions.  Errors in
-     * specifying the paramters will simple result in garbage substitutions.
-     */
+PNG_INTERNAL_FUNCTION(void,png_warning_parameter,(png_warning_parameters p,
+   int number, png_const_charp string),PNG_EMPTY);
+   /* Parameters are limited in size to PNG_WARNING_PARAMETER_SIZE characters,
+    * including the trailing '\0'.
+    */
+PNG_INTERNAL_FUNCTION(void,png_warning_parameter_unsigned,
+   (png_warning_parameters p, int number, int format, png_alloc_size_t value),
+   PNG_EMPTY);
+   /* Use png_alloc_size_t because it is an unsigned type as big as any we
+    * need to output.  Use the following for a signed value.
+    */
+PNG_INTERNAL_FUNCTION(void,png_warning_parameter_signed,
+   (png_warning_parameters p, int number, int format, png_int_32 value),
+   PNG_EMPTY);
+
+PNG_INTERNAL_FUNCTION(void,png_formatted_warning,(png_const_structrp png_ptr,
+   png_warning_parameters p, png_const_charp message),PNG_EMPTY);
+   /* 'message' follows the X/Open approach of using @1, @2 to insert
+    * parameters previously supplied using the above functions.  Errors in
+    * specifying the parameters will simply result in garbage substitutions.
+    */
 #endif
 
+#ifdef PNG_BENIGN_ERRORS_SUPPORTED
+/* Application errors (new in 1.6); use these functions (declared below) for
+ * errors in the parameters or order of API function calls on read.  The
+ * 'warning' should be used for an error that can be handled completely; the
+ * 'error' for one which can be handled safely but which may lose application
+ * information or settings.
+ *
+ * By default these both result in a png_error call prior to release, while in a
+ * released version the 'warning' is just a warning.  However if the application
+ * explicitly disables benign errors (explicitly permitting the code to lose
+ * information) they both turn into warnings.
+ *
+ * If benign errors aren't supported they end up as the corresponding base call
+ * (png_warning or png_error.)
+ */
+PNG_INTERNAL_FUNCTION(void,png_app_warning,(png_const_structrp png_ptr,
+   png_const_charp message),PNG_EMPTY);
+   /* The application provided invalid parameters to an API function or called
+    * an API function at the wrong time, libpng can completely recover.
+    */
+
+PNG_INTERNAL_FUNCTION(void,png_app_error,(png_const_structrp png_ptr,
+   png_const_charp message),PNG_EMPTY);
+   /* As above but libpng will ignore the call, or attempt some other partial
+    * recovery from the error.
+    */
+#else
+#  define png_app_warning(pp,s) png_warning(pp,s)
+#  define png_app_error(pp,s) png_error(pp,s)
+#endif
+
+PNG_INTERNAL_FUNCTION(void,png_chunk_report,(png_const_structrp png_ptr,
+   png_const_charp message, int error),PNG_EMPTY);
+   /* Report a recoverable issue in chunk data.  On read this is used to report
+    * a problem found while reading a particular chunk and the
+    * png_chunk_benign_error or png_chunk_warning function is used as
+    * appropriate.  On write this is used to report an error that comes from
+    * data set via an application call to a png_set_ API and png_app_error or
+    * png_app_warning is used as appropriate.
+    *
+    * The 'error' parameter must have one of the following values:
+    */
+#define PNG_CHUNK_WARNING     0 /* never an error */
+#define PNG_CHUNK_WRITE_ERROR 1 /* an error only on write */
+#define PNG_CHUNK_ERROR       2 /* always an error */
+
 /* ASCII to FP interfaces, currently only implemented if sCAL
  * support is required.
  */
-#ifdef PNG_sCAL_SUPPORTED
+#if defined(PNG_sCAL_SUPPORTED)
 /* MAX_DIGITS is actually the maximum number of characters in an sCAL
  * width or height, derived from the precision (number of significant
- * digits - a build time settable option) and assumpitions about the
+ * digits - a build time settable option) and assumptions about the
  * maximum ridiculous exponent.
  */
 #define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/)
-#endif
 
-#ifdef PNG_sCAL_SUPPORTED
 #ifdef PNG_FLOATING_POINT_SUPPORTED
-PNG_EXTERN void png_ascii_from_fp PNGARG((png_structp png_ptr, png_charp ascii,
-    png_size_t size, double fp, unsigned int precision));
+PNG_INTERNAL_FUNCTION(void,png_ascii_from_fp,(png_const_structrp png_ptr,
+   png_charp ascii, png_size_t size, double fp, unsigned int precision),
+   PNG_EMPTY);
 #endif /* FLOATING_POINT */
 
 #ifdef PNG_FIXED_POINT_SUPPORTED
-PNG_EXTERN void png_ascii_from_fixed PNGARG((png_structp png_ptr,
-    png_charp ascii, png_size_t size, png_fixed_point fp));
+PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr,
+   png_charp ascii, png_size_t size, png_fixed_point fp),PNG_EMPTY);
 #endif /* FIXED_POINT */
-#endif /* READ_sCAL */
+#endif /* sCAL */
 
 #if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED)
 /* An internal API to validate the format of a floating point number.
@@ -1532,7 +1683,7 @@ PNG_EXTERN void png_ascii_from_fixed PNGARG((png_structp png_ptr,
  * NOTE: The dangling E problem.
  *   There is a PNG valid floating point number in the following:
  *
- *       PNG floating point numb1.ers are not greedy.
+ *       PNG floating point numbers are not greedy.
  *
  *   Working this out requires *TWO* character lookahead (because of the
  *   sign), the parser does not do this - it will fail at the 'r' - this
@@ -1598,8 +1749,8 @@ PNG_EXTERN void png_ascii_from_fixed PNGARG((png_structp png_ptr,
  * that omits the last character (i.e. set the size to the index of
  * the problem character.)  This has not been tested within libpng.
  */
-PNG_EXTERN int png_check_fp_number PNGARG((png_const_charp string,
-    png_size_t size, int *statep, png_size_tp whereami));
+PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string,
+   png_size_t size, int *statep, png_size_tp whereami),PNG_EMPTY);
 
 /* This is the same but it checks a complete string and returns true
  * only if it just contains a floating point number.  As of 1.5.4 this
@@ -1607,8 +1758,8 @@ PNG_EXTERN int png_check_fp_number PNGARG((png_const_charp string,
  * it was valid (otherwise it returns 0.)  This can be used for testing
  * for negative or zero values using the sticky flag.
  */
-PNG_EXTERN int png_check_fp_string PNGARG((png_const_charp string,
-    png_size_t size));
+PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string,
+   png_size_t size),PNG_EMPTY);
 #endif /* pCAL || sCAL */
 
 #if defined(PNG_READ_GAMMA_SUPPORTED) ||\
@@ -1619,29 +1770,37 @@ PNG_EXTERN int png_check_fp_string PNGARG((png_const_charp string,
  * for overflow, true (1) if no overflow, in which case *res
  * holds the result.
  */
-PNG_EXTERN int png_muldiv PNGARG((png_fixed_point_p res, png_fixed_point a,
-    png_int_32 multiplied_by, png_int_32 divided_by));
+PNG_INTERNAL_FUNCTION(int,png_muldiv,(png_fixed_point_p res, png_fixed_point a,
+   png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY);
 #endif
 
 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
 /* Same deal, but issue a warning on overflow and return 0. */
-PNG_EXTERN png_fixed_point png_muldiv_warn PNGARG((png_structp png_ptr,
-    png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by));
+PNG_INTERNAL_FUNCTION(png_fixed_point,png_muldiv_warn,
+   (png_const_structrp png_ptr, png_fixed_point a, png_int_32 multiplied_by,
+   png_int_32 divided_by),PNG_EMPTY);
 #endif
 
-#if (defined PNG_READ_GAMMA_SUPPORTED) || (defined PNG_cHRM_SUPPORTED)
+#ifdef PNG_GAMMA_SUPPORTED
 /* Calculate a reciprocal - used for gamma values.  This returns
- * 0 if the argument is 0 in order to maintain an undefined value,
+ * 0 if the argument is 0 in order to maintain an undefined value;
  * there are no warnings.
  */
-PNG_EXTERN png_fixed_point png_reciprocal PNGARG((png_fixed_point a));
+PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal,(png_fixed_point a),
+   PNG_EMPTY);
 
+#ifdef PNG_READ_GAMMA_SUPPORTED
 /* The same but gives a reciprocal of the product of two fixed point
  * values.  Accuracy is suitable for gamma calculations but this is
- * not exact - use png_muldiv for that.
+ * not exact - use png_muldiv for that.  Only required at present on read.
  */
-PNG_EXTERN png_fixed_point png_reciprocal2 PNGARG((png_fixed_point a,
-    png_fixed_point b));
+PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal2,(png_fixed_point a,
+   png_fixed_point b),PNG_EMPTY);
+#endif
+
+/* Return true if the gamma value is significantly different from 1.0 */
+PNG_INTERNAL_FUNCTION(int,png_gamma_significant,(png_fixed_point gamma_value),
+   PNG_EMPTY);
 #endif
 
 #ifdef PNG_READ_GAMMA_SUPPORTED
@@ -1652,76 +1811,76 @@ PNG_EXTERN png_fixed_point png_reciprocal2 PNGARG((png_fixed_point a,
  * While the input is an 'unsigned' value it must actually be the
  * correct bit value - 0..255 or 0..65535 as required.
  */
-PNG_EXTERN png_uint_16 png_gamma_correct PNGARG((png_structp png_ptr,
-    unsigned int value, png_fixed_point gamma_value));
-PNG_EXTERN int png_gamma_significant PNGARG((png_fixed_point gamma_value));
-PNG_EXTERN png_uint_16 png_gamma_16bit_correct PNGARG((unsigned int value,
-    png_fixed_point gamma_value));
-PNG_EXTERN png_byte png_gamma_8bit_correct PNGARG((unsigned int value,
-    png_fixed_point gamma_value));
-PNG_EXTERN void png_destroy_gamma_table(png_structp png_ptr);
-PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr,
-    int bit_depth));
-#endif
-
-/* Missing declarations if FIXED_POINT is *not* supported - fixed properly
- * in libpng 1.6
- */
-#ifndef PNG_FIXED_POINT_SUPPORTED
-#ifdef PNG_cHRM_SUPPORTED
-PNG_EXTERN png_uint_32 png_get_cHRM_XYZ_fixed PNGARG(
-    (png_structp png_ptr, png_const_infop info_ptr,
-    png_fixed_point *int_red_X, png_fixed_point *int_red_Y,
-    png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
-    png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
-    png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
-    png_fixed_point *int_blue_Z));
-PNG_EXTERN void png_set_cHRM_XYZ_fixed PNGARG((png_structp png_ptr,
-    png_infop info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,
-    png_fixed_point int_red_Z, png_fixed_point int_green_X,
-    png_fixed_point int_green_Y, png_fixed_point int_green_Z,
-    png_fixed_point int_blue_X, png_fixed_point int_blue_Y,
-    png_fixed_point int_blue_Z));
-PNG_EXTERN void png_set_cHRM_fixed PNGARG((png_structp png_ptr,
-    png_infop info_ptr, png_fixed_point int_white_x,
-    png_fixed_point int_white_y, png_fixed_point int_red_x,
-    png_fixed_point int_red_y, png_fixed_point int_green_x,
-    png_fixed_point int_green_y, png_fixed_point int_blue_x,
-    png_fixed_point int_blue_y));
-#endif
-
-#ifdef PNG_gAMA_SUPPORTED
-PNG_EXTERN png_uint_32 png_get_gAMA_fixed PNGARG(
-    (png_const_structp png_ptr, png_const_infop info_ptr,
-    png_fixed_point *int_file_gamma));
-PNG_EXTERN void png_set_gAMA_fixed PNGARG((png_structp png_ptr,
-    png_infop info_ptr, png_fixed_point int_file_gamma));
-#endif
-
-#ifdef PNG_READ_BACKGROUND_SUPPORTED
-PNG_EXTERN void png_set_background_fixed PNGARG((png_structp png_ptr,
-    png_const_color_16p background_color, int background_gamma_code,
-    int need_expand, png_fixed_point background_gamma));
-#endif
+PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_correct,(png_structrp png_ptr,
+   unsigned int value, png_fixed_point gamma_value),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_16bit_correct,(unsigned int value,
+   png_fixed_point gamma_value),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_byte,png_gamma_8bit_correct,(unsigned int value,
+   png_fixed_point gamma_value),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_destroy_gamma_table,(png_structrp png_ptr),
+   PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_build_gamma_table,(png_structrp png_ptr,
+   int bit_depth),PNG_EMPTY);
+#endif
+
+/* SIMPLIFIED READ/WRITE SUPPORT */
+#if defined PNG_SIMPLIFIED_READ_SUPPORTED ||\
+   defined PNG_SIMPLIFIED_WRITE_SUPPORTED
+/* The internal structure that png_image::opaque points to. */
+typedef struct png_control
+{
+   png_structp png_ptr;
+   png_infop   info_ptr;
+   png_voidp   error_buf;           /* Always a jmp_buf at present. */
 
-#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
-PNG_EXTERN void png_set_alpha_mode_fixed PNGARG((png_structp png_ptr,
-    int mode, png_fixed_point output_gamma));
-#endif
+   png_const_bytep memory;          /* Memory buffer. */
+   png_size_t      size;            /* Size of the memory buffer. */
 
-#ifdef PNG_READ_GAMMA_SUPPORTED
-PNG_EXTERN void png_set_gamma_fixed PNGARG((png_structp png_ptr,
-    png_fixed_point screen_gamma, png_fixed_point override_file_gamma));
+   unsigned int for_write       :1; /* Otherwise it is a read structure */
+   unsigned int owned_file      :1; /* We own the file in io_ptr */
+} png_control;
+
+/* Return the pointer to the jmp_buf from a png_control: necessary because C
+ * does not reveal the type of the elements of jmp_buf.
+ */
+#ifdef __cplusplus
+#  define png_control_jmp_buf(pc) (((jmp_buf*)((pc)->error_buf))[0])
+#else
+#  define png_control_jmp_buf(pc) ((pc)->error_buf)
 #endif
 
-#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
-PNG_EXTERN void png_set_rgb_to_gray_fixed PNGARG((png_structp png_ptr,
-    int error_action, png_fixed_point red, png_fixed_point green));
+/* Utility to safely execute a piece of libpng code catching and logging any
+ * errors that might occur.  Returns true on success, false on failure (either
+ * of the function or as a result of a png_error.)
+ */
+PNG_INTERNAL_FUNCTION(void,png_safe_error,(png_structp png_ptr,
+   png_const_charp error_message),PNG_NORETURN);
+
+#ifdef PNG_WARNINGS_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_safe_warning,(png_structp png_ptr,
+   png_const_charp warning_message),PNG_EMPTY);
+#else
+#  define png_safe_warning 0/*dummy argument*/
 #endif
-#endif /* FIX MISSING !FIXED_POINT DECLARATIONS */
+
+PNG_INTERNAL_FUNCTION(int,png_safe_execute,(png_imagep image,
+   int (*function)(png_voidp), png_voidp arg),PNG_EMPTY);
+
+/* Utility to log an error; this also cleans up the png_image; the function
+ * always returns 0 (false).
+ */
+PNG_INTERNAL_FUNCTION(int,png_image_error,(png_imagep image,
+   png_const_charp error_message),PNG_EMPTY);
+
+#ifndef PNG_SIMPLIFIED_READ_SUPPORTED
+/* png_image_free is used by the write code but not exported */
+PNG_INTERNAL_FUNCTION(void, png_image_free, (png_imagep image), PNG_EMPTY);
+#endif /* !SIMPLIFIED_READ */
+
+#endif /* SIMPLIFIED READ/WRITE */
 
 #ifdef PNG_FILTER_OPTIMIZATIONS
-PNG_EXTERN void PNG_FILTER_OPTIMIZATIONS(png_structp png_ptr, unsigned int bpp);
+PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
    /* This is the initialization function for hardware specific optimizations,
     * one implementation (for ARM NEON machines) is contained in
     * arm/filter_neon.c.  It need not be defined - the generic code will be used
index 4296cf1cb66b583e8114c863c9f16f50f3b4ba5c..5cd20e8c39460957d13edfc4bfba13ce4adf0ade 100644 (file)
@@ -1,8 +1,8 @@
 
 /* pngread.c - read a PNG file
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
- * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.0 [February 14, 2013]
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -15,6 +15,9 @@
  */
 
 #include "pngpriv.h"
+#if defined PNG_SIMPLIFIED_READ_SUPPORTED && defined PNG_STDIO_SUPPORTED
+#  include <errno.h>
+#endif
 
 #ifdef PNG_READ_SUPPORTED
 
@@ -23,10 +26,12 @@ PNG_FUNCTION(png_structp,PNGAPI
 png_create_read_struct,(png_const_charp user_png_ver, png_voidp error_ptr,
     png_error_ptr error_fn, png_error_ptr warn_fn),PNG_ALLOCATED)
 {
-
-#ifdef PNG_USER_MEM_SUPPORTED
-   return (png_create_read_struct_2(user_png_ver, error_ptr, error_fn,
-       warn_fn, NULL, NULL, NULL));
+#ifndef PNG_USER_MEM_SUPPORTED
+   png_structp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
+      error_fn, warn_fn, NULL, NULL, NULL);
+#else
+   return png_create_read_struct_2(user_png_ver, error_ptr, error_fn,
+       warn_fn, NULL, NULL, NULL);
 }
 
 /* Alternate create PNG structure for reading, and allocate any memory
@@ -37,131 +42,40 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
     png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
     png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED)
 {
+   png_structp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
+      error_fn, warn_fn, mem_ptr, malloc_fn, free_fn);
 #endif /* PNG_USER_MEM_SUPPORTED */
 
-#ifdef PNG_SETJMP_SUPPORTED
-   volatile
-#endif
-   png_structp png_ptr;
-   volatile int png_cleanup_needed = 0;
-
-#ifdef PNG_SETJMP_SUPPORTED
-#ifdef USE_FAR_KEYWORD
-   jmp_buf tmp_jmpbuf;
-#endif
-#endif
-
-   png_debug(1, "in png_create_read_struct");
-
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
-       malloc_fn, mem_ptr);
-#else
-   png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
-#endif
-   if (png_ptr == NULL)
-      return (NULL);
-
-   /* Added at libpng-1.2.6 */
-#ifdef PNG_USER_LIMITS_SUPPORTED
-   png_ptr->user_width_max = PNG_USER_WIDTH_MAX;
-   png_ptr->user_height_max = PNG_USER_HEIGHT_MAX;
-
-   /* Added at libpng-1.2.43 and 1.4.0 */
-   png_ptr->user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX;
-
-   /* Added at libpng-1.2.43 and 1.4.1 */
-   png_ptr->user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX;
-#endif
-
-#ifdef PNG_SETJMP_SUPPORTED
-/* Applications that neglect to set up their own setjmp() and then
- * encounter a png_error() will longjmp here.  Since the jmpbuf is
- * then meaningless we abort instead of returning.
- */
-#ifdef USE_FAR_KEYWORD
-   if (setjmp(tmp_jmpbuf))
-#else
-   if (setjmp(png_jmpbuf(png_ptr))) /* Sets longjmp to match setjmp */
-#endif
-      PNG_ABORT();
-#ifdef USE_FAR_KEYWORD
-   png_memcpy(png_jmpbuf(png_ptr), tmp_jmpbuf, png_sizeof(jmp_buf));
-#endif
-#endif /* PNG_SETJMP_SUPPORTED */
-
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn);
-#endif
-
-   png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn);
-
-   /* Call the general version checker (shared with read and write code): */
-   if (!png_user_version_check(png_ptr, user_png_ver))
-      png_cleanup_needed = 1;
-
-   if (!png_cleanup_needed)
-   {
-   /* Initialize zbuf - compression buffer */
-   png_ptr->zbuf_size = PNG_ZBUF_SIZE;
-   png_ptr->zbuf = (png_bytep)png_malloc_warn(png_ptr, png_ptr->zbuf_size);
-
-   if (png_ptr->zbuf == NULL)
-      png_cleanup_needed = 1;
-   }
-
-   png_ptr->zstream.zalloc = png_zalloc;
-   png_ptr->zstream.zfree = png_zfree;
-   png_ptr->zstream.opaque = (voidpf)png_ptr;
-
-   if (!png_cleanup_needed)
+   if (png_ptr != NULL)
    {
-      switch (inflateInit(&png_ptr->zstream))
-      {
-         case Z_OK:
-            break; /* Do nothing */
-
-         case Z_MEM_ERROR:
-            png_warning(png_ptr, "zlib memory error");
-            png_cleanup_needed = 1;
-            break;
-
-         case Z_STREAM_ERROR:
-            png_warning(png_ptr, "zlib stream error");
-            png_cleanup_needed = 1;
-            break;
+      png_ptr->mode = PNG_IS_READ_STRUCT;
 
-         case Z_VERSION_ERROR:
-            png_warning(png_ptr, "zlib version error");
-            png_cleanup_needed = 1;
-            break;
+      /* Added in libpng-1.6.0; this can be used to detect a read structure if
+       * required (it will be zero in a write structure.)
+       */
+#     ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+         png_ptr->IDAT_read_size = PNG_IDAT_READ_SIZE;
+#     endif
 
-         default: png_warning(png_ptr, "Unknown zlib error");
-            png_cleanup_needed = 1;
-      }
-   }
+#     ifdef PNG_BENIGN_READ_ERRORS_SUPPORTED
+         png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN;
 
-   if (png_cleanup_needed)
-   {
-      /* Clean up PNG structure and deallocate any memory. */
-      png_free(png_ptr, png_ptr->zbuf);
-      png_ptr->zbuf = NULL;
-#ifdef PNG_USER_MEM_SUPPORTED
-      png_destroy_struct_2((png_voidp)png_ptr,
-          (png_free_ptr)free_fn, (png_voidp)mem_ptr);
-#else
-      png_destroy_struct((png_voidp)png_ptr);
-#endif
-      return (NULL);
+         /* In stable builds only warn if an application error can be completely
+          * handled.
+          */
+#        if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC
+            png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN;
+#        endif
+#     endif
+
+      /* TODO: delay this, it can be done in png_init_io (if the app doesn't
+       * do it itself) avoiding setting the default function if it is not
+       * required.
+       */
+      png_set_read_fn(png_ptr, NULL, NULL);
    }
 
-   png_ptr->zstream.next_out = png_ptr->zbuf;
-   png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
-
-   png_set_read_fn(png_ptr, NULL, NULL);
-
-
-   return (png_ptr);
+   return png_ptr;
 }
 
 
@@ -175,8 +89,12 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
  * read if it is determined that this isn't a valid PNG file.
  */
 void PNGAPI
-png_read_info(png_structp png_ptr, png_infop info_ptr)
+png_read_info(png_structrp png_ptr, png_inforp info_ptr)
 {
+#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+   int keep;
+#endif
+
    png_debug(1, "in png_read_info");
 
    if (png_ptr == NULL || info_ptr == NULL)
@@ -190,13 +108,30 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
       png_uint_32 length = png_read_chunk_header(png_ptr);
       png_uint_32 chunk_name = png_ptr->chunk_name;
 
-      /* This should be a binary subdivision search or a hash for
-       * matching the chunk name rather than a linear search.
+      /* IDAT logic needs to happen here to simplify getting the two flags
+       * right.
        */
       if (chunk_name == png_IDAT)
-         if (png_ptr->mode & PNG_AFTER_IDAT)
-            png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
+      {
+         if (!(png_ptr->mode & PNG_HAVE_IHDR))
+            png_chunk_error(png_ptr, "Missing IHDR before IDAT");
+
+         else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
+             !(png_ptr->mode & PNG_HAVE_PLTE))
+            png_chunk_error(png_ptr, "Missing PLTE before IDAT");
+
+         else if (png_ptr->mode & PNG_AFTER_IDAT)
+            png_chunk_benign_error(png_ptr, "Too many IDATs found");
+
+         png_ptr->mode |= PNG_HAVE_IDAT;
+      }
+
+      else if (png_ptr->mode & PNG_HAVE_IDAT)
+         png_ptr->mode |= PNG_AFTER_IDAT;
 
+      /* This should be a binary subdivision search or a hash for
+       * matching the chunk name rather than a linear search.
+       */
       if (chunk_name == png_IHDR)
          png_handle_IHDR(png_ptr, info_ptr, length);
 
@@ -204,26 +139,16 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
          png_handle_IEND(png_ptr, info_ptr, length);
 
 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-      else if (png_chunk_unknown_handling(png_ptr, chunk_name) !=
-         PNG_HANDLE_CHUNK_AS_DEFAULT)
+      else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0)
       {
-         if (chunk_name == png_IDAT)
-            png_ptr->mode |= PNG_HAVE_IDAT;
-
-         png_handle_unknown(png_ptr, info_ptr, length);
+         png_handle_unknown(png_ptr, info_ptr, length, keep);
 
          if (chunk_name == png_PLTE)
             png_ptr->mode |= PNG_HAVE_PLTE;
 
          else if (chunk_name == png_IDAT)
          {
-            if (!(png_ptr->mode & PNG_HAVE_IHDR))
-               png_error(png_ptr, "Missing IHDR before IDAT");
-
-            else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
-                !(png_ptr->mode & PNG_HAVE_PLTE))
-               png_error(png_ptr, "Missing PLTE before IDAT");
-
+            png_ptr->idat_size = 0; /* It has been consumed */
             break;
          }
       }
@@ -233,15 +158,7 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
 
       else if (chunk_name == png_IDAT)
       {
-         if (!(png_ptr->mode & PNG_HAVE_IHDR))
-            png_error(png_ptr, "Missing IHDR before IDAT");
-
-         else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
-             !(png_ptr->mode & PNG_HAVE_PLTE))
-            png_error(png_ptr, "Missing PLTE before IDAT");
-
          png_ptr->idat_size = length;
-         png_ptr->mode |= PNG_HAVE_IDAT;
          break;
       }
 
@@ -331,27 +248,36 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
 #endif
 
       else
-         png_handle_unknown(png_ptr, info_ptr, length);
+         png_handle_unknown(png_ptr, info_ptr, length,
+            PNG_HANDLE_CHUNK_AS_DEFAULT);
    }
 }
 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 
 /* Optional call to update the users info_ptr structure */
 void PNGAPI
-png_read_update_info(png_structp png_ptr, png_infop info_ptr)
+png_read_update_info(png_structrp png_ptr, png_inforp info_ptr)
 {
    png_debug(1, "in png_read_update_info");
 
-   if (png_ptr == NULL)
-      return;
+   if (png_ptr != NULL)
+   {
+      if ((png_ptr->flags & PNG_FLAG_ROW_INIT) == 0)
+      {
+         png_read_start_row(png_ptr);
 
-   png_read_start_row(png_ptr);
+#        ifdef PNG_READ_TRANSFORMS_SUPPORTED
+            png_read_transform_info(png_ptr, info_ptr);
+#        else
+            PNG_UNUSED(info_ptr)
+#        endif
+      }
 
-#ifdef PNG_READ_TRANSFORMS_SUPPORTED
-   png_read_transform_info(png_ptr, info_ptr);
-#else
-   PNG_UNUSED(info_ptr)
-#endif
+      /* New in 1.6.0 this avoids the bug of doing the initializations twice */
+      else
+         png_app_error(png_ptr,
+            "png_read_update_info/png_start_read_image: duplicate call");
+   }
 }
 
 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
@@ -361,21 +287,27 @@ png_read_update_info(png_structp png_ptr, png_infop info_ptr)
  * If the user doesn't call this, we will do it ourselves.
  */
 void PNGAPI
-png_start_read_image(png_structp png_ptr)
+png_start_read_image(png_structrp png_ptr)
 {
    png_debug(1, "in png_start_read_image");
 
    if (png_ptr != NULL)
-     png_read_start_row(png_ptr);
+   {
+      if ((png_ptr->flags & PNG_FLAG_ROW_INIT) == 0)
+         png_read_start_row(png_ptr);
+
+      /* New in 1.6.0 this avoids the bug of doing the initializations twice */
+      else
+         png_app_error(png_ptr,
+            "png_start_read_image/png_read_update_info: duplicate call");
+   }
 }
 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 
 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 void PNGAPI
-png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
+png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
 {
-   int ret;
-
    png_row_info row_info;
 
    if (png_ptr == NULL)
@@ -502,6 +434,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
                return;
             }
             break;
+
          case 5:
             if ((png_ptr->row_number & 1) || png_ptr->width < 2)
             {
@@ -528,49 +461,8 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
    if (!(png_ptr->mode & PNG_HAVE_IDAT))
       png_error(png_ptr, "Invalid attempt to read row data");
 
-   png_ptr->zstream.next_out = png_ptr->row_buf;
-   png_ptr->zstream.avail_out =
-       (uInt)(PNG_ROWBYTES(png_ptr->pixel_depth,
-       png_ptr->iwidth) + 1);
-
-   do
-   {
-      if (!(png_ptr->zstream.avail_in))
-      {
-         while (!png_ptr->idat_size)
-         {
-            png_crc_finish(png_ptr, 0);
-
-            png_ptr->idat_size = png_read_chunk_header(png_ptr);
-            if (png_ptr->chunk_name != png_IDAT)
-               png_error(png_ptr, "Not enough image data");
-         }
-         png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size;
-         png_ptr->zstream.next_in = png_ptr->zbuf;
-         if (png_ptr->zbuf_size > png_ptr->idat_size)
-            png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size;
-         png_crc_read(png_ptr, png_ptr->zbuf,
-             (png_size_t)png_ptr->zstream.avail_in);
-         png_ptr->idat_size -= png_ptr->zstream.avail_in;
-      }
-
-      ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
-
-      if (ret == Z_STREAM_END)
-      {
-         if (png_ptr->zstream.avail_out || png_ptr->zstream.avail_in ||
-            png_ptr->idat_size)
-            png_benign_error(png_ptr, "Extra compressed data");
-         png_ptr->mode |= PNG_AFTER_IDAT;
-         png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
-         break;
-      }
-
-      if (ret != Z_OK)
-         png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg :
-             "Decompression error");
-
-   } while (png_ptr->zstream.avail_out);
+   /* Fill the row with IDAT data: */
+   png_read_IDAT_data(png_ptr, png_ptr->row_buf, row_info.rowbytes + 1);
 
    if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE)
    {
@@ -586,7 +478,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
     * it may not be in the future, so this was changed just to copy the
     * interlaced count:
     */
-   png_memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1);
+   memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1);
 
 #ifdef PNG_MNG_FEATURES_SUPPORTED
    if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
@@ -643,6 +535,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
 
    if (png_ptr->read_row_fn != NULL)
       (*(png_ptr->read_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass);
+
 }
 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 
@@ -672,7 +565,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
  */
 
 void PNGAPI
-png_read_rows(png_structp png_ptr, png_bytepp row,
+png_read_rows(png_structrp png_ptr, png_bytepp row,
     png_bytepp display_row, png_uint_32 num_rows)
 {
    png_uint_32 i;
@@ -727,7 +620,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
  * [*] png_handle_alpha() does not exist yet, as of this version of libpng
  */
 void PNGAPI
-png_read_image(png_structp png_ptr, png_bytepp image)
+png_read_image(png_structrp png_ptr, png_bytepp image)
 {
    png_uint_32 i, image_height;
    int pass, j;
@@ -792,14 +685,24 @@ png_read_image(png_structp png_ptr, png_bytepp image)
  * or time information at the end of the file, if info is not NULL.
  */
 void PNGAPI
-png_read_end(png_structp png_ptr, png_infop info_ptr)
+png_read_end(png_structrp png_ptr, png_inforp info_ptr)
 {
+#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+   int keep;
+#endif
+
    png_debug(1, "in png_read_end");
 
    if (png_ptr == NULL)
       return;
 
-   png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */
+   /* If png_read_end is called in the middle of reading the rows there may
+    * still be pending IDAT data and an owned zstream.  Deal with this here.
+    */
+#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+   if (!png_chunk_unknown_handling(png_ptr, png_IDAT))
+#endif
+      png_read_finish_IDAT(png_ptr);
 
 #ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
    /* Report invalid palette index; added at libng-1.5.10 */
@@ -820,15 +723,14 @@ png_read_end(png_structp png_ptr, png_infop info_ptr)
          png_handle_IEND(png_ptr, info_ptr, length);
 
 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-      else if (png_chunk_unknown_handling(png_ptr, chunk_name) !=
-         PNG_HANDLE_CHUNK_AS_DEFAULT)
+      else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0)
       {
          if (chunk_name == png_IDAT)
          {
             if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
                png_benign_error(png_ptr, "Too many IDATs found");
          }
-         png_handle_unknown(png_ptr, info_ptr, length);
+         png_handle_unknown(png_ptr, info_ptr, length, keep);
          if (chunk_name == png_PLTE)
             png_ptr->mode |= PNG_HAVE_PLTE;
       }
@@ -933,117 +835,25 @@ png_read_end(png_structp png_ptr, png_infop info_ptr)
 #endif
 
       else
-         png_handle_unknown(png_ptr, info_ptr, length);
+         png_handle_unknown(png_ptr, info_ptr, length,
+            PNG_HANDLE_CHUNK_AS_DEFAULT);
    } while (!(png_ptr->mode & PNG_HAVE_IEND));
 }
 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 
-/* Free all memory used by the read */
-void PNGAPI
-png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
-    png_infopp end_info_ptr_ptr)
-{
-   png_structp png_ptr = NULL;
-   png_infop info_ptr = NULL, end_info_ptr = NULL;
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_free_ptr free_fn = NULL;
-   png_voidp mem_ptr = NULL;
-#endif
-
-   png_debug(1, "in png_destroy_read_struct");
-
-   if (png_ptr_ptr != NULL)
-      png_ptr = *png_ptr_ptr;
-   if (png_ptr == NULL)
-      return;
-
-#ifdef PNG_USER_MEM_SUPPORTED
-   free_fn = png_ptr->free_fn;
-   mem_ptr = png_ptr->mem_ptr;
-#endif
-
-   if (info_ptr_ptr != NULL)
-      info_ptr = *info_ptr_ptr;
-
-   if (end_info_ptr_ptr != NULL)
-      end_info_ptr = *end_info_ptr_ptr;
-
-   png_read_destroy(png_ptr, info_ptr, end_info_ptr);
-
-   if (info_ptr != NULL)
-   {
-#ifdef PNG_TEXT_SUPPORTED
-      png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, -1);
-#endif
-
-#ifdef PNG_USER_MEM_SUPPORTED
-      png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn,
-          (png_voidp)mem_ptr);
-#else
-      png_destroy_struct((png_voidp)info_ptr);
-#endif
-      *info_ptr_ptr = NULL;
-   }
-
-   if (end_info_ptr != NULL)
-   {
-#ifdef PNG_READ_TEXT_SUPPORTED
-      png_free_data(png_ptr, end_info_ptr, PNG_FREE_TEXT, -1);
-#endif
-#ifdef PNG_USER_MEM_SUPPORTED
-      png_destroy_struct_2((png_voidp)end_info_ptr, (png_free_ptr)free_fn,
-          (png_voidp)mem_ptr);
-#else
-      png_destroy_struct((png_voidp)end_info_ptr);
-#endif
-      *end_info_ptr_ptr = NULL;
-   }
-
-   if (png_ptr != NULL)
-   {
-#ifdef PNG_USER_MEM_SUPPORTED
-      png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn,
-          (png_voidp)mem_ptr);
-#else
-      png_destroy_struct((png_voidp)png_ptr);
-#endif
-      *png_ptr_ptr = NULL;
-   }
-}
-
-/* Free all memory used by the read (old method) */
-void /* PRIVATE */
-png_read_destroy(png_structp png_ptr, png_infop info_ptr,
-    png_infop end_info_ptr)
+/* Free all memory used in the read struct */
+static void
+png_read_destroy(png_structrp png_ptr)
 {
-#ifdef PNG_SETJMP_SUPPORTED
-   jmp_buf tmp_jmp;
-#endif
-   png_error_ptr error_fn;
-#ifdef PNG_WARNINGS_SUPPORTED
-   png_error_ptr warning_fn;
-#endif
-   png_voidp error_ptr;
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_free_ptr free_fn;
-#endif
-
    png_debug(1, "in png_read_destroy");
 
-   if (info_ptr != NULL)
-      png_info_destroy(png_ptr, info_ptr);
-
-   if (end_info_ptr != NULL)
-      png_info_destroy(png_ptr, end_info_ptr);
-
 #ifdef PNG_READ_GAMMA_SUPPORTED
    png_destroy_gamma_table(png_ptr);
 #endif
 
-   png_free(png_ptr, png_ptr->zbuf);
    png_free(png_ptr, png_ptr->big_row_buf);
    png_free(png_ptr, png_ptr->big_prev_row);
-   png_free(png_ptr, png_ptr->chunkdata);
+   png_free(png_ptr, png_ptr->read_buffer);
 
 #ifdef PNG_READ_QUANTIZE_SUPPORTED
    png_free(png_ptr, png_ptr->palette_lookup);
@@ -1061,53 +871,56 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr,
    png_ptr->free_me &= ~PNG_FREE_TRNS;
 #endif
 
-#ifdef PNG_READ_hIST_SUPPORTED
-   if (png_ptr->free_me & PNG_FREE_HIST)
-      png_free(png_ptr, png_ptr->hist);
-   png_ptr->free_me &= ~PNG_FREE_HIST;
-#endif
-
    inflateEnd(&png_ptr->zstream);
 
 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
    png_free(png_ptr, png_ptr->save_buffer);
 #endif
 
-   /* Save the important info out of the png_struct, in case it is
-    * being used again.
-    */
-#ifdef PNG_SETJMP_SUPPORTED
-   png_memcpy(tmp_jmp, png_ptr->longjmp_buffer, png_sizeof(jmp_buf));
+#if (defined PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) &&\
+   (defined PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
+   png_free(png_ptr, png_ptr->unknown_chunk.data);
 #endif
 
-   error_fn = png_ptr->error_fn;
-#ifdef PNG_WARNINGS_SUPPORTED
-   warning_fn = png_ptr->warning_fn;
-#endif
-   error_ptr = png_ptr->error_ptr;
-#ifdef PNG_USER_MEM_SUPPORTED
-   free_fn = png_ptr->free_fn;
+#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+   png_free(png_ptr, png_ptr->chunk_list);
 #endif
 
-   png_memset(png_ptr, 0, png_sizeof(png_struct));
+   /* NOTE: the 'setjmp' buffer may still be allocated and the memory and error
+    * callbacks are still set at this point.  They are required to complete the
+    * destruction of the png_struct itself.
+    */
+}
 
-   png_ptr->error_fn = error_fn;
-#ifdef PNG_WARNINGS_SUPPORTED
-   png_ptr->warning_fn = warning_fn;
-#endif
-   png_ptr->error_ptr = error_ptr;
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_ptr->free_fn = free_fn;
-#endif
+/* Free all memory used by the read */
+void PNGAPI
+png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
+    png_infopp end_info_ptr_ptr)
+{
+   png_structrp png_ptr = NULL;
 
-#ifdef PNG_SETJMP_SUPPORTED
-   png_memcpy(png_ptr->longjmp_buffer, tmp_jmp, png_sizeof(jmp_buf));
-#endif
+   png_debug(1, "in png_destroy_read_struct");
+
+   if (png_ptr_ptr != NULL)
+      png_ptr = *png_ptr_ptr;
+
+   if (png_ptr == NULL)
+      return;
+
+   /* libpng 1.6.0: use the API to destroy info structs to ensure consistent
+    * behavior.  Prior to 1.6.0 libpng did extra 'info' destruction in this API.
+    * The extra was, apparently, unnecessary yet this hides memory leak bugs.
+    */
+   png_destroy_info_struct(png_ptr, end_info_ptr_ptr);
+   png_destroy_info_struct(png_ptr, info_ptr_ptr);
 
+   *png_ptr_ptr = NULL;
+   png_read_destroy(png_ptr);
+   png_destroy_png_struct(png_ptr);
 }
 
 void PNGAPI
-png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn)
+png_set_read_status_fn(png_structrp png_ptr, png_read_status_ptr read_row_fn)
 {
    if (png_ptr == NULL)
       return;
@@ -1119,7 +932,7 @@ png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn)
 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 #ifdef PNG_INFO_IMAGE_SUPPORTED
 void PNGAPI
-png_read_png(png_structp png_ptr, png_infop info_ptr,
+png_read_png(png_structrp png_ptr, png_inforp info_ptr,
                            int transforms,
                            voidp params)
 {
@@ -1132,7 +945,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
     * PNG file before the first IDAT (image data chunk).
     */
    png_read_info(png_ptr, info_ptr);
-   if (info_ptr->height > PNG_UINT_32_MAX/png_sizeof(png_bytep))
+   if (info_ptr->height > PNG_UINT_32_MAX/(sizeof (png_bytep)))
       png_error(png_ptr, "Image is too high to process with png_read_png()");
 
    /* -------------- image transformations start here ------------------- */
@@ -1279,7 +1092,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
       png_uint_32 iptr;
 
       info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr,
-          info_ptr->height * png_sizeof(png_bytep));
+          info_ptr->height * (sizeof (png_bytep)));
       for (iptr=0; iptr<info_ptr->height; iptr++)
          info_ptr->row_pointers[iptr] = NULL;
 
@@ -1302,4 +1115,2863 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
 }
 #endif /* PNG_INFO_IMAGE_SUPPORTED */
 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
+
+#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
+/* SIMPLIFIED READ
+ *
+ * This code currently relies on the sequential reader, though it could easily
+ * be made to work with the progressive one.
+ */
+/* Arguments to png_image_finish_read: */
+
+/* Encoding of PNG data (used by the color-map code) */
+/* TODO: change these, dang, ANSI-C reserves the 'E' namespace. */
+#  define E_NOTSET  0 /* File encoding not yet known */
+#  define E_sRGB    1 /* 8-bit encoded to sRGB gamma */
+#  define E_LINEAR  2 /* 16-bit linear: not encoded, NOT pre-multiplied! */
+#  define E_FILE    3 /* 8-bit encoded to file gamma, not sRGB or linear */
+#  define E_LINEAR8 4 /* 8-bit linear: only from a file value */
+
+/* Color-map processing: after libpng has run on the PNG image further
+ * processing may be needed to conver the data to color-map indicies.
+ */
+#define PNG_CMAP_NONE      0
+#define PNG_CMAP_GA        1 /* Process GA data to a color-map with alpha */
+#define PNG_CMAP_TRANS     2 /* Process GA data to a background index */
+#define PNG_CMAP_RGB       3 /* Process RGB data */
+#define PNG_CMAP_RGB_ALPHA 4 /* Process RGBA data */
+
+/* The following document where the background is for each processing case. */
+#define PNG_CMAP_NONE_BACKGROUND      256
+#define PNG_CMAP_GA_BACKGROUND        231
+#define PNG_CMAP_TRANS_BACKGROUND     254
+#define PNG_CMAP_RGB_BACKGROUND       256
+#define PNG_CMAP_RGB_ALPHA_BACKGROUND 216
+
+typedef struct
+{
+   /* Arguments: */
+   png_imagep image;
+   png_voidp  buffer;
+   png_int_32 row_stride;
+   png_voidp  colormap;
+   png_const_colorp background;
+   /* Local variables: */
+   png_voidp       local_row;
+   png_voidp       first_row;
+   ptrdiff_t       row_bytes;           /* step between rows */
+   int             file_encoding;       /* E_ values above */
+   png_fixed_point gamma_to_linear;     /* For E_FILE, reciprocal of gamma */
+   int             colormap_processing; /* PNG_CMAP_ values above */
+} png_image_read_control;
+
+/* Do all the *safe* initialization - 'safe' means that png_error won't be
+ * called, so setting up the jmp_buf is not required.  This means that anything
+ * called from here must *not* call png_malloc - it has to call png_malloc_warn
+ * instead so that control is returned safely back to this routine.
+ */
+static int
+png_image_read_init(png_imagep image)
+{
+   if (image->opaque == NULL)
+   {
+      png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, image,
+          png_safe_error, png_safe_warning);
+
+      /* And set the rest of the structure to NULL to ensure that the various
+       * fields are consistent.
+       */
+      memset(image, 0, (sizeof *image));
+      image->version = PNG_IMAGE_VERSION;
+
+      if (png_ptr != NULL)
+      {
+         png_infop info_ptr = png_create_info_struct(png_ptr);
+
+         if (info_ptr != NULL)
+         {
+            png_controlp control = png_voidcast(png_controlp,
+               png_malloc_warn(png_ptr, (sizeof *control)));
+
+            if (control != NULL)
+            {
+               memset(control, 0, (sizeof *control));
+
+               control->png_ptr = png_ptr;
+               control->info_ptr = info_ptr;
+               control->for_write = 0;
+
+               image->opaque = control;
+               return 1;
+            }
+
+            /* Error clean up */
+            png_destroy_info_struct(png_ptr, &info_ptr);
+         }
+
+         png_destroy_read_struct(&png_ptr, NULL, NULL);
+      }
+
+      return png_image_error(image, "png_image_read: out of memory");
+   }
+
+   return png_image_error(image, "png_image_read: opaque pointer not NULL");
+}
+
+/* Utility to find the base format of a PNG file from a png_struct. */
+static png_uint_32
+png_image_format(png_structrp png_ptr)
+{
+   png_uint_32 format = 0;
+
+   if (png_ptr->color_type & PNG_COLOR_MASK_COLOR)
+      format |= PNG_FORMAT_FLAG_COLOR;
+
+   if (png_ptr->color_type & PNG_COLOR_MASK_ALPHA)
+      format |= PNG_FORMAT_FLAG_ALPHA;
+
+   /* Use png_ptr here, not info_ptr, because by examination png_handle_tRNS
+    * sets the png_struct fields; that's all we are interested in here.  The
+    * precise interaction with an app call to png_set_tRNS and PNG file reading
+    * is unclear.
+    */
+   else if (png_ptr->num_trans > 0)
+      format |= PNG_FORMAT_FLAG_ALPHA;
+
+   if (png_ptr->bit_depth == 16)
+      format |= PNG_FORMAT_FLAG_LINEAR;
+
+   if (png_ptr->color_type & PNG_COLOR_MASK_PALETTE)
+      format |= PNG_FORMAT_FLAG_COLORMAP;
+
+   return format;
+}
+
+/* Is the given gamma significantly different from sRGB?  The test is the same
+ * one used in pngrtran.c when deciding whether to do gamma correction.  The
+ * arithmetic optimizes the division by using the fact that the inverse of the
+ * file sRGB gamma is 2.2
+ */
+static int
+png_gamma_not_sRGB(png_fixed_point g)
+{
+   if (g < PNG_FP_1)
+   {
+      /* An uninitialized gamma is assumed to be sRGB for the simplified API. */
+      if (g == 0)
+         return 0;
+
+      return png_gamma_significant((g * 11 + 2)/5 /* i.e. *2.2, rounded */);
+   }
+
+   return 1;
+}
+
+/* Do the main body of a 'png_image_begin_read' function; read the PNG file
+ * header and fill in all the information.  This is executed in a safe context,
+ * unlike the init routine above.
+ */
+static int
+png_image_read_header(png_voidp argument)
+{
+   png_imagep image = png_voidcast(png_imagep, argument);
+   png_structrp png_ptr = image->opaque->png_ptr;
+   png_inforp info_ptr = image->opaque->info_ptr;
+
+   png_set_benign_errors(png_ptr, 1/*warn*/);
+   png_read_info(png_ptr, info_ptr);
+
+   /* Do this the fast way; just read directly out of png_struct. */
+   image->width = png_ptr->width;
+   image->height = png_ptr->height;
+
+   {
+      png_uint_32 format = png_image_format(png_ptr);
+
+      image->format = format;
+
+#ifdef PNG_COLORSPACE_SUPPORTED
+      /* Does the colorspace match sRGB?  If there is no color endpoint
+       * (colorant) information assume yes, otherwise require the
+       * 'ENDPOINTS_MATCHE_sRGB' colorspace flag to have been set.  If the
+       * colorspace has been determined to be invalid ignore it.
+       */
+      if ((format & PNG_FORMAT_FLAG_COLOR) != 0 && ((png_ptr->colorspace.flags
+         & (PNG_COLORSPACE_HAVE_ENDPOINTS|PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB|
+            PNG_COLORSPACE_INVALID)) == PNG_COLORSPACE_HAVE_ENDPOINTS))
+         image->flags |= PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB;
+#endif
+   }
+
+   /* We need the maximum number of entries regardless of the format the
+    * application sets here.
+    */
+   {
+      png_uint_32 cmap_entries;
+
+      switch (png_ptr->color_type)
+      {
+         case PNG_COLOR_TYPE_GRAY:
+            cmap_entries = 1U << png_ptr->bit_depth;
+            break;
+
+         case PNG_COLOR_TYPE_PALETTE:
+            cmap_entries = png_ptr->num_palette;
+            break;
+
+         default:
+            cmap_entries = 256;
+            break;
+      }
+
+      if (cmap_entries > 256)
+         cmap_entries = 256;
+
+      image->colormap_entries = cmap_entries;
+   }
+
+   return 1;
+}
+
+#ifdef PNG_STDIO_SUPPORTED
+int PNGAPI
+png_image_begin_read_from_stdio(png_imagep image, FILE* file)
+{
+   if (image != NULL && image->version == PNG_IMAGE_VERSION)
+   {
+      if (file != NULL)
+      {
+         if (png_image_read_init(image))
+         {
+            /* This is slightly evil, but png_init_io doesn't do anything other
+             * than this and we haven't changed the standard IO functions so
+             * this saves a 'safe' function.
+             */
+            image->opaque->png_ptr->io_ptr = file;
+            return png_safe_execute(image, png_image_read_header, image);
+         }
+      }
+
+      else
+         return png_image_error(image,
+            "png_image_begin_read_from_stdio: invalid argument");
+   }
+
+   else if (image != NULL)
+      return png_image_error(image,
+         "png_image_begin_read_from_stdio: incorrect PNG_IMAGE_VERSION");
+
+   return 0;
+}
+
+int PNGAPI
+png_image_begin_read_from_file(png_imagep image, const char *file_name)
+{
+   if (image != NULL && image->version == PNG_IMAGE_VERSION)
+   {
+      if (file_name != NULL)
+      {
+         FILE *fp = fopen(file_name, "rb");
+
+         if (fp != NULL)
+         {
+            if (png_image_read_init(image))
+            {
+               image->opaque->png_ptr->io_ptr = fp;
+               image->opaque->owned_file = 1;
+               return png_safe_execute(image, png_image_read_header, image);
+            }
+
+            /* Clean up: just the opened file. */
+            (void)fclose(fp);
+         }
+
+         else
+            return png_image_error(image, strerror(errno));
+      }
+
+      else
+         return png_image_error(image,
+            "png_image_begin_read_from_file: invalid argument");
+   }
+
+   else if (image != NULL)
+      return png_image_error(image,
+         "png_image_begin_read_from_file: incorrect PNG_IMAGE_VERSION");
+
+   return 0;
+}
+#endif /* PNG_STDIO_SUPPORTED */
+
+static void PNGCBAPI
+png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need)
+{
+   if (png_ptr != NULL)
+   {
+      png_imagep image = png_voidcast(png_imagep, png_ptr->io_ptr);
+      if (image != NULL)
+      {
+         png_controlp cp = image->opaque;
+         if (cp != NULL)
+         {
+            png_const_bytep memory = cp->memory;
+            png_size_t size = cp->size;
+
+            if (memory != NULL && size >= need)
+            {
+               memcpy(out, memory, need);
+               cp->memory = memory + need;
+               cp->size = size - need;
+               return;
+            }
+
+            png_error(png_ptr, "read beyond end of data");
+         }
+      }
+
+      png_error(png_ptr, "invalid memory read");
+   }
+}
+
+int PNGAPI png_image_begin_read_from_memory(png_imagep image,
+   png_const_voidp memory, png_size_t size)
+{
+   if (image != NULL && image->version == PNG_IMAGE_VERSION)
+   {
+      if (memory != NULL && size > 0)
+      {
+         if (png_image_read_init(image))
+         {
+            /* Now set the IO functions to read from the memory buffer and
+             * store it into io_ptr.  Again do this in-place to avoid calling a
+             * libpng function that requires error handling.
+             */
+            image->opaque->memory = png_voidcast(png_const_bytep, memory);
+            image->opaque->size = size;
+            image->opaque->png_ptr->io_ptr = image;
+            image->opaque->png_ptr->read_data_fn = png_image_memory_read;
+
+            return png_safe_execute(image, png_image_read_header, image);
+         }
+      }
+
+      else
+         return png_image_error(image,
+            "png_image_begin_read_from_memory: invalid argument");
+   }
+
+   else if (image != NULL)
+      return png_image_error(image,
+         "png_image_begin_read_from_memory: incorrect PNG_IMAGE_VERSION");
+
+   return 0;
+}
+
+/* Utility function to skip chunks that are not used by the simplified image
+ * read functions and an appropriate macro to call it.
+ */
+#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+static void
+png_image_skip_unused_chunks(png_structrp png_ptr)
+{
+   /* Prepare the reader to ignore all recognized chunks whose data will not
+    * be used, i.e., all chunks recognized by libpng except for those
+    * involved in basic image reading:
+    *
+    *    IHDR, PLTE, IDAT, IEND
+    *
+    * Or image data handling:
+    *
+    *    tRNS, bKGD, gAMA, cHRM, sRGB, iCCP and sBIT.
+    *
+    * This provides a small performance improvement and eliminates any
+    * potential vulnerability to security problems in the unused chunks.
+    */
+   {
+         static PNG_CONST png_byte chunks_to_process[] = {
+            98,  75,  71,  68, '\0',  /* bKGD */
+            99,  72,  82,  77, '\0',  /* cHRM */
+           103,  65,  77,  65, '\0',  /* gAMA */
+           105,  67,  67,  80, '\0',  /* iCCP */
+           115,  66,  73,  84, '\0',  /* sBIT */
+           115,  82,  71,  66, '\0',  /* sRGB */
+           };
+
+       /* Ignore unknown chunks and all other chunks except for the
+        * IHDR, PLTE, tRNS, IDAT, and IEND chunks.
+        */
+       png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_NEVER,
+         NULL, -1);
+
+       /* But do not ignore image data handling chunks */
+       png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_AS_DEFAULT,
+         chunks_to_process, (sizeof chunks_to_process)/5);
+    }
+}
+
+#  define PNG_SKIP_CHUNKS(p) png_image_skip_unused_chunks(p)
+#else
+#  define PNG_SKIP_CHUNKS(p) ((void)0)
+#endif /* PNG_HANDLE_AS_UNKNOWN_SUPPORTED */
+
+/* The following macro gives the exact rounded answer for all values in the
+ * range 0..255 (it actually divides by 51.2, but the rounding still generates
+ * the correct numbers 0..5
+ */
+#define PNG_DIV51(v8) (((v8) * 5 + 130) >> 8)
+
+/* Utility functions to make particular color-maps */
+static void
+set_file_encoding(png_image_read_control *display)
+{
+   png_fixed_point g = display->image->opaque->png_ptr->colorspace.gamma;
+   if (png_gamma_significant(g))
+   {
+      if (png_gamma_not_sRGB(g))
+      {
+         display->file_encoding = E_FILE;
+         display->gamma_to_linear = png_reciprocal(g);
+      }
+
+      else
+         display->file_encoding = E_sRGB;
+   }
+
+   else
+      display->file_encoding = E_LINEAR8;
+}
+
+static unsigned int
+decode_gamma(png_image_read_control *display, png_uint_32 value, int encoding)
+{
+   if (encoding == E_FILE) /* double check */
+      encoding = display->file_encoding;
+
+   if (encoding == E_NOTSET) /* must be the file encoding */
+   {
+      set_file_encoding(display);
+      encoding = display->file_encoding;
+   }
+
+   switch (encoding)
+   {
+      case E_FILE:
+         value = png_gamma_16bit_correct(value*257, display->gamma_to_linear);
+         break;
+
+      case E_sRGB:
+         value = png_sRGB_table[value];
+         break;
+
+      case E_LINEAR:
+         break;
+
+      case E_LINEAR8:
+         value *= 257;
+         break;
+
+      default:
+         png_error(display->image->opaque->png_ptr,
+            "unexpected encoding (internal error)");
+         break;
+   }
+
+   return value;
+}
+
+static png_uint_32
+png_colormap_compose(png_image_read_control *display,
+   png_uint_32 foreground, int foreground_encoding, png_uint_32 alpha,
+   png_uint_32 background, int encoding)
+{
+   /* The file value is composed on the background, the background has the given
+    * encoding and so does the result, the file is encoded with E_FILE and the
+    * file and alpha are 8-bit values.  The (output) encoding will always be
+    * E_LINEAR or E_sRGB.
+    */
+   png_uint_32 f = decode_gamma(display, foreground, foreground_encoding);
+   png_uint_32 b = decode_gamma(display, background, encoding);
+
+   /* The alpha is always an 8-bit value (it comes from the palette), the value
+    * scaled by 255 is what PNG_sRGB_FROM_LINEAR requires.
+    */
+   f = f * alpha + b * (255-alpha);
+
+   if (encoding == E_LINEAR)
+   {
+      /* Scale to 65535; divide by 255, approximately (in fact this is extremely
+       * accurate, it divides by 255.00000005937181414556, with no overflow.)
+       */
+      f *= 257; /* Now scaled by 65535 */
+      f += f >> 16;
+      f = (f+32768) >> 16;
+   }
+
+   else /* E_sRGB */
+      f = PNG_sRGB_FROM_LINEAR(f);
+
+   return f;
+}
+
+/* NOTE: E_LINEAR values to this routine must be 16-bit, but E_FILE values must
+ * be 8-bit.
+ */
+static void
+png_create_colormap_entry(png_image_read_control *display,
+   png_uint_32 ip, png_uint_32 red, png_uint_32 green, png_uint_32 blue,
+   png_uint_32 alpha, int encoding)
+{
+   png_imagep image = display->image;
+   const int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) ?
+      E_LINEAR : E_sRGB;
+   const int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 &&
+      (red != green || green != blue);
+
+   if (ip > 255)
+      png_error(image->opaque->png_ptr, "color-map index out of range");
+
+   /* Update the cache with whether the file gamma is significantly different
+    * from sRGB.
+    */
+   if (encoding == E_FILE)
+   {
+      if (display->file_encoding == E_NOTSET)
+         set_file_encoding(display);
+
+      /* Note that the cached value may be E_FILE too, but if it is then the
+       * gamma_to_linear member has been set.
+       */
+      encoding = display->file_encoding;
+   }
+
+   if (encoding == E_FILE)
+   {
+      png_fixed_point g = display->gamma_to_linear;
+
+      red = png_gamma_16bit_correct(red*257, g);
+      green = png_gamma_16bit_correct(green*257, g);
+      blue = png_gamma_16bit_correct(blue*257, g);
+
+      if (convert_to_Y || output_encoding == E_LINEAR)
+      {
+         alpha *= 257;
+         encoding = E_LINEAR;
+      }
+
+      else
+      {
+         red = PNG_sRGB_FROM_LINEAR(red * 255);
+         green = PNG_sRGB_FROM_LINEAR(green * 255);
+         blue = PNG_sRGB_FROM_LINEAR(blue * 255);
+         encoding = E_sRGB;
+      }
+   }
+
+   else if (encoding == E_LINEAR8)
+   {
+      /* This encoding occurs quite frequently in test cases because PngSuite
+       * includes a gAMA 1.0 chunk with most images.
+       */
+      red *= 257;
+      green *= 257;
+      blue *= 257;
+      alpha *= 257;
+      encoding = E_LINEAR;
+   }
+
+   else if (encoding == E_sRGB && (convert_to_Y || output_encoding == E_LINEAR))
+   {
+      /* The values are 8-bit sRGB values, but must be converted to 16-bit
+       * linear.
+       */
+      red = png_sRGB_table[red];
+      green = png_sRGB_table[green];
+      blue = png_sRGB_table[blue];
+      alpha *= 257;
+      encoding = E_LINEAR;
+   }
+
+   /* This is set if the color isn't gray but the output is. */
+   if (encoding == E_LINEAR)
+   {
+      if (convert_to_Y)
+      {
+         /* NOTE: these values are copied from png_do_rgb_to_gray */
+         png_uint_32 y = (png_uint_32)6968 * red  + (png_uint_32)23434 * green +
+            (png_uint_32)2366 * blue;
+
+         if (output_encoding == E_LINEAR)
+            y = (y + 16384) >> 15;
+
+         else
+         {
+            /* y is scaled by 32768, we need it scaled by 255: */
+            y = (y + 128) >> 8;
+            y *= 255;
+            y = PNG_sRGB_FROM_LINEAR((y + 64) >> 7);
+            encoding = E_sRGB;
+         }
+
+         blue = red = green = y;
+      }
+
+      else if (output_encoding == E_sRGB)
+      {
+         red = PNG_sRGB_FROM_LINEAR(red * 255);
+         green = PNG_sRGB_FROM_LINEAR(green * 255);
+         blue = PNG_sRGB_FROM_LINEAR(blue * 255);
+         alpha = PNG_DIV257(alpha);
+         encoding = E_sRGB;
+      }
+   }
+
+   if (encoding != output_encoding)
+      png_error(image->opaque->png_ptr, "bad encoding (internal error)");
+
+   /* Store the value. */
+   {
+#     ifdef PNG_FORMAT_BGR_SUPPORTED
+         const int afirst = (image->format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
+            (image->format & PNG_FORMAT_FLAG_ALPHA) != 0;
+#     else
+#        define afirst 0
+#     endif
+#     ifdef PNG_FORMAT_BGR_SUPPORTED
+         const int bgr = (image->format & PNG_FORMAT_FLAG_BGR) ? 2 : 0;
+#     else
+#        define bgr 0
+#     endif
+
+      if (output_encoding == E_LINEAR)
+      {
+         png_uint_16p entry = png_voidcast(png_uint_16p, display->colormap);
+
+         entry += ip * PNG_IMAGE_SAMPLE_CHANNELS(image->format);
+
+         /* The linear 16-bit values must be pre-multiplied by the alpha channel
+          * value, if less than 65535 (this is, effectively, composite on black
+          * if the alpha channel is removed.)
+          */
+         switch (PNG_IMAGE_SAMPLE_CHANNELS(image->format))
+         {
+            case 4:
+               entry[afirst ? 0 : 3] = (png_uint_16)alpha;
+               /* FALL THROUGH */
+
+            case 3:
+               if (alpha < 65535)
+               {
+                  if (alpha > 0)
+                  {
+                     blue = (blue * alpha + 32767U)/65535U;
+                     green = (green * alpha + 32767U)/65535U;
+                     red = (red * alpha + 32767U)/65535U;
+                  }
+
+                  else
+                     red = green = blue = 0;
+               }
+               entry[afirst + (2 ^ bgr)] = (png_uint_16)blue;
+               entry[afirst + 1] = (png_uint_16)green;
+               entry[afirst + bgr] = (png_uint_16)red;
+               break;
+
+            case 2:
+               entry[1 ^ afirst] = (png_uint_16)alpha;
+               /* FALL THROUGH */
+
+            case 1:
+               if (alpha < 65535)
+               {
+                  if (alpha > 0)
+                     green = (green * alpha + 32767U)/65535U;
+
+                  else
+                     green = 0;
+               }
+               entry[afirst] = (png_uint_16)green;
+               break;
+
+            default:
+               break;
+         }
+      }
+
+      else /* output encoding is E_sRGB */
+      {
+         png_bytep entry = png_voidcast(png_bytep, display->colormap);
+
+         entry += ip * PNG_IMAGE_SAMPLE_CHANNELS(image->format);
+
+         switch (PNG_IMAGE_SAMPLE_CHANNELS(image->format))
+         {
+            case 4:
+               entry[afirst ? 0 : 3] = (png_byte)alpha;
+            case 3:
+               entry[afirst + (2 ^ bgr)] = (png_byte)blue;
+               entry[afirst + 1] = (png_byte)green;
+               entry[afirst + bgr] = (png_byte)red;
+               break;
+
+            case 2:
+               entry[1 ^ afirst] = (png_byte)alpha;
+            case 1:
+               entry[afirst] = (png_byte)green;
+               break;
+
+            default:
+               break;
+         }
+      }
+
+#     ifdef afirst
+#        undef afirst
+#     endif
+#     ifdef bgr
+#        undef bgr
+#     endif
+   }
+}
+
+static int
+make_gray_file_colormap(png_image_read_control *display)
+{
+   unsigned int i;
+
+   for (i=0; i<256; ++i)
+      png_create_colormap_entry(display, i, i, i, i, 255, E_FILE);
+
+   return i;
+}
+
+static int
+make_gray_colormap(png_image_read_control *display)
+{
+   unsigned int i;
+
+   for (i=0; i<256; ++i)
+      png_create_colormap_entry(display, i, i, i, i, 255, E_sRGB);
+
+   return i;
+}
+#define PNG_GRAY_COLORMAP_ENTRIES 256
+
+static int
+make_ga_colormap(png_image_read_control *display)
+{
+   unsigned int i, a;
+
+   /* Alpha is retained, the output will be a color-map with entries
+    * selected by six levels of alpha.  One transparent entry, 6 gray
+    * levels for all the intermediate alpha values, leaving 230 entries
+    * for the opaque grays.  The color-map entries are the six values
+    * [0..5]*51, the GA processing uses PNG_DIV51(value) to find the
+    * relevant entry.
+    *
+    * if (alpha > 229) // opaque
+    * {
+    *    // The 231 entries are selected to make the math below work:
+    *    base = 0;
+    *    entry = (231 * gray + 128) >> 8;
+    * }
+    * else if (alpha < 26) // transparent
+    * {
+    *    base = 231;
+    *    entry = 0;
+    * }
+    * else // partially opaque
+    * {
+    *    base = 226 + 6 * PNG_DIV51(alpha);
+    *    entry = PNG_DIV51(gray);
+    * }
+    */
+   i = 0;
+   while (i < 231)
+   {
+      unsigned int gray = (i * 256 + 115) / 231;
+      png_create_colormap_entry(display, i++, gray, gray, gray, 255, E_sRGB);
+   }
+
+   /* 255 is used here for the component values for consistency with the code
+    * that undoes premultiplication in pngwrite.c.
+    */
+   png_create_colormap_entry(display, i++, 255, 255, 255, 0, E_sRGB);
+
+   for (a=1; a<5; ++a)
+   {
+      unsigned int g;
+
+      for (g=0; g<6; ++g)
+         png_create_colormap_entry(display, i++, g*51, g*51, g*51, a*51,
+            E_sRGB);
+   }
+
+   return i;
+}
+
+#define PNG_GA_COLORMAP_ENTRIES 256
+
+static int
+make_rgb_colormap(png_image_read_control *display)
+{
+   unsigned int i, r;
+
+   /* Build a 6x6x6 opaque RGB cube */
+   for (i=r=0; r<6; ++r)
+   {
+      unsigned int g;
+
+      for (g=0; g<6; ++g)
+      {
+         unsigned int b;
+
+         for (b=0; b<6; ++b)
+            png_create_colormap_entry(display, i++, r*51, g*51, b*51, 255,
+               E_sRGB);
+      }
+   }
+
+   return i;
+}
+
+#define PNG_RGB_COLORMAP_ENTRIES 216
+
+/* Return a palette index to the above palette given three 8-bit sRGB values. */
+#define PNG_RGB_INDEX(r,g,b) \
+   ((png_byte)(6 * (6 * PNG_DIV51(r) + PNG_DIV51(g)) + PNG_DIV51(b)))
+
+static int
+png_image_read_colormap(png_voidp argument)
+{
+   png_image_read_control *display =
+      png_voidcast(png_image_read_control*, argument);
+   const png_imagep image = display->image;
+
+   const png_structrp png_ptr = image->opaque->png_ptr;
+   const png_uint_32 output_format = image->format;
+   const int output_encoding = (output_format & PNG_FORMAT_FLAG_LINEAR) ?
+      E_LINEAR : E_sRGB;
+
+   unsigned int cmap_entries;
+   unsigned int output_processing;        /* Output processing option */
+   unsigned int data_encoding = E_NOTSET; /* Encoding libpng must produce */
+
+   /* Background information; the background color and the index of this color
+    * in the color-map if it exists (else 256).
+    */
+   unsigned int background_index = 256;
+   png_uint_32 back_r, back_g, back_b;
+
+   /* Flags to accumulate things that need to be done to the input. */
+   int expand_tRNS = 0;
+
+   /* Exclude the NYI feature of compositing onto a color-mapped buffer; it is
+    * very difficult to do, the results look awful, and it is difficult to see
+    * what possible use it is because the application can't control the
+    * color-map.
+    */
+   if (((png_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0 ||
+         png_ptr->num_trans > 0) /* alpha in input */ &&
+      ((output_format & PNG_FORMAT_FLAG_ALPHA) == 0) /* no alpha in output */)
+   {
+      if (output_encoding == E_LINEAR) /* compose on black */
+         back_b = back_g = back_r = 0;
+
+      else if (display->background == NULL /* no way to remove it */)
+         png_error(png_ptr,
+            "a background color must be supplied to remove alpha/transparency");
+
+      /* Get a copy of the background color (this avoids repeating the checks
+       * below.)  The encoding is 8-bit sRGB or 16-bit linear, depending on the
+       * output format.
+       */
+      else
+      {
+         back_g = display->background->green;
+         if (output_format & PNG_FORMAT_FLAG_COLOR)
+         {
+            back_r = display->background->red;
+            back_b = display->background->blue;
+         }
+         else
+            back_b = back_r = back_g;
+      }
+   }
+
+   else if (output_encoding == E_LINEAR)
+      back_b = back_r = back_g = 65535;
+
+   else
+      back_b = back_r = back_g = 255;
+
+   /* Decide what to do based on the PNG color type of the input data.  The
+    * utility function png_create_colormap_entry deals with most aspects of the
+    * output transformations; this code works out how to produce bytes of
+    * color-map entries from the original format.
+    */
+   switch (png_ptr->color_type)
+   {
+      case PNG_COLOR_TYPE_GRAY:
+         if (png_ptr->bit_depth <= 8)
+         {
+            /* There at most 256 colors in the output, regardless of
+             * transparency.
+             */
+            unsigned int step, i, val, trans = 256/*ignore*/, back_alpha = 0;
+
+            cmap_entries = 1U << png_ptr->bit_depth;
+            if (cmap_entries > image->colormap_entries)
+               png_error(png_ptr, "gray[8] color-map: too few entries");
+
+            step = 255 / (cmap_entries - 1);
+            output_processing = PNG_CMAP_NONE;
+
+            /* If there is a tRNS chunk then this either selects a transparent
+             * value or, if the output has no alpha, the background color.
+             */
+            if (png_ptr->num_trans > 0)
+            {
+               trans = png_ptr->trans_color.gray;
+
+               if ((output_format & PNG_FORMAT_FLAG_ALPHA) == 0)
+                  back_alpha = output_encoding == E_LINEAR ? 65535 : 255;
+            }
+
+            /* png_create_colormap_entry just takes an RGBA and writes the
+             * corresponding color-map entry using the format from 'image',
+             * including the required conversion to sRGB or linear as
+             * appropriate.  The input values are always either sRGB (if the
+             * gamma correction flag is 0) or 0..255 scaled file encoded values
+             * (if the function must gamma correct them).
+             */
+            for (i=val=0; i<cmap_entries; ++i, val += step)
+            {
+               /* 'i' is a file value.  While this will result in duplicated
+                * entries for 8-bit non-sRGB encoded files it is necessary to
+                * have non-gamma corrected values to do tRNS handling.
+                */
+               if (i != trans)
+                  png_create_colormap_entry(display, i, val, val, val, 255,
+                     E_FILE/*8-bit with file gamma*/);
+
+               /* Else this entry is transparent.  The colors don't matter if
+                * there is an alpha channel (back_alpha == 0), but it does no
+                * harm to pass them in; the values are not set above so this
+                * passes in white.
+                *
+                * NOTE: this preserves the full precision of the application
+                * supplied background color when it is used.
+                */
+               else
+                  png_create_colormap_entry(display, i, back_r, back_g, back_b,
+                     back_alpha, output_encoding);
+            }
+
+            /* We need libpng to preserve the original encoding. */
+            data_encoding = E_FILE;
+
+            /* The rows from libpng, while technically gray values, are now also
+             * color-map indicies; however, they may need to be expanded to 1
+             * byte per pixel.  This is what png_set_packing does (i.e., it
+             * unpacks the bit values into bytes.)
+             */
+            if (png_ptr->bit_depth < 8)
+               png_set_packing(png_ptr);
+         }
+
+         else /* bit depth is 16 */
+         {
+            /* The 16-bit input values can be converted directly to 8-bit gamma
+             * encoded values; however, if a tRNS chunk is present 257 color-map
+             * entries are required.  This means that the extra entry requires
+             * special processing; add an alpha channel, sacrifice gray level
+             * 254 and convert transparent (alpha==0) entries to that.
+             *
+             * Use libpng to chop the data to 8 bits.  Convert it to sRGB at the
+             * same time to minimize quality loss.  If a tRNS chunk is present
+             * this means libpng must handle it too; otherwise it is impossible
+             * to do the exact match on the 16-bit value.
+             *
+             * If the output has no alpha channel *and* the background color is
+             * gray then it is possible to let libpng handle the substitution by
+             * ensuring that the corresponding gray level matches the background
+             * color exactly.
+             */
+            data_encoding = E_sRGB;
+
+            if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
+               png_error(png_ptr, "gray[16] color-map: too few entries");
+
+            cmap_entries = make_gray_colormap(display);
+
+            if (png_ptr->num_trans > 0)
+            {
+               unsigned int back_alpha;
+
+               if (output_format & PNG_FORMAT_FLAG_ALPHA)
+                  back_alpha = 0;
+
+               else
+               {
+                  if (back_r == back_g && back_g == back_b)
+                  {
+                     /* Background is gray; no special processing will be
+                      * required.
+                      */
+                     png_color_16 c;
+                     png_uint_32 gray = back_g;
+
+                     if (output_encoding == E_LINEAR)
+                     {
+                        gray = PNG_sRGB_FROM_LINEAR(gray * 255);
+
+                        /* And make sure the corresponding palette entry
+                         * matches.
+                         */
+                        png_create_colormap_entry(display, gray, back_g, back_g,
+                           back_g, 65535, E_LINEAR);
+                     }
+
+                     /* The background passed to libpng, however, must be the
+                      * sRGB value.
+                      */
+                     c.index = 0; /*unused*/
+                     c.gray = c.red = c.green = c.blue = (png_uint_16)gray;
+
+                     /* NOTE: does this work without expanding tRNS to alpha?
+                      * It should be the color->gray case below apparently
+                      * doesn't.
+                      */
+                     png_set_background_fixed(png_ptr, &c,
+                        PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/,
+                        0/*gamma: not used*/);
+
+                     output_processing = PNG_CMAP_NONE;
+                     break;
+                  }
+
+                  back_alpha = output_encoding == E_LINEAR ? 65535 : 255;
+               }
+
+               /* output_processing means that the libpng-processed row will be
+                * 8-bit GA and it has to be processing to single byte color-map
+                * values.  Entry 254 is replaced by either a completely
+                * transparent entry or by the background color at full
+                * precision (and the background color is not a simple gray leve
+                * in this case.)
+                */
+               expand_tRNS = 1;
+               output_processing = PNG_CMAP_TRANS;
+               background_index = 254;
+
+               /* And set (overwrite) color-map entry 254 to the actual
+                * background color at full precision.
+                */
+               png_create_colormap_entry(display, 254, back_r, back_g, back_b,
+                  back_alpha, output_encoding);
+            }
+
+            else
+               output_processing = PNG_CMAP_NONE;
+         }
+         break;
+
+      case PNG_COLOR_TYPE_GRAY_ALPHA:
+         /* 8-bit or 16-bit PNG with two channels - gray and alpha.  A minimum
+          * of 65536 combinations.  If, however, the alpha channel is to be
+          * removed there are only 256 possibilities if the background is gray.
+          * (Otherwise there is a subset of the 65536 possibilities defined by
+          * the triangle between black, white and the background color.)
+          *
+          * Reduce 16-bit files to 8-bit and sRGB encode the result.  No need to
+          * worry about tRNS matching - tRNS is ignored if there is an alpha
+          * channel.
+          */
+         data_encoding = E_sRGB;
+
+         if (output_format & PNG_FORMAT_FLAG_ALPHA)
+         {
+            if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
+               png_error(png_ptr, "gray+alpha color-map: too few entries");
+
+            cmap_entries = make_ga_colormap(display);
+
+            background_index = PNG_CMAP_GA_BACKGROUND;
+            output_processing = PNG_CMAP_GA;
+         }
+
+         else /* alpha is removed */
+         {
+            /* Alpha must be removed as the PNG data is processed when the
+             * background is a color because the G and A channels are
+             * independent and the vector addition (non-parallel vectors) is a
+             * 2-D problem.
+             *
+             * This can be reduced to the same algorithm as above by making a
+             * colormap containing gray levels (for the opaque grays), a
+             * background entry (for a transparent pixel) and a set of four six
+             * level color values, one set for each intermediate alpha value.
+             * See the comments in make_ga_colormap for how this works in the
+             * per-pixel processing.
+             *
+             * If the background is gray, however, we only need a 256 entry gray
+             * level color map.  It is sufficient to make the entry generated
+             * for the background color be exactly the color specified.
+             */
+            if ((output_format & PNG_FORMAT_FLAG_COLOR) == 0 ||
+               (back_r == back_g && back_g == back_b))
+            {
+               /* Background is gray; no special processing will be required. */
+               png_color_16 c;
+               png_uint_32 gray = back_g;
+
+               if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
+                  png_error(png_ptr, "gray-alpha color-map: too few entries");
+
+               cmap_entries = make_gray_colormap(display);
+
+               if (output_encoding == E_LINEAR)
+               {
+                  gray = PNG_sRGB_FROM_LINEAR(gray * 255);
+
+                  /* And make sure the corresponding palette entry matches. */
+                  png_create_colormap_entry(display, gray, back_g, back_g,
+                     back_g, 65535, E_LINEAR);
+               }
+
+               /* The background passed to libpng, however, must be the sRGB
+                * value.
+                */
+               c.index = 0; /*unused*/
+               c.gray = c.red = c.green = c.blue = (png_uint_16)gray;
+
+               png_set_background_fixed(png_ptr, &c,
+                  PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/,
+                  0/*gamma: not used*/);
+
+               output_processing = PNG_CMAP_NONE;
+            }
+
+            else
+            {
+               png_uint_32 i, a;
+
+               /* This is the same as png_make_ga_colormap, above, except that
+                * the entries are all opaque.
+                */
+               if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
+                  png_error(png_ptr, "ga-alpha color-map: too few entries");
+
+               i = 0;
+               while (i < 231)
+               {
+                  png_uint_32 gray = (i * 256 + 115) / 231;
+                  png_create_colormap_entry(display, i++, gray, gray, gray,
+                     255, E_sRGB);
+               }
+
+               /* NOTE: this preserves the full precision of the application
+                * background color.
+                */
+               background_index = i;
+               png_create_colormap_entry(display, i++, back_r, back_g, back_b,
+                  output_encoding == E_LINEAR ? 65535U : 255U, output_encoding);
+
+               /* For non-opaque input composite on the sRGB background - this
+                * requires inverting the encoding for each component.  The input
+                * is still converted to the sRGB encoding because this is a
+                * reasonable approximate to the logarithmic curve of human
+                * visual sensitivity, at least over the narrow range which PNG
+                * represents.  Consequently 'G' is always sRGB encoded, while
+                * 'A' is linear.  We need the linear background colors.
+                */
+               if (output_encoding == E_sRGB) /* else already linear */
+               {
+                  /* This may produce a value not exactly matching the
+                   * background, but that's ok because these numbers are only
+                   * used when alpha != 0
+                   */
+                  back_r = png_sRGB_table[back_r];
+                  back_g = png_sRGB_table[back_g];
+                  back_b = png_sRGB_table[back_b];
+               }
+
+               for (a=1; a<5; ++a)
+               {
+                  unsigned int g;
+
+                  /* PNG_sRGB_FROM_LINEAR expects a 16-bit linear value scaled
+                   * by an 8-bit alpha value (0..255).
+                   */
+                  png_uint_32 alpha = 51 * a;
+                  png_uint_32 back_rx = (255-alpha) * back_r;
+                  png_uint_32 back_gx = (255-alpha) * back_g;
+                  png_uint_32 back_bx = (255-alpha) * back_b;
+
+                  for (g=0; g<6; ++g)
+                  {
+                     png_uint_32 gray = png_sRGB_table[g*51] * alpha;
+
+                     png_create_colormap_entry(display, i++,
+                        PNG_sRGB_FROM_LINEAR(gray + back_rx),
+                        PNG_sRGB_FROM_LINEAR(gray + back_gx),
+                        PNG_sRGB_FROM_LINEAR(gray + back_bx), 255, E_sRGB);
+                  }
+               }
+
+               cmap_entries = i;
+               output_processing = PNG_CMAP_GA;
+            }
+         }
+         break;
+
+      case PNG_COLOR_TYPE_RGB:
+      case PNG_COLOR_TYPE_RGB_ALPHA:
+         /* Exclude the case where the output is gray; we can always handle this
+          * with the cases above.
+          */
+         if ((output_format & PNG_FORMAT_FLAG_COLOR) == 0)
+         {
+            /* The color-map will be grayscale, so we may as well convert the
+             * input RGB values to a simple grayscale and use the grayscale
+             * code above.
+             *
+             * NOTE: calling this apparently damages the recognition of the
+             * transparent color in background color handling; call
+             * png_set_tRNS_to_alpha before png_set_background_fixed.
+             */
+            png_set_rgb_to_gray_fixed(png_ptr, PNG_ERROR_ACTION_NONE, -1,
+               -1);
+            data_encoding = E_sRGB;
+
+            /* The output will now be one or two 8-bit gray or gray+alpha
+             * channels.  The more complex case arises when the input has alpha.
+             */
+            if ((png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
+               png_ptr->num_trans > 0) &&
+               (output_format & PNG_FORMAT_FLAG_ALPHA) != 0)
+            {
+               /* Both input and output have an alpha channel, so no background
+                * processing is required; just map the GA bytes to the right
+                * color-map entry.
+                */
+               expand_tRNS = 1;
+
+               if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
+                  png_error(png_ptr, "rgb[ga] color-map: too few entries");
+
+               cmap_entries = make_ga_colormap(display);
+               background_index = PNG_CMAP_GA_BACKGROUND;
+               output_processing = PNG_CMAP_GA;
+            }
+
+            else
+            {
+               /* Either the input or the output has no alpha channel, so there
+                * will be no non-opaque pixels in the color-map; it will just be
+                * grayscale.
+                */
+               if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
+                  png_error(png_ptr, "rgb[gray] color-map: too few entries");
+
+               /* Ideally this code would use libpng to do the gamma correction,
+                * but if an input alpha channel is to be removed we will hit the
+                * libpng bug in gamma+compose+rgb-to-gray (the double gamma
+                * correction bug).  Fix this by dropping the gamma correction in
+                * this case and doing it in the palette; this will result in
+                * duplicate palette entries, but that's better than the
+                * alternative of double gamma correction.
+                */
+               if ((png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
+                  png_ptr->num_trans > 0) &&
+                  png_gamma_not_sRGB(png_ptr->colorspace.gamma))
+               {
+                  cmap_entries = make_gray_file_colormap(display);
+                  data_encoding = E_FILE;
+               }
+
+               else
+                  cmap_entries = make_gray_colormap(display);
+
+               /* But if the input has alpha or transparency it must be removed
+                */
+               if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
+                  png_ptr->num_trans > 0)
+               {
+                  png_color_16 c;
+                  png_uint_32 gray = back_g;
+
+                  /* We need to ensure that the application background exists in
+                   * the colormap and that completely transparent pixels map to
+                   * it.  Achieve this simply by ensuring that the entry
+                   * selected for the background really is the background color.
+                   */
+                  if (data_encoding == E_FILE) /* from the fixup above */
+                  {
+                     /* The app supplied a gray which is in output_encoding, we
+                      * need to convert it to a value of the input (E_FILE)
+                      * encoding then set this palette entry to the required
+                      * output encoding.
+                      */
+                     if (output_encoding == E_sRGB)
+                        gray = png_sRGB_table[gray]; /* now E_LINEAR */
+
+                     gray = PNG_DIV257(png_gamma_16bit_correct(gray,
+                        png_ptr->colorspace.gamma)); /* now E_FILE */
+
+                     /* And make sure the corresponding palette entry contains
+                      * exactly the required sRGB value.
+                      */
+                     png_create_colormap_entry(display, gray, back_g, back_g,
+                        back_g, 0/*unused*/, output_encoding);
+                  }
+
+                  else if (output_encoding == E_LINEAR)
+                  {
+                     gray = PNG_sRGB_FROM_LINEAR(gray * 255);
+
+                     /* And make sure the corresponding palette entry matches.
+                      */
+                     png_create_colormap_entry(display, gray, back_g, back_g,
+                        back_g, 0/*unused*/, E_LINEAR);
+                  }
+
+                  /* The background passed to libpng, however, must be the
+                   * output (normally sRGB) value.
+                   */
+                  c.index = 0; /*unused*/
+                  c.gray = c.red = c.green = c.blue = (png_uint_16)gray;
+
+                  /* NOTE: the following is apparently a bug in libpng. Without
+                   * it the transparent color recognition in
+                   * png_set_background_fixed seems to go wrong.
+                   */
+                  expand_tRNS = 1;
+                  png_set_background_fixed(png_ptr, &c,
+                     PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/,
+                     0/*gamma: not used*/);
+               }
+
+               output_processing = PNG_CMAP_NONE;
+            }
+         }
+
+         else /* output is color */
+         {
+            /* We could use png_quantize here so long as there is no transparent
+             * color or alpha; png_quantize ignores alpha.  Easier overall just
+             * to do it once and using PNG_DIV51 on the 6x6x6 reduced RGB cube.
+             * Consequently we always want libpng to produce sRGB data.
+             */
+            data_encoding = E_sRGB;
+
+            /* Is there any transparency or alpha? */
+            if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
+               png_ptr->num_trans > 0)
+            {
+               /* Is there alpha in the output too?  If so all four channels are
+                * processed into a special RGB cube with alpha support.
+                */
+               if (output_format & PNG_FORMAT_FLAG_ALPHA)
+               {
+                  png_uint_32 r;
+
+                  if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
+                     png_error(png_ptr, "rgb+alpha color-map: too few entries");
+
+                  cmap_entries = make_rgb_colormap(display);
+
+                  /* Add a transparent entry. */
+                  png_create_colormap_entry(display, cmap_entries, 255, 255,
+                     255, 0, E_sRGB);
+
+                  /* This is stored as the background index for the processing
+                   * algorithm.
+                   */
+                  background_index = cmap_entries++;
+
+                  /* Add 27 r,g,b entries each with alpha 0.5. */
+                  for (r=0; r<256; r = (r << 1) | 0x7f)
+                  {
+                     png_uint_32 g;
+
+                     for (g=0; g<256; g = (g << 1) | 0x7f)
+                     {
+                        png_uint_32 b;
+
+                        /* This generates components with the values 0, 127 and
+                         * 255
+                         */
+                        for (b=0; b<256; b = (b << 1) | 0x7f)
+                           png_create_colormap_entry(display, cmap_entries++,
+                              r, g, b, 128, E_sRGB);
+                     }
+                  }
+
+                  expand_tRNS = 1;
+                  output_processing = PNG_CMAP_RGB_ALPHA;
+               }
+
+               else
+               {
+                  /* Alpha/transparency must be removed.  The background must
+                   * exist in the color map (achieved by setting adding it after
+                   * the 666 color-map).  If the standard processing code will
+                   * pick up this entry automatically that's all that is
+                   * required; libpng can be called to do the background
+                   * processing.
+                   */
+                  unsigned int sample_size =
+                     PNG_IMAGE_SAMPLE_SIZE(output_format);
+                  png_uint_32 r, g, b; /* sRGB background */
+
+                  if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
+                     png_error(png_ptr, "rgb-alpha color-map: too few entries");
+
+                  cmap_entries = make_rgb_colormap(display);
+
+                  png_create_colormap_entry(display, cmap_entries, back_r,
+                        back_g, back_b, 0/*unused*/, output_encoding);
+
+                  if (output_encoding == E_LINEAR)
+                  {
+                     r = PNG_sRGB_FROM_LINEAR(back_r * 255);
+                     g = PNG_sRGB_FROM_LINEAR(back_g * 255);
+                     b = PNG_sRGB_FROM_LINEAR(back_b * 255);
+                  }
+
+                  else
+                  {
+                     r = back_r;
+                     g = back_g;
+                     b = back_g;
+                  }
+
+                  /* Compare the newly-created color-map entry with the one the
+                   * PNG_CMAP_RGB algorithm will use.  If the two entries don't
+                   * match, add the new one and set this as the background
+                   * index.
+                   */
+                  if (memcmp((png_const_bytep)display->colormap +
+                        sample_size * cmap_entries,
+                     (png_const_bytep)display->colormap +
+                        sample_size * PNG_RGB_INDEX(r,g,b),
+                     sample_size) != 0)
+                  {
+                     /* The background color must be added. */
+                     background_index = cmap_entries++;
+
+                     /* Add 27 r,g,b entries each with created by composing with
+                      * the background at alpha 0.5.
+                      */
+                     for (r=0; r<256; r = (r << 1) | 0x7f)
+                     {
+                        for (g=0; g<256; g = (g << 1) | 0x7f)
+                        {
+                           /* This generates components with the values 0, 127
+                            * and 255
+                            */
+                           for (b=0; b<256; b = (b << 1) | 0x7f)
+                              png_create_colormap_entry(display, cmap_entries++,
+                                 png_colormap_compose(display, r, E_sRGB, 128,
+                                    back_r, output_encoding),
+                                 png_colormap_compose(display, g, E_sRGB, 128,
+                                    back_g, output_encoding),
+                                 png_colormap_compose(display, b, E_sRGB, 128,
+                                    back_b, output_encoding),
+                                 0/*unused*/, output_encoding);
+                        }
+                     }
+
+                     expand_tRNS = 1;
+                     output_processing = PNG_CMAP_RGB_ALPHA;
+                  }
+
+                  else /* background color is in the standard color-map */
+                  {
+                     png_color_16 c;
+
+                     c.index = 0; /*unused*/
+                     c.red = (png_uint_16)back_r;
+                     c.gray = c.green = (png_uint_16)back_g;
+                     c.blue = (png_uint_16)back_b;
+
+                     png_set_background_fixed(png_ptr, &c,
+                        PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/,
+                        0/*gamma: not used*/);
+
+                     output_processing = PNG_CMAP_RGB;
+                  }
+               }
+            }
+
+            else /* no alpha or transparency in the input */
+            {
+               /* Alpha in the output is irrelevant, simply map the opaque input
+                * pixels to the 6x6x6 color-map.
+                */
+               if (PNG_RGB_COLORMAP_ENTRIES > image->colormap_entries)
+                  png_error(png_ptr, "rgb color-map: too few entries");
+
+               cmap_entries = make_rgb_colormap(display);
+               output_processing = PNG_CMAP_RGB;
+            }
+         }
+         break;
+
+      case PNG_COLOR_TYPE_PALETTE:
+         /* It's already got a color-map.  It may be necessary to eliminate the
+          * tRNS entries though.
+          */
+         {
+            unsigned int num_trans = png_ptr->num_trans;
+            png_const_bytep trans = num_trans > 0 ? png_ptr->trans_alpha : NULL;
+            png_const_colorp colormap = png_ptr->palette;
+            const int do_background = trans != NULL &&
+               (output_format & PNG_FORMAT_FLAG_ALPHA) == 0;
+            unsigned int i;
+
+            /* Just in case: */
+            if (trans == NULL)
+               num_trans = 0;
+
+            output_processing = PNG_CMAP_NONE;
+            data_encoding = E_FILE; /* Don't change from color-map indicies */
+            cmap_entries = png_ptr->num_palette;
+            if (cmap_entries > 256)
+               cmap_entries = 256;
+
+            if (cmap_entries > image->colormap_entries)
+               png_error(png_ptr, "palette color-map: too few entries");
+
+            for (i=0; i < cmap_entries; ++i)
+            {
+               if (do_background && i < num_trans && trans[i] < 255)
+               {
+                  if (trans[i] == 0)
+                     png_create_colormap_entry(display, i, back_r, back_g,
+                        back_b, 0, output_encoding);
+
+                  else
+                  {
+                     /* Must compose the PNG file color in the color-map entry
+                      * on the sRGB color in 'back'.
+                      */
+                     png_create_colormap_entry(display, i,
+                        png_colormap_compose(display, colormap[i].red, E_FILE,
+                           trans[i], back_r, output_encoding),
+                        png_colormap_compose(display, colormap[i].green, E_FILE,
+                           trans[i], back_g, output_encoding),
+                        png_colormap_compose(display, colormap[i].blue, E_FILE,
+                           trans[i], back_b, output_encoding),
+                        output_encoding == E_LINEAR ? trans[i] * 257U :
+                           trans[i],
+                        output_encoding);
+                  }
+               }
+
+               else
+                  png_create_colormap_entry(display, i, colormap[i].red,
+                     colormap[i].green, colormap[i].blue,
+                     i < num_trans ? trans[i] : 255U, E_FILE/*8-bit*/);
+            }
+
+            /* The PNG data may have indicies packed in fewer than 8 bits, it
+             * must be expanded if so.
+             */
+            if (png_ptr->bit_depth < 8)
+               png_set_packing(png_ptr);
+         }
+         break;
+
+      default:
+         png_error(png_ptr, "invalid PNG color type");
+         /*NOT REACHED*/
+         break;
+   }
+
+   /* Now deal with the output processing */
+   if (expand_tRNS && png_ptr->num_trans > 0 &&
+      (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) == 0)
+      png_set_tRNS_to_alpha(png_ptr);
+
+   switch (data_encoding)
+   {
+      default:
+         png_error(png_ptr, "bad data option (internal error)");
+         break;
+
+      case E_sRGB:
+         /* Change to 8-bit sRGB */
+         png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB);
+         /* FALL THROUGH */
+
+      case E_FILE:
+         if (png_ptr->bit_depth > 8)
+            png_set_scale_16(png_ptr);
+         break;
+   }
+
+   if (cmap_entries > 256 || cmap_entries > image->colormap_entries)
+      png_error(png_ptr, "color map overflow (BAD internal error)");
+
+   image->colormap_entries = cmap_entries;
+
+   /* Double check using the recorded background index */
+   switch (output_processing)
+   {
+      case PNG_CMAP_NONE:
+         if (background_index != PNG_CMAP_NONE_BACKGROUND)
+            goto bad_background;
+         break;
+
+      case PNG_CMAP_GA:
+         if (background_index != PNG_CMAP_GA_BACKGROUND)
+            goto bad_background;
+         break;
+
+      case PNG_CMAP_TRANS:
+         if (background_index >= cmap_entries ||
+            background_index != PNG_CMAP_TRANS_BACKGROUND)
+            goto bad_background;
+         break;
+
+      case PNG_CMAP_RGB:
+         if (background_index != PNG_CMAP_RGB_BACKGROUND)
+            goto bad_background;
+         break;
+
+      case PNG_CMAP_RGB_ALPHA:
+         if (background_index != PNG_CMAP_RGB_ALPHA_BACKGROUND)
+            goto bad_background;
+         break;
+
+      default:
+         png_error(png_ptr, "bad processing option (internal error)");
+
+      bad_background:
+         png_error(png_ptr, "bad background index (internal error)");
+   }
+
+   display->colormap_processing = output_processing;
+
+   return 1/*ok*/;
+}
+
+/* The final part of the color-map read called from png_image_finish_read. */
+static int
+png_image_read_and_map(png_voidp argument)
+{
+   png_image_read_control *display = png_voidcast(png_image_read_control*,
+      argument);
+   png_imagep image = display->image;
+   png_structrp png_ptr = image->opaque->png_ptr;
+   int passes;
+
+   /* Called when the libpng data must be transformed into the color-mapped
+    * form.  There is a local row buffer in display->local and this routine must
+    * do the interlace handling.
+    */
+   switch (png_ptr->interlaced)
+   {
+      case PNG_INTERLACE_NONE:
+         passes = 1;
+         break;
+
+      case PNG_INTERLACE_ADAM7:
+         passes = PNG_INTERLACE_ADAM7_PASSES;
+         break;
+
+      default:
+         passes = 0;
+         png_error(png_ptr, "unknown interlace type");
+   }
+
+   {
+      png_uint_32  height = image->height;
+      png_uint_32  width = image->width;
+      int          proc = display->colormap_processing;
+      png_bytep    first_row = png_voidcast(png_bytep, display->first_row);
+      ptrdiff_t    step_row = display->row_bytes;
+      int pass;
+
+      for (pass = 0; pass < passes; ++pass)
+      {
+         unsigned int     startx, stepx, stepy;
+         png_uint_32      y;
+
+         if (png_ptr->interlaced == PNG_INTERLACE_ADAM7)
+         {
+            /* The row may be empty for a short image: */
+            if (PNG_PASS_COLS(width, pass) == 0)
+               continue;
+
+            startx = PNG_PASS_START_COL(pass);
+            stepx = PNG_PASS_COL_OFFSET(pass);
+            y = PNG_PASS_START_ROW(pass);
+            stepy = PNG_PASS_ROW_OFFSET(pass);
+         }
+
+         else
+         {
+            y = 0;
+            startx = 0;
+            stepx = stepy = 1;
+         }
+
+         for (; y<height; y += stepy)
+         {
+            png_bytep inrow = png_voidcast(png_bytep, display->local_row);
+            png_bytep outrow = first_row + y * step_row;
+            png_const_bytep end_row = outrow + width;
+
+            /* Read read the libpng data into the temporary buffer. */
+            png_read_row(png_ptr, inrow, NULL);
+
+            /* Now process the row according to the processing option, note
+             * that the caller verifies that the format of the libpng output
+             * data is as required.
+             */
+            outrow += startx;
+            switch (proc)
+            {
+               case PNG_CMAP_GA:
+                  for (; outrow < end_row; outrow += stepx)
+                  {
+                     /* The data is always in the PNG order */
+                     unsigned int gray = *inrow++;
+                     unsigned int alpha = *inrow++;
+                     unsigned int entry;
+
+                     /* NOTE: this code is copied as a comment in
+                      * make_ga_colormap above.  Please update the
+                      * comment if you change this code!
+                      */
+                     if (alpha > 229) /* opaque */
+                     {
+                        entry = (231 * gray + 128) >> 8;
+                     }
+                     else if (alpha < 26) /* transparent */
+                     {
+                        entry = 231;
+                     }
+                     else /* partially opaque */
+                     {
+                        entry = 226 + 6 * PNG_DIV51(alpha) + PNG_DIV51(gray);
+                     }
+
+                     *outrow = (png_byte)entry;
+                  }
+                  break;
+
+               case PNG_CMAP_TRANS:
+                  for (; outrow < end_row; outrow += stepx)
+                  {
+                     png_byte gray = *inrow++;
+                     png_byte alpha = *inrow++;
+
+                     if (alpha == 0)
+                        *outrow = PNG_CMAP_TRANS_BACKGROUND;
+
+                     else if (gray != PNG_CMAP_TRANS_BACKGROUND)
+                        *outrow = gray;
+
+                     else
+                        *outrow = (png_byte)(PNG_CMAP_TRANS_BACKGROUND+1);
+                  }
+                  break;
+
+               case PNG_CMAP_RGB:
+                  for (; outrow < end_row; outrow += stepx)
+                  {
+                     *outrow = PNG_RGB_INDEX(inrow[0], inrow[1], inrow[2]);
+                     inrow += 3;
+                  }
+                  break;
+
+               case PNG_CMAP_RGB_ALPHA:
+                  for (; outrow < end_row; outrow += stepx)
+                  {
+                     unsigned int alpha = inrow[3];
+
+                     /* Because the alpha entries only hold alpha==0.5 values
+                      * split the processing at alpha==0.25 (64) and 0.75
+                      * (196).
+                      */
+
+                     if (alpha >= 196)
+                        *outrow = PNG_RGB_INDEX(inrow[0], inrow[1],
+                           inrow[2]);
+
+                     else if (alpha < 64)
+                        *outrow = PNG_CMAP_RGB_ALPHA_BACKGROUND;
+
+                     else
+                     {
+                        /* Likewise there are three entries for each of r, g
+                         * and b.  We could select the entry by popcount on
+                         * the top two bits on those architectures that
+                         * support it, this is what the code below does,
+                         * crudely.
+                         */
+                        unsigned int back_i = PNG_CMAP_RGB_ALPHA_BACKGROUND+1;
+
+                        /* Here are how the values map:
+                         *
+                         * 0x00 .. 0x3f -> 0
+                         * 0x40 .. 0xbf -> 1
+                         * 0xc0 .. 0xff -> 2
+                         *
+                         * So, as above with the explicit alpha checks, the
+                         * breakpoints are at 64 and 196.
+                         */
+                        if (inrow[0] & 0x80) back_i += 9; /* red */
+                        if (inrow[0] & 0x40) back_i += 9;
+                        if (inrow[0] & 0x80) back_i += 3; /* green */
+                        if (inrow[0] & 0x40) back_i += 3;
+                        if (inrow[0] & 0x80) back_i += 1; /* blue */
+                        if (inrow[0] & 0x40) back_i += 1;
+
+                        *outrow = (png_byte)back_i;
+                     }
+
+                     inrow += 4;
+                  }
+                  break;
+
+               default:
+                  break;
+            }
+         }
+      }
+   }
+
+   return 1;
+}
+
+static int
+png_image_read_colormapped(png_voidp argument)
+{
+   png_image_read_control *display = png_voidcast(png_image_read_control*,
+      argument);
+   png_imagep image = display->image;
+   png_controlp control = image->opaque;
+   png_structrp png_ptr = control->png_ptr;
+   png_inforp info_ptr = control->info_ptr;
+
+   int passes = 0; /* As a flag */
+
+   PNG_SKIP_CHUNKS(png_ptr);
+
+   /* Update the 'info' structure and make sure the result is as required; first
+    * make sure to turn on the interlace handling if it will be required
+    * (because it can't be turned on *after* the call to png_read_update_info!)
+    */
+   if (display->colormap_processing == PNG_CMAP_NONE)
+      passes = png_set_interlace_handling(png_ptr);
+
+   png_read_update_info(png_ptr, info_ptr);
+
+   /* The expected output can be deduced from the colormap_processing option. */
+   switch (display->colormap_processing)
+   {
+      case PNG_CMAP_NONE:
+         /* Output must be one channel and one byte per pixel, the output
+          * encoding can be anything.
+          */
+         if ((info_ptr->color_type == PNG_COLOR_TYPE_PALETTE ||
+            info_ptr->color_type == PNG_COLOR_TYPE_GRAY) &&
+            info_ptr->bit_depth == 8)
+            break;
+
+         goto bad_output;
+
+      case PNG_CMAP_TRANS:
+      case PNG_CMAP_GA:
+         /* Output must be two channels and the 'G' one must be sRGB, the latter
+          * can be checked with an exact number because it should have been set
+          * to this number above!
+          */
+         if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA &&
+            info_ptr->bit_depth == 8 &&
+            png_ptr->screen_gamma == PNG_GAMMA_sRGB &&
+            image->colormap_entries == 256)
+            break;
+
+         goto bad_output;
+
+      case PNG_CMAP_RGB:
+         /* Output must be 8-bit sRGB encoded RGB */
+         if (info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
+            info_ptr->bit_depth == 8 &&
+            png_ptr->screen_gamma == PNG_GAMMA_sRGB &&
+            image->colormap_entries == 216)
+            break;
+
+         goto bad_output;
+
+      case PNG_CMAP_RGB_ALPHA:
+         /* Output must be 8-bit sRGB encoded RGBA */
+         if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA &&
+            info_ptr->bit_depth == 8 &&
+            png_ptr->screen_gamma == PNG_GAMMA_sRGB &&
+            image->colormap_entries == 244 /* 216 + 1 + 27 */)
+            break;
+
+         /* goto bad_output; */
+         /* FALL THROUGH */
+
+      default:
+      bad_output:
+         png_error(png_ptr, "bad color-map processing (internal error)");
+   }
+
+   /* Now read the rows.  Do this here if it is possible to read directly into
+    * the output buffer, otherwise allocate a local row buffer of the maximum
+    * size libpng requires and call the relevant processing routine safely.
+    */
+   {
+      png_voidp first_row = display->buffer;
+      ptrdiff_t row_bytes = display->row_stride;
+
+      /* The following expression is designed to work correctly whether it gives
+       * a signed or an unsigned result.
+       */
+      if (row_bytes < 0)
+      {
+         char *ptr = png_voidcast(char*, first_row);
+         ptr += (image->height-1) * (-row_bytes);
+         first_row = png_voidcast(png_voidp, ptr);
+      }
+
+      display->first_row = first_row;
+      display->row_bytes = row_bytes;
+   }
+
+   if (passes == 0)
+   {
+      int result;
+      png_voidp row = png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr));
+
+      display->local_row = row;
+      result = png_safe_execute(image, png_image_read_and_map, display);
+      display->local_row = NULL;
+      png_free(png_ptr, row);
+
+      return result;
+   }
+
+   else
+   {
+      png_alloc_size_t row_bytes = display->row_bytes;
+
+      while (--passes >= 0)
+      {
+         png_uint_32      y = image->height;
+         png_bytep        row = png_voidcast(png_bytep, display->first_row);
+
+         while (y-- > 0)
+         {
+            png_read_row(png_ptr, row, NULL);
+            row += row_bytes;
+         }
+      }
+
+      return 1;
+   }
+}
+
+/* Just the row reading part of png_image_read. */
+static int
+png_image_read_composite(png_voidp argument)
+{
+   png_image_read_control *display = png_voidcast(png_image_read_control*,
+      argument);
+   png_imagep image = display->image;
+   png_structrp png_ptr = image->opaque->png_ptr;
+   int passes;
+
+   switch (png_ptr->interlaced)
+   {
+      case PNG_INTERLACE_NONE:
+         passes = 1;
+         break;
+
+      case PNG_INTERLACE_ADAM7:
+         passes = PNG_INTERLACE_ADAM7_PASSES;
+         break;
+
+      default:
+         passes = 0;
+         png_error(png_ptr, "unknown interlace type");
+   }
+
+   {
+      png_uint_32  height = image->height;
+      png_uint_32  width = image->width;
+      ptrdiff_t    step_row = display->row_bytes;
+      unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) ? 3 : 1;
+      int pass;
+
+      for (pass = 0; pass < passes; ++pass)
+      {
+         unsigned int     startx, stepx, stepy;
+         png_uint_32      y;
+
+         if (png_ptr->interlaced == PNG_INTERLACE_ADAM7)
+         {
+            /* The row may be empty for a short image: */
+            if (PNG_PASS_COLS(width, pass) == 0)
+               continue;
+
+            startx = PNG_PASS_START_COL(pass) * channels;
+            stepx = PNG_PASS_COL_OFFSET(pass) * channels;
+            y = PNG_PASS_START_ROW(pass);
+            stepy = PNG_PASS_ROW_OFFSET(pass);
+         }
+
+         else
+         {
+            y = 0;
+            startx = 0;
+            stepx = channels;
+            stepy = 1;
+         }
+
+         for (; y<height; y += stepy)
+         {
+            png_bytep inrow = png_voidcast(png_bytep, display->local_row);
+            png_bytep outrow;
+            png_const_bytep end_row;
+
+            /* Read the row, which is packed: */
+            png_read_row(png_ptr, inrow, NULL);
+
+            outrow = png_voidcast(png_bytep, display->first_row);
+            outrow += y * step_row;
+            end_row = outrow + width * channels;
+
+            /* Now do the composition on each pixel in this row. */
+            outrow += startx;
+            for (; outrow < end_row; outrow += stepx)
+            {
+               png_byte alpha = inrow[channels];
+
+               if (alpha > 0) /* else no change to the output */
+               {
+                  unsigned int c;
+
+                  for (c=0; c<channels; ++c)
+                  {
+                     png_uint_32 component = inrow[c];
+
+                     if (alpha < 255) /* else just use component */
+                     {
+                        /* This is PNG_OPTIMIZED_ALPHA, the component value
+                         * is a linear 8-bit value.  Combine this with the
+                         * current outrow[c] value which is sRGB encoded.
+                         * Arithmetic here is 16-bits to preserve the output
+                         * values correctly.
+                         */
+                        component *= 257*255; /* =65535 */
+                        component += (255-alpha)*png_sRGB_table[outrow[c]];
+
+                        /* So 'component' is scaled by 255*65535 and is
+                         * therefore appropriate for the sRGB to linear
+                         * conversion table.
+                         */
+                        component = PNG_sRGB_FROM_LINEAR(component);
+                     }
+
+                     outrow[c] = (png_byte)component;
+                  }
+               }
+
+               inrow += channels+1; /* components and alpha channel */
+            }
+         }
+      }
+   }
+
+   return 1;
+}
+
+/* The do_local_background case; called when all the following transforms are to
+ * be done:
+ *
+ * PNG_RGB_TO_GRAY
+ * PNG_COMPOSITE
+ * PNG_GAMMA
+ *
+ * This is a work-round for the fact that both the PNG_RGB_TO_GRAY and
+ * PNG_COMPOSITE code performs gamma correction, so we get double gamma
+ * correction.  The fix-up is to prevent the PNG_COMPOSITE operation happening
+ * inside libpng, so this routine sees an 8 or 16-bit gray+alpha row and handles
+ * the removal or pre-multiplication of the alpha channel.
+ */
+static int
+png_image_read_background(png_voidp argument)
+{
+   png_image_read_control *display = png_voidcast(png_image_read_control*,
+      argument);
+   png_imagep image = display->image;
+   png_structrp png_ptr = image->opaque->png_ptr;
+   png_inforp info_ptr = image->opaque->info_ptr;
+   png_uint_32 height = image->height;
+   png_uint_32 width = image->width;
+   int pass, passes;
+
+   /* Double check the convoluted logic below.  We expect to get here with
+    * libpng doing rgb to gray and gamma correction but background processing
+    * left to the png_image_read_background function.  The rows libpng produce
+    * might be 8 or 16-bit but should always have two channels; gray plus alpha.
+    */
+   if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == 0)
+      png_error(png_ptr, "lost rgb to gray");
+
+   if ((png_ptr->transformations & PNG_COMPOSE) != 0)
+      png_error(png_ptr, "unexpected compose");
+
+   if (png_get_channels(png_ptr, info_ptr) != 2)
+      png_error(png_ptr, "lost/gained channels");
+
+   /* Expect the 8-bit case to always remove the alpha channel */
+   if ((image->format & PNG_FORMAT_FLAG_LINEAR) == 0 &&
+      (image->format & PNG_FORMAT_FLAG_ALPHA) != 0)
+      png_error(png_ptr, "unexpected 8-bit transformation");
+
+   switch (png_ptr->interlaced)
+   {
+      case PNG_INTERLACE_NONE:
+         passes = 1;
+         break;
+
+      case PNG_INTERLACE_ADAM7:
+         passes = PNG_INTERLACE_ADAM7_PASSES;
+         break;
+
+      default:
+         passes = 0;
+         png_error(png_ptr, "unknown interlace type");
+   }
+
+   switch (png_get_bit_depth(png_ptr, info_ptr))
+   {
+      default:
+         png_error(png_ptr, "unexpected bit depth");
+         break;
+
+      case 8:
+         /* 8-bit sRGB gray values with an alpha channel; the alpha channel is
+          * to be removed by composing on a backgroundi: either the row if
+          * display->background is NULL or display->background->green if not.
+          * Unlike the code above ALPHA_OPTIMIZED has *not* been done.
+          */
+         {
+            png_bytep first_row = png_voidcast(png_bytep, display->first_row);
+            ptrdiff_t step_row = display->row_bytes;
+
+            for (pass = 0; pass < passes; ++pass)
+            {
+               png_bytep        row = png_voidcast(png_bytep,
+                                                   display->first_row);
+               unsigned int     startx, stepx, stepy;
+               png_uint_32      y;
+
+               if (png_ptr->interlaced == PNG_INTERLACE_ADAM7)
+               {
+                  /* The row may be empty for a short image: */
+                  if (PNG_PASS_COLS(width, pass) == 0)
+                     continue;
+
+                  startx = PNG_PASS_START_COL(pass);
+                  stepx = PNG_PASS_COL_OFFSET(pass);
+                  y = PNG_PASS_START_ROW(pass);
+                  stepy = PNG_PASS_ROW_OFFSET(pass);
+               }
+
+               else
+               {
+                  y = 0;
+                  startx = 0;
+                  stepx = stepy = 1;
+               }
+
+               if (display->background == NULL)
+               {
+                  for (; y<height; y += stepy)
+                  {
+                     png_bytep inrow = png_voidcast(png_bytep,
+                        display->local_row);
+                     png_bytep outrow = first_row + y * step_row;
+                     png_const_bytep end_row = outrow + width;
+
+                     /* Read the row, which is packed: */
+                     png_read_row(png_ptr, inrow, NULL);
+
+                     /* Now do the composition on each pixel in this row. */
+                     outrow += startx;
+                     for (; outrow < end_row; outrow += stepx)
+                     {
+                        png_byte alpha = inrow[1];
+
+                        if (alpha > 0) /* else no change to the output */
+                        {
+                           png_uint_32 component = inrow[0];
+
+                           if (alpha < 255) /* else just use component */
+                           {
+                              /* Since PNG_OPTIMIZED_ALPHA was not set it is
+                               * necessary to invert the sRGB transfer
+                               * function and multiply the alpha out.
+                               */
+                              component = png_sRGB_table[component] * alpha;
+                              component += png_sRGB_table[outrow[0]] *
+                                 (255-alpha);
+                              component = PNG_sRGB_FROM_LINEAR(component);
+                           }
+
+                           outrow[0] = (png_byte)component;
+                        }
+
+                        inrow += 2; /* gray and alpha channel */
+                     }
+                  }
+               }
+
+               else /* constant background value */
+               {
+                  png_byte background8 = display->background->green;
+                  png_uint_16 background = png_sRGB_table[background8];
+
+                  for (; y<height; y += stepy)
+                  {
+                     png_bytep inrow = png_voidcast(png_bytep,
+                        display->local_row);
+                     png_bytep outrow = first_row + y * step_row;
+                     png_const_bytep end_row = outrow + width;
+
+                     /* Read the row, which is packed: */
+                     png_read_row(png_ptr, inrow, NULL);
+
+                     /* Now do the composition on each pixel in this row. */
+                     outrow += startx;
+                     for (; outrow < end_row; outrow += stepx)
+                     {
+                        png_byte alpha = inrow[1];
+
+                        if (alpha > 0) /* else use background */
+                        {
+                           png_uint_32 component = inrow[0];
+
+                           if (alpha < 255) /* else just use component */
+                           {
+                              component = png_sRGB_table[component] * alpha;
+                              component += background * (255-alpha);
+                              component = PNG_sRGB_FROM_LINEAR(component);
+                           }
+
+                           outrow[0] = (png_byte)component;
+                        }
+
+                        else
+                           outrow[0] = background8;
+
+                        inrow += 2; /* gray and alpha channel */
+                     }
+
+                     row += display->row_bytes;
+                  }
+               }
+            }
+         }
+         break;
+
+      case 16:
+         /* 16-bit linear with pre-multiplied alpha; the pre-multiplication must
+          * still be done and, maybe, the alpha channel removed.  This code also
+          * handles the alpha-first option.
+          */
+         {
+            png_uint_16p first_row = png_voidcast(png_uint_16p,
+               display->first_row);
+            /* The division by two is safe because the caller passed in a
+             * stride which was multiplied by 2 (below) to get row_bytes.
+             */
+            ptrdiff_t    step_row = display->row_bytes / 2;
+            int preserve_alpha = (image->format & PNG_FORMAT_FLAG_ALPHA) != 0;
+            unsigned int outchannels = 1+preserve_alpha;
+            int swap_alpha = 0;
+
+            if (preserve_alpha && (image->format & PNG_FORMAT_FLAG_AFIRST))
+               swap_alpha = 1;
+
+            for (pass = 0; pass < passes; ++pass)
+            {
+               unsigned int     startx, stepx, stepy;
+               png_uint_32      y;
+
+               /* The 'x' start and step are adjusted to output components here.
+                */
+               if (png_ptr->interlaced == PNG_INTERLACE_ADAM7)
+               {
+                  /* The row may be empty for a short image: */
+                  if (PNG_PASS_COLS(width, pass) == 0)
+                     continue;
+
+                  startx = PNG_PASS_START_COL(pass) * outchannels;
+                  stepx = PNG_PASS_COL_OFFSET(pass) * outchannels;
+                  y = PNG_PASS_START_ROW(pass);
+                  stepy = PNG_PASS_ROW_OFFSET(pass);
+               }
+
+               else
+               {
+                  y = 0;
+                  startx = 0;
+                  stepx = outchannels;
+                  stepy = 1;
+               }
+
+               for (; y<height; y += stepy)
+               {
+                  png_const_uint_16p inrow;
+                  png_uint_16p outrow = first_row + y*step_row;
+                  png_uint_16p end_row = outrow + width * outchannels;
+
+                  /* Read the row, which is packed: */
+                  png_read_row(png_ptr, png_voidcast(png_bytep,
+                     display->local_row), NULL);
+                  inrow = png_voidcast(png_const_uint_16p, display->local_row);
+
+                  /* Now do the pre-multiplication on each pixel in this row.
+                   */
+                  outrow += startx;
+                  for (; outrow < end_row; outrow += stepx)
+                  {
+                     png_uint_32 component = inrow[0];
+                     png_uint_16 alpha = inrow[1];
+
+                     if (alpha > 0) /* else 0 */
+                     {
+                        if (alpha < 65535) /* else just use component */
+                        {
+                           component *= alpha;
+                           component += 32767;
+                           component /= 65535;
+                        }
+                     }
+
+                     else
+                        component = 0;
+
+                     outrow[swap_alpha] = (png_uint_16)component;
+                     if (preserve_alpha)
+                        outrow[1 ^ swap_alpha] = alpha;
+
+                     inrow += 2; /* components and alpha channel */
+                  }
+               }
+            }
+         }
+         break;
+   }
+
+   return 1;
+}
+
+/* The guts of png_image_finish_read as a png_safe_execute callback. */
+static int
+png_image_read_direct(png_voidp argument)
+{
+   png_image_read_control *display = png_voidcast(png_image_read_control*,
+      argument);
+   png_imagep image = display->image;
+   png_structrp png_ptr = image->opaque->png_ptr;
+   png_inforp info_ptr = image->opaque->info_ptr;
+
+   png_uint_32 format = image->format;
+   int linear = (format & PNG_FORMAT_FLAG_LINEAR) != 0;
+   int do_local_compose = 0;
+   int do_local_background = 0; /* to avoid double gamma correction bug */
+   int passes = 0;
+
+   /* Add transforms to ensure the correct output format is produced then check
+    * that the required implementation support is there.  Always expand; always
+    * need 8 bits minimum, no palette and expanded tRNS.
+    */
+   png_set_expand(png_ptr);
+
+   /* Now check the format to see if it was modified. */
+   {
+      png_uint_32 base_format = png_image_format(png_ptr) &
+         ~PNG_FORMAT_FLAG_COLORMAP /* removed by png_set_expand */;
+      png_uint_32 change = format ^ base_format;
+      png_fixed_point output_gamma;
+      int mode; /* alpha mode */
+
+      /* Do this first so that we have a record if rgb to gray is happening. */
+      if (change & PNG_FORMAT_FLAG_COLOR)
+      {
+         /* gray<->color transformation required. */
+         if (format & PNG_FORMAT_FLAG_COLOR)
+            png_set_gray_to_rgb(png_ptr);
+
+         else
+         {
+            /* libpng can't do both rgb to gray and
+             * background/pre-multiplication if there is also significant gamma
+             * correction, because both operations require linear colors and
+             * the code only supports one transform doing the gamma correction.
+             * Handle this by doing the pre-multiplication or background
+             * operation in this code, if necessary.
+             *
+             * TODO: fix this by rewriting pngrtran.c (!)
+             *
+             * For the moment (given that fixing this in pngrtran.c is an
+             * enormous change) 'do_local_background' is used to indicate that
+             * the problem exists.
+             */
+            if (base_format & PNG_FORMAT_FLAG_ALPHA)
+               do_local_background = 1/*maybe*/;
+
+            png_set_rgb_to_gray_fixed(png_ptr, PNG_ERROR_ACTION_NONE,
+               PNG_RGB_TO_GRAY_DEFAULT, PNG_RGB_TO_GRAY_DEFAULT);
+         }
+
+         change &= ~PNG_FORMAT_FLAG_COLOR;
+      }
+
+      /* Set the gamma appropriately, linear for 16-bit input, sRGB otherwise.
+       */
+      {
+         png_fixed_point input_gamma_default;
+
+         if (base_format & PNG_FORMAT_FLAG_LINEAR)
+            input_gamma_default = PNG_GAMMA_LINEAR;
+         else
+            input_gamma_default = PNG_DEFAULT_sRGB;
+
+         /* Call png_set_alpha_mode to set the default for the input gamma; the
+          * output gamma is set by a second call below.
+          */
+         png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, input_gamma_default);
+      }
+
+      if (linear)
+      {
+         /* If there *is* an alpha channel in the input it must be multiplied
+          * out; use PNG_ALPHA_STANDARD, otherwise just use PNG_ALPHA_PNG.
+          */
+         if (base_format & PNG_FORMAT_FLAG_ALPHA)
+            mode = PNG_ALPHA_STANDARD; /* associated alpha */
+
+         else
+            mode = PNG_ALPHA_PNG;
+
+         output_gamma = PNG_GAMMA_LINEAR;
+      }
+
+      else
+      {
+         mode = PNG_ALPHA_PNG;
+         output_gamma = PNG_DEFAULT_sRGB;
+      }
+
+      /* If 'do_local_background' is set check for the presence of gamma
+       * correction; this is part of the work-round for the libpng bug
+       * described above.
+       *
+       * TODO: fix libpng and remove this.
+       */
+      if (do_local_background)
+      {
+         png_fixed_point gtest;
+
+         /* This is 'png_gamma_threshold' from pngrtran.c; the test used for
+          * gamma correction, the screen gamma hasn't been set on png_struct
+          * yet; it's set below.  png_struct::gamma, however, is set to the
+          * final value.
+          */
+         if (png_muldiv(&gtest, output_gamma, png_ptr->colorspace.gamma,
+               PNG_FP_1) && !png_gamma_significant(gtest))
+            do_local_background = 0;
+
+         else if (mode == PNG_ALPHA_STANDARD)
+         {
+            do_local_background = 2/*required*/;
+            mode = PNG_ALPHA_PNG; /* prevent libpng doing it */
+         }
+
+         /* else leave as 1 for the checks below */
+      }
+
+      /* If the bit-depth changes then handle that here. */
+      if (change & PNG_FORMAT_FLAG_LINEAR)
+      {
+         if (linear /*16-bit output*/)
+            png_set_expand_16(png_ptr);
+
+         else /* 8-bit output */
+            png_set_scale_16(png_ptr);
+
+         change &= ~PNG_FORMAT_FLAG_LINEAR;
+      }
+
+      /* Now the background/alpha channel changes. */
+      if (change & PNG_FORMAT_FLAG_ALPHA)
+      {
+         /* Removing an alpha channel requires composition for the 8-bit
+          * formats; for the 16-bit it is already done, above, by the
+          * pre-multiplication and the channel just needs to be stripped.
+          */
+         if (base_format & PNG_FORMAT_FLAG_ALPHA)
+         {
+            /* If RGB->gray is happening the alpha channel must be left and the
+             * operation completed locally.
+             *
+             * TODO: fix libpng and remove this.
+             */
+            if (do_local_background)
+               do_local_background = 2/*required*/;
+
+            /* 16-bit output: just remove the channel */
+            else if (linear) /* compose on black (well, pre-multiply) */
+               png_set_strip_alpha(png_ptr);
+
+            /* 8-bit output: do an appropriate compose */
+            else if (display->background != NULL)
+            {
+               png_color_16 c;
+
+               c.index = 0; /*unused*/
+               c.red = display->background->red;
+               c.green = display->background->green;
+               c.blue = display->background->blue;
+               c.gray = display->background->green;
+
+               /* This is always an 8-bit sRGB value, using the 'green' channel
+                * for gray is much better than calculating the luminance here;
+                * we can get off-by-one errors in that calculation relative to
+                * the app expectations and that will show up in transparent
+                * pixels.
+                */
+               png_set_background_fixed(png_ptr, &c,
+                  PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/,
+                  0/*gamma: not used*/);
+            }
+
+            else /* compose on row: implemented below. */
+            {
+               do_local_compose = 1;
+               /* This leaves the alpha channel in the output, so it has to be
+                * removed by the code below.  Set the encoding to the 'OPTIMIZE'
+                * one so the code only has to hack on the pixels that require
+                * composition.
+                */
+               mode = PNG_ALPHA_OPTIMIZED;
+            }
+         }
+
+         else /* output needs an alpha channel */
+         {
+            /* This is tricky because it happens before the swap operation has
+             * been accomplished; however, the swap does *not* swap the added
+             * alpha channel (weird API), so it must be added in the correct
+             * place.
+             */
+            png_uint_32 filler; /* opaque filler */
+            int where;
+
+            if (linear)
+               filler = 65535;
+
+            else
+               filler = 255;
+
+#           ifdef PNG_FORMAT_AFIRST_SUPPORTED
+               if (format & PNG_FORMAT_FLAG_AFIRST)
+               {
+                  where = PNG_FILLER_BEFORE;
+                  change &= ~PNG_FORMAT_FLAG_AFIRST;
+               }
+
+               else
+#           endif
+               where = PNG_FILLER_AFTER;
+
+            png_set_add_alpha(png_ptr, filler, where);
+         }
+
+         /* This stops the (irrelevant) call to swap_alpha below. */
+         change &= ~PNG_FORMAT_FLAG_ALPHA;
+      }
+
+      /* Now set the alpha mode correctly; this is always done, even if there is
+       * no alpha channel in either the input or the output because it correctly
+       * sets the output gamma.
+       */
+      png_set_alpha_mode_fixed(png_ptr, mode, output_gamma);
+
+#     ifdef PNG_FORMAT_BGR_SUPPORTED
+         if (change & PNG_FORMAT_FLAG_BGR)
+         {
+            /* Check only the output format; PNG is never BGR; don't do this if
+             * the output is gray, but fix up the 'format' value in that case.
+             */
+            if (format & PNG_FORMAT_FLAG_COLOR)
+               png_set_bgr(png_ptr);
+
+            else
+               format &= ~PNG_FORMAT_FLAG_BGR;
+
+            change &= ~PNG_FORMAT_FLAG_BGR;
+         }
+#     endif
+
+#     ifdef PNG_FORMAT_AFIRST_SUPPORTED
+         if (change & PNG_FORMAT_FLAG_AFIRST)
+         {
+            /* Only relevant if there is an alpha channel - it's particularly
+             * important to handle this correctly because do_local_compose may
+             * be set above and then libpng will keep the alpha channel for this
+             * code to remove.
+             */
+            if (format & PNG_FORMAT_FLAG_ALPHA)
+            {
+               /* Disable this if doing a local background,
+                * TODO: remove this when local background is no longer required.
+                */
+               if (do_local_background != 2)
+                  png_set_swap_alpha(png_ptr);
+            }
+
+            else
+               format &= ~PNG_FORMAT_FLAG_AFIRST;
+
+            change &= ~PNG_FORMAT_FLAG_AFIRST;
+         }
+#     endif
+
+      /* If the *output* is 16-bit then we need to check for a byte-swap on this
+       * architecture.
+       */
+      if (linear)
+      {
+         PNG_CONST png_uint_16 le = 0x0001;
+
+         if (*(png_const_bytep)&le)
+            png_set_swap(png_ptr);
+      }
+
+      /* If change is not now 0 some transformation is missing - error out. */
+      if (change)
+         png_error(png_ptr, "png_read_image: unsupported transformation");
+   }
+
+   PNG_SKIP_CHUNKS(png_ptr);
+
+   /* Update the 'info' structure and make sure the result is as required; first
+    * make sure to turn on the interlace handling if it will be required
+    * (because it can't be turned on *after* the call to png_read_update_info!)
+    *
+    * TODO: remove the do_local_background fixup below.
+    */
+   if (!do_local_compose && do_local_background != 2)
+      passes = png_set_interlace_handling(png_ptr);
+
+   png_read_update_info(png_ptr, info_ptr);
+
+   {
+      png_uint_32 info_format = 0;
+
+      if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
+         info_format |= PNG_FORMAT_FLAG_COLOR;
+
+      if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
+      {
+         /* do_local_compose removes this channel below. */
+         if (!do_local_compose)
+         {
+            /* do_local_background does the same if required. */
+            if (do_local_background != 2 ||
+               (format & PNG_FORMAT_FLAG_ALPHA) != 0)
+               info_format |= PNG_FORMAT_FLAG_ALPHA;
+         }
+      }
+
+      else if (do_local_compose) /* internal error */
+         png_error(png_ptr, "png_image_read: alpha channel lost");
+
+      if (info_ptr->bit_depth == 16)
+         info_format |= PNG_FORMAT_FLAG_LINEAR;
+
+#     ifdef PNG_FORMAT_BGR_SUPPORTED
+         if (png_ptr->transformations & PNG_BGR)
+            info_format |= PNG_FORMAT_FLAG_BGR;
+#     endif
+
+#     ifdef PNG_FORMAT_AFIRST_SUPPORTED
+         if (do_local_background == 2)
+         {
+            if (format & PNG_FORMAT_FLAG_AFIRST)
+               info_format |= PNG_FORMAT_FLAG_AFIRST;
+         }
+
+         if ((png_ptr->transformations & PNG_SWAP_ALPHA) != 0 ||
+            ((png_ptr->transformations & PNG_ADD_ALPHA) != 0 &&
+            (png_ptr->flags & PNG_FLAG_FILLER_AFTER) == 0))
+         {
+            if (do_local_background == 2)
+               png_error(png_ptr, "unexpected alpha swap transformation");
+
+            info_format |= PNG_FORMAT_FLAG_AFIRST;
+         }
+#     endif
+
+      /* This is actually an internal error. */
+      if (info_format != format)
+         png_error(png_ptr, "png_read_image: invalid transformations");
+   }
+
+   /* Now read the rows.  If do_local_compose is set then it is necessary to use
+    * a local row buffer.  The output will be GA, RGBA or BGRA and must be
+    * converted to G, RGB or BGR as appropriate.  The 'local_row' member of the
+    * display acts as a flag.
+    */
+   {
+      png_voidp first_row = display->buffer;
+      ptrdiff_t row_bytes = display->row_stride;
+
+      if (linear)
+         row_bytes *= 2;
+
+      /* The following expression is designed to work correctly whether it gives
+       * a signed or an unsigned result.
+       */
+      if (row_bytes < 0)
+      {
+         char *ptr = png_voidcast(char*, first_row);
+         ptr += (image->height-1) * (-row_bytes);
+         first_row = png_voidcast(png_voidp, ptr);
+      }
+
+      display->first_row = first_row;
+      display->row_bytes = row_bytes;
+   }
+
+   if (do_local_compose)
+   {
+      int result;
+      png_voidp row = png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr));
+
+      display->local_row = row;
+      result = png_safe_execute(image, png_image_read_composite, display);
+      display->local_row = NULL;
+      png_free(png_ptr, row);
+
+      return result;
+   }
+
+   else if (do_local_background == 2)
+   {
+      int result;
+      png_voidp row = png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr));
+
+      display->local_row = row;
+      result = png_safe_execute(image, png_image_read_background, display);
+      display->local_row = NULL;
+      png_free(png_ptr, row);
+
+      return result;
+   }
+
+   else
+   {
+      png_alloc_size_t row_bytes = display->row_bytes;
+
+      while (--passes >= 0)
+      {
+         png_uint_32      y = image->height;
+         png_bytep        row = png_voidcast(png_bytep, display->first_row);
+
+         while (y-- > 0)
+         {
+            png_read_row(png_ptr, row, NULL);
+            row += row_bytes;
+         }
+      }
+
+      return 1;
+   }
+}
+
+int PNGAPI
+png_image_finish_read(png_imagep image, png_const_colorp background,
+   void *buffer, png_int_32 row_stride, void *colormap)
+{
+   if (image != NULL && image->version == PNG_IMAGE_VERSION)
+   {
+      png_uint_32 check;
+
+      if (row_stride == 0)
+         row_stride = PNG_IMAGE_ROW_STRIDE(*image);
+
+      if (row_stride < 0)
+         check = -row_stride;
+
+      else
+         check = row_stride;
+
+      if (image->opaque != NULL && buffer != NULL &&
+         check >= PNG_IMAGE_ROW_STRIDE(*image))
+      {
+         if ((image->format & PNG_FORMAT_FLAG_COLORMAP) == 0 ||
+            (image->colormap_entries > 0 && colormap != NULL))
+         {
+            int result;
+            png_image_read_control display;
+
+            memset(&display, 0, (sizeof display));
+            display.image = image;
+            display.buffer = buffer;
+            display.row_stride = row_stride;
+            display.colormap = colormap;
+            display.background = background;
+            display.local_row = NULL;
+
+            /* Choose the correct 'end' routine; for the color-map case all the
+             * setup has already been done.
+             */
+            if (image->format & PNG_FORMAT_FLAG_COLORMAP)
+               result =
+                  png_safe_execute(image, png_image_read_colormap, &display) &&
+                  png_safe_execute(image, png_image_read_colormapped, &display);
+
+            else
+               result =
+                  png_safe_execute(image, png_image_read_direct, &display);
+
+            png_image_free(image);
+            return result;
+         }
+
+         else
+            return png_image_error(image,
+               "png_image_finish_read[color-map]: no color-map");
+      }
+
+      else
+         return png_image_error(image,
+            "png_image_finish_read: invalid argument");
+   }
+
+   else if (image != NULL)
+      return png_image_error(image,
+         "png_image_finish_read: damaged PNG_IMAGE_VERSION");
+
+   return 0;
+}
+
+#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */
 #endif /* PNG_READ_SUPPORTED */
index e9c381c5ba41f79eaaae9770cf7f0c7e222d2186..d7864407bd8dacd0535b09ad70282a4538bc2034 100644 (file)
@@ -1,8 +1,8 @@
 
 /* pngrio.c - functions for data input
  *
- * Last changed in libpng 1.5.0 [January 6, 2011]
- * Copyright (c) 1998-2011 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.0 [February 14, 2013]
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -29,7 +29,7 @@
  * to read more then 64K on a 16 bit machine.
  */
 void /* PRIVATE */
-png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
+png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length)
 {
    png_debug1(4, "reading %d bytes", (int)length);
 
@@ -46,7 +46,6 @@ png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
  * read_data function and use it at run time with png_set_read_fn(), rather
  * than changing the library.
  */
-#  ifndef USE_FAR_KEYWORD
 void PNGCBAPI
 png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
 {
@@ -58,68 +57,11 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
    /* fread() returns 0 on error, so it is OK to store this in a png_size_t
     * instead of an int, which is what fread() actually returns.
     */
-   check = fread(data, 1, length, (png_FILE_p)png_ptr->io_ptr);
+   check = fread(data, 1, length, png_voidcast(png_FILE_p, png_ptr->io_ptr));
 
    if (check != length)
       png_error(png_ptr, "Read Error");
 }
-#  else
-/* This is the model-independent version. Since the standard I/O library
-   can't handle far buffers in the medium and small models, we have to copy
-   the data.
-*/
-
-#define NEAR_BUF_SIZE 1024
-#define MIN(a,b) (a <= b ? a : b)
-
-static void PNGCBAPI
-png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
-{
-   png_size_t check;
-   png_byte *n_data;
-   png_FILE_p io_ptr;
-
-   if (png_ptr == NULL)
-      return;
-
-   /* Check if data really is near. If so, use usual code. */
-   n_data = (png_byte *)CVT_PTR_NOCHECK(data);
-   io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
-
-   if ((png_bytep)n_data == data)
-   {
-      check = fread(n_data, 1, length, io_ptr);
-   }
-
-   else
-   {
-      png_byte buf[NEAR_BUF_SIZE];
-      png_size_t read, remaining, err;
-      check = 0;
-      remaining = length;
-
-      do
-      {
-         read = MIN(NEAR_BUF_SIZE, remaining);
-         err = fread(buf, 1, read, io_ptr);
-         png_memcpy(data, buf, read); /* copy far buffer to near buffer */
-
-         if (err != read)
-            break;
-
-         else
-            check += err;
-
-         data += read;
-         remaining -= read;
-      }
-      while (remaining != 0);
-   }
-
-   if ((png_uint_32)check != (png_uint_32)length)
-      png_error(png_ptr, "read Error");
-}
-#  endif
 #endif
 
 /* This function allows the application to supply a new input function
@@ -142,7 +84,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
  *                be used.
  */
 void PNGAPI
-png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
+png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
    png_rw_ptr read_data_fn)
 {
    if (png_ptr == NULL)
index 064d92b7e44967f9acc720338e3b5192a6e44f9c..a485cacc4f76dffc73c0b5a17e776c2a7a717901 100644 (file)
@@ -1,7 +1,7 @@
 
 /* pngrtran.c - transforms the data in a row for PNG readers
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
+ * Last changed in libpng 1.6.0 [February 14, 2013]
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -22,7 +22,7 @@
 
 /* Set the action on getting a CRC error for an ancillary or critical chunk. */
 void PNGAPI
-png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action)
+png_set_crc_action(png_structrp png_ptr, int crit_action, int ancil_action)
 {
    png_debug(1, "in png_set_crc_action");
 
@@ -88,16 +88,46 @@ png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action)
    }
 }
 
+#ifdef PNG_READ_TRANSFORMS_SUPPORTED
+/* Is it OK to set a transformation now?  Only if png_start_read_image or
+ * png_read_update_info have not been called.  It is not necessary for the IHDR
+ * to have been read in all cases, the parameter allows for this check too.
+ */
+static int
+png_rtran_ok(png_structrp png_ptr, int need_IHDR)
+{
+   if (png_ptr != NULL)
+   {
+      if (png_ptr->flags & PNG_FLAG_ROW_INIT)
+         png_app_error(png_ptr,
+            "invalid after png_start_read_image or png_read_update_info");
+
+      else if (need_IHDR && (png_ptr->mode & PNG_HAVE_IHDR) == 0)
+         png_app_error(png_ptr, "invalid before the PNG header has been read");
+
+      else
+      {
+         /* Turn on failure to initialize correctly for all transforms. */
+         png_ptr->flags |= PNG_FLAG_DETECT_UNINITIALIZED;
+
+         return 1; /* Ok */
+      }
+   }
+
+   return 0; /* no png_error possible! */
+}
+#endif
+
 #ifdef PNG_READ_BACKGROUND_SUPPORTED
 /* Handle alpha and tRNS via a background color */
 void PNGFAPI
-png_set_background_fixed(png_structp png_ptr,
+png_set_background_fixed(png_structrp png_ptr,
     png_const_color_16p background_color, int background_gamma_code,
     int need_expand, png_fixed_point background_gamma)
 {
    png_debug(1, "in png_set_background_fixed");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0) || background_color == NULL)
       return;
 
    if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN)
@@ -110,8 +140,7 @@ png_set_background_fixed(png_structp png_ptr,
    png_ptr->transformations &= ~PNG_ENCODE_ALPHA;
    png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA;
 
-   png_memcpy(&(png_ptr->background), background_color,
-      png_sizeof(png_color_16));
+   png_ptr->background = *background_color;
    png_ptr->background_gamma = background_gamma;
    png_ptr->background_gamma_type = (png_byte)(background_gamma_code);
    if (need_expand)
@@ -122,7 +151,7 @@ png_set_background_fixed(png_structp png_ptr,
 
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 void PNGAPI
-png_set_background(png_structp png_ptr,
+png_set_background(png_structrp png_ptr,
     png_const_color_16p background_color, int background_gamma_code,
     int need_expand, double background_gamma)
 {
@@ -138,11 +167,11 @@ png_set_background(png_structp png_ptr,
  */
 #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
 void PNGAPI
-png_set_scale_16(png_structp png_ptr)
+png_set_scale_16(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_scale_16");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    png_ptr->transformations |= PNG_SCALE_16_TO_8;
@@ -152,11 +181,11 @@ png_set_scale_16(png_structp png_ptr)
 #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
 /* Chop 16-bit depth files to 8-bit depth */
 void PNGAPI
-png_set_strip_16(png_structp png_ptr)
+png_set_strip_16(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_strip_16");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    png_ptr->transformations |= PNG_16_TO_8;
@@ -165,11 +194,11 @@ png_set_strip_16(png_structp png_ptr)
 
 #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
 void PNGAPI
-png_set_strip_alpha(png_structp png_ptr)
+png_set_strip_alpha(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_strip_alpha");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    png_ptr->transformations |= PNG_STRIP_ALPHA;
@@ -178,7 +207,7 @@ png_set_strip_alpha(png_structp png_ptr)
 
 #if defined(PNG_READ_ALPHA_MODE_SUPPORTED) || defined(PNG_READ_GAMMA_SUPPORTED)
 static png_fixed_point
-translate_gamma_flags(png_structp png_ptr, png_fixed_point output_gamma,
+translate_gamma_flags(png_structrp png_ptr, png_fixed_point output_gamma,
    int is_screen)
 {
    /* Check for flag values.  The main reason for having the old Mac value as a
@@ -215,7 +244,7 @@ translate_gamma_flags(png_structp png_ptr, png_fixed_point output_gamma,
 
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 static png_fixed_point
-convert_gamma_value(png_structp png_ptr, double output_gamma)
+convert_gamma_value(png_structrp png_ptr, double output_gamma)
 {
    /* The following silently ignores cases where fixed point (times 100,000)
     * gamma values are passed to the floating point API.  This is safe and it
@@ -240,7 +269,7 @@ convert_gamma_value(png_structp png_ptr, double output_gamma)
 
 #ifdef PNG_READ_ALPHA_MODE_SUPPORTED
 void PNGFAPI
-png_set_alpha_mode_fixed(png_structp png_ptr, int mode,
+png_set_alpha_mode_fixed(png_structrp png_ptr, int mode,
    png_fixed_point output_gamma)
 {
    int compose = 0;
@@ -248,7 +277,7 @@ png_set_alpha_mode_fixed(png_structp png_ptr, int mode,
 
    png_debug(1, "in png_set_alpha_mode");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    output_gamma = translate_gamma_flags(png_ptr, output_gamma, 1/*screen*/);
@@ -320,8 +349,11 @@ png_set_alpha_mode_fixed(png_structp png_ptr, int mode,
     * the side effect that the gamma in a second call to png_set_alpha_mode will
     * be ignored.)
     */
-   if (png_ptr->gamma == 0)
-      png_ptr->gamma = file_gamma;
+   if (png_ptr->colorspace.gamma == 0)
+   {
+      png_ptr->colorspace.gamma = file_gamma;
+      png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA;
+   }
 
    /* But always set the output gamma: */
    png_ptr->screen_gamma = output_gamma;
@@ -332,8 +364,8 @@ png_set_alpha_mode_fixed(png_structp png_ptr, int mode,
    if (compose)
    {
       /* And obtain alpha pre-multiplication by composing on black: */
-      png_memset(&png_ptr->background, 0, sizeof png_ptr->background);
-      png_ptr->background_gamma = png_ptr->gamma; /* just in case */
+      memset(&png_ptr->background, 0, (sizeof png_ptr->background));
+      png_ptr->background_gamma = png_ptr->colorspace.gamma; /* just in case */
       png_ptr->background_gamma_type = PNG_BACKGROUND_GAMMA_FILE;
       png_ptr->transformations &= ~PNG_BACKGROUND_EXPAND;
 
@@ -343,14 +375,11 @@ png_set_alpha_mode_fixed(png_structp png_ptr, int mode,
 
       png_ptr->transformations |= PNG_COMPOSE;
    }
-
-   /* New API, make sure apps call the correct initializers: */
-   png_ptr->flags |= PNG_FLAG_DETECT_UNINITIALIZED;
 }
 
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 void PNGAPI
-png_set_alpha_mode(png_structp png_ptr, int mode, double output_gamma)
+png_set_alpha_mode(png_structrp png_ptr, int mode, double output_gamma)
 {
    png_set_alpha_mode_fixed(png_ptr, mode, convert_gamma_value(png_ptr,
       output_gamma));
@@ -370,21 +399,21 @@ png_set_alpha_mode(png_structp png_ptr, int mode, double output_gamma)
 
 typedef struct png_dsort_struct
 {
-   struct png_dsort_struct FAR * next;
+   struct png_dsort_struct * next;
    png_byte left;
    png_byte right;
 } png_dsort;
-typedef png_dsort FAR *       png_dsortp;
-typedef png_dsort FAR * FAR * png_dsortpp;
+typedef png_dsort *   png_dsortp;
+typedef png_dsort * * png_dsortpp;
 
 void PNGAPI
-png_set_quantize(png_structp png_ptr, png_colorp palette,
+png_set_quantize(png_structrp png_ptr, png_colorp palette,
     int num_palette, int maximum_colors, png_const_uint_16p histogram,
     int full_quantize)
 {
    png_debug(1, "in png_set_quantize");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    png_ptr->transformations |= PNG_QUANTIZE;
@@ -394,7 +423,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
       int i;
 
       png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
-          (png_uint_32)(num_palette * png_sizeof(png_byte)));
+          (png_uint_32)(num_palette * (sizeof (png_byte))));
       for (i = 0; i < num_palette; i++)
          png_ptr->quantize_index[i] = (png_byte)i;
    }
@@ -411,7 +440,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
 
          /* Initialize an array to sort colors */
          png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)(num_palette * png_sizeof(png_byte)));
+             (png_uint_32)(num_palette * (sizeof (png_byte))));
 
          /* Initialize the quantize_sort array */
          for (i = 0; i < num_palette; i++)
@@ -545,9 +574,9 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
 
          /* Initialize palette index arrays */
          png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)(num_palette * png_sizeof(png_byte)));
+             (png_uint_32)(num_palette * (sizeof (png_byte))));
          png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)(num_palette * png_sizeof(png_byte)));
+             (png_uint_32)(num_palette * (sizeof (png_byte))));
 
          /* Initialize the sort array */
          for (i = 0; i < num_palette; i++)
@@ -557,7 +586,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
          }
 
          hash = (png_dsortpp)png_calloc(png_ptr, (png_uint_32)(769 *
-             png_sizeof(png_dsortp)));
+             (sizeof (png_dsortp))));
 
          num_new_palette = num_palette;
 
@@ -587,7 +616,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
                   {
 
                      t = (png_dsortp)png_malloc_warn(png_ptr,
-                         (png_uint_32)(png_sizeof(png_dsort)));
+                         (png_uint_32)(sizeof (png_dsort)));
 
                      if (t == NULL)
                          break;
@@ -712,12 +741,12 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
       png_size_t num_entries = ((png_size_t)1 << total_bits);
 
       png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
-          (png_uint_32)(num_entries * png_sizeof(png_byte)));
+          (png_uint_32)(num_entries * (sizeof (png_byte))));
 
       distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries *
-          png_sizeof(png_byte)));
+          (sizeof (png_byte))));
 
-      png_memset(distance, 0xff, num_entries * png_sizeof(png_byte));
+      memset(distance, 0xff, num_entries * (sizeof (png_byte)));
 
       for (i = 0; i < num_palette; i++)
       {
@@ -766,19 +795,18 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
 
 #ifdef PNG_READ_GAMMA_SUPPORTED
 void PNGFAPI
-png_set_gamma_fixed(png_structp png_ptr, png_fixed_point scrn_gamma,
+png_set_gamma_fixed(png_structrp png_ptr, png_fixed_point scrn_gamma,
    png_fixed_point file_gamma)
 {
    png_debug(1, "in png_set_gamma_fixed");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    /* New in libpng-1.5.4 - reserve particular negative values as flags. */
    scrn_gamma = translate_gamma_flags(png_ptr, scrn_gamma, 1/*screen*/);
    file_gamma = translate_gamma_flags(png_ptr, file_gamma, 0/*file*/);
 
-#if PNG_LIBPNG_VER >= 10600
    /* Checking the gamma values for being >0 was added in 1.5.4 along with the
     * premultiplied alpha support; this actually hides an undocumented feature
     * of the previous implementation which allowed gamma processing to be
@@ -787,26 +815,27 @@ png_set_gamma_fixed(png_structp png_ptr, png_fixed_point scrn_gamma,
     * accept '0' for the gamma value it takes, because it isn't always used.
     *
     * Since this is an API change (albeit a very minor one that removes an
-    * undocumented API feature) it will not be made until libpng-1.6.0.
+    * undocumented API feature) the following checks were only enabled in
+    * libpng-1.6.0.
     */
    if (file_gamma <= 0)
       png_error(png_ptr, "invalid file gamma in png_set_gamma");
 
    if (scrn_gamma <= 0)
       png_error(png_ptr, "invalid screen gamma in png_set_gamma");
-#endif
 
    /* Set the gamma values unconditionally - this overrides the value in the PNG
     * file if a gAMA chunk was present.  png_set_alpha_mode provides a
     * different, easier, way to default the file gamma.
     */
-   png_ptr->gamma = file_gamma;
+   png_ptr->colorspace.gamma = file_gamma;
+   png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA;
    png_ptr->screen_gamma = scrn_gamma;
 }
 
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 void PNGAPI
-png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma)
+png_set_gamma(png_structrp png_ptr, double scrn_gamma, double file_gamma)
 {
    png_set_gamma_fixed(png_ptr, convert_gamma_value(png_ptr, scrn_gamma),
       convert_gamma_value(png_ptr, file_gamma));
@@ -820,15 +849,14 @@ png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma)
  * to alpha channels.
  */
 void PNGAPI
-png_set_expand(png_structp png_ptr)
+png_set_expand(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_expand");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
-   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
 }
 
 /* GRR 19990627:  the following three functions currently are identical
@@ -851,40 +879,38 @@ png_set_expand(png_structp png_ptr)
 
 /* Expand paletted images to RGB. */
 void PNGAPI
-png_set_palette_to_rgb(png_structp png_ptr)
+png_set_palette_to_rgb(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_palette_to_rgb");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
-   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
 }
 
 /* Expand grayscale images of less than 8-bit depth to 8 bits. */
 void PNGAPI
-png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
+png_set_expand_gray_1_2_4_to_8(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_expand_gray_1_2_4_to_8");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    png_ptr->transformations |= PNG_EXPAND;
-   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
 }
 
-
-
 /* Expand tRNS chunks to alpha channels. */
 void PNGAPI
-png_set_tRNS_to_alpha(png_structp png_ptr)
+png_set_tRNS_to_alpha(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_tRNS_to_alpha");
 
+   if (!png_rtran_ok(png_ptr, 0))
+      return;
+
    png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
-   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
 }
 #endif /* defined(PNG_READ_EXPAND_SUPPORTED) */
 
@@ -893,45 +919,42 @@ png_set_tRNS_to_alpha(png_structp png_ptr)
  * it may not work correctly.)
  */
 void PNGAPI
-png_set_expand_16(png_structp png_ptr)
+png_set_expand_16(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_expand_16");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
    png_ptr->transformations |= (PNG_EXPAND_16 | PNG_EXPAND | PNG_EXPAND_tRNS);
-   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
-
-   /* New API, make sure apps call the correct initializers: */
-   png_ptr->flags |= PNG_FLAG_DETECT_UNINITIALIZED;
 }
 #endif
 
 #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
 void PNGAPI
-png_set_gray_to_rgb(png_structp png_ptr)
+png_set_gray_to_rgb(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_gray_to_rgb");
 
-   if (png_ptr != NULL)
-   {
-      /* Because rgb must be 8 bits or more: */
-      png_set_expand_gray_1_2_4_to_8(png_ptr);
-      png_ptr->transformations |= PNG_GRAY_TO_RGB;
-      png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
-   }
+   if (!png_rtran_ok(png_ptr, 0))
+      return;
+
+   /* Because rgb must be 8 bits or more: */
+   png_set_expand_gray_1_2_4_to_8(png_ptr);
+   png_ptr->transformations |= PNG_GRAY_TO_RGB;
 }
 #endif
 
 #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
 void PNGFAPI
-png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
+png_set_rgb_to_gray_fixed(png_structrp png_ptr, int error_action,
     png_fixed_point red, png_fixed_point green)
 {
    png_debug(1, "in png_set_rgb_to_gray");
 
-   if (png_ptr == NULL)
+   /* Need the IHDR here because of the check on color_type below. */
+   /* TODO: fix this */
+   if (!png_rtran_ok(png_ptr, 1))
       return;
 
    switch(error_action)
@@ -952,15 +975,19 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
          png_error(png_ptr, "invalid error action to rgb_to_gray");
          break;
    }
+
    if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 #ifdef PNG_READ_EXPAND_SUPPORTED
       png_ptr->transformations |= PNG_EXPAND;
 #else
    {
-      png_warning(png_ptr,
+      /* Make this an error in 1.6 because otherwise the application may assume
+       * that it just worked and get a memory overwrite.
+       */
+      png_error(png_ptr,
         "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED");
 
-      png_ptr->transformations &= ~PNG_RGB_TO_GRAY;
+      /* png_ptr->transformations &= ~PNG_RGB_TO_GRAY; */
    }
 #endif
    {
@@ -984,7 +1011,7 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
       else
       {
          if (red >= 0 && green >= 0)
-            png_warning(png_ptr,
+            png_app_warning(png_ptr,
                "ignoring out of range rgb_to_gray coefficients");
 
          /* Use the defaults, from the cHRM chunk if set, else the historical
@@ -1010,29 +1037,26 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
  */
 
 void PNGAPI
-png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red,
+png_set_rgb_to_gray(png_structrp png_ptr, int error_action, double red,
    double green)
 {
-   if (png_ptr == NULL)
-      return;
-
    png_set_rgb_to_gray_fixed(png_ptr, error_action,
       png_fixed(png_ptr, red, "rgb to gray red coefficient"),
       png_fixed(png_ptr, green, "rgb to gray green coefficient"));
 }
 #endif /* FLOATING POINT */
 
-#endif
+#endif /* RGB_TO_GRAY */
 
 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
     defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
 void PNGAPI
-png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
+png_set_read_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr
     read_user_transform_fn)
 {
    png_debug(1, "in png_set_read_user_transform_fn");
 
-   if (png_ptr == NULL)
+   if (!png_rtran_ok(png_ptr, 0))
       return;
 
 #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
@@ -1074,7 +1098,7 @@ png_gamma_threshold(png_fixed_point screen_gamma, png_fixed_point file_gamma)
  * extracted from 'png_init_read_transformations'.
  */
 static void /* PRIVATE */
-png_init_palette_transformations(png_structp png_ptr)
+png_init_palette_transformations(png_structrp png_ptr)
 {
    /* Called to handle the (input) palette case.  In png_do_read_transformations
     * the first step is to expand the palette if requested, so this code must
@@ -1157,7 +1181,7 @@ png_init_palette_transformations(png_structp png_ptr)
 }
 
 static void /* PRIVATE */
-png_init_rgb_transformations(png_structp png_ptr)
+png_init_rgb_transformations(png_structrp png_ptr)
 {
    /* Added to libpng-1.5.4: check the color type to determine whether there
     * is any alpha or transparency in the image and simply cancel the
@@ -1221,7 +1245,7 @@ png_init_rgb_transformations(png_structp png_ptr)
             default:
 
             case 8:
-               /* FALL THROUGH (already 8 bits) */
+               /* FALL THROUGH (Already 8 bits) */
 
             case 16:
                /* Already a full 16 bits */
@@ -1242,7 +1266,7 @@ png_init_rgb_transformations(png_structp png_ptr)
 }
 
 void /* PRIVATE */
-png_init_read_transformations(png_structp png_ptr)
+png_init_read_transformations(png_structrp png_ptr)
 {
    png_debug(1, "in png_init_read_transformations");
 
@@ -1267,17 +1291,17 @@ png_init_read_transformations(png_structp png_ptr)
        */
       int gamma_correction = 0;
 
-      if (png_ptr->gamma != 0) /* has been set */
+      if (png_ptr->colorspace.gamma != 0) /* has been set */
       {
          if (png_ptr->screen_gamma != 0) /* screen set too */
-            gamma_correction = png_gamma_threshold(png_ptr->gamma,
+            gamma_correction = png_gamma_threshold(png_ptr->colorspace.gamma,
                png_ptr->screen_gamma);
 
          else
             /* Assume the output matches the input; a long time default behavior
              * of libpng, although the standard has nothing to say about this.
              */
-            png_ptr->screen_gamma = png_reciprocal(png_ptr->gamma);
+            png_ptr->screen_gamma = png_reciprocal(png_ptr->colorspace.gamma);
       }
 
       else if (png_ptr->screen_gamma != 0)
@@ -1286,7 +1310,7 @@ png_init_read_transformations(png_structp png_ptr)
           * png_set_alpha_mode (even if the alpha handling mode isn't required
           * or isn't changed from the default.)
           */
-         png_ptr->gamma = png_reciprocal(png_ptr->screen_gamma);
+         png_ptr->colorspace.gamma = png_reciprocal(png_ptr->screen_gamma);
 
       else /* neither are set */
          /* Just in case the following prevents any processing - file and screen
@@ -1294,7 +1318,10 @@ png_init_read_transformations(png_structp png_ptr)
           * third gamma value other than png_set_background with 'UNIQUE', and,
           * prior to 1.5.4
           */
-         png_ptr->screen_gamma = png_ptr->gamma = PNG_FP_1;
+         png_ptr->screen_gamma = png_ptr->colorspace.gamma = PNG_FP_1;
+
+      /* We have a gamma value now. */
+      png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA;
 
       /* Now turn the gamma transformation on or off as appropriate.  Notice
        * that PNG_GAMMA just refers to the file->screen correction.  Alpha
@@ -1376,9 +1403,16 @@ png_init_read_transformations(png_structp png_ptr)
    }
 #endif
 
-#if defined(PNG_READ_EXPAND_SUPPORTED) && \
-   defined(PNG_READ_BACKGROUND_SUPPORTED) && \
-   defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
+#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+   /* Make sure the coefficients for the rgb to gray conversion are set
+    * appropriately.
+    */
+   if (png_ptr->transformations & PNG_RGB_TO_GRAY)
+      png_colorspace_set_rgb_coefficients(png_ptr);
+#endif
+
+#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
+#if defined PNG_READ_EXPAND_SUPPORTED && defined PNG_READ_BACKGROUND_SUPPORTED
    /* Detect gray background and attempt to enable optimization for
     * gray --> RGB case.
     *
@@ -1420,7 +1454,8 @@ png_init_read_transformations(png_structp png_ptr)
          }
       }
    }
-#endif /* PNG_READ_GRAY_TO_RGB_SUPPORTED (etc) */
+#endif /* PNG_READ_EXPAND_SUPPORTED && PNG_READ_BACKGROUND_SUPPORTED */
+#endif /* PNG_READ_GRAY_TO_RGB_SUPPORTED */
 
    /* For indexed PNG data (PNG_COLOR_TYPE_PALETTE) many of the transformations
     * can be performed directly on the palette, and some (such as rgb to gray)
@@ -1456,7 +1491,7 @@ png_init_read_transformations(png_structp png_ptr)
        * NOTE: this discards the low 16 bits of the user supplied background
        * color, but until expand_16 works properly there is no choice!
        */
-#     define CHOP(x) (x)=((png_uint_16)(((png_uint_32)(x)*255+32895) >> 16))
+#     define CHOP(x) (x)=((png_uint_16)PNG_DIV257(x))
       CHOP(png_ptr->background.red);
       CHOP(png_ptr->background.green);
       CHOP(png_ptr->background.blue);
@@ -1516,10 +1551,10 @@ png_init_read_transformations(png_structp png_ptr)
     */
    if ((png_ptr->transformations & PNG_GAMMA)
       || ((png_ptr->transformations & PNG_RGB_TO_GRAY)
-         && (png_gamma_significant(png_ptr->gamma) ||
+         && (png_gamma_significant(png_ptr->colorspace.gamma) ||
             png_gamma_significant(png_ptr->screen_gamma)))
       || ((png_ptr->transformations & PNG_COMPOSE)
-         && (png_gamma_significant(png_ptr->gamma)
+         && (png_gamma_significant(png_ptr->colorspace.gamma)
             || png_gamma_significant(png_ptr->screen_gamma)
 #  ifdef PNG_READ_BACKGROUND_SUPPORTED
             || (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_UNIQUE
@@ -1576,8 +1611,8 @@ png_init_read_transformations(png_structp png_ptr)
                      break;
 
                   case PNG_BACKGROUND_GAMMA_FILE:
-                     g = png_reciprocal(png_ptr->gamma);
-                     gs = png_reciprocal2(png_ptr->gamma,
+                     g = png_reciprocal(png_ptr->colorspace.gamma);
+                     gs = png_reciprocal2(png_ptr->colorspace.gamma,
                         png_ptr->screen_gamma);
                      break;
 
@@ -1685,8 +1720,9 @@ png_init_read_transformations(png_structp png_ptr)
                   break;
 
                case PNG_BACKGROUND_GAMMA_FILE:
-                  g = png_reciprocal(png_ptr->gamma);
-                  gs = png_reciprocal2(png_ptr->gamma, png_ptr->screen_gamma);
+                  g = png_reciprocal(png_ptr->colorspace.gamma);
+                  gs = png_reciprocal2(png_ptr->colorspace.gamma,
+                     png_ptr->screen_gamma);
                   break;
 
                case PNG_BACKGROUND_GAMMA_UNIQUE:
@@ -1877,7 +1913,7 @@ png_init_read_transformations(png_structp png_ptr)
  * assuming the transformations result in valid PNG data.
  */
 void /* PRIVATE */
-png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
+png_read_transform_info(png_structrp png_ptr, png_inforp info_ptr)
 {
    png_debug(1, "in png_read_transform_info");
 
@@ -1928,8 +1964,12 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
     * however it seems that the code in png_init_read_transformations, which has
     * been called before this from png_read_update_info->png_read_start_row
     * sometimes does the gamma transform and cancels the flag.
+    *
+    * TODO: this looks wrong; the info_ptr should end up with a gamma equal to
+    * the screen_gamma value.  The following probably results in weirdness if
+    * the info_ptr is used by the app after the rows have been read.
     */
-   info_ptr->gamma = png_ptr->gamma;
+   info_ptr->colorspace.gamma = png_ptr->colorspace.gamma;
 #endif
 
    if (info_ptr->bit_depth == 16)
@@ -2077,7 +2117,7 @@ defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
  * decide how it fits in with the other transformations here.
  */
 void /* PRIVATE */
-png_do_read_transformations(png_structp png_ptr, png_row_infop row_info)
+png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
 {
    png_debug(1, "in png_do_read_transformations");
 
@@ -2092,8 +2132,9 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info)
 
    /* The following is debugging; prior to 1.5.4 the code was never compiled in;
     * in 1.5.4 PNG_FLAG_DETECT_UNINITIALIZED was added and the macro
-    * PNG_WARN_UNINITIALIZED_ROW removed.  In 1.5 the new flag is set only for
-    * selected new APIs to ensure that there is no API change.
+    * PNG_WARN_UNINITIALIZED_ROW removed.  In 1.6 the new flag is set only for
+    * all transformations, however in practice the ROW_INIT always gets done on
+    * demand, if necessary.
     */
    if ((png_ptr->flags & PNG_FLAG_DETECT_UNINITIALIZED) != 0 &&
       !(png_ptr->flags & PNG_FLAG_ROW_INIT))
@@ -3224,7 +3265,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
  *  to that used above.
  */
 int /* PRIVATE */
-png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
+png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
 
 {
    int rgb_error = 0;
@@ -3243,7 +3284,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
 
       if (row_info->bit_depth == 8)
       {
-#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
+#ifdef PNG_READ_GAMMA_SUPPORTED
          /* Notice that gamma to/from 1 are not necessarily inverses (if
           * there is an overall gamma correction).  Prior to 1.5.5 this code
           * checked the linearized values for equality; this doesn't match
@@ -3320,7 +3361,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
 
       else /* RGB bit_depth == 16 */
       {
-#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
+#ifdef PNG_READ_GAMMA_SUPPORTED
          if (png_ptr->gamma_16_to_1 != NULL && png_ptr->gamma_16_from_1 != NULL)
          {
             png_bytep sp = row;
@@ -3484,7 +3525,7 @@ png_build_grayscale_palette(int bit_depth, png_colorp palette)
  * at a gamma of 1.0.  Paletted files have already been taken care of.
  */
 void /* PRIVATE */
-png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
+png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
 {
 #ifdef PNG_READ_GAMMA_SUPPORTED
    png_const_bytep gamma_table = png_ptr->gamma_table;
@@ -3494,12 +3535,12 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
    png_const_uint_16pp gamma_16_from_1 = png_ptr->gamma_16_from_1;
    png_const_uint_16pp gamma_16_to_1 = png_ptr->gamma_16_to_1;
    int gamma_shift = png_ptr->gamma_shift;
+   int optimize = (png_ptr->flags & PNG_FLAG_OPTIMIZE_ALPHA) != 0;
 #endif
 
    png_bytep sp;
    png_uint_32 i;
    png_uint_32 row_width = row_info->width;
-   int optimize = (png_ptr->flags & PNG_FLAG_OPTIMIZE_ALPHA) != 0;
    int shift;
 
    png_debug(1, "in png_do_compose");
@@ -3520,8 +3561,9 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
                      if ((png_uint_16)((*sp >> shift) & 0x01)
                         == png_ptr->trans_color.gray)
                      {
-                        *sp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff);
-                        *sp |= (png_byte)(png_ptr->background.gray << shift);
+                        unsigned int tmp = *sp & (0x7f7f >> (7 - shift));
+                        tmp |= png_ptr->background.gray << shift;
+                        *sp = (png_byte)(tmp & 0xff);
                      }
 
                      if (!shift)
@@ -3548,17 +3590,19 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
                         if ((png_uint_16)((*sp >> shift) & 0x03)
                             == png_ptr->trans_color.gray)
                         {
-                           *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff);
-                           *sp |= (png_byte)(png_ptr->background.gray << shift);
+                           unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
+                           tmp |= png_ptr->background.gray << shift;
+                           *sp = (png_byte)(tmp & 0xff);
                         }
 
                         else
                         {
-                           png_byte p = (png_byte)((*sp >> shift) & 0x03);
-                           png_byte g = (png_byte)((gamma_table [p | (p << 2) |
-                               (p << 4) | (p << 6)] >> 6) & 0x03);
-                           *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff);
-                           *sp |= (png_byte)(g << shift);
+                           unsigned int p = (*sp >> shift) & 0x03;
+                           unsigned int g = (gamma_table [p | (p << 2) |
+                               (p << 4) | (p << 6)] >> 6) & 0x03;
+                           unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
+                           tmp |= g << shift;
+                           *sp = (png_byte)(tmp & 0xff);
                         }
 
                         if (!shift)
@@ -3582,8 +3626,9 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
                         if ((png_uint_16)((*sp >> shift) & 0x03)
                             == png_ptr->trans_color.gray)
                         {
-                           *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff);
-                           *sp |= (png_byte)(png_ptr->background.gray << shift);
+                           unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
+                           tmp |= png_ptr->background.gray << shift;
+                           *sp = (png_byte)(tmp & 0xff);
                         }
 
                         if (!shift)
@@ -3611,17 +3656,19 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
                         if ((png_uint_16)((*sp >> shift) & 0x0f)
                             == png_ptr->trans_color.gray)
                         {
-                           *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff);
-                           *sp |= (png_byte)(png_ptr->background.gray << shift);
+                           unsigned int tmp = *sp & (0xf0f >> (4 - shift));
+                           tmp |= png_ptr->background.gray << shift;
+                           *sp = (png_byte)(tmp & 0xff);
                         }
 
                         else
                         {
-                           png_byte p = (png_byte)((*sp >> shift) & 0x0f);
-                           png_byte g = (png_byte)((gamma_table[p |
-                               (p << 4)] >> 4) & 0x0f);
-                           *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff);
-                           *sp |= (png_byte)(g << shift);
+                           unsigned int p = (*sp >> shift) & 0x0f;
+                           unsigned int g = (gamma_table[p | (p << 4)] >> 4) &
+                              0x0f;
+                           unsigned int tmp = *sp & (0xf0f >> (4 - shift));
+                           tmp |= g << shift;
+                           *sp = (png_byte)(tmp & 0xff);
                         }
 
                         if (!shift)
@@ -3645,8 +3692,9 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
                         if ((png_uint_16)((*sp >> shift) & 0x0f)
                             == png_ptr->trans_color.gray)
                         {
-                           *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff);
-                           *sp |= (png_byte)(png_ptr->background.gray << shift);
+                           unsigned int tmp = *sp & (0xf0f >> (4 - shift));
+                           tmp |= png_ptr->background.gray << shift;
+                           *sp = (png_byte)(tmp & 0xff);
                         }
 
                         if (!shift)
@@ -4126,16 +4174,16 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
                         v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
                         png_composite_16(w, v, a, png_ptr->background_1.red);
                         if (!optimize)
-                           w = gamma_16_from_1[((w&0xff) >> gamma_shift)]
-                               [w >> 8];
+                           w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >>
+                                8];
                         *sp = (png_byte)((w >> 8) & 0xff);
                         *(sp + 1) = (png_byte)(w & 0xff);
 
                         v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)];
                         png_composite_16(w, v, a, png_ptr->background_1.green);
                         if (!optimize)
-                           w = gamma_16_from_1[((w&0xff) >> gamma_shift)]
-                               [w >> 8];
+                           w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >>
+                                8];
 
                         *(sp + 2) = (png_byte)((w >> 8) & 0xff);
                         *(sp + 3) = (png_byte)(w & 0xff);
@@ -4143,8 +4191,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
                         v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)];
                         png_composite_16(w, v, a, png_ptr->background_1.blue);
                         if (!optimize)
-                           w = gamma_16_from_1[((w&0xff) >> gamma_shift)]
-                               [w >> 8];
+                           w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >>
+                                8];
 
                         *(sp + 4) = (png_byte)((w >> 8) & 0xff);
                         *(sp + 5) = (png_byte)(w & 0xff);
@@ -4217,7 +4265,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
  * build_gamma_table().
  */
 void /* PRIVATE */
-png_do_gamma(png_row_infop row_info, png_bytep row, png_structp png_ptr)
+png_do_gamma(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
 {
    png_const_bytep gamma_table = png_ptr->gamma_table;
    png_const_uint_16pp gamma_16_table = png_ptr->gamma_16_table;
@@ -4418,7 +4466,7 @@ png_do_gamma(png_row_infop row_info, png_bytep row, png_structp png_ptr)
  * from_1 tables.
  */
 void /* PRIVATE */
-png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structp png_ptr)
+png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
 {
    png_uint_32 row_width = row_info->width;
 
@@ -4650,7 +4698,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
    {
       if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
       {
-         png_uint_16 gray = (png_uint_16)(trans_color ? trans_color->gray : 0);
+         unsigned int gray = trans_color ? trans_color->gray : 0;
 
          if (row_info->bit_depth < 8)
          {
@@ -4658,7 +4706,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
             {
                case 1:
                {
-                  gray = (png_uint_16)((gray & 0x01) * 0xff);
+                  gray = (gray & 0x01) * 0xff;
                   sp = row + (png_size_t)((row_width - 1) >> 3);
                   dp = row + (png_size_t)row_width - 1;
                   shift = 7 - (int)((row_width + 7) & 0x07);
@@ -4686,7 +4734,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
 
                case 2:
                {
-                  gray = (png_uint_16)((gray & 0x03) * 0x55);
+                  gray = (gray & 0x03) * 0x55;
                   sp = row + (png_size_t)((row_width - 1) >> 2);
                   dp = row + (png_size_t)row_width - 1;
                   shift = (int)((3 - ((row_width + 3) & 0x03)) << 1);
@@ -4711,7 +4759,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
 
                case 4:
                {
-                  gray = (png_uint_16)((gray & 0x0f) * 0x11);
+                  gray = (gray & 0x0f) * 0x11;
                   sp = row + (png_size_t)((row_width - 1) >> 1);
                   dp = row + (png_size_t)row_width - 1;
                   shift = (int)((1 - ((row_width + 1) & 0x01)) << 2);
@@ -4746,9 +4794,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
          {
             if (row_info->bit_depth == 8)
             {
-               /* NOTE: prior to libpng 1.5.14 this cleared out the top bits of
-                * 'gray', however if those are set it is an error.
-                */
+               gray = gray & 0xff;
                sp = row + (png_size_t)row_width - 1;
                dp = row + (png_size_t)(row_width << 1) - 1;
 
@@ -4766,8 +4812,8 @@ png_do_expand(png_row_infop row_info, png_bytep row,
 
             else if (row_info->bit_depth == 16)
             {
-               png_byte gray_high = (png_byte)((gray >> 8) & 0xff);
-               png_byte gray_low = (png_byte)(gray & 0xff);
+               unsigned int gray_high = (gray >> 8) & 0xff;
+               unsigned int gray_low = gray & 0xff;
                sp = row + row_info->rowbytes - 1;
                dp = row + (row_info->rowbytes << 1) - 1;
                for (i = 0; i < row_width; i++)
index 5ee452d575a6e5d2bf1f1bd5b4b58b380219af9c..e66075786e1138273640bf87e0ae90754bdf43e7 100644 (file)
@@ -1,8 +1,8 @@
 
 /* pngrutil.c - utilities to read a PNG file
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
- * Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.0 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2012 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -21,7 +21,7 @@
 #define png_strtod(p,a,b) strtod(a,b)
 
 png_uint_32 PNGAPI
-png_get_uint_31(png_structp png_ptr, png_const_bytep buf)
+png_get_uint_31(png_const_structrp png_ptr, png_const_bytep buf)
 {
    png_uint_32 uval = png_get_uint_32(buf);
 
@@ -40,7 +40,7 @@ png_get_uint_31(png_structp png_ptr, png_const_bytep buf)
 #define PNG_FIXED_ERROR (-1)
 
 static png_fixed_point /* PRIVATE */
-png_get_fixed_point(png_structp png_ptr, png_const_bytep buf)
+png_get_fixed_point(png_structrp png_ptr, png_const_bytep buf)
 {
    png_uint_32 uval = png_get_uint_32(buf);
 
@@ -114,7 +114,7 @@ png_get_uint_16)(png_const_bytep buf)
 
 /* Read and check the PNG file signature */
 void /* PRIVATE */
-png_read_sig(png_structp png_ptr, png_infop info_ptr)
+png_read_sig(png_structrp png_ptr, png_inforp info_ptr)
 {
    png_size_t num_checked, num_to_check;
 
@@ -149,7 +149,7 @@ png_read_sig(png_structp png_ptr, png_infop info_ptr)
  * Put the type name into png_ptr->chunk_name, and return the length.
  */
 png_uint_32 /* PRIVATE */
-png_read_chunk_header(png_structp png_ptr)
+png_read_chunk_header(png_structrp png_ptr)
 {
    png_byte buf[8];
    png_uint_32 length;
@@ -186,7 +186,7 @@ png_read_chunk_header(png_structp png_ptr)
 
 /* Read data, and (optionally) run it through the CRC. */
 void /* PRIVATE */
-png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length)
+png_crc_read(png_structrp png_ptr, png_bytep buf, png_uint_32 length)
 {
    if (png_ptr == NULL)
       return;
@@ -196,24 +196,27 @@ png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length)
 }
 
 /* Optionally skip data and then check the CRC.  Depending on whether we
- * are reading a ancillary or critical chunk, and how the program has set
+ * are reading an ancillary or critical chunk, and how the program has set
  * things up, we may calculate the CRC on the data and print a message.
  * Returns '1' if there was a CRC error, '0' otherwise.
  */
 int /* PRIVATE */
-png_crc_finish(png_structp png_ptr, png_uint_32 skip)
+png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
 {
-   png_size_t i;
-   png_size_t istop = png_ptr->zbuf_size;
-
-   for (i = (png_size_t)skip; i > istop; i -= istop)
+   /* The size of the local buffer for inflate is a good guess as to a
+    * reasonable size to use for buffering reads from the application.
+    */
+   while (skip > 0)
    {
-      png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
-   }
+      png_uint_32 len;
+      png_byte tmpbuf[PNG_INFLATE_BUF_SIZE];
 
-   if (i)
-   {
-      png_crc_read(png_ptr, png_ptr->zbuf, i);
+      len = (sizeof tmpbuf);
+      if (len > skip)
+         len = skip;
+      skip -= len;
+
+      png_crc_read(png_ptr, tmpbuf, len);
    }
 
    if (png_crc_error(png_ptr))
@@ -241,7 +244,7 @@ png_crc_finish(png_structp png_ptr, png_uint_32 skip)
  * the data it has read thus far.
  */
 int /* PRIVATE */
-png_crc_error(png_structp png_ptr)
+png_crc_error(png_structrp png_ptr)
 {
    png_byte crc_bytes[4];
    png_uint_32 crc;
@@ -277,248 +280,508 @@ png_crc_error(png_structp png_ptr)
       return (0);
 }
 
-#ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED
-static png_size_t
-png_inflate(png_structp png_ptr, png_bytep data, png_size_t size,
-    png_bytep output, png_size_t output_size)
+/* Manage the read buffer; this simply reallocates the buffer if it is not small
+ * enough (or if it is not allocated).  The routine returns a pointer to the
+ * buffer; if an error occurs and 'warn' is set the routine returns NULL, else
+ * it will call png_error (via png_malloc) on failure.  (warn == 2 means
+ * 'silent').
+ */
+static png_bytep
+png_read_buffer(png_structrp png_ptr, png_alloc_size_t new_size, int warn)
 {
-   png_size_t count = 0;
-
-   /* zlib can't necessarily handle more than 65535 bytes at once (i.e. it can't
-    * even necessarily handle 65536 bytes) because the type uInt is "16 bits or
-    * more".  Consequently it is necessary to chunk the input to zlib.  This
-    * code uses ZLIB_IO_MAX, from pngpriv.h, as the maximum (the maximum value
-    * that can be stored in a uInt.)  It is possible to set ZLIB_IO_MAX to a
-    * lower value in pngpriv.h and this may sometimes have a performance
-    * advantage, because it forces access of the input data to be separated from
-    * at least some of the use by some period of time.
-    */
-   png_ptr->zstream.next_in = data;
-   /* avail_in is set below from 'size' */
-   png_ptr->zstream.avail_in = 0;
+   png_bytep buffer = png_ptr->read_buffer;
 
-   while (1)
+   if (buffer != NULL && new_size > png_ptr->read_buffer_size)
    {
-      int ret, avail;
+      png_ptr->read_buffer = NULL;
+      png_ptr->read_buffer = NULL;
+      png_ptr->read_buffer_size = 0;
+      png_free(png_ptr, buffer);
+      buffer = NULL;
+   }
 
-      /* The setting of 'avail_in' used to be outside the loop; by setting it
-       * inside it is possible to chunk the input to zlib and simply rely on
-       * zlib to advance the 'next_in' pointer.  This allows arbitrary amounts o
-       * data to be passed through zlib at the unavoidable cost of requiring a
-       * window save (memcpy of up to 32768 output bytes) every ZLIB_IO_MAX
-       * input bytes.
-       */
-      if (png_ptr->zstream.avail_in == 0 && size > 0)
+   if (buffer == NULL)
+   {
+      buffer = png_voidcast(png_bytep, png_malloc_base(png_ptr, new_size));
+
+      if (buffer != NULL)
       {
-         if (size <= ZLIB_IO_MAX)
-         {
-            /* The value is less than ZLIB_IO_MAX so the cast is safe: */
-            png_ptr->zstream.avail_in = (uInt)size;
-            size = 0;
-         }
+         png_ptr->read_buffer = buffer;
+         png_ptr->read_buffer_size = new_size;
+      }
 
+      else if (warn < 2) /* else silent */
+      {
+#ifdef PNG_WARNINGS_SUPPORTED
+         if (warn)
+             png_chunk_warning(png_ptr, "insufficient memory to read chunk");
          else
+#endif
          {
-            png_ptr->zstream.avail_in = ZLIB_IO_MAX;
-            size -= ZLIB_IO_MAX;
+#ifdef PNG_ERROR_TEXT_SUPPORTED
+             png_chunk_error(png_ptr, "insufficient memory to read chunk");
+#endif
          }
       }
+   }
+
+   return buffer;
+}
 
-      /* Reset the output buffer each time round - we empty it
-       * after every inflate call.
+/* png_inflate_claim: claim the zstream for some nefarious purpose that involves
+ * decompression.  Returns Z_OK on success, else a zlib error code.  It checks
+ * the owner but, in final release builds, just issues a warning if some other
+ * chunk apparently owns the stream.  Prior to release it does a png_error.
+ */
+static int
+png_inflate_claim(png_structrp png_ptr, png_uint_32 owner, int window_bits)
+{
+   if (png_ptr->zowner != 0)
+   {
+      char msg[64];
+
+      PNG_STRING_FROM_CHUNK(msg, png_ptr->zowner);
+      /* So the message that results is "<chunk> using zstream"; this is an
+       * internal error, but is very useful for debugging.  i18n requirements
+       * are minimal.
        */
-      png_ptr->zstream.next_out = png_ptr->zbuf;
-      png_ptr->zstream.avail_out = png_ptr->zbuf_size;
+      (void)png_safecat(msg, (sizeof msg), 4, " using zstream");
+#     if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC
+         png_chunk_warning(png_ptr, msg);
+         png_ptr->zowner = 0;
+#     else
+         png_chunk_error(png_ptr, msg);
+#     endif
+   }
 
-      ret = inflate(&png_ptr->zstream, Z_NO_FLUSH);
-      avail = png_ptr->zbuf_size - png_ptr->zstream.avail_out;
+   /* Implementation note: unlike 'png_deflate_claim' this internal function
+    * does not take the size of the data as an argument.  Some efficiency could
+    * be gained by using this when it is known *if* the zlib stream itself does
+    * not record the number; however, this is an illusion: the original writer
+    * of the PNG may have selected a lower window size, and we really must
+    * follow that because, for systems with with limited capabilities, we
+    * would otherwise reject the application's attempts to use a smaller window
+    * size (zlib doesn't have an interface to say "this or lower"!).
+    *
+    * inflateReset2 was added to zlib 1.2.4; before this the window could not be
+    * reset, therefore it is necessary to always allocate the maximum window
+    * size with earlier zlibs just in case later compressed chunks need it.
+    */
+   {
+      int ret; /* zlib return code */
 
-      /* First copy/count any new output - but only if we didn't
-       * get an error code.
+      /* Set this for safety, just in case the previous owner left pointers to
+       * memory allocations.
        */
-      if ((ret == Z_OK || ret == Z_STREAM_END) && avail > 0)
-      {
-         png_size_t space = avail; /* > 0, see above */
+      png_ptr->zstream.next_in = NULL;
+      png_ptr->zstream.avail_in = 0;
+      png_ptr->zstream.next_out = NULL;
+      png_ptr->zstream.avail_out = 0;
 
-         if (output != 0 && output_size > count)
-         {
-            png_size_t copy = output_size - count;
+      if (png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED)
+      {
+#        if ZLIB_VERNUM < 0x1240
+            PNG_UNUSED(window_bits)
+            ret = inflateReset(&png_ptr->zstream);
+#        else
+            ret = inflateReset2(&png_ptr->zstream, window_bits);
+#        endif
+      }
 
-            if (space < copy)
-               copy = space;
+      else
+      {
+#        if ZLIB_VERNUM < 0x1240
+            ret = inflateInit(&png_ptr->zstream);
+#        else
+            ret = inflateInit2(&png_ptr->zstream, window_bits);
+#        endif
 
-            png_memcpy(output + count, png_ptr->zbuf, copy);
-         }
-         count += space;
+         if (ret == Z_OK)
+            png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
       }
 
       if (ret == Z_OK)
-         continue;
+         png_ptr->zowner = owner;
+
+      else
+         png_zstream_error(png_ptr, ret);
+
+      return ret;
+   }
+}
 
-      /* Termination conditions - always reset the zstream, it
-       * must be left in inflateInit state.
+#ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED
+/* png_inflate now returns zlib error codes including Z_OK and Z_STREAM_END to
+ * allow the caller to do multiple calls if required.  If the 'finish' flag is
+ * set Z_FINISH will be passed to the final inflate() call and Z_STREAM_END must
+ * be returned or there has been a problem, otherwise Z_SYNC_FLUSH is used and
+ * Z_OK or Z_STREAM_END will be returned on success.
+ *
+ * The input and output sizes are updated to the actual amounts of data consumed
+ * or written, not the amount available (as in a z_stream).  The data pointers
+ * are not changed, so the next input is (data+input_size) and the next
+ * available output is (output+output_size).
+ */
+static int
+png_inflate(png_structrp png_ptr, png_uint_32 owner, int finish,
+    /* INPUT: */ png_const_bytep input, png_uint_32p input_size_ptr,
+    /* OUTPUT: */ png_bytep output, png_alloc_size_t *output_size_ptr)
+{
+   if (png_ptr->zowner == owner) /* Else not claimed */
+   {
+      int ret;
+      png_alloc_size_t avail_out = *output_size_ptr;
+      png_uint_32 avail_in = *input_size_ptr;
+
+      /* zlib can't necessarily handle more than 65535 bytes at once (i.e. it
+       * can't even necessarily handle 65536 bytes) because the type uInt is
+       * "16 bits or more".  Consequently it is necessary to chunk the input to
+       * zlib.  This code uses ZLIB_IO_MAX, from pngpriv.h, as the maximum (the
+       * maximum value that can be stored in a uInt.)  It is possible to set
+       * ZLIB_IO_MAX to a lower value in pngpriv.h and this may sometimes have
+       * a performance advantage, because it reduces the amount of data accessed
+       * at each step and that may give the OS more time to page it in.
        */
+      png_ptr->zstream.next_in = PNGZ_INPUT_CAST(input);
+      /* avail_in and avail_out are set below from 'size' */
       png_ptr->zstream.avail_in = 0;
-      inflateReset(&png_ptr->zstream);
-
-      if (ret == Z_STREAM_END)
-         return count; /* NOTE: may be zero. */
+      png_ptr->zstream.avail_out = 0;
 
-      /* Now handle the error codes - the API always returns 0
-       * and the error message is dumped into the uncompressed
-       * buffer if available.
+      /* Read directly into the output if it is available (this is set to
+       * a local buffer below if output is NULL).
        */
-#     ifdef PNG_WARNINGS_SUPPORTED
+      if (output != NULL)
+         png_ptr->zstream.next_out = output;
+
+      do
       {
-         png_const_charp msg;
+         uInt avail;
+         Byte local_buffer[PNG_INFLATE_BUF_SIZE];
+
+         /* zlib INPUT BUFFER */
+         /* The setting of 'avail_in' used to be outside the loop; by setting it
+          * inside it is possible to chunk the input to zlib and simply rely on
+          * zlib to advance the 'next_in' pointer.  This allows arbitrary
+          * amounts of data to be passed through zlib at the unavoidable cost of
+          * requiring a window save (memcpy of up to 32768 output bytes)
+          * every ZLIB_IO_MAX input bytes.
+          */
+         avail_in += png_ptr->zstream.avail_in; /* not consumed last time */
 
-         if (png_ptr->zstream.msg != 0)
-            msg = png_ptr->zstream.msg;
+         avail = ZLIB_IO_MAX;
 
-         else switch (ret)
-         {
-            case Z_BUF_ERROR:
-               msg = "Buffer error in compressed datastream";
-               break;
+         if (avail_in < avail)
+            avail = (uInt)avail_in; /* safe: < than ZLIB_IO_MAX */
 
-            case Z_DATA_ERROR:
-               msg = "Data error in compressed datastream";
-               break;
+         avail_in -= avail;
+         png_ptr->zstream.avail_in = avail;
 
-            default:
-               msg = "Incomplete compressed datastream";
-               break;
+         /* zlib OUTPUT BUFFER */
+         avail_out += png_ptr->zstream.avail_out; /* not written last time */
+
+         avail = ZLIB_IO_MAX; /* maximum zlib can process */
+
+         if (output == NULL)
+         {
+            /* Reset the output buffer each time round if output is NULL and
+             * make available the full buffer, up to 'remaining_space'
+             */
+            png_ptr->zstream.next_out = local_buffer;
+            if ((sizeof local_buffer) < avail)
+               avail = (sizeof local_buffer);
          }
 
-         png_chunk_warning(png_ptr, msg);
-      }
-#     endif
+         if (avail_out < avail)
+            avail = (uInt)avail_out; /* safe: < ZLIB_IO_MAX */
+
+         png_ptr->zstream.avail_out = avail;
+         avail_out -= avail;
+
+         /* zlib inflate call */
+         /* In fact 'avail_out' may be 0 at this point, that happens at the end
+          * of the read when the final LZ end code was not passed at the end of
+          * the previous chunk of input data.  Tell zlib if we have reached the
+          * end of the output buffer.
+          */
+         ret = inflate(&png_ptr->zstream, avail_out > 0 ? Z_NO_FLUSH :
+            (finish ? Z_FINISH : Z_SYNC_FLUSH));
+      } while (ret == Z_OK);
+
+      /* For safety kill the local buffer pointer now */
+      if (output == NULL)
+         png_ptr->zstream.next_out = NULL;
 
-      /* 0 means an error - notice that this code simply ignores
-       * zero length compressed chunks as a result.
+      /* Claw back the 'size' and 'remaining_space' byte counts. */
+      avail_in += png_ptr->zstream.avail_in;
+      avail_out += png_ptr->zstream.avail_out;
+
+      /* Update the input and output sizes; the updated values are the amount
+       * consumed or written, effectively the inverse of what zlib uses.
        */
-      return 0;
+      if (avail_out > 0)
+         *output_size_ptr -= avail_out;
+
+      if (avail_in > 0)
+         *input_size_ptr -= avail_in;
+
+      /* Ensure png_ptr->zstream.msg is set (even in the success case!) */
+      png_zstream_error(png_ptr, ret);
+      return ret;
+   }
+
+   else
+   {
+      /* This is a bad internal error.  The recovery assigns to the zstream msg
+       * pointer, which is not owned by the caller, but this is safe; it's only
+       * used on errors!
+       */
+      png_ptr->zstream.msg = PNGZ_MSG_CAST("zstream unclaimed");
+      return Z_STREAM_ERROR;
    }
 }
 
 /*
- * Decompress trailing data in a chunk.  The assumption is that chunkdata
+ * Decompress trailing data in a chunk.  The assumption is that read_buffer
  * points at an allocated area holding the contents of a chunk with a
  * trailing compressed part.  What we get back is an allocated area
  * holding the original prefix part and an uncompressed version of the
  * trailing part (the malloc area passed in is freed).
  */
-void /* PRIVATE */
-png_decompress_chunk(png_structp png_ptr, int comp_type,
-    png_size_t chunklength,
-    png_size_t prefix_size, png_size_t *newlength)
+static int
+png_decompress_chunk(png_structrp png_ptr,
+   png_uint_32 chunklength, png_uint_32 prefix_size,
+   png_alloc_size_t *newlength /* must be initialized to the maximum! */,
+   int terminate /*add a '\0' to the end of the uncompressed data*/)
 {
-   /* The caller should guarantee this */
-   if (prefix_size > chunklength)
-   {
-      /* The recovery is to delete the chunk. */
-      png_warning(png_ptr, "invalid chunklength");
-      prefix_size = 0; /* To delete everything */
-   }
+   /* TODO: implement different limits for different types of chunk.
+    *
+    * The caller supplies *newlength set to the maximum length of the
+    * uncompressed data, but this routine allocates space for the prefix and
+    * maybe a '\0' terminator too.  We have to assume that 'prefix_size' is
+    * limited only by the maximum chunk size.
+    */
+   png_alloc_size_t limit = PNG_SIZE_MAX;
+
+#  ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
+      if (png_ptr->user_chunk_malloc_max > 0 &&
+         png_ptr->user_chunk_malloc_max < limit)
+         limit = png_ptr->user_chunk_malloc_max;
+#  elif PNG_USER_CHUNK_MALLOC_MAX > 0
+      if (PNG_USER_CHUNK_MALLOC_MAX < limit)
+         limit = PNG_USER_CHUNK_MALLOC_MAX;
+#  endif
 
-   else if (comp_type == PNG_COMPRESSION_TYPE_BASE)
+   if (limit >= prefix_size + (terminate != 0))
    {
-      png_size_t expanded_size = png_inflate(png_ptr,
-          (png_bytep)(png_ptr->chunkdata + prefix_size),
-          chunklength - prefix_size,
-          0,            /* output */
-          0);           /* output size */
+      int ret;
 
-      /* Now check the limits on this chunk - if the limit fails the
-       * compressed data will be removed, the prefix will remain.
-       */
-      if (prefix_size >= (~(png_size_t)0) - 1 ||
-         expanded_size >= (~(png_size_t)0) - 1 - prefix_size
-#ifdef PNG_USER_LIMITS_SUPPORTED
-         || (png_ptr->user_chunk_malloc_max &&
-          (prefix_size + expanded_size >= png_ptr->user_chunk_malloc_max - 1))
-#else
-         || ((PNG_USER_CHUNK_MALLOC_MAX > 0) &&
-          prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1)
-#endif
-         )
-         png_warning(png_ptr, "Exceeded size limit while expanding chunk");
+      limit -= prefix_size + (terminate != 0);
+
+      if (limit < *newlength)
+         *newlength = limit;
 
-      /* If the size is zero either there was an error and a message
-       * has already been output (warning) or the size really is zero
-       * and we have nothing to do - the code will exit through the
-       * error case below.
+      /* Now try to claim the stream; the 'warn' setting causes zlib to be told
+       * to use the maximum window size during inflate; this hides errors in the
+       * deflate header window bits value which is used if '0' is passed.  In
+       * fact this only has an effect with zlib versions 1.2.4 and later - see
+       * the comments in png_inflate_claim above.
        */
-      else if (expanded_size > 0)
+      ret = png_inflate_claim(png_ptr, png_ptr->chunk_name,
+         png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN ? 15 : 0);
+
+      if (ret == Z_OK)
       {
-         /* Success (maybe) - really uncompress the chunk. */
-         png_size_t new_size = 0;
-         png_charp text = (png_charp)png_malloc_warn(png_ptr,
-             prefix_size + expanded_size + 1);
+         png_uint_32 lzsize = chunklength - prefix_size;
+
+         ret = png_inflate(png_ptr, png_ptr->chunk_name, 1/*finish*/,
+            /* input: */ png_ptr->read_buffer + prefix_size, &lzsize,
+            /* output: */ NULL, newlength);
 
-         if (text != NULL)
+         if (ret == Z_STREAM_END)
          {
-            png_memcpy(text, png_ptr->chunkdata, prefix_size);
-            new_size = png_inflate(png_ptr,
-                (png_bytep)(png_ptr->chunkdata + prefix_size),
-                chunklength - prefix_size,
-                (png_bytep)(text + prefix_size), expanded_size);
-            text[prefix_size + expanded_size] = 0; /* just in case */
-
-            if (new_size == expanded_size)
+            /* Use 'inflateReset' here, not 'inflateReset2' because this
+             * preserves the previously decided window size (otherwise it would
+             * be necessary to store the previous window size.)  In practice
+             * this doesn't matter anyway, because png_inflate will call inflate
+             * with Z_FINISH in almost all cases, so the window will not be
+             * maintained.
+             */
+            if (inflateReset(&png_ptr->zstream) == Z_OK)
             {
-               png_free(png_ptr, png_ptr->chunkdata);
-               png_ptr->chunkdata = text;
-               *newlength = prefix_size + expanded_size;
-               return; /* The success return! */
+               /* Because of the limit checks above we know that the new,
+                * expanded, size will fit in a size_t (let alone an
+                * png_alloc_size_t).  Use png_malloc_base here to avoid an
+                * extra OOM message.
+                */
+               png_alloc_size_t new_size = *newlength;
+               png_alloc_size_t buffer_size = prefix_size + new_size +
+                  (terminate != 0);
+               png_bytep text = png_voidcast(png_bytep, png_malloc_base(png_ptr,
+                  buffer_size));
+
+               if (text != NULL)
+               {
+                  ret = png_inflate(png_ptr, png_ptr->chunk_name, 1/*finish*/,
+                     png_ptr->read_buffer + prefix_size, &lzsize,
+                     text + prefix_size, newlength);
+
+                  if (ret == Z_STREAM_END)
+                  {
+                     if (new_size == *newlength)
+                     {
+                        if (terminate)
+                           text[prefix_size + *newlength] = 0;
+
+                        if (prefix_size > 0)
+                           memcpy(text, png_ptr->read_buffer, prefix_size);
+
+                        {
+                           png_bytep old_ptr = png_ptr->read_buffer;
+
+                           png_ptr->read_buffer = text;
+                           png_ptr->read_buffer_size = buffer_size;
+                           text = old_ptr; /* freed below */
+                        }
+                     }
+
+                     else
+                     {
+                        /* The size changed on the second read, there can be no
+                         * guarantee that anything is correct at this point.
+                         * The 'msg' pointer has been set to "unexpected end of
+                         * LZ stream", which is fine, but return an error code
+                         * that the caller won't accept.
+                         */
+                        ret = PNG_UNEXPECTED_ZLIB_RETURN;
+                     }
+                  }
+
+                  else if (ret == Z_OK)
+                     ret = PNG_UNEXPECTED_ZLIB_RETURN; /* for safety */
+
+                  /* Free the text pointer (this is the old read_buffer on
+                   * success)
+                   */
+                  png_free(png_ptr, text);
+
+                  /* This really is very benign, but it's still an error because
+                   * the extra space may otherwise be used as a Trojan Horse.
+                   */
+                  if (ret == Z_STREAM_END &&
+                     chunklength - prefix_size != lzsize)
+                     png_chunk_benign_error(png_ptr, "extra compressed data");
+               }
+
+               else
+               {
+                  /* Out of memory allocating the buffer */
+                  ret = Z_MEM_ERROR;
+                  png_zstream_error(png_ptr, Z_MEM_ERROR);
+               }
             }
 
-            png_warning(png_ptr, "png_inflate logic error");
-            png_free(png_ptr, text);
+            else
+            {
+               /* inflateReset failed, store the error message */
+               png_zstream_error(png_ptr, ret);
+
+               if (ret == Z_STREAM_END)
+                  ret = PNG_UNEXPECTED_ZLIB_RETURN;
+            }
          }
 
-         else
-            png_warning(png_ptr, "Not enough memory to decompress chunk");
+         else if (ret == Z_OK)
+            ret = PNG_UNEXPECTED_ZLIB_RETURN;
+
+         /* Release the claimed stream */
+         png_ptr->zowner = 0;
       }
+
+      else /* the claim failed */ if (ret == Z_STREAM_END) /* impossible! */
+         ret = PNG_UNEXPECTED_ZLIB_RETURN;
+
+      return ret;
    }
 
-   else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */
+   else
    {
-      PNG_WARNING_PARAMETERS(p)
-      png_warning_parameter_signed(p, 1, PNG_NUMBER_FORMAT_d, comp_type);
-      png_formatted_warning(png_ptr, p, "Unknown compression type @1");
-
-      /* The recovery is to simply drop the data. */
+      /* Application/configuration limits exceeded */
+      png_zstream_error(png_ptr, Z_MEM_ERROR);
+      return Z_MEM_ERROR;
    }
+}
+#endif /* PNG_READ_COMPRESSED_TEXT_SUPPORTED */
 
-   /* Generic error return - leave the prefix, delete the compressed
-    * data, reallocate the chunkdata to remove the potentially large
-    * amount of compressed data.
-    */
+#ifdef PNG_READ_iCCP_SUPPORTED
+/* Perform a partial read and decompress, producing 'avail_out' bytes and
+ * reading from the current chunk as required.
+ */
+static int
+png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size,
+   png_uint_32p chunk_bytes, png_bytep next_out, png_alloc_size_t *out_size,
+   int finish)
+{
+   if (png_ptr->zowner == png_ptr->chunk_name)
    {
-      png_charp text = (png_charp)png_malloc_warn(png_ptr, prefix_size + 1);
+      int ret;
+
+      /* next_in and avail_in must have been initialized by the caller. */
+      png_ptr->zstream.next_out = next_out;
+      png_ptr->zstream.avail_out = 0; /* set in the loop */
 
-      if (text != NULL)
+      do
       {
-         if (prefix_size > 0)
-            png_memcpy(text, png_ptr->chunkdata, prefix_size);
+         if (png_ptr->zstream.avail_in == 0)
+         {
+            if (read_size > *chunk_bytes)
+               read_size = (uInt)*chunk_bytes;
+            *chunk_bytes -= read_size;
 
-         png_free(png_ptr, png_ptr->chunkdata);
-         png_ptr->chunkdata = text;
+            if (read_size > 0)
+               png_crc_read(png_ptr, read_buffer, read_size);
+
+            png_ptr->zstream.next_in = read_buffer;
+            png_ptr->zstream.avail_in = read_size;
+         }
+
+         if (png_ptr->zstream.avail_out == 0)
+         {
+            uInt avail = ZLIB_IO_MAX;
+            if (avail > *out_size)
+               avail = (uInt)*out_size;
+            *out_size -= avail;
 
-         /* This is an extra zero in the 'uncompressed' part. */
-         *(png_ptr->chunkdata + prefix_size) = 0x00;
+            png_ptr->zstream.avail_out = avail;
+         }
+
+         /* Use Z_SYNC_FLUSH when there is no more chunk data to ensure that all
+          * the available output is produced; this allows reading of truncated
+          * streams.
+          */
+         ret = inflate(&png_ptr->zstream,
+            *chunk_bytes > 0 ? Z_NO_FLUSH : (finish ? Z_FINISH : Z_SYNC_FLUSH));
       }
-      /* Ignore a malloc error here - it is safe. */
+      while (ret == Z_OK && (*out_size > 0 || png_ptr->zstream.avail_out > 0));
+
+      *out_size += png_ptr->zstream.avail_out;
+      png_ptr->zstream.avail_out = 0; /* Should not be required, but is safe */
+
+      /* Ensure the error message pointer is always set: */
+      png_zstream_error(png_ptr, ret);
+      return ret;
    }
 
-   *newlength = prefix_size;
+   else
+   {
+      png_ptr->zstream.msg = PNGZ_MSG_CAST("zstream unclaimed");
+      return Z_STREAM_ERROR;
+   }
 }
-#endif /* PNG_READ_COMPRESSED_TEXT_SUPPORTED */
+#endif
 
 /* Read and check the IDHR chunk */
 void /* PRIVATE */
-png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_IHDR(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_byte buf[13];
    png_uint_32 width, height;
@@ -528,11 +791,11 @@ png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    png_debug(1, "in png_handle_IHDR");
 
    if (png_ptr->mode & PNG_HAVE_IHDR)
-      png_error(png_ptr, "Out of place IHDR");
+      png_chunk_error(png_ptr, "out of place");
 
    /* Check the length */
    if (length != 13)
-      png_error(png_ptr, "Invalid IHDR chunk");
+      png_chunk_error(png_ptr, "invalid");
 
    png_ptr->mode |= PNG_HAVE_IHDR;
 
@@ -593,7 +856,7 @@ png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
 /* Read and check the palette */
 void /* PRIVATE */
-png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_color palette[PNG_MAX_PALETTE_LENGTH];
    int num, i;
@@ -604,25 +867,32 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    png_debug(1, "in png_handle_PLTE");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before PLTE");
+      png_chunk_error(png_ptr, "missing IHDR");
+
+   /* Moved to before the 'after IDAT' check below because otherwise duplicate
+    * PLTE chunks are potentially ignored (the spec says there shall not be more
+    * than one PLTE, the error is not treated as benign, so this check trumps
+    * the requirement that PLTE appears before IDAT.)
+    */
+   else if (png_ptr->mode & PNG_HAVE_PLTE)
+      png_chunk_error(png_ptr, "duplicate");
 
    else if (png_ptr->mode & PNG_HAVE_IDAT)
    {
-      png_warning(png_ptr, "Invalid PLTE after IDAT");
+      /* This is benign because the non-benign error happened before, when an
+       * IDAT was encountered in a color-mapped image with no PLTE.
+       */
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
-   else if (png_ptr->mode & PNG_HAVE_PLTE)
-      png_error(png_ptr, "Duplicate PLTE chunk");
-
    png_ptr->mode |= PNG_HAVE_PLTE;
 
-   if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR))
+   if (!(png_ptr->color_type & PNG_COLOR_MASK_COLOR))
    {
-      png_warning(png_ptr,
-          "Ignoring PLTE chunk in grayscale PNG");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "ignored in grayscale PNG");
       return;
    }
 
@@ -636,19 +906,18 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
    if (length > 3*PNG_MAX_PALETTE_LENGTH || length % 3)
    {
+      png_crc_finish(png_ptr, length);
+
       if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
-      {
-         png_warning(png_ptr, "Invalid palette chunk");
-         png_crc_finish(png_ptr, length);
-         return;
-      }
+         png_chunk_benign_error(png_ptr, "invalid");
 
       else
-      {
-         png_error(png_ptr, "Invalid palette chunk");
-      }
+         png_chunk_error(png_ptr, "invalid");
+
+      return;
    }
 
+   /* The cast is safe because 'length' is less than 3*PNG_MAX_PALETTE_LENGTH */
    num = (int)length / 3;
 
 #ifdef PNG_POINTER_INDEXING_SUPPORTED
@@ -693,6 +962,10 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
        * we have two options: an error abort, or a warning and we
        * ignore the data in this chunk (which should be OK, since
        * it's considered ancillary for a RGB or RGBA image).
+       *
+       * IMPLEMENTATION NOTE: this is only here because png_crc_finish uses the
+       * chunk type to determine whether to check the ancillary or the critical
+       * flags.
        */
       if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_USE))
       {
@@ -716,55 +989,74 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    }
 #endif
 
+   /* TODO: png_set_PLTE has the side effect of setting png_ptr->palette to its
+    * own copy of the palette.  This has the side effect that when png_start_row
+    * is called (this happens after any call to png_read_update_info) the
+    * info_ptr palette gets changed.  This is extremely unexpected and
+    * confusing.
+    *
+    * Fix this by not sharing the palette in this way.
+    */
    png_set_PLTE(png_ptr, info_ptr, palette, num);
 
+   /* The three chunks, bKGD, hIST and tRNS *must* appear after PLTE and before
+    * IDAT.  Prior to 1.6.0 this was not checked; instead the code merely
+    * checked the apparent validity of a tRNS chunk inserted before PLTE on a
+    * palette PNG.  1.6.0 attempts to rigorously follow the standard and
+    * therefore does a benign error if the erroneous condition is detected *and*
+    * cancels the tRNS if the benign error returns.  The alternative is to
+    * amend the standard since it would be rather hypocritical of the standards
+    * maintainers to ignore it.
+    */
 #ifdef PNG_READ_tRNS_SUPPORTED
-   if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
+   if (png_ptr->num_trans > 0 ||
+      (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS) != 0))
    {
-      if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
-      {
-         if (png_ptr->num_trans > (png_uint_16)num)
-         {
-            png_warning(png_ptr, "Truncating incorrect tRNS chunk length");
-            png_ptr->num_trans = (png_uint_16)num;
-         }
+      /* Cancel this because otherwise it would be used if the transforms
+       * require it.  Don't cancel the 'valid' flag because this would prevent
+       * detection of duplicate chunks.
+       */
+      png_ptr->num_trans = 0;
 
-         if (info_ptr->num_trans > (png_uint_16)num)
-         {
-            png_warning(png_ptr, "Truncating incorrect info tRNS chunk length");
-            info_ptr->num_trans = (png_uint_16)num;
-         }
-      }
+      if (info_ptr != NULL)
+         info_ptr->num_trans = 0;
+
+      png_chunk_benign_error(png_ptr, "tRNS must be after");
    }
 #endif
 
+#ifdef PNG_READ_hIST_SUPPORTED
+   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) != 0)
+      png_chunk_benign_error(png_ptr, "hIST must be after");
+#endif
+
+#ifdef PNG_READ_bKGD_SUPPORTED
+   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) != 0)
+      png_chunk_benign_error(png_ptr, "bKGD must be after");
+#endif
 }
 
 void /* PRIVATE */
-png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_IEND(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_debug(1, "in png_handle_IEND");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT))
-   {
-      png_error(png_ptr, "No image in file");
-   }
+      png_chunk_error(png_ptr, "out of place");
 
    png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND);
 
-   if (length != 0)
-   {
-      png_warning(png_ptr, "Incorrect IEND chunk length");
-   }
-
    png_crc_finish(png_ptr, length);
 
-   PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
+   if (length != 0)
+      png_chunk_benign_error(png_ptr, "invalid");
+
+   PNG_UNUSED(info_ptr)
 }
 
 #ifdef PNG_READ_gAMA_SUPPORTED
 void /* PRIVATE */
-png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_gAMA(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_fixed_point igamma;
    png_byte buf[4];
@@ -772,34 +1064,19 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    png_debug(1, "in png_handle_gAMA");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before gAMA");
+      png_chunk_error(png_ptr, "missing IHDR");
 
-   else if (png_ptr->mode & PNG_HAVE_IDAT)
+   else if (png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE))
    {
-      png_warning(png_ptr, "Invalid gAMA after IDAT");
-      png_crc_finish(png_ptr, length);
-      return;
-   }
-
-   else if (png_ptr->mode & PNG_HAVE_PLTE)
-      /* Should be an error, but we can cope with it */
-      png_warning(png_ptr, "Out of place gAMA chunk");
-
-   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
-#ifdef PNG_READ_sRGB_SUPPORTED
-       && !(info_ptr->valid & PNG_INFO_sRGB)
-#endif
-       )
-   {
-      png_warning(png_ptr, "Duplicate gAMA chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    if (length != 4)
    {
-      png_warning(png_ptr, "Incorrect gAMA chunk length");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
@@ -810,43 +1087,16 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
    igamma = png_get_fixed_point(NULL, buf);
 
-   /* Check for zero gamma or an error. */
-   if (igamma <= 0)
-   {
-      png_warning(png_ptr,
-          "Ignoring gAMA chunk with out of range gamma");
-
-      return;
-   }
-
-#  ifdef PNG_READ_sRGB_SUPPORTED
-   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB))
-   {
-      if (PNG_OUT_OF_RANGE(igamma, 45500, 500))
-      {
-         PNG_WARNING_PARAMETERS(p)
-         png_warning_parameter_signed(p, 1, PNG_NUMBER_FORMAT_fixed, igamma);
-         png_formatted_warning(png_ptr, p,
-             "Ignoring incorrect gAMA value @1 when sRGB is also present");
-         return;
-      }
-   }
-#  endif /* PNG_READ_sRGB_SUPPORTED */
-
-#  ifdef PNG_READ_GAMMA_SUPPORTED
-   /* Gamma correction on read is supported. */
-   png_ptr->gamma = igamma;
-#  endif
-   /* And set the 'info' structure members. */
-   png_set_gAMA_fixed(png_ptr, info_ptr, igamma);
+   png_colorspace_set_gamma(png_ptr, &png_ptr->colorspace, igamma);
+   png_colorspace_sync(png_ptr, info_ptr);
 }
 #endif
 
 #ifdef PNG_READ_sBIT_SUPPORTED
 void /* PRIVATE */
-png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_sBIT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
-   png_size_t truelen;
+   unsigned int truelen;
    png_byte buf[4];
 
    png_debug(1, "in png_handle_sBIT");
@@ -854,25 +1104,19 @@ png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    buf[0] = buf[1] = buf[2] = buf[3] = 0;
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before sBIT");
+      png_chunk_error(png_ptr, "missing IHDR");
 
-   else if (png_ptr->mode & PNG_HAVE_IDAT)
+   else if (png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE))
    {
-      png_warning(png_ptr, "Invalid sBIT after IDAT");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
-   else if (png_ptr->mode & PNG_HAVE_PLTE)
-   {
-      /* Should be an error, but we can cope with it */
-      png_warning(png_ptr, "Out of place sBIT chunk");
-   }
-
    if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT))
    {
-      png_warning(png_ptr, "Duplicate sBIT chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
       return;
    }
 
@@ -880,11 +1124,11 @@ png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
       truelen = 3;
 
    else
-      truelen = (png_size_t)png_ptr->channels;
+      truelen = png_ptr->channels;
 
    if (length != truelen || length > 4)
    {
-      png_warning(png_ptr, "Incorrect sBIT chunk length");
+      png_chunk_benign_error(png_ptr, "invalid");
       png_crc_finish(png_ptr, length);
       return;
    }
@@ -917,43 +1161,27 @@ png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
 #ifdef PNG_READ_cHRM_SUPPORTED
 void /* PRIVATE */
-png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_cHRM(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_byte buf[32];
-   png_fixed_point x_white, y_white, x_red, y_red, x_green, y_green, x_blue,
-      y_blue;
+   png_xy xy;
 
    png_debug(1, "in png_handle_cHRM");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before cHRM");
+      png_chunk_error(png_ptr, "missing IHDR");
 
-   else if (png_ptr->mode & PNG_HAVE_IDAT)
+   else if (png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE))
    {
-      png_warning(png_ptr, "Invalid cHRM after IDAT");
-      png_crc_finish(png_ptr, length);
-      return;
-   }
-
-   else if (png_ptr->mode & PNG_HAVE_PLTE)
-      /* Should be an error, but we can cope with it */
-      png_warning(png_ptr, "Out of place cHRM chunk");
-
-   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)
-#  ifdef PNG_READ_sRGB_SUPPORTED
-       && !(info_ptr->valid & PNG_INFO_sRGB)
-#  endif
-      )
-   {
-      png_warning(png_ptr, "Duplicate cHRM chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    if (length != 32)
    {
-      png_warning(png_ptr, "Incorrect cHRM chunk length");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
@@ -962,429 +1190,388 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    if (png_crc_finish(png_ptr, 0))
       return;
 
-   x_white = png_get_fixed_point(NULL, buf);
-   y_white = png_get_fixed_point(NULL, buf + 4);
-   x_red   = png_get_fixed_point(NULL, buf + 8);
-   y_red   = png_get_fixed_point(NULL, buf + 12);
-   x_green = png_get_fixed_point(NULL, buf + 16);
-   y_green = png_get_fixed_point(NULL, buf + 20);
-   x_blue  = png_get_fixed_point(NULL, buf + 24);
-   y_blue  = png_get_fixed_point(NULL, buf + 28);
-
-   if (x_white == PNG_FIXED_ERROR ||
-       y_white == PNG_FIXED_ERROR ||
-       x_red   == PNG_FIXED_ERROR ||
-       y_red   == PNG_FIXED_ERROR ||
-       x_green == PNG_FIXED_ERROR ||
-       y_green == PNG_FIXED_ERROR ||
-       x_blue  == PNG_FIXED_ERROR ||
-       y_blue  == PNG_FIXED_ERROR)
-   {
-      png_warning(png_ptr, "Ignoring cHRM chunk with negative chromaticities");
+   xy.whitex = png_get_fixed_point(NULL, buf);
+   xy.whitey = png_get_fixed_point(NULL, buf + 4);
+   xy.redx   = png_get_fixed_point(NULL, buf + 8);
+   xy.redy   = png_get_fixed_point(NULL, buf + 12);
+   xy.greenx = png_get_fixed_point(NULL, buf + 16);
+   xy.greeny = png_get_fixed_point(NULL, buf + 20);
+   xy.bluex  = png_get_fixed_point(NULL, buf + 24);
+   xy.bluey  = png_get_fixed_point(NULL, buf + 28);
+
+   if (xy.whitex == PNG_FIXED_ERROR ||
+       xy.whitey == PNG_FIXED_ERROR ||
+       xy.redx   == PNG_FIXED_ERROR ||
+       xy.redy   == PNG_FIXED_ERROR ||
+       xy.greenx == PNG_FIXED_ERROR ||
+       xy.greeny == PNG_FIXED_ERROR ||
+       xy.bluex  == PNG_FIXED_ERROR ||
+       xy.bluey  == PNG_FIXED_ERROR)
+   {
+      png_chunk_benign_error(png_ptr, "invalid values");
       return;
    }
 
-#ifdef PNG_READ_sRGB_SUPPORTED
-   if ((info_ptr != NULL) && (info_ptr->valid & PNG_INFO_sRGB))
-   {
-      if (PNG_OUT_OF_RANGE(x_white, 31270,  1000) ||
-          PNG_OUT_OF_RANGE(y_white, 32900,  1000) ||
-          PNG_OUT_OF_RANGE(x_red,   64000,  1000) ||
-          PNG_OUT_OF_RANGE(y_red,   33000,  1000) ||
-          PNG_OUT_OF_RANGE(x_green, 30000,  1000) ||
-          PNG_OUT_OF_RANGE(y_green, 60000,  1000) ||
-          PNG_OUT_OF_RANGE(x_blue,  15000,  1000) ||
-          PNG_OUT_OF_RANGE(y_blue,   6000,  1000))
-      {
-         PNG_WARNING_PARAMETERS(p)
-
-         png_warning_parameter_signed(p, 1, PNG_NUMBER_FORMAT_fixed, x_white);
-         png_warning_parameter_signed(p, 2, PNG_NUMBER_FORMAT_fixed, y_white);
-         png_warning_parameter_signed(p, 3, PNG_NUMBER_FORMAT_fixed, x_red);
-         png_warning_parameter_signed(p, 4, PNG_NUMBER_FORMAT_fixed, y_red);
-         png_warning_parameter_signed(p, 5, PNG_NUMBER_FORMAT_fixed, x_green);
-         png_warning_parameter_signed(p, 6, PNG_NUMBER_FORMAT_fixed, y_green);
-         png_warning_parameter_signed(p, 7, PNG_NUMBER_FORMAT_fixed, x_blue);
-         png_warning_parameter_signed(p, 8, PNG_NUMBER_FORMAT_fixed, y_blue);
-
-         png_formatted_warning(png_ptr, p,
-             "Ignoring incorrect cHRM white(@1,@2) r(@3,@4)g(@5,@6)b(@7,@8) "
-             "when sRGB is also present");
-      }
+   /* If a colorspace error has already been output skip this chunk */
+   if (png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID)
       return;
-   }
-#endif /* PNG_READ_sRGB_SUPPORTED */
 
-#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
-   /* Store the _white values as default coefficients for the rgb to gray
-    * operation if it is supported.  Check if the transform is already set to
-    * avoid destroying the transform values.
-    */
-   if (!png_ptr->rgb_to_gray_coefficients_set)
+   if (png_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM)
    {
-      /* png_set_background has not been called and we haven't seen an sRGB
-       * chunk yet.  Find the XYZ of the three end points.
-       */
-      png_XYZ XYZ;
-      png_xy xy;
-
-      xy.redx = x_red;
-      xy.redy = y_red;
-      xy.greenx = x_green;
-      xy.greeny = y_green;
-      xy.bluex = x_blue;
-      xy.bluey = y_blue;
-      xy.whitex = x_white;
-      xy.whitey = y_white;
-
-      if (png_XYZ_from_xy_checked(png_ptr, &XYZ, xy))
-      {
-         /* The success case, because XYZ_from_xy normalises to a reference
-          * white Y of 1.0 we just need to scale the numbers.  This should
-          * always work just fine. It is an internal error if this overflows.
-          */
-         {
-            png_fixed_point r, g, b;
-            if (png_muldiv(&r, XYZ.redY, 32768, PNG_FP_1) &&
-               r >= 0 && r <= 32768 &&
-               png_muldiv(&g, XYZ.greenY, 32768, PNG_FP_1) &&
-               g >= 0 && g <= 32768 &&
-               png_muldiv(&b, XYZ.blueY, 32768, PNG_FP_1) &&
-               b >= 0 && b <= 32768 &&
-               r+g+b <= 32769)
-            {
-               /* We allow 0 coefficients here.  r+g+b may be 32769 if two or
-                * all of the coefficients were rounded up.  Handle this by
-                * reducing the *largest* coefficient by 1; this matches the
-                * approach used for the default coefficients in pngrtran.c
-                */
-               int add = 0;
-
-               if (r+g+b > 32768)
-                  add = -1;
-               else if (r+g+b < 32768)
-                  add = 1;
-
-               if (add != 0)
-               {
-                  if (g >= r && g >= b)
-                     g += add;
-                  else if (r >= g && r >= b)
-                     r += add;
-                  else
-                     b += add;
-               }
-
-               /* Check for an internal error. */
-               if (r+g+b != 32768)
-                  png_error(png_ptr,
-                     "internal error handling cHRM coefficients");
-
-               png_ptr->rgb_to_gray_red_coeff   = (png_uint_16)r;
-               png_ptr->rgb_to_gray_green_coeff = (png_uint_16)g;
-            }
-
-            /* This is a png_error at present even though it could be ignored -
-             * it should never happen, but it is important that if it does, the
-             * bug is fixed.
-             */
-            else
-               png_error(png_ptr, "internal error handling cHRM->XYZ");
-         }
-      }
+      png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID;
+      png_colorspace_sync(png_ptr, info_ptr);
+      png_chunk_benign_error(png_ptr, "duplicate");
+      return;
    }
-#endif
 
-   png_set_cHRM_fixed(png_ptr, info_ptr, x_white, y_white, x_red, y_red,
-      x_green, y_green, x_blue, y_blue);
+   png_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
+   (void)png_colorspace_set_chromaticities(png_ptr, &png_ptr->colorspace, &xy,
+      1/*prefer cHRM values*/);
+   png_colorspace_sync(png_ptr, info_ptr);
 }
 #endif
 
 #ifdef PNG_READ_sRGB_SUPPORTED
 void /* PRIVATE */
-png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_sRGB(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
-   int intent;
-   png_byte buf[1];
+   png_byte intent;
 
    png_debug(1, "in png_handle_sRGB");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before sRGB");
+      png_chunk_error(png_ptr, "missing IHDR");
 
-   else if (png_ptr->mode & PNG_HAVE_IDAT)
+   else if (png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE))
    {
-      png_warning(png_ptr, "Invalid sRGB after IDAT");
-      png_crc_finish(png_ptr, length);
-      return;
-   }
-
-   else if (png_ptr->mode & PNG_HAVE_PLTE)
-      /* Should be an error, but we can cope with it */
-      png_warning(png_ptr, "Out of place sRGB chunk");
-
-   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB))
-   {
-      png_warning(png_ptr, "Duplicate sRGB chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    if (length != 1)
    {
-      png_warning(png_ptr, "Incorrect sRGB chunk length");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
-   png_crc_read(png_ptr, buf, 1);
+   png_crc_read(png_ptr, &intent, 1);
 
    if (png_crc_finish(png_ptr, 0))
       return;
 
-   intent = buf[0];
-
-   /* Check for bad intent */
-   if (intent >= PNG_sRGB_INTENT_LAST)
-   {
-      png_warning(png_ptr, "Unknown sRGB intent");
+   /* If a colorspace error has already been output skip this chunk */
+   if (png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID)
       return;
-   }
 
-#if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED)
-   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA))
+   /* Only one sRGB or iCCP chunk is allowed, use the HAVE_INTENT flag to detect
+    * this.
+    */
+   if (png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_INTENT)
    {
-      if (PNG_OUT_OF_RANGE(info_ptr->gamma, 45500, 500))
-      {
-         PNG_WARNING_PARAMETERS(p)
-
-         png_warning_parameter_signed(p, 1, PNG_NUMBER_FORMAT_fixed,
-            info_ptr->gamma);
-
-         png_formatted_warning(png_ptr, p,
-             "Ignoring incorrect gAMA value @1 when sRGB is also present");
-      }
+      png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID;
+      png_colorspace_sync(png_ptr, info_ptr);
+      png_chunk_benign_error(png_ptr, "too many profiles");
+      return;
    }
-#endif /* PNG_READ_gAMA_SUPPORTED */
-
-#ifdef PNG_READ_cHRM_SUPPORTED
-   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
-      if (PNG_OUT_OF_RANGE(info_ptr->x_white, 31270,  1000) ||
-          PNG_OUT_OF_RANGE(info_ptr->y_white, 32900,  1000) ||
-          PNG_OUT_OF_RANGE(info_ptr->x_red,   64000,  1000) ||
-          PNG_OUT_OF_RANGE(info_ptr->y_red,   33000,  1000) ||
-          PNG_OUT_OF_RANGE(info_ptr->x_green, 30000,  1000) ||
-          PNG_OUT_OF_RANGE(info_ptr->y_green, 60000,  1000) ||
-          PNG_OUT_OF_RANGE(info_ptr->x_blue,  15000,  1000) ||
-          PNG_OUT_OF_RANGE(info_ptr->y_blue,   6000,  1000))
-      {
-         png_warning(png_ptr,
-             "Ignoring incorrect cHRM value when sRGB is also present");
-      }
-#endif /* PNG_READ_cHRM_SUPPORTED */
-
-   /* This is recorded for use when handling the cHRM chunk above.  An sRGB
-    * chunk unconditionally overwrites the coefficients for grayscale conversion
-    * too.
-    */
-   png_ptr->is_sRGB = 1;
 
-#  ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
-      /* Don't overwrite user supplied values: */
-      if (!png_ptr->rgb_to_gray_coefficients_set)
-      {
-         /* These numbers come from the sRGB specification (or, since one has to
-          * pay much money to get a copy, the wikipedia sRGB page) the
-          * chromaticity values quoted have been inverted to get the reverse
-          * transformation from RGB to XYZ and the 'Y' coefficients scaled by
-          * 32768 (then rounded).
-          *
-          * sRGB and ITU Rec-709 both truncate the values for the D65 white
-          * point to four digits and, even though it actually stores five
-          * digits, the PNG spec gives the truncated value.
-          *
-          * This means that when the chromaticities are converted back to XYZ
-          * end points we end up with (6968,23435,2366), which, as described in
-          * pngrtran.c, would overflow.  If the five digit precision and up is
-          * used we get, instead:
-          *
-          *    6968*R + 23435*G + 2365*B
-          *
-          * (Notice that this rounds the blue coefficient down, rather than the
-          * choice used in pngrtran.c which is to round the green one down.)
-          */
-         png_ptr->rgb_to_gray_red_coeff   =  6968; /* 0.212639005871510 */
-         png_ptr->rgb_to_gray_green_coeff = 23434; /* 0.715168678767756 */
-         /* png_ptr->rgb_to_gray_blue_coeff  =  2366; 0.072192315360734        */
-
-         /* The following keeps the cHRM chunk from destroying the
-          * coefficients again in the event that it follows the sRGB chunk.
-          */
-         png_ptr->rgb_to_gray_coefficients_set = 1;
-      }
-#  endif
-
-   png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, intent);
+   (void)png_colorspace_set_sRGB(png_ptr, &png_ptr->colorspace, intent);
+   png_colorspace_sync(png_ptr, info_ptr);
 }
 #endif /* PNG_READ_sRGB_SUPPORTED */
 
 #ifdef PNG_READ_iCCP_SUPPORTED
 void /* PRIVATE */
-png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
-/* Note: this does not properly handle chunks that are > 64K under DOS */
+png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
+/* Note: this does not properly handle profiles that are > 64K under DOS */
 {
-   png_byte compression_type;
-   png_bytep pC;
-   png_charp profile;
-   png_uint_32 skip = 0;
-   png_uint_32 profile_size;
-   png_alloc_size_t profile_length;
-   png_size_t slength, prefix_length, data_length;
+   png_const_charp errmsg = NULL; /* error message output, or no error */
+   int finished = 0; /* crc checked */
 
    png_debug(1, "in png_handle_iCCP");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before iCCP");
+      png_chunk_error(png_ptr, "missing IHDR");
 
-   else if (png_ptr->mode & PNG_HAVE_IDAT)
+   else if (png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE))
    {
-      png_warning(png_ptr, "Invalid iCCP after IDAT");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
-   else if (png_ptr->mode & PNG_HAVE_PLTE)
-      /* Should be an error, but we can cope with it */
-      png_warning(png_ptr, "Out of place iCCP chunk");
-
-   if ((png_ptr->mode & PNG_HAVE_iCCP) || (info_ptr != NULL &&
-      (info_ptr->valid & (PNG_INFO_iCCP|PNG_INFO_sRGB))))
+   /* Consistent with all the above colorspace handling an obviously *invalid*
+    * chunk is just ignored, so does not invalidate the color space.  An
+    * alternative is to set the 'invalid' flags at the start of this routine
+    * and only clear them in they were not set before and all the tests pass.
+    * The minimum 'deflate' stream is assumed to be just the 2 byte header and 4
+    * byte checksum.  The keyword must be one character and there is a
+    * terminator (0) byte and the compression method.
+    */
+   if (length < 9)
    {
-      png_warning(png_ptr, "Duplicate iCCP chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "too short");
       return;
    }
 
-   png_ptr->mode |= PNG_HAVE_iCCP;
-
-#ifdef PNG_MAX_MALLOC_64K
-   if (length > (png_uint_32)65535L)
+   /* If a colorspace error has already been output skip this chunk */
+   if (png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID)
    {
-      png_warning(png_ptr, "iCCP chunk too large to fit in memory");
-      skip = length - (png_uint_32)65535L;
-      length = (png_uint_32)65535L;
+      png_crc_finish(png_ptr, length);
+      return;
    }
-#endif
 
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = (png_charp)png_malloc(png_ptr, length + 1);
-   slength = length;
-   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
-
-   if (png_crc_finish(png_ptr, skip))
+   /* Only one sRGB or iCCP chunk is allowed, use the HAVE_INTENT flag to detect
+    * this.
+    */
+   if ((png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_INTENT) == 0)
    {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
-   }
+      uInt read_length, keyword_length;
+      char keyword[81];
 
-   png_ptr->chunkdata[slength] = 0x00;
+      /* Find the keyword; the keyword plus separator and compression method
+       * bytes can be at most 81 characters long.
+       */
+      read_length = 81; /* maximum */
+      if (read_length > length)
+         read_length = (uInt)length;
 
-   for (profile = png_ptr->chunkdata; *profile; profile++)
-      /* Empty loop to find end of name */ ;
+      png_crc_read(png_ptr, (png_bytep)keyword, read_length);
+      length -= read_length;
 
-   ++profile;
+      keyword_length = 0;
+      while (keyword_length < 80 && keyword_length < read_length &&
+         keyword[keyword_length] != 0)
+         ++keyword_length;
 
-   /* There should be at least one zero (the compression type byte)
-    * following the separator, and we should be on it
-    */
-   if (profile >= png_ptr->chunkdata + slength - 1)
-   {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      png_warning(png_ptr, "Malformed iCCP chunk");
-      return;
-   }
+      /* TODO: make the keyword checking common */
+      if (keyword_length >= 1 && keyword_length <= 79)
+      {
+         /* We only understand '0' compression - deflate - so if we get a
+          * different value we can't safely decode the chunk.
+          */
+         if (keyword_length+1 < read_length &&
+            keyword[keyword_length+1] == PNG_COMPRESSION_TYPE_BASE)
+         {
+            read_length -= keyword_length+2;
 
-   /* Compression_type should always be zero */
-   compression_type = *profile++;
+            if (png_inflate_claim(png_ptr, png_iCCP,
+               png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN ? 15 : 0) == Z_OK)
+            {
+               Byte profile_header[132];
+               Byte local_buffer[PNG_INFLATE_BUF_SIZE];
+               png_alloc_size_t size = (sizeof profile_header);
 
-   if (compression_type)
-   {
-      png_warning(png_ptr, "Ignoring nonzero compression type in iCCP chunk");
-      compression_type = 0x00;  /* Reset it to zero (libpng-1.0.6 through 1.0.8
-                                 wrote nonzero) */
-   }
+               png_ptr->zstream.next_in = (Bytef*)keyword + (keyword_length+2);
+               png_ptr->zstream.avail_in = read_length;
+               (void)png_inflate_read(png_ptr, local_buffer,
+                  (sizeof local_buffer), &length, profile_header, &size,
+                  0/*finish: don't, because the output is too small*/);
 
-   prefix_length = profile - png_ptr->chunkdata;
-   png_decompress_chunk(png_ptr, compression_type,
-       slength, prefix_length, &data_length);
+               if (size == 0)
+               {
+                  /* We have the ICC profile header; do the basic header checks.
+                   */
+                  const png_uint_32 profile_length =
+                     png_get_uint_32(profile_header);
 
-   profile_length = data_length - prefix_length;
+                  if (png_icc_check_length(png_ptr, &png_ptr->colorspace,
+                     keyword, profile_length))
+                  {
+                     /* The length is apparently ok, so we can check the 132
+                      * byte header.
+                      */
+                     if (png_icc_check_header(png_ptr, &png_ptr->colorspace,
+                        keyword, profile_length, profile_header,
+                        png_ptr->color_type))
+                     {
+                        /* Now read the tag table; a variable size buffer is
+                         * needed at this point, allocate one for the whole
+                         * profile.  The header check has already validated
+                         * that none of these stuff will overflow.
+                         */
+                        const png_uint_32 tag_count = png_get_uint_32(
+                           profile_header+128);
+                        png_bytep profile = png_read_buffer(png_ptr,
+                           profile_length, 2/*silent*/);
+
+                        if (profile != NULL)
+                        {
+                           memcpy(profile, profile_header,
+                              (sizeof profile_header));
+
+                           size = 12 * tag_count;
+
+                           (void)png_inflate_read(png_ptr, local_buffer,
+                              (sizeof local_buffer), &length,
+                              profile + (sizeof profile_header), &size, 0);
+
+                           /* Still expect a a buffer error because we expect
+                            * there to be some tag data!
+                            */
+                           if (size == 0)
+                           {
+                              if (png_icc_check_tag_table(png_ptr,
+                                 &png_ptr->colorspace, keyword, profile_length,
+                                 profile))
+                              {
+                                 /* The profile has been validated for basic
+                                  * security issues, so read the whole thing in.
+                                  */
+                                 size = profile_length - (sizeof profile_header)
+                                    - 12 * tag_count;
+
+                                 (void)png_inflate_read(png_ptr, local_buffer,
+                                    (sizeof local_buffer), &length,
+                                    profile + (sizeof profile_header) +
+                                    12 * tag_count, &size, 1/*finish*/);
+
+                                 if (length > 0 && !(png_ptr->flags &
+                                       PNG_FLAG_BENIGN_ERRORS_WARN))
+                                    errmsg = "extra compressed data";
+
+                                 /* But otherwise allow extra data: */
+                                 else if (size == 0)
+                                 {
+                                    if (length > 0)
+                                    {
+                                       /* This can be handled completely, so
+                                        * keep going.
+                                        */
+                                       png_chunk_warning(png_ptr,
+                                          "extra compressed data");
+                                    }
+
+                                    png_crc_finish(png_ptr, length);
+                                    finished = 1;
+
+#                                   ifdef PNG_sRGB_SUPPORTED
+                                       /* Check for a match against sRGB */
+                                       png_icc_set_sRGB(png_ptr,
+                                          &png_ptr->colorspace, profile,
+                                          png_ptr->zstream.adler);
+#                                   endif
+
+                                    /* Steal the profile for info_ptr. */
+                                    if (info_ptr != NULL)
+                                    {
+                                       png_free_data(png_ptr, info_ptr,
+                                          PNG_FREE_ICCP, 0);
+
+                                       info_ptr->iccp_name = png_voidcast(char*,
+                                          png_malloc_base(png_ptr,
+                                          keyword_length+1));
+                                       if (info_ptr->iccp_name != NULL)
+                                       {
+                                          memcpy(info_ptr->iccp_name, keyword,
+                                             keyword_length+1);
+                                          info_ptr->iccp_proflen =
+                                             profile_length;
+                                          info_ptr->iccp_profile = profile;
+                                          png_ptr->read_buffer = NULL; /*steal*/
+                                          info_ptr->free_me |= PNG_FREE_ICCP;
+                                          info_ptr->valid |= PNG_INFO_iCCP;
+                                       }
+
+                                       else
+                                       {
+                                          png_ptr->colorspace.flags |=
+                                             PNG_COLORSPACE_INVALID;
+                                          errmsg = "out of memory";
+                                       }
+                                    }
+
+                                    /* else the profile remains in the read
+                                     * buffer which gets reused for subsequent
+                                     * chunks.
+                                     */
+
+                                    if (info_ptr != NULL)
+                                       png_colorspace_sync(png_ptr, info_ptr);
+
+                                    if (errmsg == NULL)
+                                    {
+                                       png_ptr->zowner = 0;
+                                       return;
+                                    }
+                                 }
+
+                                 else if (size > 0)
+                                    errmsg = "truncated";
+
+                                 else
+                                    errmsg = png_ptr->zstream.msg;
+                              }
+
+                              /* else png_icc_check_tag_table output an error */
+                           }
+
+                           else /* profile truncated */
+                              errmsg = png_ptr->zstream.msg;
+                        }
 
-   if (prefix_length > data_length || profile_length < 4)
-   {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      png_warning(png_ptr, "Profile size field missing from iCCP chunk");
-      return;
-   }
+                        else
+                           errmsg = "out of memory";
+                     }
+
+                     /* else png_icc_check_header output an error */
+                  }
 
-   /* Check the profile_size recorded in the first 32 bits of the ICC profile */
-   pC = (png_bytep)(png_ptr->chunkdata + prefix_length);
-   profile_size = ((*(pC    )) << 24) |
-                  ((*(pC + 1)) << 16) |
-                  ((*(pC + 2)) <<  8) |
-                  ((*(pC + 3))      );
+                  /* else png_icc_check_length output an error */
+               }
 
-   /* NOTE: the following guarantees that 'profile_length' fits into 32 bits,
-    * because profile_size is a 32 bit value.
-    */
-   if (profile_size < profile_length)
-      profile_length = profile_size;
+               else /* profile truncated */
+                  errmsg = png_ptr->zstream.msg;
 
-   /* And the following guarantees that profile_size == profile_length. */
-   if (profile_size > profile_length)
-   {
-      PNG_WARNING_PARAMETERS(p)
+               /* Release the stream */
+               png_ptr->zowner = 0;
+            }
 
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
+            else /* png_inflate_claim failed */
+               errmsg = png_ptr->zstream.msg;
+         }
 
-      png_warning_parameter_unsigned(p, 1, PNG_NUMBER_FORMAT_u, profile_size);
-      png_warning_parameter_unsigned(p, 2, PNG_NUMBER_FORMAT_u, profile_length);
-      png_formatted_warning(png_ptr, p,
-         "Ignoring iCCP chunk with declared size = @1 and actual length = @2");
-      return;
+         else
+            errmsg = "bad compression method"; /* or missing */
+      }
+
+      else
+         errmsg = "bad keyword";
    }
 
-   png_set_iCCP(png_ptr, info_ptr, png_ptr->chunkdata,
-       compression_type, (png_bytep)png_ptr->chunkdata + prefix_length,
-       profile_size);
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = NULL;
+   else
+      errmsg = "too many profiles";
+
+   /* Failure: the reason is in 'errmsg' */
+   if (!finished)
+      png_crc_finish(png_ptr, length);
+
+   png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID;
+   png_colorspace_sync(png_ptr, info_ptr);
+   if (errmsg != NULL) /* else already output */
+      png_chunk_benign_error(png_ptr, errmsg);
 }
 #endif /* PNG_READ_iCCP_SUPPORTED */
 
 #ifdef PNG_READ_sPLT_SUPPORTED
 void /* PRIVATE */
-png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 /* Note: this does not properly handle chunks that are > 64K under DOS */
 {
-   png_bytep entry_start;
+   png_bytep entry_start, buffer;
    png_sPLT_t new_palette;
    png_sPLT_entryp pp;
    png_uint_32 data_length;
    int entry_size, i;
    png_uint_32 skip = 0;
-   png_size_t slength;
    png_uint_32 dl;
    png_size_t max_dl;
 
    png_debug(1, "in png_handle_sPLT");
 
 #ifdef PNG_USER_LIMITS_SUPPORTED
-
    if (png_ptr->user_chunk_cache_max != 0)
    {
       if (png_ptr->user_chunk_cache_max == 1)
@@ -1403,54 +1590,52 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 #endif
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before sPLT");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    else if (png_ptr->mode & PNG_HAVE_IDAT)
    {
-      png_warning(png_ptr, "Invalid sPLT after IDAT");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
 #ifdef PNG_MAX_MALLOC_64K
-   if (length > (png_uint_32)65535L)
+   if (length > 65535U)
    {
-      png_warning(png_ptr, "sPLT chunk too large to fit in memory");
-      skip = length - (png_uint_32)65535L;
-      length = (png_uint_32)65535L;
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "too large to fit in memory");
+      return;
    }
 #endif
 
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = (png_charp)png_malloc(png_ptr, length + 1);
+   buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/);
+   if (buffer == NULL)
+   {
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of memory");
+      return;
+   }
+
 
    /* WARNING: this may break if size_t is less than 32 bits; it is assumed
     * that the PNG_MAX_MALLOC_64K test is enabled in this case, but this is a
     * potential breakage point if the types in pngconf.h aren't exactly right.
     */
-   slength = length;
-   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
+   png_crc_read(png_ptr, buffer, length);
 
    if (png_crc_finish(png_ptr, skip))
-   {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
       return;
-   }
 
-   png_ptr->chunkdata[slength] = 0x00;
+   buffer[length] = 0;
 
-   for (entry_start = (png_bytep)png_ptr->chunkdata; *entry_start;
-       entry_start++)
+   for (entry_start = buffer; *entry_start; entry_start++)
       /* Empty loop to find end of name */ ;
 
    ++entry_start;
 
    /* A sample depth should follow the separator, and we should be on it  */
-   if (entry_start > (png_bytep)png_ptr->chunkdata + slength - 2)
+   if (entry_start > buffer + length - 2)
    {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
       png_warning(png_ptr, "malformed sPLT chunk");
       return;
    }
@@ -1458,23 +1643,19 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    new_palette.depth = *entry_start++;
    entry_size = (new_palette.depth == 8 ? 6 : 10);
    /* This must fit in a png_uint_32 because it is derived from the original
-    * chunk data length (and use 'length', not 'slength' here for clarity -
-    * they are guaranteed to be the same, see the tests above.)
+    * chunk data length.
     */
-   data_length = length - (png_uint_32)(entry_start -
-      (png_bytep)png_ptr->chunkdata);
+   data_length = length - (png_uint_32)(entry_start - buffer);
 
    /* Integrity-check the data length */
    if (data_length % entry_size)
    {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
       png_warning(png_ptr, "sPLT chunk has bad length");
       return;
    }
 
    dl = (png_int_32)(data_length / entry_size);
-   max_dl = PNG_SIZE_MAX / png_sizeof(png_sPLT_entry);
+   max_dl = PNG_SIZE_MAX / (sizeof (png_sPLT_entry));
 
    if (dl > max_dl)
    {
@@ -1485,7 +1666,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    new_palette.nentries = (png_int_32)(data_length / entry_size);
 
    new_palette.entries = (png_sPLT_entryp)png_malloc_warn(
-       png_ptr, new_palette.nentries * png_sizeof(png_sPLT_entry));
+       png_ptr, new_palette.nentries * (sizeof (png_sPLT_entry)));
 
    if (new_palette.entries == NULL)
    {
@@ -1543,38 +1724,36 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 #endif
 
    /* Discard all chunk data except the name and stash that */
-   new_palette.name = png_ptr->chunkdata;
+   new_palette.name = (png_charp)buffer;
 
    png_set_sPLT(png_ptr, info_ptr, &new_palette, 1);
 
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = NULL;
    png_free(png_ptr, new_palette.entries);
 }
 #endif /* PNG_READ_sPLT_SUPPORTED */
 
 #ifdef PNG_READ_tRNS_SUPPORTED
 void /* PRIVATE */
-png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_byte readbuf[PNG_MAX_PALETTE_LENGTH];
 
    png_debug(1, "in png_handle_tRNS");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before tRNS");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    else if (png_ptr->mode & PNG_HAVE_IDAT)
    {
-      png_warning(png_ptr, "Invalid tRNS after IDAT");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
    {
-      png_warning(png_ptr, "Duplicate tRNS chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
       return;
    }
 
@@ -1584,8 +1763,8 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
       if (length != 2)
       {
-         png_warning(png_ptr, "Incorrect tRNS chunk length");
          png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "invalid");
          return;
       }
 
@@ -1600,12 +1779,12 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
       if (length != 6)
       {
-         png_warning(png_ptr, "Incorrect tRNS chunk length");
          png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "invalid");
          return;
       }
 
-      png_crc_read(png_ptr, buf, (png_size_t)length);
+      png_crc_read(png_ptr, buf, length);
       png_ptr->num_trans = 1;
       png_ptr->trans_color.red = png_get_uint_16(buf);
       png_ptr->trans_color.green = png_get_uint_16(buf + 2);
@@ -1616,33 +1795,28 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    {
       if (!(png_ptr->mode & PNG_HAVE_PLTE))
       {
-         /* Should be an error, but we can cope with it. */
-         png_warning(png_ptr, "Missing PLTE before tRNS");
-      }
-
-      if (length > (png_uint_32)png_ptr->num_palette ||
-          length > PNG_MAX_PALETTE_LENGTH)
-      {
-         png_warning(png_ptr, "Incorrect tRNS chunk length");
+         /* TODO: is this actually an error in the ISO spec? */
          png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "out of place");
          return;
       }
 
-      if (length == 0)
+      if (length > png_ptr->num_palette || length > PNG_MAX_PALETTE_LENGTH ||
+         length == 0)
       {
-         png_warning(png_ptr, "Zero length tRNS chunk");
          png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "invalid");
          return;
       }
 
-      png_crc_read(png_ptr, readbuf, (png_size_t)length);
+      png_crc_read(png_ptr, readbuf, length);
       png_ptr->num_trans = (png_uint_16)length;
    }
 
    else
    {
-      png_warning(png_ptr, "tRNS chunk not allowed with alpha channel");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid with alpha channel");
       return;
    }
 
@@ -1652,6 +1826,10 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
       return;
    }
 
+   /* TODO: this is a horrible side effect in the palette case because the
+    * png_struct ends up with a pointer to the tRNS buffer owned by the
+    * png_info.  Fix this.
+    */
    png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans,
        &(png_ptr->trans_color));
 }
@@ -1659,36 +1837,30 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
 #ifdef PNG_READ_bKGD_SUPPORTED
 void /* PRIVATE */
-png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
-   png_size_t truelen;
+   unsigned int truelen;
    png_byte buf[6];
    png_color_16 background;
 
    png_debug(1, "in png_handle_bKGD");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before bKGD");
+      png_chunk_error(png_ptr, "missing IHDR");
 
-   else if (png_ptr->mode & PNG_HAVE_IDAT)
+   else if ((png_ptr->mode & PNG_HAVE_IDAT) ||
+      (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
+       !(png_ptr->mode & PNG_HAVE_PLTE)))
    {
-      png_warning(png_ptr, "Invalid bKGD after IDAT");
-      png_crc_finish(png_ptr, length);
-      return;
-   }
-
-   else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
-       !(png_ptr->mode & PNG_HAVE_PLTE))
-   {
-      png_warning(png_ptr, "Missing PLTE before bKGD");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD))
    {
-      png_warning(png_ptr, "Duplicate bKGD chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
       return;
    }
 
@@ -1703,8 +1875,8 @@ png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
    if (length != truelen)
    {
-      png_warning(png_ptr, "Incorrect bKGD chunk length");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
@@ -1726,7 +1898,7 @@ png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
       {
          if (buf[0] >= info_ptr->num_palette)
          {
-            png_warning(png_ptr, "Incorrect bKGD chunk index value");
+            png_chunk_benign_error(png_ptr, "invalid index");
             return;
          }
 
@@ -1765,7 +1937,7 @@ png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
 #ifdef PNG_READ_hIST_SUPPORTED
 void /* PRIVATE */
-png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    unsigned int num, i;
    png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH];
@@ -1773,39 +1945,31 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    png_debug(1, "in png_handle_hIST");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before hIST");
+      png_chunk_error(png_ptr, "missing IHDR");
 
-   else if (png_ptr->mode & PNG_HAVE_IDAT)
+   else if ((png_ptr->mode & PNG_HAVE_IDAT) || !(png_ptr->mode & PNG_HAVE_PLTE))
    {
-      png_warning(png_ptr, "Invalid hIST after IDAT");
-      png_crc_finish(png_ptr, length);
-      return;
-   }
-
-   else if (!(png_ptr->mode & PNG_HAVE_PLTE))
-   {
-      png_warning(png_ptr, "Missing PLTE before hIST");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST))
    {
-      png_warning(png_ptr, "Duplicate hIST chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
       return;
    }
 
-   if (length > 2*PNG_MAX_PALETTE_LENGTH ||
-       length != (unsigned int) (2*png_ptr->num_palette))
+   num = length / 2 ;
+
+   if (num != png_ptr->num_palette || num > PNG_MAX_PALETTE_LENGTH)
    {
-      png_warning(png_ptr, "Incorrect hIST chunk length");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
-   num = length / 2 ;
-
    for (i = 0; i < num; i++)
    {
       png_byte buf[2];
@@ -1823,7 +1987,7 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
 #ifdef PNG_READ_pHYs_SUPPORTED
 void /* PRIVATE */
-png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_pHYs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_byte buf[9];
    png_uint_32 res_x, res_y;
@@ -1832,26 +1996,26 @@ png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    png_debug(1, "in png_handle_pHYs");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before pHYs");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    else if (png_ptr->mode & PNG_HAVE_IDAT)
    {
-      png_warning(png_ptr, "Invalid pHYs after IDAT");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
    {
-      png_warning(png_ptr, "Duplicate pHYs chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
       return;
    }
 
    if (length != 9)
    {
-      png_warning(png_ptr, "Incorrect pHYs chunk length");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
@@ -1869,7 +2033,7 @@ png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
 #ifdef PNG_READ_oFFs_SUPPORTED
 void /* PRIVATE */
-png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_oFFs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_byte buf[9];
    png_int_32 offset_x, offset_y;
@@ -1878,26 +2042,26 @@ png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    png_debug(1, "in png_handle_oFFs");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before oFFs");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    else if (png_ptr->mode & PNG_HAVE_IDAT)
    {
-      png_warning(png_ptr, "Invalid oFFs after IDAT");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
    {
-      png_warning(png_ptr, "Duplicate oFFs chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
       return;
    }
 
    if (length != 9)
    {
-      png_warning(png_ptr, "Incorrect oFFs chunk length");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
@@ -1916,71 +2080,64 @@ png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 #ifdef PNG_READ_pCAL_SUPPORTED
 /* Read the pCAL chunk (described in the PNG Extensions document) */
 void /* PRIVATE */
-png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_pCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_int_32 X0, X1;
    png_byte type, nparams;
-   png_charp buf, units, endptr;
+   png_bytep buffer, buf, units, endptr;
    png_charpp params;
-   png_size_t slength;
    int i;
 
    png_debug(1, "in png_handle_pCAL");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before pCAL");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    else if (png_ptr->mode & PNG_HAVE_IDAT)
    {
-      png_warning(png_ptr, "Invalid pCAL after IDAT");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL))
    {
-      png_warning(png_ptr, "Duplicate pCAL chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
       return;
    }
 
    png_debug1(2, "Allocating and reading pCAL chunk data (%u bytes)",
        length + 1);
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
 
-   if (png_ptr->chunkdata == NULL)
+   buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/);
+
+   if (buffer == NULL)
    {
-      png_warning(png_ptr, "No memory for pCAL purpose");
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of memory");
       return;
    }
 
-   slength = length;
-   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
+   png_crc_read(png_ptr, buffer, length);
 
    if (png_crc_finish(png_ptr, 0))
-   {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
       return;
-   }
 
-   png_ptr->chunkdata[slength] = 0x00; /* Null terminate the last string */
+   buffer[length] = 0; /* Null terminate the last string */
 
    png_debug(3, "Finding end of pCAL purpose string");
-   for (buf = png_ptr->chunkdata; *buf; buf++)
+   for (buf = buffer; *buf; buf++)
       /* Empty loop */ ;
 
-   endptr = png_ptr->chunkdata + slength;
+   endptr = buffer + length;
 
    /* We need to have at least 12 bytes after the purpose string
     * in order to get the parameter information.
     */
    if (endptr <= buf + 12)
    {
-      png_warning(png_ptr, "Invalid pCAL data");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
@@ -2000,15 +2157,13 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
        (type == PNG_EQUATION_ARBITRARY && nparams != 3) ||
        (type == PNG_EQUATION_HYPERBOLIC && nparams != 4))
    {
-      png_warning(png_ptr, "Invalid pCAL parameters for equation type");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
+      png_chunk_benign_error(png_ptr, "invalid parameter count");
       return;
    }
 
    else if (type >= PNG_EQUATION_LAST)
    {
-      png_warning(png_ptr, "Unrecognized equation type for pCAL chunk");
+      png_chunk_benign_error(png_ptr, "unrecognized equation type");
    }
 
    for (buf = units; *buf; buf++)
@@ -2016,43 +2171,37 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
    png_debug(3, "Allocating pCAL parameters array");
 
-   params = (png_charpp)png_malloc_warn(png_ptr,
-       (png_size_t)(nparams * png_sizeof(png_charp)));
+   params = png_voidcast(png_charpp, png_malloc_warn(png_ptr,
+       nparams * (sizeof (png_charp))));
 
    if (params == NULL)
    {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      png_warning(png_ptr, "No memory for pCAL params");
+      png_chunk_benign_error(png_ptr, "out of memory");
       return;
    }
 
    /* Get pointers to the start of each parameter string. */
-   for (i = 0; i < (int)nparams; i++)
+   for (i = 0; i < nparams; i++)
    {
       buf++; /* Skip the null string terminator from previous parameter. */
 
       png_debug1(3, "Reading pCAL parameter %d", i);
 
-      for (params[i] = buf; buf <= endptr && *buf != 0x00; buf++)
+      for (params[i] = (png_charp)buf; buf <= endptr && *buf != 0; buf++)
          /* Empty loop to move past each parameter string */ ;
 
       /* Make sure we haven't run out of data yet */
       if (buf > endptr)
       {
-         png_warning(png_ptr, "Invalid pCAL data");
-         png_free(png_ptr, png_ptr->chunkdata);
-         png_ptr->chunkdata = NULL;
          png_free(png_ptr, params);
+         png_chunk_benign_error(png_ptr, "invalid data");
          return;
       }
    }
 
-   png_set_pCAL(png_ptr, info_ptr, png_ptr->chunkdata, X0, X1, type, nparams,
-      units, params);
+   png_set_pCAL(png_ptr, info_ptr, (png_charp)buffer, X0, X1, type, nparams,
+      (png_charp)units, params);
 
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = NULL;
    png_free(png_ptr, params);
 }
 #endif
@@ -2060,67 +2209,61 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 #ifdef PNG_READ_sCAL_SUPPORTED
 /* Read the sCAL chunk */
 void /* PRIVATE */
-png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
-   png_size_t slength, i;
+   png_bytep buffer;
+   png_size_t i;
    int state;
 
    png_debug(1, "in png_handle_sCAL");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before sCAL");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    else if (png_ptr->mode & PNG_HAVE_IDAT)
    {
-      png_warning(png_ptr, "Invalid sCAL after IDAT");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of place");
       return;
    }
 
    else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL))
    {
-      png_warning(png_ptr, "Duplicate sCAL chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
       return;
    }
 
    /* Need unit type, width, \0, height: minimum 4 bytes */
    else if (length < 4)
    {
-      png_warning(png_ptr, "sCAL chunk too short");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
    png_debug1(2, "Allocating and reading sCAL chunk data (%u bytes)",
       length + 1);
 
-   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
+   buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/);
 
-   if (png_ptr->chunkdata == NULL)
+   if (buffer == NULL)
    {
-      png_warning(png_ptr, "Out of memory while processing sCAL chunk");
+      png_chunk_benign_error(png_ptr, "out of memory");
       png_crc_finish(png_ptr, length);
       return;
    }
 
-   slength = length;
-   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
-   png_ptr->chunkdata[slength] = 0x00; /* Null terminate the last string */
+   png_crc_read(png_ptr, buffer, length);
+   buffer[length] = 0; /* Null terminate the last string */
 
    if (png_crc_finish(png_ptr, 0))
-   {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
       return;
-   }
 
    /* Validate the unit. */
-   if (png_ptr->chunkdata[0] != 1 && png_ptr->chunkdata[0] != 2)
+   if (buffer[0] != 1 && buffer[0] != 2)
    {
-      png_warning(png_ptr, "Invalid sCAL ignored: invalid unit");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
+      png_chunk_benign_error(png_ptr, "invalid unit");
       return;
    }
 
@@ -2130,41 +2273,36 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    i = 1;
    state = 0;
 
-   if (!png_check_fp_number(png_ptr->chunkdata, slength, &state, &i) ||
-       i >= slength || png_ptr->chunkdata[i++] != 0)
-      png_warning(png_ptr, "Invalid sCAL chunk ignored: bad width format");
+   if (!png_check_fp_number((png_const_charp)buffer, length, &state, &i) ||
+       i >= length || buffer[i++] != 0)
+      png_chunk_benign_error(png_ptr, "bad width format");
 
    else if (!PNG_FP_IS_POSITIVE(state))
-      png_warning(png_ptr, "Invalid sCAL chunk ignored: non-positive width");
+      png_chunk_benign_error(png_ptr, "non-positive width");
 
    else
    {
       png_size_t heighti = i;
 
       state = 0;
-      if (!png_check_fp_number(png_ptr->chunkdata, slength, &state, &i) ||
-          i != slength)
-         png_warning(png_ptr, "Invalid sCAL chunk ignored: bad height format");
+      if (!png_check_fp_number((png_const_charp)buffer, length, &state, &i) ||
+         i != length)
+         png_chunk_benign_error(png_ptr, "bad height format");
 
       else if (!PNG_FP_IS_POSITIVE(state))
-         png_warning(png_ptr,
-            "Invalid sCAL chunk ignored: non-positive height");
+         png_chunk_benign_error(png_ptr, "non-positive height");
 
       else
          /* This is the (only) success case. */
-         png_set_sCAL_s(png_ptr, info_ptr, png_ptr->chunkdata[0],
-            png_ptr->chunkdata+1, png_ptr->chunkdata+heighti);
+         png_set_sCAL_s(png_ptr, info_ptr, buffer[0],
+            (png_charp)buffer+1, (png_charp)buffer+heighti);
    }
-
-   /* Clean up - just free the temporarily allocated buffer. */
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = NULL;
 }
 #endif
 
 #ifdef PNG_READ_tIME_SUPPORTED
 void /* PRIVATE */
-png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_tIME(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
    png_byte buf[7];
    png_time mod_time;
@@ -2172,12 +2310,12 @@ png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
    png_debug(1, "in png_handle_tIME");
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Out of place tIME chunk");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME))
    {
-      png_warning(png_ptr, "Duplicate tIME chunk");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
       return;
    }
 
@@ -2186,8 +2324,8 @@ png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
    if (length != 7)
    {
-      png_warning(png_ptr, "Incorrect tIME chunk length");
       png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "invalid");
       return;
    }
 
@@ -2210,14 +2348,13 @@ png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 #ifdef PNG_READ_tEXt_SUPPORTED
 /* Note: this does not properly handle chunks that are > 64K under DOS */
 void /* PRIVATE */
-png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_tEXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
-   png_textp text_ptr;
+   png_text  text_info;
+   png_bytep buffer;
    png_charp key;
    png_charp text;
    png_uint_32 skip = 0;
-   png_size_t slength;
-   int ret;
 
    png_debug(1, "in png_handle_tEXt");
 
@@ -2232,84 +2369,59 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
       if (--png_ptr->user_chunk_cache_max == 1)
       {
-         png_warning(png_ptr, "No space in chunk cache for tEXt");
          png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "no space in chunk cache");
          return;
       }
    }
 #endif
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before tEXt");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    if (png_ptr->mode & PNG_HAVE_IDAT)
       png_ptr->mode |= PNG_AFTER_IDAT;
 
 #ifdef PNG_MAX_MALLOC_64K
-   if (length > (png_uint_32)65535L)
+   if (length > 65535U)
    {
-      png_warning(png_ptr, "tEXt chunk too large to fit in memory");
-      skip = length - (png_uint_32)65535L;
-      length = (png_uint_32)65535L;
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "too large to fit in memory");
+      return;
    }
 #endif
 
-   png_free(png_ptr, png_ptr->chunkdata);
+   buffer = png_read_buffer(png_ptr, length+1, 1/*warn*/);
 
-   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
-
-   if (png_ptr->chunkdata == NULL)
+   if (buffer == NULL)
    {
-     png_warning(png_ptr, "No memory to process text chunk");
+     png_chunk_benign_error(png_ptr, "out of memory");
      return;
    }
 
-   slength = length;
-   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
+   png_crc_read(png_ptr, buffer, length);
 
    if (png_crc_finish(png_ptr, skip))
-   {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
       return;
-   }
 
-   key = png_ptr->chunkdata;
-
-   key[slength] = 0x00;
+   key = (png_charp)buffer;
+   key[length] = 0;
 
    for (text = key; *text; text++)
       /* Empty loop to find end of key */ ;
 
-   if (text != key + slength)
+   if (text != key + length)
       text++;
 
-   text_ptr = (png_textp)png_malloc_warn(png_ptr,
-       png_sizeof(png_text));
-
-   if (text_ptr == NULL)
-   {
-      png_warning(png_ptr, "Not enough memory to process text chunk");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
-   }
-
-   text_ptr->compression = PNG_TEXT_COMPRESSION_NONE;
-   text_ptr->key = key;
-   text_ptr->lang = NULL;
-   text_ptr->lang_key = NULL;
-   text_ptr->itxt_length = 0;
-   text_ptr->text = text;
-   text_ptr->text_length = png_strlen(text);
-
-   ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
+   text_info.compression = PNG_TEXT_COMPRESSION_NONE;
+   text_info.key = key;
+   text_info.lang = NULL;
+   text_info.lang_key = NULL;
+   text_info.itxt_length = 0;
+   text_info.text = text;
+   text_info.text_length = strlen(text);
 
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = NULL;
-   png_free(png_ptr, text_ptr);
-
-   if (ret)
+   if (png_set_text_2(png_ptr, info_ptr, &text_info, 1))
       png_warning(png_ptr, "Insufficient memory to process text chunk");
 }
 #endif
@@ -2317,13 +2429,11 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 #ifdef PNG_READ_zTXt_SUPPORTED
 /* Note: this does not correctly handle chunks that are > 64K under DOS */
 void /* PRIVATE */
-png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
-   png_textp text_ptr;
-   png_charp text;
-   int comp_type;
-   int ret;
-   png_size_t slength, prefix_len, data_len;
+   png_const_charp errmsg = NULL;
+   png_bytep       buffer;
+   png_uint_32     keyword_length;
 
    png_debug(1, "in png_handle_zTXt");
 
@@ -2338,123 +2448,101 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
       if (--png_ptr->user_chunk_cache_max == 1)
       {
-         png_warning(png_ptr, "No space in chunk cache for zTXt");
          png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "no space in chunk cache");
          return;
       }
    }
 #endif
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before zTXt");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    if (png_ptr->mode & PNG_HAVE_IDAT)
       png_ptr->mode |= PNG_AFTER_IDAT;
 
-#ifdef PNG_MAX_MALLOC_64K
-   /* We will no doubt have problems with chunks even half this size, but
-    * there is no hard and fast rule to tell us where to stop.
-    */
-   if (length > (png_uint_32)65535L)
-   {
-      png_warning(png_ptr, "zTXt chunk too large to fit in memory");
-      png_crc_finish(png_ptr, length);
-      return;
-   }
-#endif
-
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
+   buffer = png_read_buffer(png_ptr, length, 2/*silent*/);
 
-   if (png_ptr->chunkdata == NULL)
+   if (buffer == NULL)
    {
-      png_warning(png_ptr, "Out of memory processing zTXt chunk");
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of memory");
       return;
    }
 
-   slength = length;
-   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
+   png_crc_read(png_ptr, buffer, length);
 
    if (png_crc_finish(png_ptr, 0))
-   {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
       return;
-   }
 
-   png_ptr->chunkdata[slength] = 0x00;
+   /* TODO: also check that the keyword contents match the spec! */
+   for (keyword_length = 0;
+      keyword_length < length && buffer[keyword_length] != 0;
+      ++keyword_length)
+      /* Empty loop to find end of name */ ;
 
-   for (text = png_ptr->chunkdata; *text; text++)
-      /* Empty loop */ ;
+   if (keyword_length > 79 || keyword_length < 1)
+      errmsg = "bad keyword";
 
-   /* zTXt must have some text after the chunkdataword */
-   if (text >= png_ptr->chunkdata + slength - 2)
-   {
-      png_warning(png_ptr, "Truncated zTXt chunk");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
-   }
+   /* zTXt must have some LZ data after the keyword, although it may expand to
+    * zero bytes; we need a '\0' at the end of the keyword, the compression type
+    * then the LZ data:
+    */
+   else if (keyword_length + 3 > length)
+      errmsg = "truncated";
+
+   else if (buffer[keyword_length+1] != PNG_COMPRESSION_TYPE_BASE)
+      errmsg = "unknown compression type";
 
    else
    {
-       comp_type = *(++text);
-
-       if (comp_type != PNG_TEXT_COMPRESSION_zTXt)
-       {
-          png_warning(png_ptr, "Unknown compression type in zTXt chunk");
-          comp_type = PNG_TEXT_COMPRESSION_zTXt;
-       }
-
-       text++;        /* Skip the compression_method byte */
-   }
-
-   prefix_len = text - png_ptr->chunkdata;
+      png_alloc_size_t uncompressed_length = PNG_SIZE_MAX;
 
-   png_decompress_chunk(png_ptr, comp_type,
-       (png_size_t)length, prefix_len, &data_len);
+      /* TODO: at present png_decompress_chunk imposes a single application
+       * level memory limit, this should be split to different values for iCCP
+       * and text chunks.
+       */
+      if (png_decompress_chunk(png_ptr, length, keyword_length+2,
+         &uncompressed_length, 1/*terminate*/) == Z_STREAM_END)
+      {
+         png_text text;
 
-   text_ptr = (png_textp)png_malloc_warn(png_ptr,
-       png_sizeof(png_text));
+         /* It worked; png_ptr->read_buffer now looks like a tEXt chunk except
+          * for the extra compression type byte and the fact that it isn't
+          * necessarily '\0' terminated.
+          */
+         buffer = png_ptr->read_buffer;
+         buffer[uncompressed_length+(keyword_length+2)] = 0;
+
+         text.compression = PNG_TEXT_COMPRESSION_zTXt;
+         text.key = (png_charp)buffer;
+         text.text = (png_charp)(buffer + keyword_length+2);
+         text.text_length = uncompressed_length;
+         text.itxt_length = 0;
+         text.lang = NULL;
+         text.lang_key = NULL;
+
+         if (png_set_text_2(png_ptr, info_ptr, &text, 1))
+            errmsg = "insufficient memory";
+      }
 
-   if (text_ptr == NULL)
-   {
-      png_warning(png_ptr, "Not enough memory to process zTXt chunk");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
+      else
+         errmsg = png_ptr->zstream.msg;
    }
 
-   text_ptr->compression = comp_type;
-   text_ptr->key = png_ptr->chunkdata;
-   text_ptr->lang = NULL;
-   text_ptr->lang_key = NULL;
-   text_ptr->itxt_length = 0;
-   text_ptr->text = png_ptr->chunkdata + prefix_len;
-   text_ptr->text_length = data_len;
-
-   ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
-
-   png_free(png_ptr, text_ptr);
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = NULL;
-
-   if (ret)
-      png_error(png_ptr, "Insufficient memory to store zTXt chunk");
+   if (errmsg != NULL)
+      png_chunk_benign_error(png_ptr, errmsg);
 }
 #endif
 
 #ifdef PNG_READ_iTXt_SUPPORTED
 /* Note: this does not correctly handle chunks that are > 64K under DOS */
 void /* PRIVATE */
-png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 {
-   png_textp text_ptr;
-   png_charp key, lang, text, lang_key;
-   int comp_flag;
-   int comp_type;
-   int ret;
-   png_size_t slength, prefix_len, data_len;
+   png_const_charp errmsg = NULL;
+   png_bytep buffer;
+   png_uint_32 prefix_length;
 
    png_debug(1, "in png_handle_iTXt");
 
@@ -2469,289 +2557,389 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 
       if (--png_ptr->user_chunk_cache_max == 1)
       {
-         png_warning(png_ptr, "No space in chunk cache for iTXt");
          png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "no space in chunk cache");
          return;
       }
    }
 #endif
 
    if (!(png_ptr->mode & PNG_HAVE_IHDR))
-      png_error(png_ptr, "Missing IHDR before iTXt");
+      png_chunk_error(png_ptr, "missing IHDR");
 
    if (png_ptr->mode & PNG_HAVE_IDAT)
       png_ptr->mode |= PNG_AFTER_IDAT;
 
-#ifdef PNG_MAX_MALLOC_64K
-   /* We will no doubt have problems with chunks even half this size, but
-    * there is no hard and fast rule to tell us where to stop.
-    */
-   if (length > (png_uint_32)65535L)
-   {
-      png_warning(png_ptr, "iTXt chunk too large to fit in memory");
-      png_crc_finish(png_ptr, length);
-      return;
-   }
-#endif
+   buffer = png_read_buffer(png_ptr, length+1, 1/*warn*/);
 
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
-
-   if (png_ptr->chunkdata == NULL)
+   if (buffer == NULL)
    {
-      png_warning(png_ptr, "No memory to process iTXt chunk");
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of memory");
       return;
    }
 
-   slength = length;
-   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
+   png_crc_read(png_ptr, buffer, length);
 
    if (png_crc_finish(png_ptr, 0))
-   {
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
       return;
-   }
-
-   png_ptr->chunkdata[slength] = 0x00;
 
-   for (lang = png_ptr->chunkdata; *lang; lang++)
+   /* First the keyword. */
+   for (prefix_length=0;
+      prefix_length < length && buffer[prefix_length] != 0;
+      ++prefix_length)
       /* Empty loop */ ;
 
-   lang++;        /* Skip NUL separator */
-
-   /* iTXt must have a language tag (possibly empty), two compression bytes,
-    * translated keyword (possibly empty), and possibly some text after the
-    * keyword
-    */
-
-   if (lang >= png_ptr->chunkdata + slength - 3)
-   {
-      png_warning(png_ptr, "Truncated iTXt chunk");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
-   }
-
-   comp_flag = *lang++;
-   comp_type = *lang++;
+   /* Perform a basic check on the keyword length here. */
+   if (prefix_length > 79 || prefix_length < 1)
+      errmsg = "bad keyword";
 
-   /* 1.5.14: The spec says "for uncompressed text decoders shall ignore [the
-    * compression type]".  The compression flag shall be 0 (no compression) or
-    * 1 (compressed with method 0 - deflate.)
+   /* Expect keyword, compression flag, compression type, language, translated
+    * keyword (both may be empty but are 0 terminated) then the text, which may
+    * be empty.
     */
-   if (comp_flag != 0 && comp_flag != 1)
-   {
-      png_warning(png_ptr, "invalid iTXt compression flag");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
-   }
+   else if (prefix_length + 5 > length)
+      errmsg = "truncated";
 
-   if (comp_flag/*compressed*/ && comp_type != 0)
+   else if (buffer[prefix_length+1] == 0 ||
+      (buffer[prefix_length+1] == 1 &&
+      buffer[prefix_length+2] == PNG_COMPRESSION_TYPE_BASE))
    {
-      png_warning(png_ptr, "unknown iTXt compression type");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
-   }
+      int compressed = buffer[prefix_length+1] != 0;
+      png_uint_32 language_offset, translated_keyword_offset;
+      png_alloc_size_t uncompressed_length = 0;
 
-   for (lang_key = lang; *lang_key; lang_key++)
-      /* Empty loop */ ;
+      /* Now the language tag */
+      prefix_length += 3;
+      language_offset = prefix_length;
 
-   lang_key++;        /* Skip NUL separator */
+      for (; prefix_length < length && buffer[prefix_length] != 0;
+         ++prefix_length)
+         /* Empty loop */ ;
 
-   if (lang_key >= png_ptr->chunkdata + slength)
-   {
-      png_warning(png_ptr, "Truncated iTXt chunk");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
-   }
+      /* WARNING: the length may be invalid here, this is checked below. */
+      translated_keyword_offset = ++prefix_length;
 
-   for (text = lang_key; *text; text++)
-      /* Empty loop */ ;
+      for (; prefix_length < length && buffer[prefix_length] != 0;
+         ++prefix_length)
+         /* Empty loop */ ;
 
-   text++;        /* Skip NUL separator */
+      /* prefix_length should now be at the trailing '\0' of the translated
+       * keyword, but it may already be over the end.  None of this arithmetic
+       * can overflow because chunks are at most 2^31 bytes long, but on 16-bit
+       * systems the available allocaton may overflow.
+       */
+      ++prefix_length;
 
-   if (text >= png_ptr->chunkdata + slength)
-   {
-      png_warning(png_ptr, "Malformed iTXt chunk");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
-   }
+      if (!compressed && prefix_length <= length)
+         uncompressed_length = length - prefix_length;
+
+      else if (compressed && prefix_length < length)
+      {
+         uncompressed_length = PNG_SIZE_MAX;
 
-   prefix_len = text - png_ptr->chunkdata;
+         /* TODO: at present png_decompress_chunk imposes a single application
+          * level memory limit, this should be split to different values for
+          * iCCP and text chunks.
+          */
+         if (png_decompress_chunk(png_ptr, length, prefix_length,
+            &uncompressed_length, 1/*terminate*/) == Z_STREAM_END)
+            buffer = png_ptr->read_buffer;
 
-   key=png_ptr->chunkdata;
+         else
+            errmsg = png_ptr->zstream.msg;
+      }
 
-   if (comp_flag/*compressed*/)
-      png_decompress_chunk(png_ptr, comp_type,
-          (size_t)length, prefix_len, &data_len);
+      else
+         errmsg = "truncated";
 
-   else
-      data_len = png_strlen(png_ptr->chunkdata + prefix_len);
+      if (errmsg == NULL)
+      {
+         png_text text;
 
-   text_ptr = (png_textp)png_malloc_warn(png_ptr,
-       png_sizeof(png_text));
+         buffer[uncompressed_length+prefix_length] = 0;
 
-   if (text_ptr == NULL)
-   {
-      png_warning(png_ptr, "Not enough memory to process iTXt chunk");
-      png_free(png_ptr, png_ptr->chunkdata);
-      png_ptr->chunkdata = NULL;
-      return;
-   }
+         if (compressed)
+            text.compression = PNG_ITXT_COMPRESSION_NONE;
 
-   text_ptr->compression =
-      (comp_flag ? PNG_ITXT_COMPRESSION_zTXt : PNG_ITXT_COMPRESSION_NONE);
-   text_ptr->lang_key = png_ptr->chunkdata + (lang_key - key);
-   text_ptr->lang = png_ptr->chunkdata + (lang - key);
-   text_ptr->itxt_length = data_len;
-   text_ptr->text_length = 0;
-   text_ptr->key = png_ptr->chunkdata;
-   text_ptr->text = png_ptr->chunkdata + prefix_len;
+         else
+            text.compression = PNG_ITXT_COMPRESSION_zTXt;
+
+         text.key = (png_charp)buffer;
+         text.lang = (png_charp)buffer + language_offset;
+         text.lang_key = (png_charp)buffer + translated_keyword_offset;
+         text.text = (png_charp)buffer + prefix_length;
+         text.text_length = 0;
+         text.itxt_length = uncompressed_length;
 
-   ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
+         if (png_set_text_2(png_ptr, info_ptr, &text, 1))
+            errmsg = "insufficient memory";
+      }
+   }
 
-   png_free(png_ptr, text_ptr);
-   png_free(png_ptr, png_ptr->chunkdata);
-   png_ptr->chunkdata = NULL;
+   else
+      errmsg = "bad compression info";
 
-   if (ret)
-      png_error(png_ptr, "Insufficient memory to store iTXt chunk");
+   if (errmsg != NULL)
+      png_chunk_benign_error(png_ptr, errmsg);
 }
 #endif
 
-/* This function is called when we haven't found a handler for a
- * chunk.  If there isn't a problem with the chunk itself (ie bad
- * chunk name, CRC, or a critical chunk), the chunk is silently ignored
- * -- unless the PNG_FLAG_UNKNOWN_CHUNKS_SUPPORTED flag is on in which
- * case it will be saved away to be written out later.
- */
-void /* PRIVATE */
-png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
+#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
+/* Utility function for png_handle_unknown; set up png_ptr::unknown_chunk */
+static int
+png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length)
 {
-   png_uint_32 skip = 0;
+   png_alloc_size_t limit = PNG_SIZE_MAX;
 
-   png_debug(1, "in png_handle_unknown");
+   if (png_ptr->unknown_chunk.data != NULL)
+   {
+      png_free(png_ptr, png_ptr->unknown_chunk.data);
+      png_ptr->unknown_chunk.data = NULL;
+   }
 
-#ifdef PNG_USER_LIMITS_SUPPORTED
-   if (png_ptr->user_chunk_cache_max != 0)
+#  ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
+      if (png_ptr->user_chunk_malloc_max > 0 &&
+         png_ptr->user_chunk_malloc_max < limit)
+         limit = png_ptr->user_chunk_malloc_max;
+
+#  elif PNG_USER_CHUNK_MALLOC_MAX > 0
+      if (PNG_USER_CHUNK_MALLOC_MAX < limit)
+         limit = PNG_USER_CHUNK_MALLOC_MAX;
+#  endif
+
+   if (length <= limit)
    {
-      if (png_ptr->user_chunk_cache_max == 1)
-      {
-         png_crc_finish(png_ptr, length);
-         return;
-      }
+      PNG_CSTRING_FROM_CHUNK(png_ptr->unknown_chunk.name, png_ptr->chunk_name);
+      /* The following is safe because of the PNG_SIZE_MAX init above */
+      png_ptr->unknown_chunk.size = (png_size_t)length/*SAFE*/;
+      /* 'mode' is a flag array, only the bottom four bits matter here */
+      png_ptr->unknown_chunk.location = (png_byte)png_ptr->mode/*SAFE*/;
 
-      if (--png_ptr->user_chunk_cache_max == 1)
+      if (length == 0)
+         png_ptr->unknown_chunk.data = NULL;
+
+      else
       {
-         png_warning(png_ptr, "No space in chunk cache for unknown chunk");
-         png_crc_finish(png_ptr, length);
-         return;
+         /* Do a 'warn' here - it is handled below. */
+         png_ptr->unknown_chunk.data = png_voidcast(png_bytep,
+            png_malloc_warn(png_ptr, length));
       }
    }
-#endif
 
-   if (png_ptr->mode & PNG_HAVE_IDAT)
+   if (png_ptr->unknown_chunk.data == NULL && length > 0)
    {
-      if (png_ptr->chunk_name != png_IDAT)
-         png_ptr->mode |= PNG_AFTER_IDAT;
+      /* This is benign because we clean up correctly */
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "unknown chunk exceeds memory limits");
+      return 0;
    }
 
-   if (PNG_CHUNK_CRITICAL(png_ptr->chunk_name))
+   else
    {
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-      if (png_chunk_unknown_handling(png_ptr, png_ptr->chunk_name) !=
-          PNG_HANDLE_CHUNK_ALWAYS
-#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
-          && png_ptr->read_user_chunk_fn == NULL
-#endif
-          )
-#endif
-         png_chunk_error(png_ptr, "unknown critical chunk");
+      if (length > 0)
+         png_crc_read(png_ptr, png_ptr->unknown_chunk.data, length);
+      png_crc_finish(png_ptr, 0);
+      return 1;
    }
+}
+#endif /* PNG_READ_UNKNOWN_CHUNKS_SUPPORTED */
+
+/* Handle an unknown, or known but disabled, chunk */
+void /* PRIVATE */
+png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
+   png_uint_32 length, int keep)
+{
+   int handled = 0; /* the chunk was handled */
+
+   png_debug(1, "in png_handle_unknown");
 
 #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
-   if ((png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS)
-#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
-       || (png_ptr->read_user_chunk_fn != NULL)
-#endif
-       )
-   {
-#ifdef PNG_MAX_MALLOC_64K
-      if (length > 65535)
-      {
-         png_warning(png_ptr, "unknown chunk too large to fit in memory");
-         skip = length - 65535;
-         length = 65535;
-      }
-#endif
+   /* NOTE: this code is based on the code in libpng-1.4.12 except for fixing
+    * the bug which meant that setting a non-default behavior for a specific
+    * chunk would be ignored (the default was always used unless a user
+    * callback was installed).
+    *
+    * 'keep' is the value from the png_chunk_unknown_handling, the setting for
+    * this specific chunk_name, if PNG_HANDLE_AS_UNKNOWN_SUPPORTED, if not it
+    * will always be PNG_HANDLE_CHUNK_AS_DEFAULT and it needs to be set here.
+    * This is just an optimization to avoid multiple calls to the lookup
+    * function.
+    */
+#  ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+#     ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+         keep = png_chunk_unknown_handling(png_ptr, png_ptr->chunk_name);
+#     endif
+#  endif
 
-      /* TODO: this code is very close to the unknown handling in pngpread.c,
-       * maybe it can be put into a common utility routine?
-       * png_struct::unknown_chunk is just used as a temporary variable, along
-       * with the data into which the chunk is read.  These can be eliminated.
+   /* One of the following methods will read the chunk or skip it (at least one
+    * of these is always defined because this is the only way to switch on
+    * PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
+    */
+#  ifdef PNG_READ_USER_CHUNKS_SUPPORTED
+      /* The user callback takes precedence over the chunk keep value, but the
+       * keep value is still required to validate a save of a critical chunk.
        */
-      PNG_CSTRING_FROM_CHUNK(png_ptr->unknown_chunk.name, png_ptr->chunk_name);
-      png_ptr->unknown_chunk.size = (png_size_t)length;
+      if (png_ptr->read_user_chunk_fn != NULL)
+      {
+         if (png_cache_unknown_chunk(png_ptr, length))
+         {
+            /* Callback to user unknown chunk handler */
+            int ret = (*(png_ptr->read_user_chunk_fn))(png_ptr,
+               &png_ptr->unknown_chunk);
+
+            /* ret is:
+             * negative: An error occured, png_chunk_error will be called.
+             *     zero: The chunk was not handled, the chunk will be discarded
+             *           unless png_set_keep_unknown_chunks has been used to set
+             *           a 'keep' behavior for this particular chunk, in which
+             *           case that will be used.  A critical chunk will cause an
+             *           error at this point unless it is to be saved.
+             * positive: The chunk was handled, libpng will ignore/discard it.
+             */
+            if (ret < 0)
+               png_chunk_error(png_ptr, "error in user chunk");
 
-      if (length == 0)
-         png_ptr->unknown_chunk.data = NULL;
+            else if (ret == 0)
+            {
+               /* If the keep value is 'default' or 'never' override it, but
+                * still error out on critical chunks unless the keep value is
+                * 'always'  While this is weird it is the behavior in 1.4.12.  A
+                * possible improvement would be to obey the value set for the
+                * chunk, but this would be an API change that would probably
+                * damage some applications.
+                *
+                * The png_app_warning below catches the case that matters, where
+                * the application has neither set specific save for this chunk
+                * or global save.
+                */
+               if (keep < PNG_HANDLE_CHUNK_IF_SAFE)
+               {
+#                 ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+                     if (png_ptr->unknown_default < PNG_HANDLE_CHUNK_IF_SAFE)
+                        png_app_warning(png_ptr,
+ "forcing save of an unhandled chunk; please call png_set_keep_unknown_chunks");
+#                 endif
+                  keep = PNG_HANDLE_CHUNK_IF_SAFE;
+               }
+            }
+
+            else /* chunk was handled */
+            {
+               handled = 1;
+               /* Critical chunks can be safely discarded at this point. */
+               keep = PNG_HANDLE_CHUNK_NEVER;
+            }
+         }
+
+         else
+            keep = PNG_HANDLE_CHUNK_NEVER; /* insufficient memory */
+      }
 
       else
+         /* Use the SAVE_UNKNOWN_CHUNKS code or skip the chunk */
+#  endif /* PNG_READ_USER_CHUNKS_SUPPORTED */
+
+#  ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
       {
-         png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, length);
-         png_crc_read(png_ptr, png_ptr->unknown_chunk.data, length);
+         /* keep is currently just the per-chunk setting, if there was no
+          * setting change it to the global default now (not that this may
+          * still be AS_DEFAULT) then obtain the cache of the chunk if required,
+          * if not simply skip the chunk.
+          */
+         if (keep == PNG_HANDLE_CHUNK_AS_DEFAULT)
+            keep = png_ptr->unknown_default;
+
+         if (keep == PNG_HANDLE_CHUNK_ALWAYS ||
+            (keep == PNG_HANDLE_CHUNK_IF_SAFE &&
+             PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name)))
+         {
+            if (!png_cache_unknown_chunk(png_ptr, length))
+               keep = PNG_HANDLE_CHUNK_NEVER;
+         }
+
+         else
+            png_crc_finish(png_ptr, length);
       }
+#  else
+#     ifndef PNG_READ_USER_CHUNKS_SUPPORTED
+#        error no method to support READ_UNKNOWN_CHUNKS
+#     endif
 
-#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
-      if (png_ptr->read_user_chunk_fn != NULL)
       {
-         /* Callback to user unknown chunk handler */
-         int ret;
-
-         ret = (*(png_ptr->read_user_chunk_fn))
-             (png_ptr, &png_ptr->unknown_chunk);
+         /* If here there is no read callback pointer set and no support is
+          * compiled in to just save the unknown chunks, so simply skip this
+          * chunk.  If 'keep' is something other than AS_DEFAULT or NEVER then
+          * the app has erroneously asked for unknown chunk saving when there
+          * is no support.
+          */
+         if (keep > PNG_HANDLE_CHUNK_NEVER)
+            png_app_error(png_ptr, "no unknown chunk support available");
 
-         if (ret < 0)
-            png_chunk_error(png_ptr, "error in user chunk");
+         png_crc_finish(png_ptr, length);
+      }
+#  endif
 
-         if (ret == 0)
+#  ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
+      /* Now store the chunk in the chunk list if appropriate, and if the limits
+       * permit it.
+       */
+      if (keep == PNG_HANDLE_CHUNK_ALWAYS ||
+         (keep == PNG_HANDLE_CHUNK_IF_SAFE &&
+          PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name)))
+      {
+#     ifdef PNG_USER_LIMITS_SUPPORTED
+         switch (png_ptr->user_chunk_cache_max)
          {
-            if (PNG_CHUNK_CRITICAL(png_ptr->chunk_name))
-            {
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-               if (png_chunk_unknown_handling(png_ptr, png_ptr->chunk_name) !=
-                   PNG_HANDLE_CHUNK_ALWAYS)
-#endif
-                  png_chunk_error(png_ptr, "unknown critical chunk");
-            }
+            case 2:
+               png_ptr->user_chunk_cache_max = 1;
+               png_chunk_benign_error(png_ptr, "no space in chunk cache");
+               /* FALL THROUGH */
+            case 1:
+               /* NOTE: prior to 1.6.0 this case resulted in an unknown critical
+                * chunk being skipped, now there will be a hard error below.
+                */
+               break;
 
-            png_set_unknown_chunks(png_ptr, info_ptr,
-                &png_ptr->unknown_chunk, 1);
+            default: /* not at limit */
+               --(png_ptr->user_chunk_cache_max);
+               /* FALL THROUGH */
+            case 0: /* no limit */
+#     endif /* PNG_USER_LIMITS_SUPPORTED */
+               /* Here when the limit isn't reached or when limits are compiled
+                * out; store the chunk.
+                */
+               png_set_unknown_chunks(png_ptr, info_ptr,
+                  &png_ptr->unknown_chunk, 1);
+               handled = 1;
+#     ifdef PNG_USER_LIMITS_SUPPORTED
+               break;
          }
+#     endif
       }
+#  else /* no store support! */
+      PNG_UNUSED(info_ptr)
+#     error untested code (reading unknown chunks with no store support)
+#  endif
 
-      else
-#endif
-         png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1);
-
+   /* Regardless of the error handling below the cached data (if any) can be
+    * freed now.  Notice that the data is not freed if there is a png_error, but
+    * it will be freed by destroy_read_struct.
+    */
+   if (png_ptr->unknown_chunk.data != NULL)
       png_free(png_ptr, png_ptr->unknown_chunk.data);
-      png_ptr->unknown_chunk.data = NULL;
-   }
+   png_ptr->unknown_chunk.data = NULL;
 
-   else
-#endif
-      skip = length;
-
-   png_crc_finish(png_ptr, skip);
+#else /* !PNG_READ_UNKNOWN_CHUNKS_SUPPORTED */
+   /* There is no support to read an unknown chunk, so just skip it. */
+   png_crc_finish(png_ptr, length);
+   PNG_UNUSED(info_ptr)
+   PNG_UNUSED(keep)
+#endif /* !PNG_READ_UNKNOWN_CHUNKS_SUPPORTED */
 
-#ifndef PNG_READ_USER_CHUNKS_SUPPORTED
-   PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
-#endif
+   /* Check for unhandled critical chunks */
+   if (!handled && PNG_CHUNK_CRITICAL(png_ptr->chunk_name))
+      png_chunk_error(png_ptr, "unhandled critical chunk");
 }
 
 /* This function is called to verify that a chunk name is valid.
@@ -2767,7 +2955,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
  */
 
 void /* PRIVATE */
-png_check_chunk_name(png_structp png_ptr, png_uint_32 chunk_name)
+png_check_chunk_name(png_structrp png_ptr, png_uint_32 chunk_name)
 {
    int i;
 
@@ -2792,7 +2980,7 @@ png_check_chunk_name(png_structp png_ptr, png_uint_32 chunk_name)
  * 'display' is false only those pixels present in the pass are filled in.
  */
 void /* PRIVATE */
-png_combine_row(png_structp png_ptr, png_bytep dp, int display)
+png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
 {
    unsigned int pixel_depth = png_ptr->transformed_pixel_depth;
    png_const_bytep sp = png_ptr->row_buf + 1;
@@ -2842,7 +3030,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
       /* end_mask is now the bits to *keep* from the destination row */
    }
 
-   /* For non-interlaced images this reduces to a png_memcpy(). A png_memcpy()
+   /* For non-interlaced images this reduces to a memcpy(). A memcpy()
     * will also happen if interlacing isn't supported or if the application
     * does not call png_set_interlace_handling().  In the latter cases the
     * caller just gets a sequence of the unexpanded rows from each interlace
@@ -3143,26 +3331,27 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
                /* Check for double byte alignment and, if possible, use a
                 * 16-bit copy.  Don't attempt this for narrow images - ones that
                 * are less than an interlace panel wide.  Don't attempt it for
-                * wide bytes_to_copy either - use the png_memcpy there.
+                * wide bytes_to_copy either - use the memcpy there.
                 */
-               if (bytes_to_copy < 16 /*else use png_memcpy*/ &&
+               if (bytes_to_copy < 16 /*else use memcpy*/ &&
                   png_isaligned(dp, png_uint_16) &&
                   png_isaligned(sp, png_uint_16) &&
-                  bytes_to_copy % sizeof (png_uint_16) == 0 &&
-                  bytes_to_jump % sizeof (png_uint_16) == 0)
+                  bytes_to_copy % (sizeof (png_uint_16)) == 0 &&
+                  bytes_to_jump % (sizeof (png_uint_16)) == 0)
                {
                   /* Everything is aligned for png_uint_16 copies, but try for
                    * png_uint_32 first.
                    */
                   if (png_isaligned(dp, png_uint_32) &&
                      png_isaligned(sp, png_uint_32) &&
-                     bytes_to_copy % sizeof (png_uint_32) == 0 &&
-                     bytes_to_jump % sizeof (png_uint_32) == 0)
+                     bytes_to_copy % (sizeof (png_uint_32)) == 0 &&
+                     bytes_to_jump % (sizeof (png_uint_32)) == 0)
                   {
-                     png_uint_32p dp32 = (png_uint_32p)dp;
-                     png_const_uint_32p sp32 = (png_const_uint_32p)sp;
+                     png_uint_32p dp32 = png_aligncast(png_uint_32p,dp);
+                     png_const_uint_32p sp32 = png_aligncastconst(
+                        png_const_uint_32p, sp);
                      unsigned int skip = (bytes_to_jump-bytes_to_copy) /
-                        sizeof (png_uint_32);
+                        (sizeof (png_uint_32));
 
                      do
                      {
@@ -3170,7 +3359,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
                         do
                         {
                            *dp32++ = *sp32++;
-                           c -= sizeof (png_uint_32);
+                           c -= (sizeof (png_uint_32));
                         }
                         while (c > 0);
 
@@ -3200,10 +3389,11 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
                    */
                   else
                   {
-                     png_uint_16p dp16 = (png_uint_16p)dp;
-                     png_const_uint_16p sp16 = (png_const_uint_16p)sp;
+                     png_uint_16p dp16 = png_aligncast(png_uint_16p, dp);
+                     png_const_uint_16p sp16 = png_aligncastconst(
+                        png_const_uint_16p, sp);
                      unsigned int skip = (bytes_to_jump-bytes_to_copy) /
-                        sizeof (png_uint_16);
+                        (sizeof (png_uint_16));
 
                      do
                      {
@@ -3211,7 +3401,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
                         do
                         {
                            *dp16++ = *sp16++;
-                           c -= sizeof (png_uint_16);
+                           c -= (sizeof (png_uint_16));
                         }
                         while (c > 0);
 
@@ -3235,10 +3425,10 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
                }
 #endif /* PNG_ALIGN_ code */
 
-               /* The true default - use a png_memcpy: */
+               /* The true default - use a memcpy: */
                for (;;)
                {
-                  png_memcpy(dp, sp, bytes_to_copy);
+                  memcpy(dp, sp, bytes_to_copy);
 
                   if (row_width <= bytes_to_jump)
                      return;
@@ -3259,11 +3449,11 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
    else
 #endif
 
-   /* If here then the switch above wasn't used so just png_memcpy the whole row
+   /* If here then the switch above wasn't used so just memcpy the whole row
     * from the temporary row buffer (notice that this overwrites the end of the
     * destination row if it is a partial byte.)
     */
-   png_memcpy(dp, sp, PNG_ROWBYTES(pixel_depth, row_width));
+   memcpy(dp, sp, PNG_ROWBYTES(pixel_depth, row_width));
 
    /* Restore the overwritten bits from the last byte if necessary. */
    if (end_ptr != NULL)
@@ -3324,8 +3514,9 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
                v = (png_byte)((*sp >> sshift) & 0x01);
                for (j = 0; j < jstop; j++)
                {
-                  *dp &= (png_byte)((0x7f7f >> (7 - dshift)) & 0xff);
-                  *dp |= (png_byte)(v << dshift);
+                  unsigned int tmp = *dp & (0x7f7f >> (7 - dshift));
+                  tmp |= v << dshift;
+                  *dp = (png_byte)(tmp & 0xff);
 
                   if (dshift == s_end)
                   {
@@ -3386,8 +3577,9 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
                v = (png_byte)((*sp >> sshift) & 0x03);
                for (j = 0; j < jstop; j++)
                {
-                  *dp &= (png_byte)((0x3f3f >> (6 - dshift)) & 0xff);
-                  *dp |= (png_byte)(v << dshift);
+                  unsigned int tmp = *dp & (0x3f3f >> (6 - dshift));
+                  tmp |= v << dshift;
+                  *dp = (png_byte)(tmp & 0xff);
 
                   if (dshift == s_end)
                   {
@@ -3447,8 +3639,9 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
 
                for (j = 0; j < jstop; j++)
                {
-                  *dp &= (png_byte)((0xf0f >> (4 - dshift)) & 0xff);
-                  *dp |= (png_byte)(v << dshift);
+                  unsigned int tmp = *dp & (0xf0f >> (4 - dshift));
+                  tmp |= v << dshift;
+                  *dp = (png_byte)(tmp & 0xff);
 
                   if (dshift == s_end)
                   {
@@ -3489,11 +3682,11 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
                png_byte v[8];
                int j;
 
-               png_memcpy(v, sp, pixel_bytes);
+               memcpy(v, sp, pixel_bytes);
 
                for (j = 0; j < jstop; j++)
                {
-                  png_memcpy(dp, v, pixel_bytes);
+                  memcpy(dp, v, pixel_bytes);
                   dp -= pixel_bytes;
                }
 
@@ -3671,7 +3864,15 @@ png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row,
 }
 
 static void
-png_init_filter_functions(png_structp pp)
+png_init_filter_functions(png_structrp pp)
+   /* This function is called once for every PNG image to set the
+    * implementations required to reverse the filtering of PNG rows.  Reversing
+    * the filter is the first transformation performed on the row data.  It is
+    * performed in place, therefore an implementation can be selected based on
+    * the image pixel format.  If the implementation depends on image width then
+    * take care to ensure that it works corretly if the image is interlaced -
+    * interlacing causes the actual row width to vary.
+    */
 {
    unsigned int bpp = (pp->pixel_depth + 7) >> 3;
 
@@ -3699,9 +3900,13 @@ png_init_filter_functions(png_structp pp)
 }
 
 void /* PRIVATE */
-png_read_filter_row(png_structp pp, png_row_infop row_info, png_bytep row,
+png_read_filter_row(png_structrp pp, png_row_infop row_info, png_bytep row,
    png_const_bytep prev_row, int filter)
 {
+   /* OPTIMIZATION: DO NOT MODIFY THIS FUNCTION, instead #define
+    * PNG_FILTER_OPTIMIZATIONS to a function that overrides the generic
+    * implementations.  See png_init_filter_functions above.
+    */
    if (pp->read_filter[0] == NULL)
       png_init_filter_functions(pp);
    if (filter > PNG_FILTER_VALUE_NONE && filter < PNG_FILTER_VALUE_LAST)
@@ -3710,7 +3915,181 @@ png_read_filter_row(png_structp pp, png_row_infop row_info, png_bytep row,
 
 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 void /* PRIVATE */
-png_read_finish_row(png_structp png_ptr)
+png_read_IDAT_data(png_structrp png_ptr, png_bytep output,
+   png_alloc_size_t avail_out)
+{
+   /* Loop reading IDATs and decompressing the result into output[avail_out] */
+   png_ptr->zstream.next_out = output;
+   png_ptr->zstream.avail_out = 0; /* safety: set below */
+
+   if (output == NULL)
+      avail_out = 0;
+
+   do
+   {
+      int ret;
+      png_byte tmpbuf[PNG_INFLATE_BUF_SIZE];
+
+      if (png_ptr->zstream.avail_in == 0)
+      {
+         uInt avail_in;
+         png_bytep buffer;
+
+         while (png_ptr->idat_size == 0)
+         {
+            png_crc_finish(png_ptr, 0);
+
+            png_ptr->idat_size = png_read_chunk_header(png_ptr);
+            /* This is an error even in the 'check' case because the code just
+             * consumed a non-IDAT header.
+             */
+            if (png_ptr->chunk_name != png_IDAT)
+               png_error(png_ptr, "Not enough image data");
+         }
+
+         avail_in = png_ptr->IDAT_read_size;
+
+         if (avail_in > png_ptr->idat_size)
+            avail_in = (uInt)png_ptr->idat_size;
+
+         /* A PNG with a gradually increasing IDAT size will defeat this attempt
+          * to minimize memory usage by causing lots of re-allocs, but
+          * realistically doing IDAT_read_size re-allocs is not likely to be a
+          * big problem.
+          */
+         buffer = png_read_buffer(png_ptr, avail_in, 0/*error*/);
+
+         png_crc_read(png_ptr, buffer, avail_in);
+         png_ptr->idat_size -= avail_in;
+
+         png_ptr->zstream.next_in = buffer;
+         png_ptr->zstream.avail_in = avail_in;
+      }
+
+      /* And set up the output side. */
+      if (output != NULL) /* standard read */
+      {
+         uInt out = ZLIB_IO_MAX;
+
+         if (out > avail_out)
+            out = (uInt)avail_out;
+
+         avail_out -= out;
+         png_ptr->zstream.avail_out = out;
+      }
+
+      else /* check for end */
+      {
+         png_ptr->zstream.next_out = tmpbuf;
+         png_ptr->zstream.avail_out = (sizeof tmpbuf);
+      }
+
+      /* Use NO_FLUSH; this gives zlib the maximum opportunity to optimize the
+       * process.  If the LZ stream is truncated the sequential reader will
+       * terminally damage the stream, above, by reading the chunk header of the
+       * following chunk (it then exits with png_error).
+       *
+       * TODO: deal more elegantly with truncated IDAT lists.
+       */
+      ret = inflate(&png_ptr->zstream, Z_NO_FLUSH);
+
+      /* Take the unconsumed output back (so, in the 'check' case this just
+       * counts up).
+       */
+      avail_out += png_ptr->zstream.avail_out;
+      png_ptr->zstream.avail_out = 0;
+
+      if (ret == Z_STREAM_END)
+      {
+         /* Do this for safety; we won't read any more into this row. */
+         png_ptr->zstream.next_out = NULL;
+
+         png_ptr->mode |= PNG_AFTER_IDAT;
+         png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
+
+         if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0)
+            png_chunk_benign_error(png_ptr, "Extra compressed data");
+         break;
+      }
+
+      if (ret != Z_OK)
+      {
+         png_zstream_error(png_ptr, ret);
+
+         if (output != NULL)
+            png_chunk_error(png_ptr, png_ptr->zstream.msg);
+
+         else /* checking */
+         {
+            png_chunk_benign_error(png_ptr, png_ptr->zstream.msg);
+            return;
+         }
+      }
+   } while (avail_out > 0);
+
+   if (avail_out > 0)
+   {
+      /* The stream ended before the image; this is the same as too few IDATs so
+       * should be handled the same way.
+       */
+      if (output != NULL)
+         png_error(png_ptr, "Not enough image data");
+
+      else /* checking */
+         png_chunk_benign_error(png_ptr, "Too much image data");
+   }
+}
+
+void /* PRIVATE */
+png_read_finish_IDAT(png_structrp png_ptr)
+{
+   /* We don't need any more data and the stream should have ended, however the
+    * LZ end code may actually not have been processed.  In this case we must
+    * read it otherwise stray unread IDAT data or, more likely, an IDAT chunk
+    * may still remain to be consumed.
+    */
+   if (!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED))
+   {
+      /* The NULL causes png_read_IDAT_data to swallow any remaining bytes in
+       * the compressed stream, but the stream may be damaged too, so even after
+       * this call we may need to terminate the zstream ownership.
+       */
+      png_read_IDAT_data(png_ptr, NULL, 0);
+      png_ptr->zstream.next_out = NULL; /* safety */
+
+      /* Now clear everything out for safety; the following may not have been
+       * done.
+       */
+      if (!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED))
+      {
+         png_ptr->mode |= PNG_AFTER_IDAT;
+         png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
+      }
+   }
+
+   /* If the zstream has not been released do it now *and* terminate the reading
+    * of the final IDAT chunk.
+    */
+   if (png_ptr->zowner == png_IDAT)
+   {
+      /* Always do this; the pointers otherwise point into the read buffer. */
+      png_ptr->zstream.next_in = NULL;
+      png_ptr->zstream.avail_in = 0;
+
+      /* Now we no longer own the zstream. */
+      png_ptr->zowner = 0;
+
+      /* The slightly weird semantics of the sequential IDAT reading is that we
+       * are always in or at the end of an IDAT chunk, so we always need to do a
+       * crc_finish here.  If idat_size is non-zero we also need to read the
+       * spurious bytes at the end of the chunk now.
+       */
+      (void)png_crc_finish(png_ptr, png_ptr->idat_size);
+   }
+}
+
+void /* PRIVATE */
+png_read_finish_row(png_structrp png_ptr)
 {
 #ifdef PNG_READ_INTERLACING_SUPPORTED
    /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
@@ -3741,7 +4120,7 @@ png_read_finish_row(png_structp png_ptr)
       /* TO DO: don't do this if prev_row isn't needed (requires
        * read-ahead of the next row's filter byte.
        */
-      png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
+      memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
 
       do
       {
@@ -3773,76 +4152,13 @@ png_read_finish_row(png_structp png_ptr)
    }
 #endif /* PNG_READ_INTERLACING_SUPPORTED */
 
-   if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
-   {
-      char extra;
-      int ret;
-
-      png_ptr->zstream.next_out = (Byte *)&extra;
-      png_ptr->zstream.avail_out = (uInt)1;
-
-      for (;;)
-      {
-         if (!(png_ptr->zstream.avail_in))
-         {
-            while (!png_ptr->idat_size)
-            {
-               png_crc_finish(png_ptr, 0);
-               png_ptr->idat_size = png_read_chunk_header(png_ptr);
-               if (png_ptr->chunk_name != png_IDAT)
-                  png_error(png_ptr, "Not enough image data");
-            }
-
-            png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size;
-            png_ptr->zstream.next_in = png_ptr->zbuf;
-
-            if (png_ptr->zbuf_size > png_ptr->idat_size)
-               png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size;
-
-            png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zstream.avail_in);
-            png_ptr->idat_size -= png_ptr->zstream.avail_in;
-         }
-
-         ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
-
-         if (ret == Z_STREAM_END)
-         {
-            if (!(png_ptr->zstream.avail_out) || png_ptr->zstream.avail_in ||
-                png_ptr->idat_size)
-               png_warning(png_ptr, "Extra compressed data");
-
-            png_ptr->mode |= PNG_AFTER_IDAT;
-            png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
-            break;
-         }
-
-         if (ret != Z_OK)
-            png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg :
-                "Decompression Error");
-
-         if (!(png_ptr->zstream.avail_out))
-         {
-            png_warning(png_ptr, "Extra compressed data");
-            png_ptr->mode |= PNG_AFTER_IDAT;
-            png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
-            break;
-         }
-
-      }
-      png_ptr->zstream.avail_out = 0;
-   }
-
-   if (png_ptr->idat_size || png_ptr->zstream.avail_in)
-      png_warning(png_ptr, "Extra compression data");
-
-   inflateReset(&png_ptr->zstream);
-
-   png_ptr->mode |= PNG_AFTER_IDAT;
+   /* Here after at the end of the last row of the last pass. */
+   png_read_finish_IDAT(png_ptr);
 }
 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 
 void /* PRIVATE */
-png_read_start_row(png_structp png_ptr)
+png_read_start_row(png_structrp png_ptr)
 {
 #ifdef PNG_READ_INTERLACING_SUPPORTED
    /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
@@ -3864,7 +4180,7 @@ png_read_start_row(png_structp png_ptr)
    png_size_t row_bytes;
 
    png_debug(1, "in png_read_start_row");
-   png_ptr->zstream.avail_in = 0;
+
 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
    png_init_read_transformations(png_ptr);
 #endif
@@ -4102,7 +4418,7 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
    if (png_ptr->rowbytes > (PNG_SIZE_MAX - 1))
       png_error(png_ptr, "Row has too many bytes to allocate in memory");
 
-   png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
+   memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
 
    png_debug1(3, "width = %u,", png_ptr->width);
    png_debug1(3, "height = %u,", png_ptr->height);
@@ -4112,6 +4428,27 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
    png_debug1(3, "irowbytes = %lu",
        (unsigned long)PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1);
 
+   /* The sequential reader needs a buffer for IDAT, but the progressive reader
+    * does not, so free the read buffer now regardless; the sequential reader
+    * reallocates it on demand.
+    */
+   if (png_ptr->read_buffer)
+   {
+      png_bytep buffer = png_ptr->read_buffer;
+
+      png_ptr->read_buffer_size = 0;
+      png_ptr->read_buffer = NULL;
+      png_free(png_ptr, buffer);
+   }
+
+   /* Finally claim the zstream for the inflate of the IDAT data, use the bits
+    * value from the stream (note that this will result in a fatal error if the
+    * IDAT stream has a bogus deflate header window_bits value, but this should
+    * not be happening any longer!)
+    */
+   if (png_inflate_claim(png_ptr, png_IDAT, 0) != Z_OK)
+      png_error(png_ptr, png_ptr->zstream.msg);
+
    png_ptr->flags |= PNG_FLAG_ROW_INIT;
 }
 #endif /* PNG_READ_SUPPORTED */
index 6e9358b28966217bca1f95d8a10c7650b87334ee..84973f5ff62917cd29853c54f409b51b0ee77def 100644 (file)
@@ -1,7 +1,7 @@
 
 /* pngset.c - storage of image information into info struct
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
+ * Last changed in libpng 1.6.0 [February 14, 2013]
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
 
 #ifdef PNG_bKGD_SUPPORTED
 void PNGAPI
-png_set_bKGD(png_structp png_ptr, png_infop info_ptr,
+png_set_bKGD(png_const_structrp png_ptr, png_inforp info_ptr,
     png_const_color_16p background)
 {
    png_debug1(1, "in %s storage function", "bKGD");
 
-   if (png_ptr == NULL || info_ptr == NULL)
+   if (png_ptr == NULL || info_ptr == NULL || background == NULL)
       return;
 
-   png_memcpy(&(info_ptr->background), background, png_sizeof(png_color_16));
+   info_ptr->background = *background;
    info_ptr->valid |= PNG_INFO_bKGD;
 }
 #endif
 
 #ifdef PNG_cHRM_SUPPORTED
 void PNGFAPI
-png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
+png_set_cHRM_fixed(png_const_structrp png_ptr, png_inforp info_ptr,
     png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x,
     png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y,
     png_fixed_point blue_x, png_fixed_point blue_y)
 {
+   png_xy xy;
+
    png_debug1(1, "in %s storage function", "cHRM fixed");
 
    if (png_ptr == NULL || info_ptr == NULL)
       return;
 
-#  ifdef PNG_CHECK_cHRM_SUPPORTED
-   if (png_check_cHRM_fixed(png_ptr,
-       white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y))
-#  endif
-   {
-      info_ptr->x_white = white_x;
-      info_ptr->y_white = white_y;
-      info_ptr->x_red   = red_x;
-      info_ptr->y_red   = red_y;
-      info_ptr->x_green = green_x;
-      info_ptr->y_green = green_y;
-      info_ptr->x_blue  = blue_x;
-      info_ptr->y_blue  = blue_y;
-      info_ptr->valid |= PNG_INFO_cHRM;
-   }
+   xy.redx = red_x;
+   xy.redy = red_y;
+   xy.greenx = green_x;
+   xy.greeny = green_y;
+   xy.bluex = blue_x;
+   xy.bluey = blue_y;
+   xy.whitex = white_x;
+   xy.whitey = white_y;
+
+   if (png_colorspace_set_chromaticities(png_ptr, &info_ptr->colorspace, &xy,
+      2/* override with app values*/))
+      info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
+
+   png_colorspace_sync_info(png_ptr, info_ptr);
 }
 
 void PNGFAPI
-png_set_cHRM_XYZ_fixed(png_structp png_ptr, png_infop info_ptr,
+png_set_cHRM_XYZ_fixed(png_const_structrp png_ptr, png_inforp info_ptr,
     png_fixed_point int_red_X, png_fixed_point int_red_Y,
     png_fixed_point int_red_Z, png_fixed_point int_green_X,
     png_fixed_point int_green_Y, png_fixed_point int_green_Z,
@@ -73,33 +74,31 @@ png_set_cHRM_XYZ_fixed(png_structp png_ptr, png_infop info_ptr,
     png_fixed_point int_blue_Z)
 {
    png_XYZ XYZ;
-   png_xy xy;
 
    png_debug1(1, "in %s storage function", "cHRM XYZ fixed");
 
    if (png_ptr == NULL || info_ptr == NULL)
       return;
 
-   XYZ.redX = int_red_X;
-   XYZ.redY = int_red_Y;
-   XYZ.redZ = int_red_Z;
-   XYZ.greenX = int_green_X;
-   XYZ.greenY = int_green_Y;
-   XYZ.greenZ = int_green_Z;
-   XYZ.blueX = int_blue_X;
-   XYZ.blueY = int_blue_Y;
-   XYZ.blueZ = int_blue_Z;
-
-   if (png_xy_from_XYZ(&xy, XYZ))
-      png_error(png_ptr, "XYZ values out of representable range");
-
-   png_set_cHRM_fixed(png_ptr, info_ptr, xy.whitex, xy.whitey, xy.redx, xy.redy,
-      xy.greenx, xy.greeny, xy.bluex, xy.bluey);
+   XYZ.red_X = int_red_X;
+   XYZ.red_Y = int_red_Y;
+   XYZ.red_Z = int_red_Z;
+   XYZ.green_X = int_green_X;
+   XYZ.green_Y = int_green_Y;
+   XYZ.green_Z = int_green_Z;
+   XYZ.blue_X = int_blue_X;
+   XYZ.blue_Y = int_blue_Y;
+   XYZ.blue_Z = int_blue_Z;
+
+   if (png_colorspace_set_endpoints(png_ptr, &info_ptr->colorspace, &XYZ, 2))
+      info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
+
+   png_colorspace_sync_info(png_ptr, info_ptr);
 }
 
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 void PNGAPI
-png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
+png_set_cHRM(png_const_structrp png_ptr, png_inforp info_ptr,
     double white_x, double white_y, double red_x, double red_y,
     double green_x, double green_y, double blue_x, double blue_y)
 {
@@ -115,7 +114,7 @@ png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
 }
 
 void PNGAPI
-png_set_cHRM_XYZ(png_structp png_ptr, png_infop info_ptr, double red_X,
+png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
     double red_Y, double red_Z, double green_X, double green_Y, double green_Z,
     double blue_X, double blue_Y, double blue_Z)
 {
@@ -136,35 +135,21 @@ png_set_cHRM_XYZ(png_structp png_ptr, png_infop info_ptr, double red_X,
 
 #ifdef PNG_gAMA_SUPPORTED
 void PNGFAPI
-png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
-    file_gamma)
+png_set_gAMA_fixed(png_const_structrp png_ptr, png_inforp info_ptr,
+    png_fixed_point file_gamma)
 {
    png_debug1(1, "in %s storage function", "gAMA");
 
    if (png_ptr == NULL || info_ptr == NULL)
       return;
 
-   /* Changed in libpng-1.5.4 to limit the values to ensure overflow can't
-    * occur.  Since the fixed point representation is assymetrical it is
-    * possible for 1/gamma to overflow the limit of 21474 and this means the
-    * gamma value must be at least 5/100000 and hence at most 20000.0.  For
-    * safety the limits here are a little narrower.  The values are 0.00016 to
-    * 6250.0, which are truly ridiculous gamma values (and will produce
-    * displays that are all black or all white.)
-    */
-   if (file_gamma < 16 || file_gamma > 625000000)
-      png_warning(png_ptr, "Out of range gamma value ignored");
-
-   else
-   {
-      info_ptr->gamma = file_gamma;
-      info_ptr->valid |= PNG_INFO_gAMA;
-   }
+   png_colorspace_set_gamma(png_ptr, &info_ptr->colorspace, file_gamma);
+   png_colorspace_sync_info(png_ptr, info_ptr);
 }
 
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 void PNGAPI
-png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
+png_set_gAMA(png_const_structrp png_ptr, png_inforp info_ptr, double file_gamma)
 {
    png_set_gAMA_fixed(png_ptr, info_ptr, png_fixed(png_ptr, file_gamma,
        "png_set_gAMA"));
@@ -174,7 +159,8 @@ png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
 
 #ifdef PNG_hIST_SUPPORTED
 void PNGAPI
-png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_const_uint_16p hist)
+png_set_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
+    png_const_uint_16p hist)
 {
    int i;
 
@@ -197,26 +183,26 @@ png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_const_uint_16p hist)
    /* Changed from info->num_palette to PNG_MAX_PALETTE_LENGTH in
     * version 1.2.1
     */
-   png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr,
-       PNG_MAX_PALETTE_LENGTH * png_sizeof(png_uint_16));
+   info_ptr->hist = png_voidcast(png_uint_16p, png_malloc_warn(png_ptr,
+       PNG_MAX_PALETTE_LENGTH * (sizeof (png_uint_16))));
 
-   if (png_ptr->hist == NULL)
+   if (info_ptr->hist == NULL)
    {
       png_warning(png_ptr, "Insufficient memory for hIST chunk data");
       return;
    }
 
+   info_ptr->free_me |= PNG_FREE_HIST;
+
    for (i = 0; i < info_ptr->num_palette; i++)
-      png_ptr->hist[i] = hist[i];
+      info_ptr->hist[i] = hist[i];
 
-   info_ptr->hist = png_ptr->hist;
    info_ptr->valid |= PNG_INFO_hIST;
-   info_ptr->free_me |= PNG_FREE_HIST;
 }
 #endif
 
 void PNGAPI
-png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
+png_set_IHDR(png_const_structrp png_ptr, png_inforp info_ptr,
     png_uint_32 width, png_uint_32 height, int bit_depth,
     int color_type, int interlace_type, int compression_type,
     int filter_type)
@@ -266,7 +252,7 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
 
 #ifdef PNG_oFFs_SUPPORTED
 void PNGAPI
-png_set_oFFs(png_structp png_ptr, png_infop info_ptr,
+png_set_oFFs(png_const_structrp png_ptr, png_inforp info_ptr,
     png_int_32 offset_x, png_int_32 offset_y, int unit_type)
 {
    png_debug1(1, "in %s storage function", "oFFs");
@@ -283,7 +269,7 @@ png_set_oFFs(png_structp png_ptr, png_infop info_ptr,
 
 #ifdef PNG_pCAL_SUPPORTED
 void PNGAPI
-png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
+png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
     png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type,
     int nparams, png_const_charp units, png_charpp params)
 {
@@ -292,10 +278,11 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
 
    png_debug1(1, "in %s storage function", "pCAL");
 
-   if (png_ptr == NULL || info_ptr == NULL)
+   if (png_ptr == NULL || info_ptr == NULL || purpose == NULL || units == NULL
+      || (nparams > 0 && params == NULL))
       return;
 
-   length = png_strlen(purpose) + 1;
+   length = strlen(purpose) + 1;
    png_debug1(3, "allocating purpose for info (%lu bytes)",
        (unsigned long)length);
 
@@ -305,12 +292,17 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
    if (type < 0 || type > 3)
       png_error(png_ptr, "Invalid pCAL equation type");
 
+   if (nparams < 0 || nparams > 255)
+      png_error(png_ptr, "Invalid pCAL parameter count");
+
    /* Validate params[nparams] */
    for (i=0; i<nparams; ++i)
-      if (!png_check_fp_string(params[i], png_strlen(params[i])))
+      if (params[i] == NULL ||
+         !png_check_fp_string(params[i], strlen(params[i])))
          png_error(png_ptr, "Invalid format for pCAL parameter");
 
-   info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length);
+   info_ptr->pcal_purpose = png_voidcast(png_charp,
+      png_malloc_warn(png_ptr, length));
 
    if (info_ptr->pcal_purpose == NULL)
    {
@@ -318,7 +310,7 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
       return;
    }
 
-   png_memcpy(info_ptr->pcal_purpose, purpose, length);
+   memcpy(info_ptr->pcal_purpose, purpose, length);
 
    png_debug(3, "storing X0, X1, type, and nparams in info");
    info_ptr->pcal_X0 = X0;
@@ -326,11 +318,12 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
    info_ptr->pcal_type = (png_byte)type;
    info_ptr->pcal_nparams = (png_byte)nparams;
 
-   length = png_strlen(units) + 1;
+   length = strlen(units) + 1;
    png_debug1(3, "allocating units for info (%lu bytes)",
      (unsigned long)length);
 
-   info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length);
+   info_ptr->pcal_units = png_voidcast(png_charp,
+      png_malloc_warn(png_ptr, length));
 
    if (info_ptr->pcal_units == NULL)
    {
@@ -338,10 +331,10 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
       return;
    }
 
-   png_memcpy(info_ptr->pcal_units, units, length);
+   memcpy(info_ptr->pcal_units, units, length);
 
-   info_ptr->pcal_params = (png_charpp)png_malloc_warn(png_ptr,
-       (png_size_t)((nparams + 1) * png_sizeof(png_charp)));
+   info_ptr->pcal_params = png_voidcast(png_charpp, png_malloc_warn(png_ptr,
+       (png_size_t)((nparams + 1) * (sizeof (png_charp)))));
 
    if (info_ptr->pcal_params == NULL)
    {
@@ -349,11 +342,11 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
       return;
    }
 
-   png_memset(info_ptr->pcal_params, 0, (nparams + 1) * png_sizeof(png_charp));
+   memset(info_ptr->pcal_params, 0, (nparams + 1) * (sizeof (png_charp)));
 
    for (i = 0; i < nparams; i++)
    {
-      length = png_strlen(params[i]) + 1;
+      length = strlen(params[i]) + 1;
       png_debug2(3, "allocating parameter %d for info (%lu bytes)", i,
           (unsigned long)length);
 
@@ -365,7 +358,7 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
          return;
       }
 
-      png_memcpy(info_ptr->pcal_params[i], params[i], length);
+      memcpy(info_ptr->pcal_params[i], params[i], length);
    }
 
    info_ptr->valid |= PNG_INFO_pCAL;
@@ -375,7 +368,7 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
 
 #ifdef PNG_sCAL_SUPPORTED
 void PNGAPI
-png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
+png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr,
     int unit, png_const_charp swidth, png_const_charp sheight)
 {
    png_size_t lengthw = 0, lengthh = 0;
@@ -391,11 +384,11 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
    if (unit != 1 && unit != 2)
       png_error(png_ptr, "Invalid sCAL unit");
 
-   if (swidth == NULL || (lengthw = png_strlen(swidth)) == 0 ||
+   if (swidth == NULL || (lengthw = strlen(swidth)) == 0 ||
        swidth[0] == 45 /* '-' */ || !png_check_fp_string(swidth, lengthw))
       png_error(png_ptr, "Invalid sCAL width");
 
-   if (sheight == NULL || (lengthh = png_strlen(sheight)) == 0 ||
+   if (sheight == NULL || (lengthh = strlen(sheight)) == 0 ||
        sheight[0] == 45 /* '-' */ || !png_check_fp_string(sheight, lengthh))
       png_error(png_ptr, "Invalid sCAL height");
 
@@ -405,7 +398,8 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
 
    png_debug1(3, "allocating unit for info (%u bytes)", (unsigned int)lengthw);
 
-   info_ptr->scal_s_width = (png_charp)png_malloc_warn(png_ptr, lengthw);
+   info_ptr->scal_s_width = png_voidcast(png_charp,
+      png_malloc_warn(png_ptr, lengthw));
 
    if (info_ptr->scal_s_width == NULL)
    {
@@ -413,13 +407,14 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
       return;
    }
 
-   png_memcpy(info_ptr->scal_s_width, swidth, lengthw);
+   memcpy(info_ptr->scal_s_width, swidth, lengthw);
 
    ++lengthh;
 
    png_debug1(3, "allocating unit for info (%u bytes)", (unsigned int)lengthh);
 
-   info_ptr->scal_s_height = (png_charp)png_malloc_warn(png_ptr, lengthh);
+   info_ptr->scal_s_height = png_voidcast(png_charp,
+      png_malloc_warn(png_ptr, lengthh));
 
    if (info_ptr->scal_s_height == NULL)
    {
@@ -430,7 +425,7 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
       return;
    }
 
-   png_memcpy(info_ptr->scal_s_height, sheight, lengthh);
+   memcpy(info_ptr->scal_s_height, sheight, lengthh);
 
    info_ptr->valid |= PNG_INFO_sCAL;
    info_ptr->free_me |= PNG_FREE_SCAL;
@@ -438,8 +433,8 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
 
 #  ifdef PNG_FLOATING_POINT_SUPPORTED
 void PNGAPI
-png_set_sCAL(png_structp png_ptr, png_infop info_ptr, int unit, double width,
-    double height)
+png_set_sCAL(png_const_structrp png_ptr, png_inforp info_ptr, int unit,
+    double width, double height)
 {
    png_debug1(1, "in %s storage function", "sCAL");
 
@@ -456,9 +451,9 @@ png_set_sCAL(png_structp png_ptr, png_infop info_ptr, int unit, double width,
       char swidth[PNG_sCAL_MAX_DIGITS+1];
       char sheight[PNG_sCAL_MAX_DIGITS+1];
 
-      png_ascii_from_fp(png_ptr, swidth, sizeof swidth, width,
+      png_ascii_from_fp(png_ptr, swidth, (sizeof swidth), width,
          PNG_sCAL_PRECISION);
-      png_ascii_from_fp(png_ptr, sheight, sizeof sheight, height,
+      png_ascii_from_fp(png_ptr, sheight, (sizeof sheight), height,
          PNG_sCAL_PRECISION);
 
       png_set_sCAL_s(png_ptr, info_ptr, unit, swidth, sheight);
@@ -468,7 +463,7 @@ png_set_sCAL(png_structp png_ptr, png_infop info_ptr, int unit, double width,
 
 #  ifdef PNG_FIXED_POINT_SUPPORTED
 void PNGAPI
-png_set_sCAL_fixed(png_structp png_ptr, png_infop info_ptr, int unit,
+png_set_sCAL_fixed(png_const_structrp png_ptr, png_inforp info_ptr, int unit,
     png_fixed_point width, png_fixed_point height)
 {
    png_debug1(1, "in %s storage function", "sCAL");
@@ -486,8 +481,8 @@ png_set_sCAL_fixed(png_structp png_ptr, png_infop info_ptr, int unit,
       char swidth[PNG_sCAL_MAX_DIGITS+1];
       char sheight[PNG_sCAL_MAX_DIGITS+1];
 
-      png_ascii_from_fixed(png_ptr, swidth, sizeof swidth, width);
-      png_ascii_from_fixed(png_ptr, sheight, sizeof sheight, height);
+      png_ascii_from_fixed(png_ptr, swidth, (sizeof swidth), width);
+      png_ascii_from_fixed(png_ptr, sheight, (sizeof sheight), height);
 
       png_set_sCAL_s(png_ptr, info_ptr, unit, swidth, sheight);
    }
@@ -497,7 +492,7 @@ png_set_sCAL_fixed(png_structp png_ptr, png_infop info_ptr, int unit,
 
 #ifdef PNG_pHYs_SUPPORTED
 void PNGAPI
-png_set_pHYs(png_structp png_ptr, png_infop info_ptr,
+png_set_pHYs(png_const_structrp png_ptr, png_inforp info_ptr,
     png_uint_32 res_x, png_uint_32 res_y, int unit_type)
 {
    png_debug1(1, "in %s storage function", "pHYs");
@@ -513,13 +508,13 @@ png_set_pHYs(png_structp png_ptr, png_infop info_ptr,
 #endif
 
 void PNGAPI
-png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
+png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr,
     png_const_colorp palette, int num_palette)
 {
 
    png_debug1(1, "in %s storage function", "PLTE");
 
-   if (png_ptr == NULL || info_ptr == NULL)
+   if (png_ptr == NULL || info_ptr == NULL || palette == NULL)
       return;
 
    if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH)
@@ -537,6 +532,9 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
    /* It may not actually be necessary to set png_ptr->palette here;
     * we do it for backward compatibility with the way the png_handle_tRNS
     * function used to do the allocation.
+    *
+    * 1.6.0: the above statement appears to be incorrect; something has to set
+    * the palette inside png_struct on read.
     */
    png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);
 
@@ -544,10 +542,10 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
     * of num_palette entries, in case of an invalid PNG file that has
     * too-large sample values.
     */
-   png_ptr->palette = (png_colorp)png_calloc(png_ptr,
-       PNG_MAX_PALETTE_LENGTH * png_sizeof(png_color));
+   png_ptr->palette = png_voidcast(png_colorp, png_calloc(png_ptr,
+       PNG_MAX_PALETTE_LENGTH * (sizeof (png_color))));
 
-   png_memcpy(png_ptr->palette, palette, num_palette * png_sizeof(png_color));
+   memcpy(png_ptr->palette, palette, num_palette * (sizeof (png_color)));
    info_ptr->palette = png_ptr->palette;
    info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette;
 
@@ -558,34 +556,34 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
 
 #ifdef PNG_sBIT_SUPPORTED
 void PNGAPI
-png_set_sBIT(png_structp png_ptr, png_infop info_ptr,
+png_set_sBIT(png_const_structrp png_ptr, png_inforp info_ptr,
     png_const_color_8p sig_bit)
 {
    png_debug1(1, "in %s storage function", "sBIT");
 
-   if (png_ptr == NULL || info_ptr == NULL)
+   if (png_ptr == NULL || info_ptr == NULL || sig_bit == NULL)
       return;
 
-   png_memcpy(&(info_ptr->sig_bit), sig_bit, png_sizeof(png_color_8));
+   info_ptr->sig_bit = *sig_bit;
    info_ptr->valid |= PNG_INFO_sBIT;
 }
 #endif
 
 #ifdef PNG_sRGB_SUPPORTED
 void PNGAPI
-png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int srgb_intent)
+png_set_sRGB(png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)
 {
    png_debug1(1, "in %s storage function", "sRGB");
 
    if (png_ptr == NULL || info_ptr == NULL)
       return;
 
-   info_ptr->srgb_intent = (png_byte)srgb_intent;
-   info_ptr->valid |= PNG_INFO_sRGB;
+   (void)png_colorspace_set_sRGB(png_ptr, &info_ptr->colorspace, srgb_intent);
+   png_colorspace_sync_info(png_ptr, info_ptr);
 }
 
 void PNGAPI
-png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
+png_set_sRGB_gAMA_and_cHRM(png_const_structrp png_ptr, png_inforp info_ptr,
     int srgb_intent)
 {
    png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM");
@@ -593,28 +591,21 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
    if (png_ptr == NULL || info_ptr == NULL)
       return;
 
-   png_set_sRGB(png_ptr, info_ptr, srgb_intent);
-
-#  ifdef PNG_gAMA_SUPPORTED
-   png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_sRGB_INVERSE);
-#  endif
+   if (png_colorspace_set_sRGB(png_ptr, &info_ptr->colorspace, srgb_intent))
+   {
+      /* This causes the gAMA and cHRM to be written too */
+      info_ptr->colorspace.flags |=
+         PNG_COLORSPACE_FROM_gAMA|PNG_COLORSPACE_FROM_cHRM;
+   }
 
-#  ifdef PNG_cHRM_SUPPORTED
-   png_set_cHRM_fixed(png_ptr, info_ptr,
-      /* color      x       y */
-      /* white */ 31270, 32900,
-      /* red   */ 64000, 33000,
-      /* green */ 30000, 60000,
-      /* blue  */ 15000,  6000
-   );
-#  endif /* cHRM */
+   png_colorspace_sync_info(png_ptr, info_ptr);
 }
 #endif /* sRGB */
 
 
 #ifdef PNG_iCCP_SUPPORTED
 void PNGAPI
-png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
+png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
     png_const_charp name, int compression_type,
     png_const_bytep profile, png_uint_32 proflen)
 {
@@ -627,37 +618,58 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
    if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL)
       return;
 
-   length = png_strlen(name)+1;
-   new_iccp_name = (png_charp)png_malloc_warn(png_ptr, length);
+   if (compression_type != PNG_COMPRESSION_TYPE_BASE)
+      png_app_error(png_ptr, "Invalid iCCP compression method");
+
+   /* Set the colorspace first because this validates the profile; do not
+    * override previously set app cHRM or gAMA here (because likely as not the
+    * application knows better than libpng what the correct values are.)  Pass
+    * the info_ptr color_type field to png_colorspace_set_ICC because in the
+    * write case it has not yet been stored in png_ptr.
+    */
+   {
+      int result = png_colorspace_set_ICC(png_ptr, &info_ptr->colorspace, name,
+         proflen, profile, info_ptr->color_type);
+
+      png_colorspace_sync_info(png_ptr, info_ptr);
+
+      /* Don't do any of the copying if the profile was bad, or inconsistent. */
+      if (!result)
+         return;
+
+      /* But do write the gAMA and cHRM chunks from the profile. */
+      info_ptr->colorspace.flags |=
+         PNG_COLORSPACE_FROM_gAMA|PNG_COLORSPACE_FROM_cHRM;
+   }
+
+   length = strlen(name)+1;
+   new_iccp_name = png_voidcast(png_charp, png_malloc_warn(png_ptr, length));
 
    if (new_iccp_name == NULL)
    {
-        png_warning(png_ptr, "Insufficient memory to process iCCP chunk");
+      png_benign_error(png_ptr, "Insufficient memory to process iCCP chunk");
       return;
    }
 
-   png_memcpy(new_iccp_name, name, length);
-   new_iccp_profile = (png_bytep)png_malloc_warn(png_ptr, proflen);
+   memcpy(new_iccp_name, name, length);
+   new_iccp_profile = png_voidcast(png_bytep,
+      png_malloc_warn(png_ptr, proflen));
 
    if (new_iccp_profile == NULL)
    {
-      png_free (png_ptr, new_iccp_name);
-      png_warning(png_ptr,
+      png_free(png_ptr, new_iccp_name);
+      png_benign_error(png_ptr,
           "Insufficient memory to process iCCP profile");
       return;
    }
 
-   png_memcpy(new_iccp_profile, profile, (png_size_t)proflen);
+   memcpy(new_iccp_profile, profile, proflen);
 
    png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, 0);
 
    info_ptr->iccp_proflen = proflen;
    info_ptr->iccp_name = new_iccp_name;
    info_ptr->iccp_profile = new_iccp_profile;
-   /* Compression is always zero but is here so the API and info structure
-    * does not have to change if we introduce multiple compression types
-    */
-   info_ptr->iccp_compression = (png_byte)compression_type;
    info_ptr->free_me |= PNG_FREE_ICCP;
    info_ptr->valid |= PNG_INFO_iCCP;
 }
@@ -665,8 +677,8 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
 
 #ifdef PNG_TEXT_SUPPORTED
 void PNGAPI
-png_set_text(png_structp png_ptr, png_infop info_ptr, png_const_textp text_ptr,
-    int num_text)
+png_set_text(png_const_structrp png_ptr, png_inforp info_ptr,
+    png_const_textp text_ptr, int num_text)
 {
    int ret;
    ret = png_set_text_2(png_ptr, info_ptr, text_ptr, num_text);
@@ -676,7 +688,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_const_textp text_ptr,
 }
 
 int /* PRIVATE */
-png_set_text_2(png_structp png_ptr, png_infop info_ptr,
+png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
     png_const_textp text_ptr, int num_text)
 {
    int i;
@@ -684,74 +696,62 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
    png_debug1(1, "in %lx storage function", png_ptr == NULL ? "unexpected" :
       (unsigned long)png_ptr->chunk_name);
 
-   if (png_ptr == NULL || info_ptr == NULL || num_text == 0)
+   if (png_ptr == NULL || info_ptr == NULL || num_text <= 0 || text_ptr == NULL)
       return(0);
 
    /* Make sure we have enough space in the "text" array in info_struct
-    * to hold all of the incoming text_ptr objects.
+    * to hold all of the incoming text_ptr objects.  This compare can't overflow
+    * because max_text >= num_text (anyway, subtract of two positive integers
+    * can't overflow in any case.)
     */
-
-   if (num_text < 0 ||
-       num_text > INT_MAX - info_ptr->num_text - 8 ||
-       (unsigned int)/*SAFE*/(num_text +/*SAFE*/
-       info_ptr->num_text + 8) >=
-       PNG_SIZE_MAX/png_sizeof(png_text))
+   if (num_text > info_ptr->max_text - info_ptr->num_text)
    {
-      png_warning(png_ptr, "too many text chunks");
-      return(0);
-   }
-
-   if (info_ptr->num_text + num_text > info_ptr->max_text)
-   {
-      int old_max_text = info_ptr->max_text;
       int old_num_text = info_ptr->num_text;
+      int max_text;
+      png_textp new_text = NULL;
 
-      if (info_ptr->text != NULL)
+      /* Calculate an appropriate max_text, checking for overflow. */
+      max_text = old_num_text;
+      if (num_text <= INT_MAX - max_text)
       {
-         png_textp old_text;
-
-         info_ptr->max_text = info_ptr->num_text + num_text + 8;
-         old_text = info_ptr->text;
+         max_text += num_text;
 
-         info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
-            (png_size_t)(info_ptr->max_text * png_sizeof(png_text)));
+         /* Round up to a multiple of 8 */
+         if (max_text < INT_MAX-8)
+            max_text = (max_text + 8) & ~0x7;
 
-         if (info_ptr->text == NULL)
-         {
-            /* Restore to previous condition */
-            info_ptr->max_text = old_max_text;
-            info_ptr->text = old_text;
-            return(1);
-         }
-
-         png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max_text *
-             png_sizeof(png_text)));
-         png_free(png_ptr, old_text);
+         else
+            max_text = INT_MAX;
+
+         /* Now allocate a new array and copy the old members in, this does all
+          * the overflow checks.
+          */
+         new_text = png_voidcast(png_textp,png_realloc_array(png_ptr,
+            info_ptr->text, old_num_text, max_text-old_num_text,
+            sizeof *new_text));
       }
 
-      else
+      if (new_text == NULL)
       {
-         info_ptr->max_text = num_text + 8;
-         info_ptr->num_text = 0;
-         info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
-             (png_size_t)(info_ptr->max_text * png_sizeof(png_text)));
-         if (info_ptr->text == NULL)
-         {
-            /* Restore to previous condition */
-            info_ptr->num_text = old_num_text;
-            info_ptr->max_text = old_max_text;
-            return(1);
-         }
-         info_ptr->free_me |= PNG_FREE_TEXT;
+         png_chunk_report(png_ptr, "too many text chunks",
+            PNG_CHUNK_WRITE_ERROR);
+         return 1;
       }
 
-      png_debug1(3, "allocated %d entries for info_ptr->text",
-          info_ptr->max_text);
+      png_free(png_ptr, info_ptr->text);
+
+      info_ptr->text = new_text;
+      info_ptr->free_me |= PNG_FREE_TEXT;
+      info_ptr->max_text = max_text;
+      /* num_text is adjusted below as the entries are copied in */
+
+      png_debug1(3, "allocated %d entries for info_ptr->text", max_text);
    }
+
    for (i = 0; i < num_text; i++)
    {
-      png_size_t text_length, key_len;
-      png_size_t lang_len, lang_key_len;
+      size_t text_length, key_len;
+      size_t lang_len, lang_key_len;
       png_textp textp = &(info_ptr->text[info_ptr->num_text]);
 
       if (text_ptr[i].key == NULL)
@@ -760,11 +760,12 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
       if (text_ptr[i].compression < PNG_TEXT_COMPRESSION_NONE ||
           text_ptr[i].compression >= PNG_TEXT_COMPRESSION_LAST)
       {
-         png_warning(png_ptr, "text compression mode is out of range");
+         png_chunk_report(png_ptr, "text compression mode is out of range",
+            PNG_CHUNK_WRITE_ERROR);
          continue;
       }
 
-      key_len = png_strlen(text_ptr[i].key);
+      key_len = strlen(text_ptr[i].key);
 
       if (text_ptr[i].compression <= 0)
       {
@@ -778,20 +779,21 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
          /* Set iTXt data */
 
          if (text_ptr[i].lang != NULL)
-            lang_len = png_strlen(text_ptr[i].lang);
+            lang_len = strlen(text_ptr[i].lang);
 
          else
             lang_len = 0;
 
          if (text_ptr[i].lang_key != NULL)
-            lang_key_len = png_strlen(text_ptr[i].lang_key);
+            lang_key_len = strlen(text_ptr[i].lang_key);
 
          else
             lang_key_len = 0;
       }
 #  else /* PNG_iTXt_SUPPORTED */
       {
-         png_warning(png_ptr, "iTXt chunk not supported");
+         png_chunk_report(png_ptr, "iTXt chunk not supported",
+            PNG_CHUNK_WRITE_ERROR);
          continue;
       }
 #  endif
@@ -810,32 +812,35 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
 
       else
       {
-         text_length = png_strlen(text_ptr[i].text);
+         text_length = strlen(text_ptr[i].text);
          textp->compression = text_ptr[i].compression;
       }
 
-      textp->key = (png_charp)png_malloc_warn(png_ptr,
-          (png_size_t)
-          (key_len + text_length + lang_len + lang_key_len + 4));
+      textp->key = png_voidcast(png_charp,png_malloc_base(png_ptr,
+          key_len + text_length + lang_len + lang_key_len + 4));
 
       if (textp->key == NULL)
-         return(1);
+      {
+         png_chunk_report(png_ptr, "text chunk: out of memory",
+               PNG_CHUNK_WRITE_ERROR);
+         return 1;
+      }
 
       png_debug2(2, "Allocated %lu bytes at %p in png_set_text",
           (unsigned long)(png_uint_32)
           (key_len + lang_len + lang_key_len + text_length + 4),
           textp->key);
 
-      png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len));
+      memcpy(textp->key, text_ptr[i].key, key_len);
       *(textp->key + key_len) = '\0';
 
       if (text_ptr[i].compression > 0)
       {
          textp->lang = textp->key + key_len + 1;
-         png_memcpy(textp->lang, text_ptr[i].lang, lang_len);
+         memcpy(textp->lang, text_ptr[i].lang, lang_len);
          *(textp->lang + lang_len) = '\0';
          textp->lang_key = textp->lang + lang_len + 1;
-         png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len);
+         memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len);
          *(textp->lang_key + lang_key_len) = '\0';
          textp->text = textp->lang_key + lang_key_len + 1;
       }
@@ -848,8 +853,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
       }
 
       if (text_length)
-         png_memcpy(textp->text, text_ptr[i].text,
-             (png_size_t)(text_length));
+         memcpy(textp->text, text_ptr[i].text, text_length);
 
       *(textp->text + text_length) = '\0';
 
@@ -870,17 +874,19 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
       info_ptr->num_text++;
       png_debug1(3, "transferred text chunk %d", info_ptr->num_text);
    }
+
    return(0);
 }
 #endif
 
 #ifdef PNG_tIME_SUPPORTED
 void PNGAPI
-png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_const_timep mod_time)
+png_set_tIME(png_const_structrp png_ptr, png_inforp info_ptr,
+    png_const_timep mod_time)
 {
    png_debug1(1, "in %s storage function", "tIME");
 
-   if (png_ptr == NULL || info_ptr == NULL ||
+   if (png_ptr == NULL || info_ptr == NULL || mod_time == NULL ||
        (png_ptr->mode & PNG_WROTE_tIME))
       return;
 
@@ -893,14 +899,14 @@ png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_const_timep mod_time)
       return;
    }
 
-   png_memcpy(&(info_ptr->mod_time), mod_time, png_sizeof(png_time));
+   info_ptr->mod_time = *mod_time;
    info_ptr->valid |= PNG_INFO_tIME;
 }
 #endif
 
 #ifdef PNG_tRNS_SUPPORTED
 void PNGAPI
-png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
+png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr,
     png_const_bytep trans_alpha, int num_trans, png_const_color_16p trans_color)
 {
    png_debug1(1, "in %s storage function", "tRNS");
@@ -908,27 +914,25 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
    if (png_ptr == NULL || info_ptr == NULL)
       return;
 
-   if (num_trans < 0 || num_trans > PNG_MAX_PALETTE_LENGTH)
-      {
-        png_warning(png_ptr, "Ignoring invalid num_trans value");
-        return;
-      }
-
    if (trans_alpha != NULL)
    {
        /* It may not actually be necessary to set png_ptr->trans_alpha here;
         * we do it for backward compatibility with the way the png_handle_tRNS
         * function used to do the allocation.
+        *
+        * 1.6.0: The above statement is incorrect; png_handle_tRNS effectively
+        * relies on png_set_tRNS storing the information in png_struct
+        * (otherwise it won't be there for the code in pngrtran.c).
         */
 
        png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
 
        /* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
-       png_ptr->trans_alpha = info_ptr->trans_alpha =
-           (png_bytep)png_malloc(png_ptr, (png_size_t)PNG_MAX_PALETTE_LENGTH);
+       png_ptr->trans_alpha = info_ptr->trans_alpha = png_voidcast(png_bytep,
+         png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH));
 
        if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH)
-          png_memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans);
+          memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans);
    }
 
    if (trans_color != NULL)
@@ -936,16 +940,15 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
       int sample_max = (1 << info_ptr->bit_depth);
 
       if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
-          (int)trans_color->gray > sample_max) ||
+          trans_color->gray > sample_max) ||
           (info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
-          ((int)trans_color->red > sample_max ||
-          (int)trans_color->green > sample_max ||
-          (int)trans_color->blue > sample_max)))
+          (trans_color->red > sample_max ||
+          trans_color->green > sample_max ||
+          trans_color->blue > sample_max)))
          png_warning(png_ptr,
             "tRNS chunk has out-of-range samples for bit_depth");
 
-      png_memcpy(&(info_ptr->trans_color), trans_color,
-         png_sizeof(png_color_16));
+      info_ptr->trans_color = *trans_color;
 
       if (num_trans == 0)
          num_trans = 1;
@@ -963,8 +966,8 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
 
 #ifdef PNG_sPLT_SUPPORTED
 void PNGAPI
-png_set_sPLT(png_structp png_ptr,
-    png_infop info_ptr, png_const_sPLT_tp entries, int nentries)
+png_set_sPLT(png_const_structrp png_ptr,
+    png_inforp info_ptr, png_const_sPLT_tp entries, int nentries)
 /*
  *  entries        - array of png_sPLT_t structures
  *                   to be added to the list of palettes
@@ -975,237 +978,447 @@ png_set_sPLT(png_structp png_ptr,
  */
 {
    png_sPLT_tp np;
-   int i;
 
-   if (png_ptr == NULL || info_ptr == NULL)
+   if (png_ptr == NULL || info_ptr == NULL || nentries <= 0 || entries == NULL)
       return;
 
-   if (nentries < 0 ||
-       nentries > INT_MAX-info_ptr->splt_palettes_num ||
-       (unsigned int)/*SAFE*/(nentries +/*SAFE*/
-       info_ptr->splt_palettes_num) >=
-       PNG_SIZE_MAX/png_sizeof(png_sPLT_t))
-      np=NULL;
-
-   else
-
-      np = (png_sPLT_tp)png_malloc_warn(png_ptr,
-          (info_ptr->splt_palettes_num + nentries) *
-          (png_size_t)png_sizeof(png_sPLT_t));
+   /* Use the internal realloc function, which checks for all the possible
+    * overflows.  Notice that the parameters are (int) and (size_t)
+    */
+   np = png_voidcast(png_sPLT_tp,png_realloc_array(png_ptr,
+      info_ptr->splt_palettes, info_ptr->splt_palettes_num, nentries,
+      sizeof *np));
 
    if (np == NULL)
    {
-      png_warning(png_ptr, "No memory for sPLT palettes");
+      /* Out of memory or too many chunks */
+      png_chunk_report(png_ptr, "too many sPLT chunks", PNG_CHUNK_WRITE_ERROR);
       return;
    }
 
-   png_memcpy(np, info_ptr->splt_palettes,
-       info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t));
-
    png_free(png_ptr, info_ptr->splt_palettes);
-   info_ptr->splt_palettes=NULL;
+   info_ptr->splt_palettes = np;
+   info_ptr->free_me |= PNG_FREE_SPLT;
 
-   for (i = 0; i < nentries; i++)
+   np += info_ptr->splt_palettes_num;
+
+   do
    {
-      png_sPLT_tp to = np + info_ptr->splt_palettes_num + i;
-      png_const_sPLT_tp from = entries + i;
       png_size_t length;
 
-      length = png_strlen(from->name) + 1;
-      to->name = (png_charp)png_malloc_warn(png_ptr, length);
-
-      if (to->name == NULL)
+      /* Skip invalid input entries */
+      if (entries->name == NULL || entries->entries == NULL)
       {
-         png_warning(png_ptr,
-             "Out of memory while processing sPLT chunk");
+         /* png_handle_sPLT doesn't do this, so this is an app error */
+         png_app_error(png_ptr, "png_set_sPLT: invalid sPLT");
+         /* Just skip the invalid entry */
          continue;
       }
 
-      png_memcpy(to->name, from->name, length);
-      to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr,
-          from->nentries * png_sizeof(png_sPLT_entry));
+      np->depth = entries->depth;
+
+      /* In the even of out-of-memory just return - there's no point keeping on
+       * trying to add sPLT chunks.
+       */
+      length = strlen(entries->name) + 1;
+      np->name = png_voidcast(png_charp, png_malloc_base(png_ptr, length));
+
+      if (np->name == NULL)
+         break;
+
+      memcpy(np->name, entries->name, length);
 
-      if (to->entries == NULL)
+      /* IMPORTANT: we have memory now that won't get freed if something else
+       * goes wrong, this code must free it.  png_malloc_array produces no
+       * warnings, use a png_chunk_report (below) if there is an error.
+       */
+      np->entries = png_voidcast(png_sPLT_entryp, png_malloc_array(png_ptr,
+          entries->nentries, sizeof (png_sPLT_entry)));
+
+      if (np->entries == NULL)
       {
-         png_warning(png_ptr,
-             "Out of memory while processing sPLT chunk");
-         png_free(png_ptr, to->name);
-         to->name = NULL;
-         continue;
+         png_free(png_ptr, np->name);
+         break;
       }
 
-      png_memcpy(to->entries, from->entries,
-          from->nentries * png_sizeof(png_sPLT_entry));
-
-      to->nentries = from->nentries;
-      to->depth = from->depth;
+      np->nentries = entries->nentries;
+      /* This multiply can't overflow because png_malloc_array has already
+       * checked it when doing the allocation.
+       */
+      memcpy(np->entries, entries->entries,
+         entries->nentries * sizeof (png_sPLT_entry));
+
+      /* Note that 'continue' skips the advance of the out pointer and out
+       * count, so an invalid entry is not added.
+       */
+      info_ptr->valid |= PNG_INFO_sPLT;
+      ++(info_ptr->splt_palettes_num);
+      ++np;
    }
+   while (++entries, --nentries);
 
-   info_ptr->splt_palettes = np;
-   info_ptr->splt_palettes_num += nentries;
-   info_ptr->valid |= PNG_INFO_sPLT;
-   info_ptr->free_me |= PNG_FREE_SPLT;
+   if (nentries > 0)
+      png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR);
 }
 #endif /* PNG_sPLT_SUPPORTED */
 
-#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
+#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
+static png_byte
+check_location(png_const_structrp png_ptr, int location)
+{
+   location &= (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT);
+
+   /* New in 1.6.0; copy the location and check it.  This is an API
+    * change, previously the app had to use the
+    * png_set_unknown_chunk_location API below for each chunk.
+    */
+   if (location == 0 && !(png_ptr->mode & PNG_IS_READ_STRUCT))
+   {
+      /* Write struct, so unknown chunks come from the app */
+      png_app_warning(png_ptr,
+         "png_set_unknown_chunks now expects a valid location");
+      /* Use the old behavior */
+      location = (png_byte)(png_ptr->mode &
+         (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT));
+   }
+
+   /* This need not be an internal error - if the app calls
+    * png_set_unknown_chunks on a read pointer it must get the location right.
+    */
+   if (location == 0)
+      png_error(png_ptr, "invalid location in png_set_unknown_chunks");
+
+   /* Now reduce the location to the top-most set bit by removing each least
+    * significant bit in turn.
+    */
+   while (location != (location & -location))
+      location &= ~(location & -location);
+
+   /* The cast is safe because 'location' is a bit mask and only the low four
+    * bits are significant.
+    */
+   return (png_byte)location;
+}
+
 void PNGAPI
-png_set_unknown_chunks(png_structp png_ptr,
-   png_infop info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)
+png_set_unknown_chunks(png_const_structrp png_ptr,
+   png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)
 {
    png_unknown_chunkp np;
-   int i;
 
-   if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0)
+   if (png_ptr == NULL || info_ptr == NULL || num_unknowns <= 0 ||
+      unknowns == NULL)
       return;
 
-   if (num_unknowns < 0 ||
-       num_unknowns > INT_MAX-info_ptr->unknown_chunks_num ||
-       (unsigned int)/*SAFE*/(num_unknowns +/*SAFE*/
-       info_ptr->unknown_chunks_num) >=
-       PNG_SIZE_MAX/png_sizeof(png_unknown_chunk))
-      np=NULL;
+   /* Check for the failure cases where support has been disabled at compile
+    * time.  This code is hardly ever compiled - it's here because
+    * STORE_UNKNOWN_CHUNKS is set by both read and write code (compiling in this
+    * code) but may be meaningless if the read or write handling of unknown
+    * chunks is not compiled in.
+    */
+#  if !(defined PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) && \
+      (defined PNG_READ_SUPPORTED)
+      if (png_ptr->mode & PNG_IS_READ_STRUCT)
+      {
+         png_app_error(png_ptr, "no unknown chunk support on read");
+         return;
+      }
+#  endif
+#  if !(defined PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) && \
+      (defined PNG_WRITE_SUPPORTED)
+      if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
+      {
+         png_app_error(png_ptr, "no unknown chunk support on write");
+         return;
+      }
+#  endif
 
-   else
-      np = (png_unknown_chunkp)png_malloc_warn(png_ptr,
-          (png_size_t)(info_ptr->unknown_chunks_num + num_unknowns) *
-          png_sizeof(png_unknown_chunk));
+   /* Prior to 1.6.0 this code used png_malloc_warn; however, this meant that
+    * unknown critical chunks could be lost with just a warning resulting in
+    * undefined behavior.  Now png_chunk_report is used to provide behavior
+    * appropriate to read or write.
+    */
+   np = png_voidcast(png_unknown_chunkp, png_realloc_array(png_ptr,
+         info_ptr->unknown_chunks, info_ptr->unknown_chunks_num, num_unknowns,
+         sizeof *np));
 
    if (np == NULL)
    {
-      png_warning(png_ptr,
-          "Out of memory while processing unknown chunk");
+      png_chunk_report(png_ptr, "too many unknown chunks",
+         PNG_CHUNK_WRITE_ERROR);
       return;
    }
 
-   png_memcpy(np, info_ptr->unknown_chunks,
-       (png_size_t)info_ptr->unknown_chunks_num *
-       png_sizeof(png_unknown_chunk));
-
    png_free(png_ptr, info_ptr->unknown_chunks);
-   info_ptr->unknown_chunks = NULL;
-
-   for (i = 0; i < num_unknowns; i++)
-   {
-      png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i;
-      png_const_unknown_chunkp from = unknowns + i;
+   info_ptr->unknown_chunks = np; /* safe because it is initialized */
+   info_ptr->free_me |= PNG_FREE_UNKN;
 
-      png_memcpy(to->name, from->name, png_sizeof(from->name));
-      to->name[png_sizeof(to->name)-1] = '\0';
-      to->size = from->size;
+   np += info_ptr->unknown_chunks_num;
 
-      /* Note our location in the read or write sequence */
-      to->location = (png_byte)(png_ptr->mode & 0xff);
+   /* Increment unknown_chunks_num each time round the loop to protect the
+    * just-allocated chunk data.
+    */
+   for (; num_unknowns > 0; --num_unknowns, ++unknowns)
+   {
+      memcpy(np->name, unknowns->name, (sizeof np->name));
+      np->name[(sizeof np->name)-1] = '\0';
+      np->location = check_location(png_ptr, unknowns->location);
 
-      if (from->size == 0)
-         to->data=NULL;
+      if (unknowns->size == 0)
+      {
+         np->data = NULL;
+         np->size = 0;
+      }
 
       else
       {
-         to->data = (png_bytep)png_malloc_warn(png_ptr,
-             (png_size_t)from->size);
+         np->data = png_voidcast(png_bytep,
+            png_malloc_base(png_ptr, unknowns->size));
 
-         if (to->data == NULL)
+         if (np->data == NULL)
          {
-            png_warning(png_ptr,
-                "Out of memory while processing unknown chunk");
-            to->size = 0;
+            png_chunk_report(png_ptr, "unknown chunk: out of memory",
+               PNG_CHUNK_WRITE_ERROR);
+            /* But just skip storing the unknown chunk */
+            continue;
          }
 
-         else
-            png_memcpy(to->data, from->data, from->size);
+         memcpy(np->data, unknowns->data, unknowns->size);
+         np->size = unknowns->size;
       }
-   }
 
-   info_ptr->unknown_chunks = np;
-   info_ptr->unknown_chunks_num += num_unknowns;
-   info_ptr->free_me |= PNG_FREE_UNKN;
+      /* These increments are skipped on out-of-memory for the data - the
+       * unknown chunk entry gets overwritten if the png_chunk_report returns.
+       * This is correct in the read case (the chunk is just dropped.)
+       */
+      ++np;
+      ++(info_ptr->unknown_chunks_num);
+   }
 }
 
 void PNGAPI
-png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr,
+png_set_unknown_chunk_location(png_const_structrp png_ptr, png_inforp info_ptr,
     int chunk, int location)
 {
-   if (png_ptr != NULL && info_ptr != NULL && chunk >= 0 && chunk <
-       info_ptr->unknown_chunks_num)
-      info_ptr->unknown_chunks[chunk].location = (png_byte)location;
+   /* This API is pretty pointless in 1.6.0 because the location can be set
+    * before the call to png_set_unknown_chunks.
+    *
+    * TODO: add a png_app_warning in 1.7
+    */
+   if (png_ptr != NULL && info_ptr != NULL && chunk >= 0 &&
+      chunk < info_ptr->unknown_chunks_num)
+   {
+      if ((location & (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT)) == 0)
+      {
+         png_app_error(png_ptr, "invalid unknown chunk location");
+         /* Fake out the pre 1.6.0 behavior: */
+         if ((location & PNG_HAVE_IDAT)) /* undocumented! */
+            location = PNG_AFTER_IDAT;
+
+         else
+            location = PNG_HAVE_IHDR; /* also undocumented */
+      }
+
+      info_ptr->unknown_chunks[chunk].location =
+         check_location(png_ptr, location);
+   }
 }
 #endif
 
 
 #ifdef PNG_MNG_FEATURES_SUPPORTED
 png_uint_32 PNGAPI
-png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features)
+png_permit_mng_features (png_structrp png_ptr, png_uint_32 mng_features)
 {
    png_debug(1, "in png_permit_mng_features");
 
    if (png_ptr == NULL)
-      return (png_uint_32)0;
+      return 0;
 
-   png_ptr->mng_features_permitted =
-       (png_byte)(mng_features & PNG_ALL_MNG_FEATURES);
+   png_ptr->mng_features_permitted = mng_features & PNG_ALL_MNG_FEATURES;
 
-   return (png_uint_32)png_ptr->mng_features_permitted;
+   return png_ptr->mng_features_permitted;
 }
 #endif
 
 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+static unsigned int
+add_one_chunk(png_bytep list, unsigned int count, png_const_bytep add, int keep)
+{
+   unsigned int i;
+
+   /* Utility function: update the 'keep' state of a chunk if it is already in
+    * the list, otherwise add it to the list.
+    */
+   for (i=0; i<count; ++i, list += 5) if (memcmp(list, add, 4) == 0)
+   {
+      list[4] = (png_byte)keep;
+      return count;
+   }
+
+   if (keep != PNG_HANDLE_CHUNK_AS_DEFAULT)
+   {
+      ++count;
+      memcpy(list, add, 4);
+      list[4] = (png_byte)keep;
+   }
+
+   return count;
+}
+
 void PNGAPI
-png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_const_bytep
-    chunk_list, int num_chunks)
+png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
+    png_const_bytep chunk_list, int num_chunks_in)
 {
-   png_bytep new_list, p;
-   int i, old_num_chunks;
+   png_bytep new_list;
+   unsigned int num_chunks, old_num_chunks;
+
    if (png_ptr == NULL)
       return;
 
-   if (num_chunks == 0)
+   if (keep < 0 || keep >= PNG_HANDLE_CHUNK_LAST)
    {
-      if (keep == PNG_HANDLE_CHUNK_ALWAYS || keep == PNG_HANDLE_CHUNK_IF_SAFE)
-         png_ptr->flags |= PNG_FLAG_KEEP_UNKNOWN_CHUNKS;
+      png_app_error(png_ptr, "png_set_keep_unknown_chunks: invalid keep");
+      return;
+   }
 
-      else
-         png_ptr->flags &= ~PNG_FLAG_KEEP_UNKNOWN_CHUNKS;
+   if (num_chunks_in <= 0)
+   {
+      png_ptr->unknown_default = keep;
 
-      if (keep == PNG_HANDLE_CHUNK_ALWAYS)
-         png_ptr->flags |= PNG_FLAG_KEEP_UNSAFE_CHUNKS;
+      /* '0' means just set the flags, so stop here */
+      if (num_chunks_in == 0)
+        return;
+   }
 
-      else
-         png_ptr->flags &= ~PNG_FLAG_KEEP_UNSAFE_CHUNKS;
+   if (num_chunks_in < 0)
+   {
+      /* Ignore all unknown chunks and all chunks recognized by
+       * libpng except for IHDR, PLTE, tRNS, IDAT, and IEND
+       */
+      static PNG_CONST png_byte chunks_to_ignore[] = {
+         98,  75,  71,  68, '\0',  /* bKGD */
+         99,  72,  82,  77, '\0',  /* cHRM */
+        103,  65,  77,  65, '\0',  /* gAMA */
+        104,  73,  83,  84, '\0',  /* hIST */
+        105,  67,  67,  80, '\0',  /* iCCP */
+        105,  84,  88, 116, '\0',  /* iTXt */
+        111,  70,  70, 115, '\0',  /* oFFs */
+        112,  67,  65,  76, '\0',  /* pCAL */
+        112,  72,  89, 115, '\0',  /* pHYs */
+        115,  66,  73,  84, '\0',  /* sBIT */
+        115,  67,  65,  76, '\0',  /* sCAL */
+        115,  80,  76,  84, '\0',  /* sPLT */
+        115,  84,  69,  82, '\0',  /* sTER */
+        115,  82,  71,  66, '\0',  /* sRGB */
+        116,  69,  88, 116, '\0',  /* tEXt */
+        116,  73,  77,  69, '\0',  /* tIME */
+        122,  84,  88, 116, '\0'   /* zTXt */
+      };
+
+      chunk_list = chunks_to_ignore;
+      num_chunks = (sizeof chunks_to_ignore)/5;
+   }
 
-      return;
+   else /* num_chunks_in > 0 */
+   {
+      if (chunk_list == NULL)
+      {
+         /* Prior to 1.6.0 this was silently ignored, now it is an app_error
+          * which can be switched off.
+          */
+         png_app_error(png_ptr, "png_set_keep_unknown_chunks: no chunk list");
+         return;
+      }
+
+      num_chunks = num_chunks_in;
    }
 
-   if (chunk_list == NULL)
+   old_num_chunks = png_ptr->num_chunk_list;
+   if (png_ptr->chunk_list == NULL)
+      old_num_chunks = 0;
+
+   /* Since num_chunks is always restricted to UINT_MAX/5 this can't overflow.
+    */
+   if (num_chunks + old_num_chunks > UINT_MAX/5)
+   {
+      png_app_error(png_ptr, "png_set_keep_unknown_chunks: too many chunks");
       return;
+   }
 
-   old_num_chunks = png_ptr->num_chunk_list;
-   new_list=(png_bytep)png_malloc(png_ptr,
-       (png_size_t)(5*(num_chunks + old_num_chunks)));
+   /* If these chunks are being reset to the default then no more memory is
+    * required because add_one_chunk above doesn't extend the list if the 'keep'
+    * parameter is the default.
+    */
+   if (keep)
+   {
+      new_list = png_voidcast(png_bytep, png_malloc(png_ptr,
+          5 * (num_chunks + old_num_chunks)));
+
+      if (old_num_chunks > 0)
+         memcpy(new_list, png_ptr->chunk_list, 5*old_num_chunks);
+   }
+
+   else if (old_num_chunks > 0)
+      new_list = png_ptr->chunk_list;
 
-   if (png_ptr->chunk_list != NULL)
+   else
+      new_list = NULL;
+
+   /* Add the new chunks together with each one's handling code.  If the chunk
+    * already exists the code is updated, otherwise the chunk is added to the
+    * end.  (In libpng 1.6.0 order no longer matters because this code enforces
+    * the earlier convention that the last setting is the one that is used.)
+    */
+   if (new_list != NULL)
    {
-      png_memcpy(new_list, png_ptr->chunk_list,
-          (png_size_t)(5*old_num_chunks));
-      png_free(png_ptr, png_ptr->chunk_list);
-      png_ptr->chunk_list=NULL;
+      png_const_bytep inlist;
+      png_bytep outlist;
+      unsigned int i;
+
+      for (i=0; i<num_chunks; ++i)
+         old_num_chunks = add_one_chunk(new_list, old_num_chunks,
+            chunk_list+5*i, keep);
+
+      /* Now remove any spurious 'default' entries. */
+      num_chunks = 0;
+      for (i=0, inlist=outlist=new_list; i<old_num_chunks; ++i, inlist += 5)
+         if (inlist[4])
+         {
+            if (outlist != inlist)
+               memcpy(outlist, inlist, 5);
+            outlist += 5;
+            ++num_chunks;
+         }
+
+      /* This means the application has removed all the specialized handling. */
+      if (num_chunks == 0)
+      {
+         if (png_ptr->chunk_list != new_list)
+            png_free(png_ptr, new_list);
+
+         new_list = NULL;
+      }
    }
 
-   png_memcpy(new_list + 5*old_num_chunks, chunk_list,
-       (png_size_t)(5*num_chunks));
+   else
+      num_chunks = 0;
+
+   png_ptr->num_chunk_list = num_chunks;
 
-   for (p = new_list + 5*old_num_chunks + 4, i = 0; i<num_chunks; i++, p += 5)
-      *p=(png_byte)keep;
+   if (png_ptr->chunk_list != new_list)
+   {
+      if (png_ptr->chunk_list != NULL)
+         png_free(png_ptr, png_ptr->chunk_list);
 
-   png_ptr->num_chunk_list = old_num_chunks + num_chunks;
-   png_ptr->chunk_list = new_list;
-   png_ptr->free_me |= PNG_FREE_LIST;
+      png_ptr->chunk_list = new_list;
+   }
 }
 #endif
 
 #ifdef PNG_READ_USER_CHUNKS_SUPPORTED
 void PNGAPI
-png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr,
+png_set_read_user_chunk_fn(png_structrp png_ptr, png_voidp user_chunk_ptr,
     png_user_chunk_ptr read_user_chunk_fn)
 {
    png_debug(1, "in png_set_read_user_chunk_fn");
@@ -1220,7 +1433,8 @@ png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr,
 
 #ifdef PNG_INFO_IMAGE_SUPPORTED
 void PNGAPI
-png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
+png_set_rows(png_const_structrp png_ptr, png_inforp info_ptr,
+    png_bytepp row_pointers)
 {
    png_debug1(1, "in %s storage function", "rows");
 
@@ -1238,46 +1452,70 @@ png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
 #endif
 
 void PNGAPI
-png_set_compression_buffer_size(png_structp png_ptr, png_size_t size)
+png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
 {
     if (png_ptr == NULL)
        return;
 
-    png_free(png_ptr, png_ptr->zbuf);
+    if (size == 0 || size > PNG_UINT_31_MAX)
+       png_error(png_ptr, "invalid compression buffer size");
 
-    if (size > ZLIB_IO_MAX)
-    {
-       png_warning(png_ptr, "Attempt to set buffer size beyond max ignored");
-       png_ptr->zbuf_size = ZLIB_IO_MAX;
-       size = ZLIB_IO_MAX; /* must fit */
-    }
+#  ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+      if (png_ptr->mode & PNG_IS_READ_STRUCT)
+      {
+         png_ptr->IDAT_read_size = (png_uint_32)size; /* checked above */
+         return;
+      }
+#  endif
 
-    else
-       png_ptr->zbuf_size = (uInt)size;
+#  ifdef PNG_WRITE_SUPPORTED
+      if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
+      {
+         if (png_ptr->zowner != 0)
+         {
+            png_warning(png_ptr,
+              "Compression buffer size cannot be changed because it is in use");
+            return;
+         }
+
+         if (size > ZLIB_IO_MAX)
+         {
+            png_warning(png_ptr,
+               "Compression buffer size limited to system maximum");
+            size = ZLIB_IO_MAX; /* must fit */
+         }
 
-    png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, size);
+         else if (size < 6)
+         {
+            /* Deflate will potentially go into an infinite loop on a SYNC_FLUSH
+             * if this is permitted.
+             */
+            png_warning(png_ptr,
+               "Compression buffer size cannot be reduced below 6");
+            return;
+         }
 
-    /* The following ensures a relatively safe failure if this gets called while
-     * the buffer is actually in use.
-     */
-    png_ptr->zstream.next_out = png_ptr->zbuf;
-    png_ptr->zstream.avail_out = 0;
-    png_ptr->zstream.avail_in = 0;
+         if (png_ptr->zbuffer_size != size)
+         {
+            png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list);
+            png_ptr->zbuffer_size = (uInt)size;
+         }
+      }
+#  endif
 }
 
 void PNGAPI
-png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
+png_set_invalid(png_const_structrp png_ptr, png_inforp info_ptr, int mask)
 {
    if (png_ptr && info_ptr)
       info_ptr->valid &= ~mask;
 }
 
 
-
 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
 /* This function was added to libpng 1.2.6 */
 void PNGAPI
-png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
+png_set_user_limits (png_structrp png_ptr, png_uint_32 user_width_max,
     png_uint_32 user_height_max)
 {
    /* Images with dimensions larger than these limits will be
@@ -1293,8 +1531,7 @@ png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
 
 /* This function was added to libpng 1.4.0 */
 void PNGAPI
-png_set_chunk_cache_max (png_structp png_ptr,
-   png_uint_32 user_chunk_cache_max)
+png_set_chunk_cache_max (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)
 {
     if (png_ptr)
        png_ptr->user_chunk_cache_max = user_chunk_cache_max;
@@ -1302,7 +1539,7 @@ png_set_chunk_cache_max (png_structp png_ptr,
 
 /* This function was added to libpng 1.4.1 */
 void PNGAPI
-png_set_chunk_malloc_max (png_structp png_ptr,
+png_set_chunk_malloc_max (png_structrp png_ptr,
     png_alloc_size_t user_chunk_malloc_max)
 {
    if (png_ptr)
@@ -1313,33 +1550,45 @@ png_set_chunk_malloc_max (png_structp png_ptr,
 
 #ifdef PNG_BENIGN_ERRORS_SUPPORTED
 void PNGAPI
-png_set_benign_errors(png_structp png_ptr, int allowed)
+png_set_benign_errors(png_structrp png_ptr, int allowed)
 {
    png_debug(1, "in png_set_benign_errors");
 
+   /* If allowed is 1, png_benign_error() is treated as a warning.
+    *
+    * If allowed is 0, png_benign_error() is treated as an error (which
+    * is the default behavior if png_set_benign_errors() is not called).
+    */
+
    if (allowed)
-      png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN;
+      png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN |
+         PNG_FLAG_APP_WARNINGS_WARN | PNG_FLAG_APP_ERRORS_WARN;
 
    else
-      png_ptr->flags &= ~PNG_FLAG_BENIGN_ERRORS_WARN;
+      png_ptr->flags &= ~(PNG_FLAG_BENIGN_ERRORS_WARN |
+         PNG_FLAG_APP_WARNINGS_WARN | PNG_FLAG_APP_ERRORS_WARN);
 }
 #endif /* PNG_BENIGN_ERRORS_SUPPORTED */
 
 #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
-/* Whether to report invalid palette index; added at libng-1.5.10
- *   allowed  - one of 0: disable; 1: enable
- */
+   /* Whether to report invalid palette index; added at libng-1.5.10.
+    * It is possible for an indexed (color-type==3) PNG file to contain
+    * pixels with invalid (out-of-range) indexes if the PLTE chunk has
+    * fewer entries than the image's bit-depth would allow. We recover
+    * from this gracefully by filling any incomplete palette with zeroes
+    * (opaque black).  By default, when this occurs libpng will issue
+    * a benign error.  This API can be used to override that behavior.
+    */
 void PNGAPI
-png_set_check_for_invalid_index(png_structp png_ptr, int allowed)
+png_set_check_for_invalid_index(png_structrp png_ptr, int allowed)
 {
    png_debug(1, "in png_set_check_for_invalid_index");
 
-   if (allowed)
+   if (allowed > 0)
       png_ptr->num_palette_max = 0;
 
    else
       png_ptr->num_palette_max = -1;
 }
 #endif
-
 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
index db0d4e49485a02b2b0fc52f11ffe8179d8d5629f..b8202d13a48a84f8ea407340a10c0d01d5c03df6 100644 (file)
@@ -1,11 +1,11 @@
 
 /* pngstruct.h - header file for PNG reference library
  *
- * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
- * Last changed in libpng 1.5.9 [February 18, 2012]
+ * Last changed in libpng 1.6.0 [February 14, 2013]
  *
  * This code is released under the libpng license.
  * For conditions of distribution and use, see the disclaimer
  * in this structure and is required for decompressing the LZ compressed
  * data in PNG files.
  */
+#ifndef ZLIB_CONST
+   /* We must ensure that zlib uses 'const' in declarations. */
+#  define ZLIB_CONST
+#endif
 #include "zlib.h"
+#ifdef const
+   /* zlib.h sometimes #defines const to nothing, undo this. */
+#  undef const
+#endif
+
+/* zlib.h has mediocre z_const use before 1.2.6, this stuff is for compatibility
+ * with older builds.
+ */
+#if ZLIB_VERNUM < 0x1260
+#  define PNGZ_MSG_CAST(s) png_constcast(char*,s)
+#  define PNGZ_INPUT_CAST(b) png_constcast(png_bytep,b)
+#else
+#  define PNGZ_MSG_CAST(s) (s)
+#  define PNGZ_INPUT_CAST(b) (b)
+#endif
+
+/* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib
+ * can handle at once.  This type need be no larger than 16 bits (so maximum of
+ * 65535), this define allows us to discover how big it is, but limited by the
+ * maximuum for png_size_t.  The value can be overriden in a library build
+ * (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably
+ * lower value (e.g. 255 works).  A lower value may help memory usage (slightly)
+ * and may even improve performance on some systems (and degrade it on others.)
+ */
+#ifndef ZLIB_IO_MAX
+#  define ZLIB_IO_MAX ((uInt)-1)
+#endif
+
+#ifdef PNG_WRITE_SUPPORTED
+/* The type of a compression buffer list used by the write code. */
+typedef struct png_compression_buffer
+{
+   struct png_compression_buffer *next;
+   png_byte                       output[1]; /* actually zbuf_size */
+} png_compression_buffer, *png_compression_bufferp;
+
+#define PNG_COMPRESSION_BUFFER_SIZE(pp)\
+   (offsetof(png_compression_buffer, output) + (pp)->zbuffer_size)
+#endif
+
+/* Colorspace support; structures used in png_struct, png_info and in internal
+ * functions to hold and communicate information about the color space.
+ *
+ * PNG_COLORSPACE_SUPPORTED is only required if the application will perform
+ * colorspace corrections, otherwise all the colorspace information can be
+ * skipped and the size of libpng can be reduced (significantly) by compiling
+ * out the colorspace support.
+ */
+#ifdef PNG_COLORSPACE_SUPPORTED
+/* The chromaticities of the red, green and blue colorants and the chromaticity
+ * of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)).
+ */
+typedef struct png_xy
+{
+   png_fixed_point redx, redy;
+   png_fixed_point greenx, greeny;
+   png_fixed_point bluex, bluey;
+   png_fixed_point whitex, whitey;
+} png_xy;
+
+/* The same data as above but encoded as CIE XYZ values.  When this data comes
+ * from chromaticities the sum of the Y values is assumed to be 1.0
+ */
+typedef struct png_XYZ
+{
+   png_fixed_point red_X, red_Y, red_Z;
+   png_fixed_point green_X, green_Y, green_Z;
+   png_fixed_point blue_X, blue_Y, blue_Z;
+} png_XYZ;
+#endif /* COLORSPACE */
+
+#if defined PNG_COLORSPACE_SUPPORTED || defined PNG_GAMMA_SUPPORTED
+/* A colorspace is all the above plus, potentially, profile information,
+ * however at present libpng does not use the profile internally so it is only
+ * stored in the png_info struct (if iCCP is supported.)  The rendering intent
+ * is retained here and is checked.
+ *
+ * The file gamma encoding information is also stored here and gamma correction
+ * is done by libpng, whereas color correction must currently be done by the
+ * application.
+ */
+typedef struct png_colorspace
+{
+#ifdef PNG_GAMMA_SUPPORTED
+   png_fixed_point gamma;        /* File gamma */
+#endif
+
+#ifdef PNG_COLORSPACE_SUPPORTED
+   png_xy      end_points_xy;    /* End points as chromaticities */
+   png_XYZ     end_points_XYZ;   /* End points as CIE XYZ colorant values */
+   png_uint_16 rendering_intent; /* Rendering intent of a profile */
+#endif
+
+   /* Flags are always defined to simplify the code. */
+   png_uint_16 flags;            /* As defined below */
+} png_colorspace, * PNG_RESTRICT png_colorspacerp;
+
+typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp;
+
+/* General flags for the 'flags' field */
+#define PNG_COLORSPACE_HAVE_GAMMA           0x0001
+#define PNG_COLORSPACE_HAVE_ENDPOINTS       0x0002
+#define PNG_COLORSPACE_HAVE_INTENT          0x0004
+#define PNG_COLORSPACE_FROM_gAMA            0x0008
+#define PNG_COLORSPACE_FROM_cHRM            0x0010
+#define PNG_COLORSPACE_FROM_sRGB            0x0020
+#define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040
+#define PNG_COLORSPACE_MATCHES_sRGB         0x0080 /* exact match on profile */
+#define PNG_COLORSPACE_INVALID              0x8000
+#define PNG_COLORSPACE_CANCEL(flags)        (0xffff ^ (flags))
+#endif /* COLORSPACE || GAMMA */
 
 struct png_struct_def
 {
 #ifdef PNG_SETJMP_SUPPORTED
-   jmp_buf longjmp_buffer;    /* used in png_error */
+   jmp_buf jmp_buf_local;     /* New name in 1.6.0 for jmp_buf in png_struct */
    png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */
+   jmp_buf *jmp_buf_ptr;      /* passed to longjmp_fn */
+   size_t jmp_buf_size;       /* size of the above, if allocated */
 #endif
    png_error_ptr error_fn;    /* function for printing errors and aborting */
 #ifdef PNG_WARNINGS_SUPPORTED
@@ -63,22 +180,12 @@ struct png_struct_def
    png_uint_32 flags;         /* flags indicating various things to libpng */
    png_uint_32 transformations; /* which transformations to perform */
 
-   z_stream zstream;          /* pointer to decompression structure (below) */
-   png_bytep zbuf;            /* buffer for zlib */
-   uInt zbuf_size;            /* size of zbuf (typically 65536) */
-#ifdef PNG_WRITE_SUPPORTED
-
-/* Added in 1.5.4: state to keep track of whether the zstream has been
- * initialized and if so whether it is for IDAT or some other chunk.
- */
-#define PNG_ZLIB_UNINITIALIZED 0
-#define PNG_ZLIB_FOR_IDAT      1
-#define PNG_ZLIB_FOR_TEXT      2 /* anything other than IDAT */
-#define PNG_ZLIB_USE_MASK      3 /* bottom two bits */
-#define PNG_ZLIB_IN_USE        4 /* a flag value */
+   png_uint_32 zowner;        /* ID (chunk type) of zstream owner, 0 if none */
+   z_stream    zstream;       /* decompression structure */
 
-   png_uint_32 zlib_state;       /* State of zlib initialization */
-/* End of material added at libpng 1.5.4 */
+#ifdef PNG_WRITE_SUPPORTED
+   png_compression_bufferp zbuffer_list; /* Created on demand during write */
+   uInt                    zbuffer_size; /* size of the actual buffer */
 
    int zlib_level;            /* holds zlib compression level */
    int zlib_method;           /* holds zlib compression method */
@@ -87,8 +194,7 @@ struct png_struct_def
    int zlib_strategy;         /* holds zlib compression strategy */
 #endif
 /* Added at libpng 1.5.4 */
-#if defined(PNG_WRITE_COMPRESSED_TEXT_SUPPORTED) || \
-    defined(PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED)
+#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
    int zlib_text_level;            /* holds zlib compression level */
    int zlib_text_method;           /* holds zlib compression method */
    int zlib_text_window_bits;      /* holds zlib compression window bits */
@@ -96,6 +202,14 @@ struct png_struct_def
    int zlib_text_strategy;         /* holds zlib compression strategy */
 #endif
 /* End of material added at libpng 1.5.4 */
+/* Added at libpng 1.6.0 */
+#ifdef PNG_WRITE_SUPPORTED
+   int zlib_set_level;        /* Actual values set into the zstream on write */
+   int zlib_set_method;
+   int zlib_set_window_bits;
+   int zlib_set_mem_level;
+   int zlib_set_strategy;
+#endif
 
    png_uint_32 width;         /* width of image in pixels */
    png_uint_32 height;        /* height of image in pixels */
@@ -111,10 +225,12 @@ struct png_struct_def
    png_bytep row_buf;         /* buffer to save current (unfiltered) row.
                                * This is a pointer into big_row_buf
                                */
+#ifdef PNG_WRITE_SUPPORTED
    png_bytep sub_row;         /* buffer to save "sub" row when filtering */
    png_bytep up_row;          /* buffer to save "up" row when filtering */
    png_bytep avg_row;         /* buffer to save "avg" row when filtering */
    png_bytep paeth_row;       /* buffer to save "Paeth" row when filtering */
+#endif
    png_size_t info_rowbytes;  /* Added in 1.5.4: cache of updated row bytes */
 
    png_uint_32 idat_size;     /* current IDAT size for read */
@@ -138,15 +254,14 @@ struct png_struct_def
    png_byte usr_bit_depth;    /* bit depth of users row: write only */
    png_byte pixel_depth;      /* number of bits per pixel */
    png_byte channels;         /* number of channels in file */
+#ifdef PNG_WRITE_SUPPORTED
    png_byte usr_channels;     /* channels at start of write: write only */
+#endif
    png_byte sig_bytes;        /* magic bytes read/written from start of file */
    png_byte maximum_pixel_depth;
                               /* pixel depth used for the row buffers */
    png_byte transformed_pixel_depth;
                               /* pixel depth after read/write transforms */
-   png_byte io_chunk_string[5];
-                              /* string name of chunk */
-
 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
    png_uint_16 filler;           /* filler bytes for pixel expansion */
 #endif
@@ -169,7 +284,6 @@ struct png_struct_def
 
 #ifdef PNG_READ_GAMMA_SUPPORTED
    int gamma_shift;      /* number of "insignificant" bits in 16-bit gamma */
-   png_fixed_point gamma;        /* file gamma value */
    png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */
 
    png_bytep gamma_table;     /* gamma table for 8-bit depth files */
@@ -233,10 +347,6 @@ struct png_struct_def
    png_bytep quantize_index; /* index translation for palette files */
 #endif
 
-#if defined(PNG_READ_QUANTIZE_SUPPORTED) || defined(PNG_hIST_SUPPORTED)
-   png_uint_16p hist;                /* histogram */
-#endif
-
 #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
    png_byte heuristic_method;        /* heuristic for row filter selection */
    png_byte num_prev_filters;        /* number of weights for previous rows */
@@ -247,10 +357,12 @@ struct png_struct_def
    png_uint_16p inv_filter_costs;    /* 1/relative filter calculation cost */
 #endif
 
+#if PNG_LIBPNG_VER < 10700
+/* To do: remove this from libpng-1.7 */
 #ifdef PNG_TIME_RFC1123_SUPPORTED
-   /* This is going to be unused in libpng16 and removed from libpng17 */
    char time_buffer[29]; /* String to hold RFC 1123 time text */
 #endif
+#endif
 
 /* New members added in libpng-1.0.6 */
 
@@ -258,17 +370,16 @@ struct png_struct_def
 
 #ifdef PNG_USER_CHUNKS_SUPPORTED
    png_voidp user_chunk_ptr;
+#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
    png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
 #endif
-
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-   int num_chunk_list;
-   png_bytep chunk_list;
 #endif
 
-#ifdef PNG_READ_sRGB_SUPPORTED
-   /* Added in 1.5.5 to record an sRGB chunk in the png. */
-   png_byte is_sRGB;
+#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+   int          unknown_default; /* As PNG_HANDLE_* */
+   unsigned int num_chunk_list;  /* Number of entries in the list */
+   png_bytep    chunk_list;      /* List of png_byte[5]; the textual chunk name
+                                  * followed by a PNG_HANDLE_* byte */
 #endif
 
 /* New members added in libpng-1.0.3 */
@@ -333,16 +444,24 @@ struct png_struct_def
 #endif
 
 /* New member added in libpng-1.0.25 and 1.2.17 */
-#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
-   /* Storage for unknown chunk that the library doesn't recognize. */
+#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
+   /* Temporary storage for unknown chunk that the library doesn't recognize,
+    * used while reading the chunk.
+    */
    png_unknown_chunk unknown_chunk;
 #endif
 
 /* New member added in libpng-1.2.26 */
   png_size_t old_big_row_buf_size;
 
+#ifdef PNG_READ_SUPPORTED
 /* New member added in libpng-1.2.30 */
-  png_charp chunkdata;  /* buffer for reading chunk data */
+  png_bytep        read_buffer;      /* buffer for reading chunk data */
+  png_alloc_size_t read_buffer_size; /* current size of the buffer */
+#endif
+#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+  uInt             IDAT_read_size;   /* limit on read buffer size for IDAT */
+#endif
 
 #ifdef PNG_IO_STATE_SUPPORTED
 /* New member added in libpng-1.4.0 */
@@ -354,5 +473,11 @@ struct png_struct_def
 
    void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info,
       png_bytep row, png_const_bytep prev_row);
+
+#ifdef PNG_READ_SUPPORTED
+#if defined PNG_COLORSPACE_SUPPORTED || defined PNG_GAMMA_SUPPORTED
+   png_colorspace   colorspace;
+#endif
+#endif
 };
 #endif /* PNGSTRUCT_H */
index 1c0dc35dda61aa29e8c0963ab156c29da513f77a..4787a246df3afbaec76baf3f42c0247501fe06bd 100644 (file)
@@ -1,7 +1,7 @@
 
 /* pngtest.c - a simple test program to test libpng
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
+ * Last changed in libpng 1.6.0 [February 14, 2013]
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -766,7 +766,7 @@ write_chunks(png_structp write_ptr, int location)
  */
 #ifdef PNG_TEXT_SUPPORTED
 static void
-pngtest_check_text_support(png_structp png_ptr, png_textp text_ptr,
+pngtest_check_text_support(png_const_structp png_ptr, png_textp text_ptr,
    int num_text)
 {
    while (num_text > 0)
@@ -1235,15 +1235,15 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
       {
          png_set_tIME(write_ptr, write_info_ptr, mod_time);
 #ifdef PNG_TIME_RFC1123_SUPPORTED
-         /* We have to use memcpy instead of "=" because the string
-          * pointed to by png_convert_to_rfc1123() gets free'ed before
-          * we use it.
-          */
-         memcpy(tIME_string,
-                    png_convert_to_rfc1123(read_ptr, mod_time),
-                    png_sizeof(tIME_string));
-         tIME_string[png_sizeof(tIME_string) - 1] = '\0';
+         if (png_convert_to_rfc1123_buffer(tIME_string, mod_time))
+            tIME_string[(sizeof tIME_string) - 1] = '\0';
+
+         else
+         {
+            strncpy(tIME_string, "*** invalid time ***", (sizeof tIME_string));
+            tIME_string[(sizeof tIME_string) - 1] = '\0';
+         }
+
          tIME_chunk_present++;
 #endif /* PNG_TIME_RFC1123_SUPPORTED */
       }
@@ -1419,14 +1419,15 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
       {
          png_set_tIME(write_ptr, write_end_info_ptr, mod_time);
 #ifdef PNG_TIME_RFC1123_SUPPORTED
-         /* We have to use memcpy instead of "=" because the string
-            pointed to by png_convert_to_rfc1123() gets free'ed before
-            we use it */
-         memcpy(tIME_string,
-                    png_convert_to_rfc1123(read_ptr, mod_time),
-                    png_sizeof(tIME_string));
-
-         tIME_string[png_sizeof(tIME_string) - 1] = '\0';
+         if (png_convert_to_rfc1123_buffer(tIME_string, mod_time))
+            tIME_string[(sizeof tIME_string) - 1] = '\0';
+
+         else
+         {
+            strncpy(tIME_string, "*** invalid time ***", sizeof tIME_string);
+            tIME_string[(sizeof tIME_string)-1] = '\0';
+         }
+
          tIME_chunk_present++;
 #endif /* PNG_TIME_RFC1123_SUPPORTED */
       }
@@ -1948,4 +1949,4 @@ main(void)
 #endif
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_5_14 Your_png_h_is_not_version_1_5_14;
+typedef png_libpng_version_1_6_0 Your_png_h_is_not_version_1_6_0;
index ee60957fc19c9125c5328c02a248cbee63ac00ec..b532172c44330794f4440c0c7513951811b05ad0 100644 (file)
@@ -1,8 +1,8 @@
 
 /* pngtrans.c - transforms the data in a row (used by both readers and writers)
  *
- * Last changed in libpng 1.5.11 [June 14, 2012]
- * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.0 [February 14, 2013]
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -18,7 +18,7 @@
 #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
 /* Turn on BGR-to-RGB mapping */
 void PNGAPI
-png_set_bgr(png_structp png_ptr)
+png_set_bgr(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_bgr");
 
@@ -32,7 +32,7 @@ png_set_bgr(png_structp png_ptr)
 #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
 /* Turn on 16 bit byte swapping */
 void PNGAPI
-png_set_swap(png_structp png_ptr)
+png_set_swap(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_swap");
 
@@ -47,7 +47,7 @@ png_set_swap(png_structp png_ptr)
 #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
 /* Turn on pixel packing */
 void PNGAPI
-png_set_packing(png_structp png_ptr)
+png_set_packing(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_packing");
 
@@ -65,7 +65,7 @@ png_set_packing(png_structp png_ptr)
 #if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED)
 /* Turn on packed pixel swapping */
 void PNGAPI
-png_set_packswap(png_structp png_ptr)
+png_set_packswap(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_packswap");
 
@@ -79,7 +79,7 @@ png_set_packswap(png_structp png_ptr)
 
 #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
 void PNGAPI
-png_set_shift(png_structp png_ptr, png_const_color_8p true_bits)
+png_set_shift(png_structrp png_ptr, png_const_color_8p true_bits)
 {
    png_debug(1, "in png_set_shift");
 
@@ -94,7 +94,7 @@ png_set_shift(png_structp png_ptr, png_const_color_8p true_bits)
 #if defined(PNG_READ_INTERLACING_SUPPORTED) || \
     defined(PNG_WRITE_INTERLACING_SUPPORTED)
 int PNGAPI
-png_set_interlace_handling(png_structp png_ptr)
+png_set_interlace_handling(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_interlace handling");
 
@@ -115,44 +115,91 @@ png_set_interlace_handling(png_structp png_ptr)
  * that don't like bytes as parameters.
  */
 void PNGAPI
-png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)
+png_set_filler(png_structrp png_ptr, png_uint_32 filler, int filler_loc)
 {
    png_debug(1, "in png_set_filler");
 
    if (png_ptr == NULL)
       return;
 
+   /* In libpng 1.6 it is possible to determine whether this is a read or write
+    * operation and therefore to do more checking here for a valid call.
+    */
+   if (png_ptr->mode & PNG_IS_READ_STRUCT)
+   {
+#     ifdef PNG_READ_FILLER_SUPPORTED
+         /* On read png_set_filler is always valid, regardless of the base PNG
+          * format, because other transformations can give a format where the
+          * filler code can execute (basically an 8 or 16-bit component RGB or G
+          * format.)
+          *
+          * NOTE: usr_channels is not used by the read code!  (This has led to
+          * confusion in the past.)  The filler is only used in the read code.
+          */
+         png_ptr->filler = (png_uint_16)filler;
+#     else
+         png_app_error(png_ptr, "png_set_filler not supported on read");
+         PNG_UNUSED(filler) /* not used in the write case */
+         return;
+#     endif
+   }
+
+   else /* write */
+   {
+#     ifdef PNG_WRITE_FILLER_SUPPORTED
+         /* On write the usr_channels parameter must be set correctly at the
+          * start to record the number of channels in the app-supplied data.
+          */
+         switch (png_ptr->color_type)
+         {
+            case PNG_COLOR_TYPE_RGB:
+               png_ptr->usr_channels = 4;
+               break;
+
+            case PNG_COLOR_TYPE_GRAY:
+               if (png_ptr->bit_depth >= 8)
+               {
+                  png_ptr->usr_channels = 2;
+                  break;
+               }
+
+               else
+               {
+                  /* There simply isn't any code in libpng to strip out bits
+                   * from bytes when the components are less than a byte in
+                   * size!
+                   */
+                  png_app_error(png_ptr,
+                     "png_set_filler is invalid for low bit depth gray output");
+                  return;
+               }
+
+            default:
+               png_app_error(png_ptr,
+                  "png_set_filler: inappropriate color type");
+               return;
+         }
+#     else
+         png_app_error(png_ptr, "png_set_filler not supported on write");
+         return;
+#     endif
+   }
+
+   /* Here on success - libpng supports the operation, set the transformation
+    * and the flag to say where the filler channel is.
+    */
    png_ptr->transformations |= PNG_FILLER;
-   png_ptr->filler = (png_uint_16)filler;
 
    if (filler_loc == PNG_FILLER_AFTER)
       png_ptr->flags |= PNG_FLAG_FILLER_AFTER;
 
    else
       png_ptr->flags &= ~PNG_FLAG_FILLER_AFTER;
-
-   /* This should probably go in the "do_read_filler" routine.
-    * I attempted to do that in libpng-1.0.1a but that caused problems
-    * so I restored it in libpng-1.0.2a
-   */
-
-   if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
-   {
-      png_ptr->usr_channels = 4;
-   }
-
-   /* Also I added this in libpng-1.0.2a (what happens when we expand
-    * a less-than-8-bit grayscale to GA?) */
-
-   if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY && png_ptr->bit_depth >= 8)
-   {
-      png_ptr->usr_channels = 2;
-   }
 }
 
 /* Added to libpng-1.2.7 */
 void PNGAPI
-png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
+png_set_add_alpha(png_structrp png_ptr, png_uint_32 filler, int filler_loc)
 {
    png_debug(1, "in png_set_add_alpha");
 
@@ -160,7 +207,9 @@ png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
       return;
 
    png_set_filler(png_ptr, filler, filler_loc);
-   png_ptr->transformations |= PNG_ADD_ALPHA;
+   /* The above may fail to do anything. */
+   if (png_ptr->transformations & PNG_FILLER)
+      png_ptr->transformations |= PNG_ADD_ALPHA;
 }
 
 #endif
@@ -168,7 +217,7 @@ png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
 #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
     defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
 void PNGAPI
-png_set_swap_alpha(png_structp png_ptr)
+png_set_swap_alpha(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_swap_alpha");
 
@@ -182,7 +231,7 @@ png_set_swap_alpha(png_structp png_ptr)
 #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
     defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
 void PNGAPI
-png_set_invert_alpha(png_structp png_ptr)
+png_set_invert_alpha(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_invert_alpha");
 
@@ -195,7 +244,7 @@ png_set_invert_alpha(png_structp png_ptr)
 
 #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
 void PNGAPI
-png_set_invert_mono(png_structp png_ptr)
+png_set_invert_mono(png_structrp png_ptr)
 {
    png_debug(1, "in png_set_invert_mono");
 
@@ -623,7 +672,7 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
     defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
 /* Added at libpng-1.5.10 */
 void /* PRIVATE */
-png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info)
+png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
 {
    if (png_ptr->num_palette < (1 << row_info->bit_depth) &&
       png_ptr->num_palette > 0) /* num_palette can be 0 in MNG files */
@@ -726,7 +775,7 @@ png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info)
     defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
 #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
 void PNGAPI
-png_set_user_transform_info(png_structp png_ptr, png_voidp
+png_set_user_transform_info(png_structrp png_ptr, png_voidp
    user_transform_ptr, int user_transform_depth, int user_transform_channels)
 {
    png_debug(1, "in png_set_user_transform_info");
@@ -746,18 +795,18 @@ png_set_user_transform_info(png_structp png_ptr, png_voidp
  */
 #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
 png_voidp PNGAPI
-png_get_user_transform_ptr(png_const_structp png_ptr)
+png_get_user_transform_ptr(png_const_structrp png_ptr)
 {
    if (png_ptr == NULL)
       return (NULL);
 
-   return ((png_voidp)png_ptr->user_transform_ptr);
+   return png_ptr->user_transform_ptr;
 }
 #endif
 
 #ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED
 png_uint_32 PNGAPI
-png_get_current_row_number(png_const_structp png_ptr)
+png_get_current_row_number(png_const_structrp png_ptr)
 {
    /* See the comments in png.h - this is the sub-image row when reading and
     * interlaced image.
@@ -769,7 +818,7 @@ png_get_current_row_number(png_const_structp png_ptr)
 }
 
 png_byte PNGAPI
-png_get_current_pass_number(png_const_structp png_ptr)
+png_get_current_pass_number(png_const_structrp png_ptr)
 {
    if (png_ptr != NULL)
       return png_ptr->pass;
index 95ffb3429f1373e7c061d46290ee2b20518601b2..e3289dfe4ad029a625f956440f0fc46a244e5777 100644 (file)
@@ -1,8 +1,8 @@
 
 /* pngwio.c - functions for data output
  *
- * Last changed in libpng 1.5.0 [January 6, 2011]
- * Copyright (c) 1998-2011 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.0 [February 14, 2013]
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  */
 
 void /* PRIVATE */
-png_write_data(png_structp png_ptr, png_const_bytep data, png_size_t length)
+png_write_data(png_structrp png_ptr, png_const_bytep data, png_size_t length)
 {
    /* NOTE: write_data_fn must not change the buffer! */
    if (png_ptr->write_data_fn != NULL )
-      (*(png_ptr->write_data_fn))(png_ptr, (png_bytep)data, length);
+      (*(png_ptr->write_data_fn))(png_ptr, png_constcast(png_bytep,data),
+         length);
 
    else
       png_error(png_ptr, "Call to NULL write function");
@@ -46,7 +47,6 @@ png_write_data(png_structp png_ptr, png_const_bytep data, png_size_t length)
  * write_data function and use it at run time with png_set_write_fn(), rather
  * than changing the library.
  */
-#ifndef USE_FAR_KEYWORD
 void PNGCBAPI
 png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
 {
@@ -60,64 +60,6 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
    if (check != length)
       png_error(png_ptr, "Write Error");
 }
-#else
-/* This is the model-independent version. Since the standard I/O library
- * can't handle far buffers in the medium and small models, we have to copy
- * the data.
- */
-
-#define NEAR_BUF_SIZE 1024
-#define MIN(a,b) (a <= b ? a : b)
-
-void PNGCBAPI
-png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
-{
-   png_uint_32 check;
-   png_byte *near_data;  /* Needs to be "png_byte *" instead of "png_bytep" */
-   png_FILE_p io_ptr;
-
-   if (png_ptr == NULL)
-      return;
-
-   /* Check if data really is near. If so, use usual code. */
-   near_data = (png_byte *)CVT_PTR_NOCHECK(data);
-   io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
-
-   if ((png_bytep)near_data == data)
-   {
-      check = fwrite(near_data, 1, length, io_ptr);
-   }
-
-   else
-   {
-      png_byte buf[NEAR_BUF_SIZE];
-      png_size_t written, remaining, err;
-      check = 0;
-      remaining = length;
-
-      do
-      {
-         written = MIN(NEAR_BUF_SIZE, remaining);
-         png_memcpy(buf, data, written); /* Copy far buffer to near buffer */
-         err = fwrite(buf, 1, written, io_ptr);
-
-         if (err != written)
-            break;
-
-         else
-            check += err;
-
-         data += written;
-         remaining -= written;
-      }
-      while (remaining != 0);
-   }
-
-   if (check != length)
-      png_error(png_ptr, "Write Error");
-}
-
-#endif
 #endif
 
 /* This function is called to output any data pending writing (normally
@@ -126,7 +68,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
  */
 #ifdef PNG_WRITE_FLUSH_SUPPORTED
 void /* PRIVATE */
-png_flush(png_structp png_ptr)
+png_flush(png_structrp png_ptr)
 {
    if (png_ptr->output_flush_fn != NULL)
       (*(png_ptr->output_flush_fn))(png_ptr);
@@ -141,7 +83,7 @@ png_default_flush(png_structp png_ptr)
    if (png_ptr == NULL)
       return;
 
-   io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
+   io_ptr = png_voidcast(png_FILE_p, (png_ptr->io_ptr));
    fflush(io_ptr);
 }
 #  endif
@@ -177,7 +119,7 @@ png_default_flush(png_structp png_ptr)
  *                 *FILE structure.
  */
 void PNGAPI
-png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
+png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
     png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)
 {
    if (png_ptr == NULL)
@@ -219,36 +161,4 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
           " same structure");
    }
 }
-
-#ifdef USE_FAR_KEYWORD
-#  ifdef _MSC_VER
-void *png_far_to_near(png_structp png_ptr, png_voidp ptr, int check)
-{
-   void *near_ptr;
-   void FAR *far_ptr;
-   FP_OFF(near_ptr) = FP_OFF(ptr);
-   far_ptr = (void FAR *)near_ptr;
-
-   if (check != 0)
-      if (FP_SEG(ptr) != FP_SEG(far_ptr))
-         png_error(png_ptr, "segment lost in conversion");
-
-   return(near_ptr);
-}
-#  else
-void *png_far_to_near(png_structp png_ptr, png_voidp ptr, int check)
-{
-   void *near_ptr;
-   void FAR *far_ptr;
-   near_ptr = (void FAR *)ptr;
-   far_ptr = (void FAR *)near_ptr;
-
-   if (check != 0)
-      if (far_ptr != ptr)
-         png_error(png_ptr, "segment lost in conversion");
-
-   return(near_ptr);
-}
-#  endif
-#endif
 #endif /* PNG_WRITE_SUPPORTED */
index 18f535cd68226dcbbb0b4c735f3cc4ba51dd560e..aa18712fb1cabc91ff7737b8606f793acc9cb1a9 100644 (file)
@@ -1,7 +1,7 @@
 
 /* pngwrite.c - general routines to write a PNG file
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
+ * Last changed in libpng 1.6.0 [February 14, 2013]
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  */
 
 #include "pngpriv.h"
+#if defined PNG_SIMPLIFIED_WRITE_SUPPORTED && defined PNG_STDIO_SUPPORTED
+#  include <errno.h>
+#endif
 
 #ifdef PNG_WRITE_SUPPORTED
 
+#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
+/* Write out all the unknown chunks for the current given location */
+static void
+write_unknown_chunks(png_structrp png_ptr, png_const_inforp info_ptr,
+   unsigned int where)
+{
+   if (info_ptr->unknown_chunks_num)
+   {
+      png_const_unknown_chunkp up;
+
+      png_debug(5, "writing extra chunks");
+
+      for (up = info_ptr->unknown_chunks;
+           up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
+           ++up)
+         if (up->location & where)
+      {
+         /* If per-chunk unknown chunk handling is enabled use it, otherwise
+          * just write the chunks the application has set.
+          */
+#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+         int keep = png_handle_as_unknown(png_ptr, up->name);
+
+         /* NOTE: this code is radically different from the read side in the
+          * matter of handling an ancillary unknown chunk.  In the read side
+          * the default behavior is to discard it, in the code below the default
+          * behavior is to write it.  Critical chunks are, however, only
+          * written if explicitly listed or if the default is set to write all
+          * unknown chunks.
+          *
+          * The default handling is also slightly weird - it is not possible to
+          * stop the writing of all unsafe-to-copy chunks!
+          *
+          * TODO: REVIEW: this would seem to be a bug.
+          */
+         if (keep != PNG_HANDLE_CHUNK_NEVER &&
+             ((up->name[3] & 0x20) /* safe-to-copy overrides everything */ ||
+              keep == PNG_HANDLE_CHUNK_ALWAYS ||
+              (keep == PNG_HANDLE_CHUNK_AS_DEFAULT &&
+               png_ptr->unknown_default == PNG_HANDLE_CHUNK_ALWAYS)))
+#endif
+         {
+            /* TODO: review, what is wrong with a zero length unknown chunk? */
+            if (up->size == 0)
+               png_warning(png_ptr, "Writing zero-length unknown chunk");
+
+            png_write_chunk(png_ptr, up->name, up->data, up->size);
+         }
+      }
+   }
+}
+#endif /* PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED */
+
 /* Writes all the PNG information.  This is the suggested way to use the
  * library.  If you have a new chunk to add, make a function to write it,
  * and put it in the correct location here.  If you want the chunk written
@@ -25,7 +81,7 @@
  * them in png_write_end(), and compressing them.
  */
 void PNGAPI
-png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
+png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr)
 {
    png_debug(1, "in png_write_info_before_PLTE");
 
@@ -51,75 +107,88 @@ png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
        info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type,
        info_ptr->filter_type,
 #ifdef PNG_WRITE_INTERLACING_SUPPORTED
-       info_ptr->interlace_type);
+       info_ptr->interlace_type
 #else
-       0);
+       0
 #endif
+      );
+
    /* The rest of these check to see if the valid field has the appropriate
     * flag set, and if it does, writes the chunk.
+    *
+    * 1.6.0: COLORSPACE support controls the writing of these chunks too, and
+    * the chunks will be written if the WRITE routine is there and information
+    * is available in the COLORSPACE.  (See png_colorspace_sync_info in png.c
+    * for where the valid flags get set.)
+    *
+    * Under certain circumstances the colorspace can be invalidated without
+    * syncing the info_struct 'valid' flags; this happens if libpng detects and
+    * error and calls png_error while the color space is being set, yet the
+    * application continues writing the PNG.  So check the 'invalid' flag here
+    * too.
     */
-#ifdef PNG_WRITE_gAMA_SUPPORTED
-   if (info_ptr->valid & PNG_INFO_gAMA)
-      png_write_gAMA_fixed(png_ptr, info_ptr->gamma);
-#endif
-#ifdef PNG_WRITE_sRGB_SUPPORTED
-   if (info_ptr->valid & PNG_INFO_sRGB)
-      png_write_sRGB(png_ptr, (int)info_ptr->srgb_intent);
+#ifdef PNG_GAMMA_SUPPORTED
+#  ifdef PNG_WRITE_gAMA_SUPPORTED
+      if (!(info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) &&
+         (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_gAMA) &&
+         (info_ptr->valid & PNG_INFO_gAMA))
+         png_write_gAMA_fixed(png_ptr, info_ptr->colorspace.gamma);
+#  endif
 #endif
 
-#ifdef PNG_WRITE_iCCP_SUPPORTED
-   if (info_ptr->valid & PNG_INFO_iCCP)
-      png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_COMPRESSION_TYPE_BASE,
-          (png_charp)info_ptr->iccp_profile, (int)info_ptr->iccp_proflen);
-#endif
+#ifdef PNG_COLORSPACE_SUPPORTED
+   /* Write only one of sRGB or an ICC profile.  If a profile was supplied
+    * and it matches one of the known sRGB ones issue a warning.
+    */
+#  ifdef PNG_WRITE_iCCP_SUPPORTED
+      if (!(info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) &&
+         (info_ptr->valid & PNG_INFO_iCCP))
+      {
+#        ifdef PNG_WRITE_sRGB_SUPPORTED
+            if (info_ptr->valid & PNG_INFO_sRGB)
+               png_app_warning(png_ptr,
+                  "profile matches sRGB but writing iCCP instead");
+#        endif
+
+         png_write_iCCP(png_ptr, info_ptr->iccp_name,
+            info_ptr->iccp_profile);
+      }
+#     ifdef PNG_WRITE_sRGB_SUPPORTED
+         else
+#     endif
+#  endif
+
+#  ifdef PNG_WRITE_sRGB_SUPPORTED
+      if (!(info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) &&
+         (info_ptr->valid & PNG_INFO_sRGB))
+         png_write_sRGB(png_ptr, info_ptr->colorspace.rendering_intent);
+#  endif /* WRITE_sRGB */
+#endif /* COLORSPACE */
+
 #ifdef PNG_WRITE_sBIT_SUPPORTED
    if (info_ptr->valid & PNG_INFO_sBIT)
       png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type);
 #endif
-#ifdef PNG_WRITE_cHRM_SUPPORTED
-   if (info_ptr->valid & PNG_INFO_cHRM)
-      png_write_cHRM_fixed(png_ptr,
-          info_ptr->x_white, info_ptr->y_white,
-          info_ptr->x_red, info_ptr->y_red,
-          info_ptr->x_green, info_ptr->y_green,
-          info_ptr->x_blue, info_ptr->y_blue);
+
+#ifdef PNG_COLORSPACE_SUPPORTED
+#  ifdef PNG_WRITE_cHRM_SUPPORTED
+      if (!(info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) &&
+         (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) &&
+         (info_ptr->valid & PNG_INFO_cHRM))
+         png_write_cHRM_fixed(png_ptr, &info_ptr->colorspace.end_points_xy);
+#  endif
 #endif
 
 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
-   if (info_ptr->unknown_chunks_num)
-   {
-      png_unknown_chunk *up;
-
-      png_debug(5, "writing extra chunks");
-
-      for (up = info_ptr->unknown_chunks;
-           up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
-           up++)
-      {
-         int keep = png_handle_as_unknown(png_ptr, up->name);
-
-         if (keep != PNG_HANDLE_CHUNK_NEVER &&
-             up->location &&
-             !(up->location & PNG_HAVE_PLTE) &&
-             !(up->location & PNG_HAVE_IDAT) &&
-             !(up->location & PNG_AFTER_IDAT) &&
-             ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
-             (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
-         {
-            if (up->size == 0)
-               png_warning(png_ptr, "Writing zero-length unknown chunk");
-
-            png_write_chunk(png_ptr, up->name, up->data, up->size);
-         }
-      }
-   }
+      write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_IHDR);
 #endif
+
       png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE;
    }
 }
 
 void PNGAPI
-png_write_info(png_structp png_ptr, png_infop info_ptr)
+png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
 {
 #if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
    int i;
@@ -263,29 +332,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
 #endif /* tEXt */
 
 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
-   if (info_ptr->unknown_chunks_num)
-   {
-      png_unknown_chunk *up;
-
-      png_debug(5, "writing extra chunks");
-
-      for (up = info_ptr->unknown_chunks;
-           up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
-           up++)
-      {
-         int keep = png_handle_as_unknown(png_ptr, up->name);
-         if (keep != PNG_HANDLE_CHUNK_NEVER &&
-             up->location &&
-             (up->location & PNG_HAVE_PLTE) &&
-             !(up->location & PNG_HAVE_IDAT) &&
-             !(up->location & PNG_AFTER_IDAT) &&
-             ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
-             (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
-         {
-            png_write_chunk(png_ptr, up->name, up->data, up->size);
-         }
-      }
-   }
+   write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_PLTE);
 #endif
 }
 
@@ -295,7 +342,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
  * comments, I suggest writing them here, and compressing them.
  */
 void PNGAPI
-png_write_end(png_structp png_ptr, png_infop info_ptr)
+png_write_end(png_structrp png_ptr, png_inforp info_ptr)
 {
    png_debug(1, "in png_write_end");
 
@@ -377,27 +424,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
       }
 #endif
 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
-   if (info_ptr->unknown_chunks_num)
-   {
-      png_unknown_chunk *up;
-
-      png_debug(5, "writing extra chunks");
-
-      for (up = info_ptr->unknown_chunks;
-           up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
-           up++)
-      {
-         int keep = png_handle_as_unknown(png_ptr, up->name);
-         if (keep != PNG_HANDLE_CHUNK_NEVER &&
-             up->location &&
-             (up->location & PNG_AFTER_IDAT) &&
-             ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
-             (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
-         {
-            png_write_chunk(png_ptr, up->name, up->data, up->size);
-         }
-      }
-   }
+      write_unknown_chunks(png_ptr, info_ptr, PNG_AFTER_IDAT);
 #endif
    }
 
@@ -421,7 +448,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
 
 #ifdef PNG_CONVERT_tIME_SUPPORTED
 void PNGAPI
-png_convert_from_struct_tm(png_timep ptime, PNG_CONST struct tm FAR * ttime)
+png_convert_from_struct_tm(png_timep ptime, PNG_CONST struct tm * ttime)
 {
    png_debug(1, "in png_convert_from_struct_tm");
 
@@ -450,104 +477,76 @@ PNG_FUNCTION(png_structp,PNGAPI
 png_create_write_struct,(png_const_charp user_png_ver, png_voidp error_ptr,
     png_error_ptr error_fn, png_error_ptr warn_fn),PNG_ALLOCATED)
 {
-#ifdef PNG_USER_MEM_SUPPORTED
-   return (png_create_write_struct_2(user_png_ver, error_ptr, error_fn,
-       warn_fn, NULL, NULL, NULL));
+#ifndef PNG_USER_MEM_SUPPORTED
+   png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
+      error_fn, warn_fn, NULL, NULL, NULL);
+#else
+   return png_create_write_struct_2(user_png_ver, error_ptr, error_fn,
+       warn_fn, NULL, NULL, NULL);
 }
 
 /* Alternate initialize png_ptr structure, and allocate any memory needed */
-static void png_reset_filter_heuristics(png_structp png_ptr); /* forward decl */
-
 PNG_FUNCTION(png_structp,PNGAPI
 png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
     png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
     png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED)
 {
+   png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
+      error_fn, warn_fn, mem_ptr, malloc_fn, free_fn);
 #endif /* PNG_USER_MEM_SUPPORTED */
-   volatile int png_cleanup_needed = 0;
-#ifdef PNG_SETJMP_SUPPORTED
-   volatile
-#endif
-   png_structp png_ptr;
-#ifdef PNG_SETJMP_SUPPORTED
-#ifdef USE_FAR_KEYWORD
-   jmp_buf tmp_jmpbuf;
-#endif
-#endif
-
-   png_debug(1, "in png_create_write_struct");
-
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
-       (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr);
-#else
-   png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
-#endif /* PNG_USER_MEM_SUPPORTED */
-   if (png_ptr == NULL)
-      return (NULL);
-
-   /* Added at libpng-1.2.6 */
-#ifdef PNG_SET_USER_LIMITS_SUPPORTED
-   png_ptr->user_width_max = PNG_USER_WIDTH_MAX;
-   png_ptr->user_height_max = PNG_USER_HEIGHT_MAX;
-#endif
 
-#ifdef PNG_SETJMP_SUPPORTED
-/* Applications that neglect to set up their own setjmp() and then
- * encounter a png_error() will longjmp here.  Since the jmpbuf is
- * then meaningless we abort instead of returning.
- */
-#ifdef USE_FAR_KEYWORD
-   if (setjmp(tmp_jmpbuf))
-#else
-   if (setjmp(png_jmpbuf(png_ptr))) /* sets longjmp to match setjmp */
-#endif
-#ifdef USE_FAR_KEYWORD
-   png_memcpy(png_jmpbuf(png_ptr), tmp_jmpbuf, png_sizeof(jmp_buf));
-#endif
-      PNG_ABORT();
-#endif
-
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn);
-#endif /* PNG_USER_MEM_SUPPORTED */
-   png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn);
-
-   if (!png_user_version_check(png_ptr, user_png_ver))
-      png_cleanup_needed = 1;
+   /* Set the zlib control values to defaults; they can be overridden by the
+    * application after the struct has been created.
+    */
+   png_ptr->zbuffer_size = PNG_ZBUF_SIZE;
 
-   /* Initialize zbuf - compression buffer */
-   png_ptr->zbuf_size = PNG_ZBUF_SIZE;
+   /* The 'zlib_strategy' setting is irrelevant because png_default_claim in
+    * pngwutil.c defaults it according to whether or not filters will be used,
+    * and ignores this setting.
+    */
+   png_ptr->zlib_strategy = PNG_Z_DEFAULT_STRATEGY;
+   png_ptr->zlib_level = PNG_Z_DEFAULT_COMPRESSION;
+   png_ptr->zlib_mem_level = 8;
+   png_ptr->zlib_window_bits = 15;
+   png_ptr->zlib_method = 8;
+
+#ifdef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
+   png_ptr->zlib_text_strategy = PNG_TEXT_Z_DEFAULT_STRATEGY;
+   png_ptr->zlib_text_level = PNG_TEXT_Z_DEFAULT_COMPRESSION;
+   png_ptr->zlib_text_mem_level = 8;
+   png_ptr->zlib_text_window_bits = 15;
+   png_ptr->zlib_text_method = 8;
+#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
+
+   /* This is a highly dubious configuration option; by default it is off, but
+    * it may be appropriate for private builds that are testing extensions not
+    * conformant to the current specification, or of applications that must not
+    * fail to write at all costs!
+    */
+#  ifdef PNG_BENIGN_WRITE_ERRORS_SUPPORTED
+      png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN;
+      /* In stable builds only warn if an application error can be completely
+       * handled.
+       */
+#  endif
 
-   if (!png_cleanup_needed)
-   {
-      png_ptr->zbuf = (png_bytep)png_malloc_warn(png_ptr,
-          png_ptr->zbuf_size);
-      if (png_ptr->zbuf == NULL)
-         png_cleanup_needed = 1;
-   }
+   /* App warnings are warnings in release (or release candidate) builds but
+    * are errors during development.
+    */
+#  if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC
+      png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN;
+#  endif
 
-   if (png_cleanup_needed)
+   if (png_ptr != NULL)
    {
-       /* Clean up PNG structure and deallocate any memory. */
-       png_free(png_ptr, png_ptr->zbuf);
-       png_ptr->zbuf = NULL;
-#ifdef PNG_USER_MEM_SUPPORTED
-       png_destroy_struct_2((png_voidp)png_ptr,
-           (png_free_ptr)free_fn, (png_voidp)mem_ptr);
-#else
-       png_destroy_struct((png_voidp)png_ptr);
-#endif
-       return (NULL);
+      /* TODO: delay this, it can be done in png_init_io() (if the app doesn't
+       * do it itself) avoiding setting the default function if it is not
+       * required.
+       */
+      png_set_write_fn(png_ptr, NULL, NULL, NULL);
    }
 
-   png_set_write_fn(png_ptr, NULL, NULL, NULL);
-
-#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
-   png_reset_filter_heuristics(png_ptr);
-#endif
-
-   return (png_ptr);
+   return png_ptr;
 }
 
 
@@ -557,7 +556,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
  * "write" the image seven times.
  */
 void PNGAPI
-png_write_rows(png_structp png_ptr, png_bytepp row,
+png_write_rows(png_structrp png_ptr, png_bytepp row,
     png_uint_32 num_rows)
 {
    png_uint_32 i; /* row counter */
@@ -579,7 +578,7 @@ png_write_rows(png_structp png_ptr, png_bytepp row,
  * if you are writing an interlaced image.
  */
 void PNGAPI
-png_write_image(png_structp png_ptr, png_bytepp image)
+png_write_image(png_structrp png_ptr, png_bytepp image)
 {
    png_uint_32 i; /* row index */
    int pass, num_pass; /* pass variables */
@@ -611,7 +610,7 @@ png_write_image(png_structp png_ptr, png_bytepp image)
 
 /* Called by user to write a row of image data */
 void PNGAPI
-png_write_row(png_structp png_ptr, png_const_bytep row)
+png_write_row(png_structrp png_ptr, png_const_bytep row)
 {
    /* 1.5.6: moved from png_struct to be a local structure: */
    png_row_info row_info;
@@ -754,7 +753,7 @@ png_write_row(png_structp png_ptr, png_const_bytep row)
    png_debug1(3, "row_info->rowbytes = %lu", (unsigned long)row_info.rowbytes);
 
    /* Copy user's row into buffer, leaving room for filter byte. */
-   png_memcpy(png_ptr->row_buf + 1, row, row_info.rowbytes);
+   memcpy(png_ptr->row_buf + 1, row, row_info.rowbytes);
 
 #ifdef PNG_WRITE_INTERLACING_SUPPORTED
    /* Handle interlacing */
@@ -820,7 +819,7 @@ png_write_row(png_structp png_ptr, png_const_bytep row)
 #ifdef PNG_WRITE_FLUSH_SUPPORTED
 /* Set the automatic flush interval or 0 to turn flushing off */
 void PNGAPI
-png_set_flush(png_structp png_ptr, int nrows)
+png_set_flush(png_structrp png_ptr, int nrows)
 {
    png_debug(1, "in png_set_flush");
 
@@ -832,10 +831,8 @@ png_set_flush(png_structp png_ptr, int nrows)
 
 /* Flush the current output buffers now */
 void PNGAPI
-png_write_flush(png_structp png_ptr)
+png_write_flush(png_structrp png_ptr)
 {
-   int wrote_IDAT;
-
    png_debug(1, "in png_write_flush");
 
    if (png_ptr == NULL)
@@ -845,133 +842,28 @@ png_write_flush(png_structp png_ptr)
    if (png_ptr->row_number >= png_ptr->num_rows)
       return;
 
-   do
-   {
-      int ret;
-
-      /* Compress the data */
-      ret = deflate(&png_ptr->zstream, Z_SYNC_FLUSH);
-      wrote_IDAT = 0;
-
-      /* Check for compression errors */
-      if (ret != Z_OK)
-      {
-         if (png_ptr->zstream.msg != NULL)
-            png_error(png_ptr, png_ptr->zstream.msg);
-
-         else
-            png_error(png_ptr, "zlib error");
-      }
-
-      if (!(png_ptr->zstream.avail_out))
-      {
-         /* Write the IDAT and reset the zlib output buffer */
-         png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
-         wrote_IDAT = 1;
-      }
-   } while (wrote_IDAT == 1);
-
-   /* If there is any data left to be output, write it into a new IDAT */
-   if (png_ptr->zbuf_size != png_ptr->zstream.avail_out)
-   {
-      /* Write the IDAT and reset the zlib output buffer */
-      png_write_IDAT(png_ptr, png_ptr->zbuf,
-          png_ptr->zbuf_size - png_ptr->zstream.avail_out);
-   }
+   png_compress_IDAT(png_ptr, NULL, 0, Z_SYNC_FLUSH);
    png_ptr->flush_rows = 0;
    png_flush(png_ptr);
 }
 #endif /* PNG_WRITE_FLUSH_SUPPORTED */
 
-/* Free all memory used by the write */
-void PNGAPI
-png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
-{
-   png_structp png_ptr = NULL;
-   png_infop info_ptr = NULL;
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_free_ptr free_fn = NULL;
-   png_voidp mem_ptr = NULL;
-#endif
-
-   png_debug(1, "in png_destroy_write_struct");
-
-   if (png_ptr_ptr != NULL)
-      png_ptr = *png_ptr_ptr;
-
-#ifdef PNG_USER_MEM_SUPPORTED
-   if (png_ptr != NULL)
-   {
-      free_fn = png_ptr->free_fn;
-      mem_ptr = png_ptr->mem_ptr;
-   }
-#endif
-
-   if (info_ptr_ptr != NULL)
-      info_ptr = *info_ptr_ptr;
-
-   if (info_ptr != NULL)
-   {
-      if (png_ptr != NULL)
-      {
-         png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
-
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-         if (png_ptr->num_chunk_list)
-         {
-            png_free(png_ptr, png_ptr->chunk_list);
-            png_ptr->num_chunk_list = 0;
-         }
-#endif
-      }
-
-#ifdef PNG_USER_MEM_SUPPORTED
-      png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn,
-          (png_voidp)mem_ptr);
-#else
-      png_destroy_struct((png_voidp)info_ptr);
+#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
+static void png_reset_filter_heuristics(png_structrp png_ptr);/* forward decl */
 #endif
-      *info_ptr_ptr = NULL;
-   }
 
-   if (png_ptr != NULL)
-   {
-      png_write_destroy(png_ptr);
-#ifdef PNG_USER_MEM_SUPPORTED
-      png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn,
-          (png_voidp)mem_ptr);
-#else
-      png_destroy_struct((png_voidp)png_ptr);
-#endif
-      *png_ptr_ptr = NULL;
-   }
-}
-
-
-/* Free any memory used in png_ptr struct (old method) */
-void /* PRIVATE */
-png_write_destroy(png_structp png_ptr)
+/* Free any memory used in png_ptr struct without freeing the struct itself. */
+static void
+png_write_destroy(png_structrp png_ptr)
 {
-#ifdef PNG_SETJMP_SUPPORTED
-   jmp_buf tmp_jmp; /* Save jump buffer */
-#endif
-   png_error_ptr error_fn;
-#ifdef PNG_WARNINGS_SUPPORTED
-   png_error_ptr warning_fn;
-#endif
-   png_voidp error_ptr;
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_free_ptr free_fn;
-#endif
-
    png_debug(1, "in png_write_destroy");
 
    /* Free any memory zlib uses */
-   if (png_ptr->zlib_state != PNG_ZLIB_UNINITIALIZED)
+   if (png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED)
       deflateEnd(&png_ptr->zstream);
 
    /* Free our memory.  png_free checks NULL for us. */
-   png_free(png_ptr, png_ptr->zbuf);
+   png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list);
    png_free(png_ptr, png_ptr->row_buf);
 #ifdef PNG_WRITE_FILTER_SUPPORTED
    png_free(png_ptr, png_ptr->prev_row);
@@ -988,39 +880,46 @@ png_write_destroy(png_structp png_ptr)
    png_free(png_ptr, png_ptr->inv_filter_costs);
 #endif
 
-#ifdef PNG_SETJMP_SUPPORTED
-   /* Reset structure */
-   png_memcpy(tmp_jmp, png_ptr->longjmp_buffer, png_sizeof(jmp_buf));
+#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+   png_free(png_ptr, png_ptr->chunk_list);
 #endif
 
-   error_fn = png_ptr->error_fn;
-#ifdef PNG_WARNINGS_SUPPORTED
-   warning_fn = png_ptr->warning_fn;
-#endif
-   error_ptr = png_ptr->error_ptr;
-#ifdef PNG_USER_MEM_SUPPORTED
-   free_fn = png_ptr->free_fn;
-#endif
+   /* The error handling and memory handling information is left intact at this
+    * point: the jmp_buf may still have to be freed.  See png_destroy_png_struct
+    * for how this happens.
+    */
+}
 
-   png_memset(png_ptr, 0, png_sizeof(png_struct));
+/* Free all memory used by the write.
+ * In libpng 1.6.0 this API changed quietly to no longer accept a NULL value for
+ * *png_ptr_ptr.  Prior to 1.6.0 it would accept such a value and it would free
+ * the passed in info_structs but it would quietly fail to free any of the data
+ * inside them.  In 1.6.0 it quietly does nothing (it has to be quiet because it
+ * has no png_ptr.)
+ */
+void PNGAPI
+png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
+{
+   png_debug(1, "in png_destroy_write_struct");
 
-   png_ptr->error_fn = error_fn;
-#ifdef PNG_WARNINGS_SUPPORTED
-   png_ptr->warning_fn = warning_fn;
-#endif
-   png_ptr->error_ptr = error_ptr;
-#ifdef PNG_USER_MEM_SUPPORTED
-   png_ptr->free_fn = free_fn;
-#endif
+   if (png_ptr_ptr != NULL)
+   {
+      png_structrp png_ptr = *png_ptr_ptr;
 
-#ifdef PNG_SETJMP_SUPPORTED
-   png_memcpy(png_ptr->longjmp_buffer, tmp_jmp, png_sizeof(jmp_buf));
-#endif
+      if (png_ptr != NULL) /* added in libpng 1.6.0 */
+      {
+         png_destroy_info_struct(png_ptr, info_ptr_ptr);
+
+         *png_ptr_ptr = NULL;
+         png_write_destroy(png_ptr);
+         png_destroy_png_struct(png_ptr);
+      }
+   }
 }
 
 /* Allow the application to select one or more row filters to use. */
 void PNGAPI
-png_set_filter(png_structp png_ptr, int method, int filters)
+png_set_filter(png_structrp png_ptr, int method, int filters)
 {
    png_debug(1, "in png_set_filter");
 
@@ -1040,8 +939,8 @@ png_set_filter(png_structp png_ptr, int method, int filters)
 #ifdef PNG_WRITE_FILTER_SUPPORTED
          case 5:
          case 6:
-         case 7: png_warning(png_ptr, "Unknown row filter for method 0");
-             /* FALL THROUGH */
+         case 7: png_app_error(png_ptr, "Unknown row filter for method 0");
+            /* FALL THROUGH */
 #endif /* PNG_WRITE_FILTER_SUPPORTED */
          case PNG_FILTER_VALUE_NONE:
             png_ptr->do_filter = PNG_FILTER_NONE; break;
@@ -1063,7 +962,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
             png_ptr->do_filter = (png_byte)filters; break;
 #else
          default:
-            png_warning(png_ptr, "Unknown row filter for method 0");
+            png_app_error(png_ptr, "Unknown row filter for method 0");
 #endif /* PNG_WRITE_FILTER_SUPPORTED */
       }
 
@@ -1156,7 +1055,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
 #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED      /* GRR 970116 */
 /* Convenience reset API. */
 static void
-png_reset_filter_heuristics(png_structp png_ptr)
+png_reset_filter_heuristics(png_structrp png_ptr)
 {
    /* Clear out any old values in the 'weights' - this must be done because if
     * the app calls set_filter_heuristics multiple times with different
@@ -1189,7 +1088,7 @@ png_reset_filter_heuristics(png_structp png_ptr)
 }
 
 static int
-png_init_filter_heuristics(png_structp png_ptr, int heuristic_method,
+png_init_filter_heuristics(png_structrp png_ptr, int heuristic_method,
    int num_weights)
 {
    if (png_ptr == NULL)
@@ -1209,7 +1108,7 @@ png_init_filter_heuristics(png_structp png_ptr, int heuristic_method,
       if (num_weights > 0)
       {
          png_ptr->prev_filters = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)(png_sizeof(png_byte) * num_weights));
+             (png_uint_32)((sizeof (png_byte)) * num_weights));
 
          /* To make sure that the weighting starts out fairly */
          for (i = 0; i < num_weights; i++)
@@ -1218,10 +1117,10 @@ png_init_filter_heuristics(png_structp png_ptr, int heuristic_method,
          }
 
          png_ptr->filter_weights = (png_uint_16p)png_malloc(png_ptr,
-             (png_uint_32)(png_sizeof(png_uint_16) * num_weights));
+             (png_uint_32)((sizeof (png_uint_16)) * num_weights));
 
          png_ptr->inv_filter_weights = (png_uint_16p)png_malloc(png_ptr,
-             (png_uint_32)(png_sizeof(png_uint_16) * num_weights));
+             (png_uint_32)((sizeof (png_uint_16)) * num_weights));
 
          for (i = 0; i < num_weights; i++)
          {
@@ -1239,10 +1138,10 @@ png_init_filter_heuristics(png_structp png_ptr, int heuristic_method,
       if (png_ptr->filter_costs == NULL)
       {
          png_ptr->filter_costs = (png_uint_16p)png_malloc(png_ptr,
-             (png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
+             (png_uint_32)((sizeof (png_uint_16)) * PNG_FILTER_VALUE_LAST));
 
          png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr,
-             (png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
+             (png_uint_32)((sizeof (png_uint_16)) * PNG_FILTER_VALUE_LAST));
       }
 
       for (i = 0; i < PNG_FILTER_VALUE_LAST; i++)
@@ -1272,7 +1171,7 @@ png_init_filter_heuristics(png_structp png_ptr, int heuristic_method,
 /* Provide floating and fixed point APIs */
 #ifdef PNG_FLOATING_POINT_SUPPORTED
 void PNGAPI
-png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
+png_set_filter_heuristics(png_structrp png_ptr, int heuristic_method,
     int num_weights, png_const_doublep filter_weights,
     png_const_doublep filter_costs)
 {
@@ -1327,7 +1226,7 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
 
 #ifdef PNG_FIXED_POINT_SUPPORTED
 void PNGAPI
-png_set_filter_heuristics_fixed(png_structp png_ptr, int heuristic_method,
+png_set_filter_heuristics_fixed(png_structrp png_ptr, int heuristic_method,
     int num_weights, png_const_fixed_point_p filter_weights,
     png_const_fixed_point_p filter_costs)
 {
@@ -1393,37 +1292,37 @@ png_set_filter_heuristics_fixed(png_structp png_ptr, int heuristic_method,
 #endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
 
 void PNGAPI
-png_set_compression_level(png_structp png_ptr, int level)
+png_set_compression_level(png_structrp png_ptr, int level)
 {
    png_debug(1, "in png_set_compression_level");
 
    if (png_ptr == NULL)
       return;
 
-   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL;
    png_ptr->zlib_level = level;
 }
 
 void PNGAPI
-png_set_compression_mem_level(png_structp png_ptr, int mem_level)
+png_set_compression_mem_level(png_structrp png_ptr, int mem_level)
 {
    png_debug(1, "in png_set_compression_mem_level");
 
    if (png_ptr == NULL)
       return;
 
-   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL;
    png_ptr->zlib_mem_level = mem_level;
 }
 
 void PNGAPI
-png_set_compression_strategy(png_structp png_ptr, int strategy)
+png_set_compression_strategy(png_structrp png_ptr, int strategy)
 {
    png_debug(1, "in png_set_compression_strategy");
 
    if (png_ptr == NULL)
       return;
 
+   /* The flag setting here prevents the libpng dynamic selection of strategy.
+    */
    png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY;
    png_ptr->zlib_strategy = strategy;
 }
@@ -1432,80 +1331,81 @@ png_set_compression_strategy(png_structp png_ptr, int strategy)
  * smaller value of window_bits if it can do so safely.
  */
 void PNGAPI
-png_set_compression_window_bits(png_structp png_ptr, int window_bits)
+png_set_compression_window_bits(png_structrp png_ptr, int window_bits)
 {
    if (png_ptr == NULL)
       return;
 
+   /* Prior to 1.6.0 this would warn but then set the window_bits value, this
+    * meant that negative window bits values could be selected which would cause
+    * libpng to write a non-standard PNG file with raw deflate or gzip
+    * compressed IDAT or ancillary chunks.  Such files can be read and there is
+    * no warning on read, so this seems like a very bad idea.
+    */
    if (window_bits > 15)
+   {
       png_warning(png_ptr, "Only compression windows <= 32k supported by PNG");
+      window_bits = 15;
+   }
 
    else if (window_bits < 8)
+   {
       png_warning(png_ptr, "Only compression windows >= 256 supported by PNG");
+      window_bits = 8;
+   }
 
-#ifndef WBITS_8_OK
-   /* Avoid libpng bug with 256-byte windows */
-   if (window_bits == 8)
-      {
-        png_warning(png_ptr, "Compression window is being reset to 512");
-        window_bits = 9;
-      }
-
-#endif
-   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS;
    png_ptr->zlib_window_bits = window_bits;
 }
 
 void PNGAPI
-png_set_compression_method(png_structp png_ptr, int method)
+png_set_compression_method(png_structrp png_ptr, int method)
 {
    png_debug(1, "in png_set_compression_method");
 
    if (png_ptr == NULL)
       return;
 
+   /* This would produce an invalid PNG file if it worked, but it doesn't and
+    * deflate will fault it, so it is harmless to just warn here.
+    */
    if (method != 8)
       png_warning(png_ptr, "Only compression method 8 is supported by PNG");
 
-   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD;
    png_ptr->zlib_method = method;
 }
 
 /* The following were added to libpng-1.5.4 */
 #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
 void PNGAPI
-png_set_text_compression_level(png_structp png_ptr, int level)
+png_set_text_compression_level(png_structrp png_ptr, int level)
 {
    png_debug(1, "in png_set_text_compression_level");
 
    if (png_ptr == NULL)
       return;
 
-   png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_LEVEL;
    png_ptr->zlib_text_level = level;
 }
 
 void PNGAPI
-png_set_text_compression_mem_level(png_structp png_ptr, int mem_level)
+png_set_text_compression_mem_level(png_structrp png_ptr, int mem_level)
 {
    png_debug(1, "in png_set_text_compression_mem_level");
 
    if (png_ptr == NULL)
       return;
 
-   png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_MEM_LEVEL;
    png_ptr->zlib_text_mem_level = mem_level;
 }
 
 void PNGAPI
-png_set_text_compression_strategy(png_structp png_ptr, int strategy)
+png_set_text_compression_strategy(png_structrp png_ptr, int strategy)
 {
    png_debug(1, "in png_set_text_compression_strategy");
 
    if (png_ptr == NULL)
       return;
 
-   png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_STRATEGY;
    png_ptr->zlib_text_strategy = strategy;
 }
 
@@ -1513,32 +1413,28 @@ png_set_text_compression_strategy(png_structp png_ptr, int strategy)
  * smaller value of window_bits if it can do so safely.
  */
 void PNGAPI
-png_set_text_compression_window_bits(png_structp png_ptr, int window_bits)
+png_set_text_compression_window_bits(png_structrp png_ptr, int window_bits)
 {
    if (png_ptr == NULL)
       return;
 
    if (window_bits > 15)
+   {
       png_warning(png_ptr, "Only compression windows <= 32k supported by PNG");
+      window_bits = 15;
+   }
 
    else if (window_bits < 8)
+   {
       png_warning(png_ptr, "Only compression windows >= 256 supported by PNG");
+      window_bits = 8;
+   }
 
-#ifndef WBITS_8_OK
-   /* Avoid libpng bug with 256-byte windows */
-   if (window_bits == 8)
-      {
-        png_warning(png_ptr, "Text compression window is being reset to 512");
-        window_bits = 9;
-      }
-
-#endif
-   png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_WINDOW_BITS;
    png_ptr->zlib_text_window_bits = window_bits;
 }
 
 void PNGAPI
-png_set_text_compression_method(png_structp png_ptr, int method)
+png_set_text_compression_method(png_structrp png_ptr, int method)
 {
    png_debug(1, "in png_set_text_compression_method");
 
@@ -1548,14 +1444,13 @@ png_set_text_compression_method(png_structp png_ptr, int method)
    if (method != 8)
       png_warning(png_ptr, "Only compression method 8 is supported by PNG");
 
-   png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_METHOD;
    png_ptr->zlib_text_method = method;
 }
 #endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
 /* end of API added to libpng-1.5.4 */
 
 void PNGAPI
-png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn)
+png_set_write_status_fn(png_structrp png_ptr, png_write_status_ptr write_row_fn)
 {
    if (png_ptr == NULL)
       return;
@@ -1565,7 +1460,7 @@ png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn)
 
 #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
 void PNGAPI
-png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
+png_set_write_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr
     write_user_transform_fn)
 {
    png_debug(1, "in png_set_write_user_transform_fn");
@@ -1581,7 +1476,7 @@ png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
 
 #ifdef PNG_INFO_IMAGE_SUPPORTED
 void PNGAPI
-png_write_png(png_structp png_ptr, png_infop info_ptr,
+png_write_png(png_structrp png_ptr, png_inforp info_ptr,
     int transforms, voidp params)
 {
    if (png_ptr == NULL || info_ptr == NULL)
@@ -1665,4 +1560,772 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
    PNG_UNUSED(params)
 }
 #endif
+
+
+#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED
+#ifdef PNG_STDIO_SUPPORTED /* currently required for png_image_write_* */
+/* Initialize the write structure - general purpose utility. */
+static int
+png_image_write_init(png_imagep image)
+{
+   png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, image,
+          png_safe_error, png_safe_warning);
+
+   if (png_ptr != NULL)
+   {
+      png_infop info_ptr = png_create_info_struct(png_ptr);
+
+      if (info_ptr != NULL)
+      {
+         png_controlp control = png_voidcast(png_controlp,
+            png_malloc_warn(png_ptr, (sizeof *control)));
+
+         if (control != NULL)
+         {
+            memset(control, 0, (sizeof *control));
+
+            control->png_ptr = png_ptr;
+            control->info_ptr = info_ptr;
+            control->for_write = 1;
+
+            image->opaque = control;
+            return 1;
+         }
+
+         /* Error clean up */
+         png_destroy_info_struct(png_ptr, &info_ptr);
+      }
+
+      png_destroy_write_struct(&png_ptr, NULL);
+   }
+
+   return png_image_error(image, "png_image_write_: out of memory");
+}
+
+/* Arguments to png_image_write_main: */
+typedef struct
+{
+   /* Arguments: */
+   png_imagep      image;
+   png_const_voidp buffer;
+   png_int_32      row_stride;
+   png_const_voidp colormap;
+   int             convert_to_8bit;
+   /* Local variables: */
+   png_const_voidp first_row;
+   ptrdiff_t       row_bytes;
+   png_voidp       local_row;
+} png_image_write_control;
+
+/* Write png_uint_16 input to a 16-bit PNG; the png_ptr has already been set to
+ * do any necessary byte swapping.  The component order is defined by the
+ * png_image format value.
+ */
+static int
+png_write_image_16bit(png_voidp argument)
+{
+   png_image_write_control *display = png_voidcast(png_image_write_control*,
+      argument);
+   png_imagep image = display->image;
+   png_structrp png_ptr = image->opaque->png_ptr;
+
+   png_const_uint_16p input_row = png_voidcast(png_const_uint_16p,
+      display->first_row);
+   png_uint_16p output_row = png_voidcast(png_uint_16p, display->local_row);
+   png_uint_16p row_end;
+   const int channels = (image->format & PNG_FORMAT_FLAG_COLOR) ? 3 : 1;
+   int aindex = 0;
+   png_uint_32 y = image->height;
+
+   if (image->format & PNG_FORMAT_FLAG_ALPHA)
+   {
+      if (image->format & PNG_FORMAT_FLAG_AFIRST)
+      {
+         aindex = -1;
+         ++input_row; /* To point to the first component */
+         ++output_row;
+      }
+
+      else
+         aindex = channels;
+   }
+
+   else
+      png_error(png_ptr, "png_write_image: internal call error");
+
+   /* Work out the output row end and count over this, note that the increment
+    * above to 'row' means that row_end can actually be beyond the end of the
+    * row; this is correct.
+    */
+   row_end = output_row + image->width * (channels+1);
+
+   while (y-- > 0)
+   {
+      png_const_uint_16p in_ptr = input_row;
+      png_uint_16p out_ptr = output_row;
+
+      while (out_ptr < row_end)
+      {
+         const png_uint_16 alpha = in_ptr[aindex];
+         png_uint_32 reciprocal = 0;
+         int c;
+
+         out_ptr[aindex] = alpha;
+
+         /* Calculate a reciprocal.  The correct calculation is simply
+          * component/alpha*65535 << 15. (I.e. 15 bits of precision); this
+          * allows correct rounding by adding .5 before the shift.  'reciprocal'
+          * is only initialized when required.
+          */
+         if (alpha > 0 && alpha < 65535)
+            reciprocal = ((0xffff<<15)+(alpha>>1))/alpha;
+
+         c = channels;
+         do /* always at least one channel */
+         {
+            png_uint_16 component = *in_ptr++;
+
+            /* The following gives 65535 for an alpha of 0, which is fine,
+             * otherwise if 0/0 is represented as some other value there is more
+             * likely to be a discontinuity which will probably damage
+             * compression when moving from a fully transparent area to a
+             * nearly transparent one.  (The assumption here is that opaque
+             * areas tend not to be 0 intensity.)
+             */
+            if (component >= alpha)
+               component = 65535;
+
+            /* component<alpha, so component/alpha is less than one and
+             * component*reciprocal is less than 2^31.
+             */
+            else if (component > 0 && alpha < 65535)
+            {
+               png_uint_32 calc = component * reciprocal;
+               calc += 16384; /* round to nearest */
+               component = (png_uint_16)(calc >> 15);
+            }
+
+            *out_ptr++ = component;
+         }
+         while (--c > 0);
+
+         /* Skip to next component (skip the intervening alpha channel) */
+         ++in_ptr;
+         ++out_ptr;
+      }
+
+      png_write_row(png_ptr, png_voidcast(png_const_bytep, display->local_row));
+      input_row += display->row_bytes/(sizeof (png_uint_16));
+   }
+
+   return 1;
+}
+
+/* Given 16-bit input (1 to 4 channels) write 8-bit output.  If an alpha channel
+ * is present it must be removed from the components, the components are then
+ * written in sRGB encoding.  No components are added or removed.
+ *
+ * Calculate an alpha reciprocal to reverse pre-multiplication.  As above the
+ * calculation can be done to 15 bits of accuracy; however, the output needs to
+ * be scaled in the range 0..255*65535, so include that scaling here.
+ */
+#define UNP_RECIPROCAL(alpha) ((((0xffff*0xff)<<7)+(alpha>>1))/alpha)
+
+static png_byte
+png_unpremultiply(png_uint_32 component, png_uint_32 alpha,
+   png_uint_32 reciprocal/*from the above macro*/)
+{
+   /* The following gives 1.0 for an alpha of 0, which is fine, otherwise if 0/0
+    * is represented as some other value there is more likely to be a
+    * discontinuity which will probably damage compression when moving from a
+    * fully transparent area to a nearly transparent one.  (The assumption here
+    * is that opaque areas tend not to be 0 intensity.)
+    *
+    * There is a rounding problem here; if alpha is less than 128 it will end up
+    * as 0 when scaled to 8 bits.  To avoid introducing spurious colors into the
+    * output change for this too.
+    */
+   if (component >= alpha || alpha < 128)
+      return 255;
+
+   /* component<alpha, so component/alpha is less than one and
+    * component*reciprocal is less than 2^31.
+    */
+   else if (component > 0)
+   {
+      /* The test is that alpha/257 (rounded) is less than 255, the first value
+       * that becomes 255 is 65407.
+       * NOTE: this must agree with the PNG_DIV257 macro (which must, therefore,
+       * be exact!)  [Could also test reciprocal != 0]
+       */
+      if (alpha < 65407)
+      {
+         component *= reciprocal;
+         component += 64; /* round to nearest */
+         component >>= 7;
+      }
+
+      else
+         component *= 255;
+
+      /* Convert the component to sRGB. */
+      return (png_byte)PNG_sRGB_FROM_LINEAR(component);
+   }
+
+   else
+      return 0;
+}
+
+static int
+png_write_image_8bit(png_voidp argument)
+{
+   png_image_write_control *display = png_voidcast(png_image_write_control*,
+      argument);
+   png_imagep image = display->image;
+   png_structrp png_ptr = image->opaque->png_ptr;
+
+   png_const_uint_16p input_row = png_voidcast(png_const_uint_16p,
+      display->first_row);
+   png_bytep output_row = png_voidcast(png_bytep, display->local_row);
+   png_uint_32 y = image->height;
+   const int channels = (image->format & PNG_FORMAT_FLAG_COLOR) ? 3 : 1;
+
+   if (image->format & PNG_FORMAT_FLAG_ALPHA)
+   {
+      png_bytep row_end;
+      int aindex;
+
+      if (image->format & PNG_FORMAT_FLAG_AFIRST)
+      {
+         aindex = -1;
+         ++input_row; /* To point to the first component */
+         ++output_row;
+      }
+
+      else
+         aindex = channels;
+
+      /* Use row_end in place of a loop counter: */
+      row_end = output_row + image->width * (channels+1);
+
+      while (y-- > 0)
+      {
+         png_const_uint_16p in_ptr = input_row;
+         png_bytep out_ptr = output_row;
+
+         while (out_ptr < row_end)
+         {
+            png_uint_16 alpha = in_ptr[aindex];
+            png_byte alphabyte = (png_byte)PNG_DIV257(alpha);
+            png_uint_32 reciprocal = 0;
+            int c;
+
+            /* Scale and write the alpha channel. */
+            out_ptr[aindex] = alphabyte;
+
+            if (alphabyte > 0 && alphabyte < 255)
+               reciprocal = UNP_RECIPROCAL(alpha);
+
+            c = channels;
+            do /* always at least one channel */
+               *out_ptr++ = png_unpremultiply(*in_ptr++, alpha, reciprocal);
+            while (--c > 0);
+
+            /* Skip to next component (skip the intervening alpha channel) */
+            ++in_ptr;
+            ++out_ptr;
+         } /* while out_ptr < row_end */
+
+         png_write_row(png_ptr, png_voidcast(png_const_bytep,
+            display->local_row));
+         input_row += display->row_bytes/(sizeof (png_uint_16));
+      } /* while y */
+   }
+
+   else
+   {
+      /* No alpha channel, so the row_end really is the end of the row and it
+       * is sufficient to loop over the components one by one.
+       */
+      png_bytep row_end = output_row + image->width * channels;
+
+      while (y-- > 0)
+      {
+         png_const_uint_16p in_ptr = input_row;
+         png_bytep out_ptr = output_row;
+
+         while (out_ptr < row_end)
+         {
+            png_uint_32 component = *in_ptr++;
+
+            component *= 255;
+            *out_ptr++ = (png_byte)PNG_sRGB_FROM_LINEAR(component);
+         }
+
+         png_write_row(png_ptr, output_row);
+         input_row += display->row_bytes/(sizeof (png_uint_16));
+      }
+   }
+
+   return 1;
+}
+
+static void
+png_image_set_PLTE(png_image_write_control *display)
+{
+   const png_imagep image = display->image;
+   const void *cmap = display->colormap;
+   const int entries = image->colormap_entries > 256 ? 256 :
+      (int)image->colormap_entries;
+
+   /* NOTE: the caller must check for cmap != NULL and entries != 0 */
+   const png_uint_32 format = image->format;
+   const int channels = PNG_IMAGE_SAMPLE_CHANNELS(format);
+
+#  ifdef PNG_FORMAT_BGR_SUPPORTED
+      const int afirst = (format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
+         (format & PNG_FORMAT_FLAG_ALPHA) != 0;
+#  else
+#     define afirst 0
+#  endif
+
+#  ifdef PNG_FORMAT_BGR_SUPPORTED
+      const int bgr = (format & PNG_FORMAT_FLAG_BGR) ? 2 : 0;
+#  else
+#     define bgr 0
+#  endif
+
+   int i, num_trans;
+   png_color palette[256];
+   png_byte tRNS[256];
+
+   memset(tRNS, 255, (sizeof tRNS));
+   memset(palette, 0, (sizeof palette));
+
+   for (i=num_trans=0; i<entries; ++i)
+   {
+      /* This gets automatically converted to sRGB with reversal of the
+       * pre-multiplication if the color-map has an alpha channel.
+       */
+      if (format & PNG_FORMAT_FLAG_LINEAR)
+      {
+         png_const_uint_16p entry = png_voidcast(png_const_uint_16p, cmap);
+
+         entry += i * channels;
+
+         if (channels & 1) /* no alpha */
+         {
+            if (channels >= 3) /* RGB */
+            {
+               palette[i].blue = (png_byte)PNG_sRGB_FROM_LINEAR(255 *
+                  entry[(2 ^ bgr)]);
+               palette[i].green = (png_byte)PNG_sRGB_FROM_LINEAR(255 *
+                  entry[1]);
+               palette[i].red = (png_byte)PNG_sRGB_FROM_LINEAR(255 *
+                  entry[bgr]);
+            }
+
+            else /* Gray */
+               palette[i].blue = palette[i].red = palette[i].green =
+                  (png_byte)PNG_sRGB_FROM_LINEAR(255 * *entry);
+         }
+
+         else /* alpha */
+         {
+            png_uint_16 alpha = entry[afirst ? 0 : channels-1];
+            png_byte alphabyte = (png_byte)PNG_DIV257(alpha);
+            png_uint_32 reciprocal = 0;
+
+            /* Calculate a reciprocal, as in the png_write_image_8bit code above
+             * this is designed to produce a value scaled to 255*65535 when
+             * divided by 128 (i.e. asr 7).
+             */
+            if (alphabyte > 0 && alphabyte < 255)
+               reciprocal = (((0xffff*0xff)<<7)+(alpha>>1))/alpha;
+
+            tRNS[i] = alphabyte;
+            if (alphabyte < 255)
+               num_trans = i+1;
+
+            if (channels >= 3) /* RGB */
+            {
+               palette[i].blue = png_unpremultiply(entry[afirst + (2 ^ bgr)],
+                  alpha, reciprocal);
+               palette[i].green = png_unpremultiply(entry[afirst + 1], alpha,
+                  reciprocal);
+               palette[i].red = png_unpremultiply(entry[afirst + bgr], alpha,
+                  reciprocal);
+            }
+
+            else /* gray */
+               palette[i].blue = palette[i].red = palette[i].green =
+                  png_unpremultiply(entry[afirst], alpha, reciprocal);
+         }
+      }
+
+      else /* Color-map has sRGB values */
+      {
+         png_const_bytep entry = png_voidcast(png_const_bytep, cmap);
+
+         entry += i * channels;
+
+         switch (channels)
+         {
+            case 4:
+               tRNS[i] = entry[afirst ? 0 : 3];
+               if (tRNS[i] < 255)
+                  num_trans = i+1;
+               /* FALL THROUGH */
+            case 3:
+               palette[i].blue = entry[afirst + (2 ^ bgr)];
+               palette[i].green = entry[afirst + 1];
+               palette[i].red = entry[afirst + bgr];
+               break;
+
+            case 2:
+               tRNS[i] = entry[1 ^ afirst];
+               if (tRNS[i] < 255)
+                  num_trans = i+1;
+               /* FALL THROUGH */
+            case 1:
+               palette[i].blue = palette[i].red = palette[i].green =
+                  entry[afirst];
+               break;
+
+            default:
+               break;
+         }
+      }
+   }
+
+#  ifdef afirst
+#     undef afirst
+#  endif
+#  ifdef bgr
+#     undef bgr
+#  endif
+
+   png_set_PLTE(image->opaque->png_ptr, image->opaque->info_ptr, palette,
+      entries);
+
+   if (num_trans > 0)
+      png_set_tRNS(image->opaque->png_ptr, image->opaque->info_ptr, tRNS,
+         num_trans, NULL);
+
+   image->colormap_entries = entries;
+}
+
+static int
+png_image_write_main(png_voidp argument)
+{
+   png_image_write_control *display = png_voidcast(png_image_write_control*,
+      argument);
+   png_imagep image = display->image;
+   png_structrp png_ptr = image->opaque->png_ptr;
+   png_inforp info_ptr = image->opaque->info_ptr;
+   png_uint_32 format = image->format;
+
+   int colormap = (format & PNG_FORMAT_FLAG_COLORMAP) != 0;
+   int linear = !colormap && (format & PNG_FORMAT_FLAG_LINEAR) != 0; /* input */
+   int alpha = !colormap && (format & PNG_FORMAT_FLAG_ALPHA) != 0;
+   int write_16bit = linear && !colormap && !display->convert_to_8bit;
+
+#  ifdef PNG_BENIGN_ERRORS_SUPPORTED
+      /* Make sure we error out on any bad situation */
+      png_set_benign_errors(png_ptr, 0/*error*/);
+#  endif
+
+   /* Default the 'row_stride' parameter if required. */
+   if (display->row_stride == 0)
+      display->row_stride = PNG_IMAGE_ROW_STRIDE(*image);
+
+   /* Set the required transforms then write the rows in the correct order. */
+   if (format & PNG_FORMAT_FLAG_COLORMAP)
+   {
+      if (display->colormap != NULL && image->colormap_entries > 0)
+      {
+         png_uint_32 entries = image->colormap_entries;
+
+         png_set_IHDR(png_ptr, info_ptr, image->width, image->height,
+            entries > 16 ? 8 : (entries > 4 ? 4 : (entries > 2 ? 2 : 1)),
+            PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
+            PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+
+         png_image_set_PLTE(display);
+      }
+
+      else
+         png_error(image->opaque->png_ptr,
+            "no color-map for color-mapped image");
+   }
+
+   else
+      png_set_IHDR(png_ptr, info_ptr, image->width, image->height,
+         write_16bit ? 16 : 8,
+         ((format & PNG_FORMAT_FLAG_COLOR) ? PNG_COLOR_MASK_COLOR : 0) +
+         ((format & PNG_FORMAT_FLAG_ALPHA) ? PNG_COLOR_MASK_ALPHA : 0),
+         PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+
+   /* Counter-intuitively the data transformations must be called *after*
+    * png_write_info, not before as in the read code, but the 'set' functions
+    * must still be called before.  Just set the color space information, never
+    * write an interlaced image.
+    */
+
+   if (write_16bit)
+   {
+      /* The gamma here is 1.0 (linear) and the cHRM chunk matches sRGB. */
+      png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_LINEAR);
+
+      if (!(image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB))
+         png_set_cHRM_fixed(png_ptr, info_ptr,
+            /* color      x       y */
+            /* white */ 31270, 32900,
+            /* red   */ 64000, 33000,
+            /* green */ 30000, 60000,
+            /* blue  */ 15000,  6000
+         );
+   }
+
+   else if (!(image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB))
+      png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_PERCEPTUAL);
+
+   /* Else writing an 8-bit file and the *colors* aren't sRGB, but the 8-bit
+    * space must still be gamma encoded.
+    */
+   else
+      png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_sRGB_INVERSE);
+
+   /* Write the file header. */
+   png_write_info(png_ptr, info_ptr);
+
+   /* Now set up the data transformations (*after* the header is written),
+    * remove the handled transformations from the 'format' flags for checking.
+    *
+    * First check for a little endian system if writing 16 bit files.
+    */
+   if (write_16bit)
+   {
+      PNG_CONST png_uint_16 le = 0x0001;
+
+      if (*(png_const_bytep)&le)
+         png_set_swap(png_ptr);
+   }
+
+#  ifdef PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
+      if (format & PNG_FORMAT_FLAG_BGR)
+      {
+         if (!colormap && (format & PNG_FORMAT_FLAG_COLOR) != 0)
+            png_set_bgr(png_ptr);
+         format &= ~PNG_FORMAT_FLAG_BGR;
+      }
+#  endif
+
+#  ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
+      if (format & PNG_FORMAT_FLAG_AFIRST)
+      {
+         if (!colormap && (format & PNG_FORMAT_FLAG_ALPHA) != 0)
+            png_set_swap_alpha(png_ptr);
+         format &= ~PNG_FORMAT_FLAG_AFIRST;
+      }
+#  endif
+
+   /* If there are 16 or fewer color-map entries we wrote a lower bit depth
+    * above, but the application data is still byte packed.
+    */
+   if (colormap && image->colormap_entries <= 16)
+      png_set_packing(png_ptr);
+
+   /* That should have handled all (both) the transforms. */
+   if ((format & ~(png_uint_32)(PNG_FORMAT_FLAG_COLOR | PNG_FORMAT_FLAG_LINEAR |
+         PNG_FORMAT_FLAG_ALPHA | PNG_FORMAT_FLAG_COLORMAP)) != 0)
+      png_error(png_ptr, "png_write_image: unsupported transformation");
+
+   {
+      png_const_bytep row = png_voidcast(png_const_bytep, display->buffer);
+      ptrdiff_t row_bytes = display->row_stride;
+
+      if (linear)
+         row_bytes *= (sizeof (png_uint_16));
+
+      if (row_bytes < 0)
+         row += (image->height-1) * (-row_bytes);
+
+      display->first_row = row;
+      display->row_bytes = row_bytes;
+   }
+
+   /* Apply 'fast' options if the flag is set. */
+   if ((image->flags & PNG_IMAGE_FLAG_FAST) != 0)
+   {
+      png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, PNG_NO_FILTERS);
+      /* NOTE: determined by experiment using pngstest, this reflects some
+       * balance between the time to write the image once and the time to read
+       * it about 50 times.  The speed-up in pngstest was about 10-20% of the
+       * total (user) time on a heavily loaded system.
+       */
+      png_set_compression_level(png_ptr, 3);
+   }
+
+   /* Check for the cases that currently require a pre-transform on the row
+    * before it is written.  This only applies when the input is 16-bit and
+    * either there is an alpha channel or it is converted to 8-bit.
+    */
+   if ((linear && alpha) || (!colormap && display->convert_to_8bit))
+   {
+      png_bytep row = png_voidcast(png_bytep, png_malloc(png_ptr,
+         png_get_rowbytes(png_ptr, info_ptr)));
+      int result;
+
+      display->local_row = row;
+      if (write_16bit)
+         result = png_safe_execute(image, png_write_image_16bit, display);
+      else
+         result = png_safe_execute(image, png_write_image_8bit, display);
+      display->local_row = NULL;
+
+      png_free(png_ptr, row);
+
+      /* Skip the 'write_end' on error: */
+      if (!result)
+         return 0;
+   }
+
+   /* Otherwise this is the case where the input is in a format currently
+    * supported by the rest of the libpng write code; call it directly.
+    */
+   else
+   {
+      png_const_bytep row = png_voidcast(png_const_bytep, display->first_row);
+      ptrdiff_t row_bytes = display->row_bytes;
+      png_uint_32 y = image->height;
+
+      while (y-- > 0)
+      {
+         png_write_row(png_ptr, row);
+         row += row_bytes;
+      }
+   }
+
+   png_write_end(png_ptr, info_ptr);
+   return 1;
+}
+
+int PNGAPI
+png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit,
+   const void *buffer, png_int_32 row_stride, const void *colormap)
+{
+   /* Write the image to the given (FILE*). */
+   if (image != NULL && image->version == PNG_IMAGE_VERSION)
+   {
+      if (file != NULL)
+      {
+         if (png_image_write_init(image))
+         {
+            png_image_write_control display;
+            int result;
+
+            /* This is slightly evil, but png_init_io doesn't do anything other
+             * than this and we haven't changed the standard IO functions so
+             * this saves a 'safe' function.
+             */
+            image->opaque->png_ptr->io_ptr = file;
+
+            memset(&display, 0, (sizeof display));
+            display.image = image;
+            display.buffer = buffer;
+            display.row_stride = row_stride;
+            display.colormap = colormap;
+            display.convert_to_8bit = convert_to_8bit;
+
+            result = png_safe_execute(image, png_image_write_main, &display);
+            png_image_free(image);
+            return result;
+         }
+
+         else
+            return 0;
+      }
+
+      else
+         return png_image_error(image,
+            "png_image_write_to_stdio: invalid argument");
+   }
+
+   else if (image != NULL)
+      return png_image_error(image,
+         "png_image_write_to_stdio: incorrect PNG_IMAGE_VERSION");
+
+   else
+      return 0;
+}
+
+int PNGAPI
+png_image_write_to_file(png_imagep image, const char *file_name,
+   int convert_to_8bit, const void *buffer, png_int_32 row_stride,
+   const void *colormap)
+{
+   /* Write the image to the named file. */
+   if (image != NULL && image->version == PNG_IMAGE_VERSION)
+   {
+      if (file_name != NULL)
+      {
+         FILE *fp = fopen(file_name, "wb");
+
+         if (fp != NULL)
+         {
+            if (png_image_write_to_stdio(image, fp, convert_to_8bit, buffer,
+               row_stride, colormap))
+            {
+               int error; /* from fflush/fclose */
+
+               /* Make sure the file is flushed correctly. */
+               if (fflush(fp) == 0 && ferror(fp) == 0)
+               {
+                  if (fclose(fp) == 0)
+                     return 1;
+
+                  error = errno; /* from fclose */
+               }
+
+               else
+               {
+                  error = errno; /* from fflush or ferror */
+                  (void)fclose(fp);
+               }
+
+               (void)remove(file_name);
+               /* The image has already been cleaned up; this is just used to
+                * set the error (because the original write succeeded).
+                */
+               return png_image_error(image, strerror(error));
+            }
+
+            else
+            {
+               /* Clean up: just the opened file. */
+               (void)fclose(fp);
+               (void)remove(file_name);
+               return 0;
+            }
+         }
+
+         else
+            return png_image_error(image, strerror(errno));
+      }
+
+      else
+         return png_image_error(image,
+            "png_image_write_to_file: invalid argument");
+   }
+
+   else if (image != NULL)
+      return png_image_error(image,
+         "png_image_write_to_file: incorrect PNG_IMAGE_VERSION");
+
+   else
+      return 0;
+}
+#endif /* PNG_STDIO_SUPPORTED */
+#endif /* SIMPLIFIED_WRITE */
 #endif /* PNG_WRITE_SUPPORTED */
index 743581327b629cc429967f41861be5a444b51530..98703f8c818a6c72bcd25cc0c4872dc709ccd42e 100644 (file)
@@ -1,8 +1,8 @@
 
 /* pngwtran.c - transforms the data in a row for PNG writers
  *
- * Last changed in libpng 1.5.13 [September 27, 2012]
- * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.0 [February 14, 2013]
+ * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -20,7 +20,7 @@
  * transformations is significant.
  */
 void /* PRIVATE */
-png_do_write_transformations(png_structp png_ptr, png_row_infop row_info)
+png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
 {
    png_debug(1, "in png_do_write_transformations");
 
@@ -45,20 +45,8 @@ png_do_write_transformations(png_structp png_ptr, png_row_infop row_info)
 
 #ifdef PNG_WRITE_FILLER_SUPPORTED
    if (png_ptr->transformations & PNG_FILLER)
-   {
-      if (png_ptr->color_type & (PNG_COLOR_MASK_ALPHA|PNG_COLOR_MASK_PALETTE))
-      {
-         /* GA, RGBA or palette; in any of these cases libpng will not do the
-          * the correct thing (whatever that might be).
-          */
-         png_warning(png_ptr, "incorrect png_set_filler call ignored");
-         png_ptr->transformations &= ~PNG_FILLER;
-      }
-
-      else
-         png_do_strip_channel(row_info, png_ptr->row_buf + 1,
-            !(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
-   }
+      png_do_strip_channel(row_info, png_ptr->row_buf + 1,
+         !(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
 #endif
 
 #ifdef PNG_WRITE_PACKSWAP_SUPPORTED
@@ -299,7 +287,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
       {
          png_bytep bp = row;
          png_size_t i;
-         png_byte mask;
+         unsigned int mask;
          png_size_t row_bytes = row_info->rowbytes;
 
          if (bit_depth->gray == 1 && row_info->bit_depth == 2)
@@ -313,20 +301,22 @@ png_do_shift(png_row_infop row_info, png_bytep row,
 
          for (i = 0; i < row_bytes; i++, bp++)
          {
-            png_uint_16 v;
             int j;
+            unsigned int v, out;
 
             v = *bp;
-            *bp = 0;
+            out = 0;
 
             for (j = shift_start[0]; j > -shift_dec[0]; j -= shift_dec[0])
             {
                if (j > 0)
-                  *bp |= (png_byte)((v << j) & 0xff);
+                  out |= v << j;
 
                else
-                  *bp |= (png_byte)((v >> (-j)) & mask);
+                  out |= (v >> (-j)) & mask;
             }
+
+            *bp = (png_byte)(out & 0xff);
          }
       }
 
@@ -339,21 +329,23 @@ png_do_shift(png_row_infop row_info, png_bytep row,
          for (i = 0; i < istop; i++, bp++)
          {
 
-            png_uint_16 v;
+            const unsigned int c = i%channels;
             int j;
-            int c = (int)(i%channels);
+            unsigned int v, out;
 
             v = *bp;
-            *bp = 0;
+            out = 0;
 
             for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c])
             {
                if (j > 0)
-                  *bp |= (png_byte)((v << j) & 0xff);
+                  out |= v << j;
 
                else
-                  *bp |= (png_byte)((v >> (-j)) & 0xff);
+                  out |= v >> (-j);
             }
+
+            *bp = (png_byte)(out & 0xff);
          }
       }
 
@@ -365,22 +357,22 @@ png_do_shift(png_row_infop row_info, png_bytep row,
 
          for (bp = row, i = 0; i < istop; i++)
          {
-            int c = (int)(i%channels);
-            png_uint_16 value, v;
+            const unsigned int c = i%channels;
             int j;
+            unsigned int value, v;
 
-            v = (png_uint_16)(((png_uint_16)(*bp) << 8) + *(bp + 1));
+            v = png_get_uint_16(bp);
             value = 0;
 
             for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c])
             {
                if (j > 0)
-                  value |= (png_uint_16)((v << j) & (png_uint_16)0xffff);
+                  value |= v << j;
 
                else
-                  value |= (png_uint_16)((v >> (-j)) & (png_uint_16)0xffff);
+                  value |= v >> (-j);
             }
-            *bp++ = (png_byte)(value >> 8);
+            *bp++ = (png_byte)((value >> 8) & 0xff);
             *bp++ = (png_byte)(value & 0xff);
          }
       }
index 604ad32aaccef8f08004f641bc56eafd31cf87ef..8c49cfd407b18951474d1a008f6ab05a5de2ad1b 100644 (file)
@@ -1,7 +1,7 @@
 
 /* pngwutil.c - utilities to write a PNG file
  *
- * Last changed in libpng 1.5.14 [January 24, 2013]
+ * Last changed in libpng 1.6.0 [February 14, 2013]
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -29,23 +29,6 @@ png_save_uint_32(png_bytep buf, png_uint_32 i)
    buf[3] = (png_byte)(i & 0xff);
 }
 
-#ifdef PNG_SAVE_INT_32_SUPPORTED
-/* The png_save_int_32 function assumes integers are stored in two's
- * complement format.  If this isn't the case, then this routine needs to
- * be modified to write data in two's complement format.  Note that,
- * the following works correctly even if png_int_32 has more than 32 bits
- * (compare the more complex code required on read for sign extention.)
- */
-void PNGAPI
-png_save_int_32(png_bytep buf, png_int_32 i)
-{
-   buf[0] = (png_byte)((i >> 24) & 0xff);
-   buf[1] = (png_byte)((i >> 16) & 0xff);
-   buf[2] = (png_byte)((i >> 8) & 0xff);
-   buf[3] = (png_byte)(i & 0xff);
-}
-#endif
-
 /* Place a 16-bit number into a buffer in PNG byte order.
  * The parameter is declared unsigned int, not png_uint_16,
  * just to avoid potential problems on pre-ANSI C compilers.
@@ -65,7 +48,7 @@ png_save_uint_16(png_bytep buf, unsigned int i)
  * bytes have already been written.
  */
 void PNGAPI
-png_write_sig(png_structp png_ptr)
+png_write_sig(png_structrp png_ptr)
 {
    png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
 
@@ -87,7 +70,7 @@ png_write_sig(png_structp png_ptr)
  * passing in png_write_chunk_data().
  */
 static void
-png_write_chunk_header(png_structp png_ptr, png_uint_32 chunk_name,
+png_write_chunk_header(png_structrp png_ptr, png_uint_32 chunk_name,
     png_uint_32 length)
 {
    png_byte buf[8];
@@ -129,7 +112,7 @@ png_write_chunk_header(png_structp png_ptr, png_uint_32 chunk_name,
 }
 
 void PNGAPI
-png_write_chunk_start(png_structp png_ptr, png_const_bytep chunk_string,
+png_write_chunk_start(png_structrp png_ptr, png_const_bytep chunk_string,
     png_uint_32 length)
 {
    png_write_chunk_header(png_ptr, PNG_CHUNK_FROM_STRING(chunk_string), length);
@@ -141,7 +124,7 @@ png_write_chunk_start(png_structp png_ptr, png_const_bytep chunk_string,
  * given to png_write_chunk_header().
  */
 void PNGAPI
-png_write_chunk_data(png_structp png_ptr, png_const_bytep data,
+png_write_chunk_data(png_structrp png_ptr, png_const_bytep data,
     png_size_t length)
 {
    /* Write the data, and run the CRC over it */
@@ -161,7 +144,7 @@ png_write_chunk_data(png_structp png_ptr, png_const_bytep data,
 
 /* Finish a chunk started with png_write_chunk_header(). */
 void PNGAPI
-png_write_chunk_end(png_structp png_ptr)
+png_write_chunk_end(png_structrp png_ptr)
 {
    png_byte buf[4];
 
@@ -190,14 +173,14 @@ png_write_chunk_end(png_structp png_ptr)
  * functions instead.
  */
 static void
-png_write_complete_chunk(png_structp png_ptr, png_uint_32 chunk_name,
+png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name,
    png_const_bytep data, png_size_t length)
 {
    if (png_ptr == NULL)
       return;
 
    /* On 64 bit architectures 'length' may not fit in a png_uint_32. */
-   if (length > PNG_UINT_32_MAX)
+   if (length > PNG_UINT_31_MAX)
       png_error(png_ptr, "length exceeds PNG maxima");
 
    png_write_chunk_header(png_ptr, chunk_name, (png_uint_32)length);
@@ -207,471 +190,568 @@ png_write_complete_chunk(png_structp png_ptr, png_uint_32 chunk_name,
 
 /* This is the API that calls the internal function above. */
 void PNGAPI
-png_write_chunk(png_structp png_ptr, png_const_bytep chunk_string,
+png_write_chunk(png_structrp png_ptr, png_const_bytep chunk_string,
    png_const_bytep data, png_size_t length)
 {
    png_write_complete_chunk(png_ptr, PNG_CHUNK_FROM_STRING(chunk_string), data,
       length);
 }
 
-/* Initialize the compressor for the appropriate type of compression. */
-static void
-png_zlib_claim(png_structp png_ptr, png_uint_32 state)
+/* This is used below to find the size of an image to pass to png_deflate_claim,
+ * so it only needs to be accurate if the size is less than 16384 bytes (the
+ * point at which a lower LZ window size can be used.)
+ */
+static png_alloc_size_t
+png_image_size(png_structrp png_ptr)
 {
-   if (!(png_ptr->zlib_state & PNG_ZLIB_IN_USE))
+   /* Only return sizes up to the maximum of a png_uint_32, do this by limiting
+    * the width and height used to 15 bits.
+    */
+   png_uint_32 h = png_ptr->height;
+
+   if (png_ptr->rowbytes < 32768 && h < 32768)
    {
-      /* If already initialized for 'state' do not re-init. */
-      if (png_ptr->zlib_state != state)
+      if (png_ptr->interlaced)
       {
-         int ret = Z_OK;
-         png_const_charp who = "-";
-
-         /* If actually initialized for another state do a deflateEnd. */
-         if (png_ptr->zlib_state != PNG_ZLIB_UNINITIALIZED)
-         {
-            ret = deflateEnd(&png_ptr->zstream);
-            who = "end";
-            png_ptr->zlib_state = PNG_ZLIB_UNINITIALIZED;
-         }
+         /* Interlacing makes the image larger because of the replication of
+          * both the filter byte and the padding to a byte boundary.
+          */
+         png_uint_32 w = png_ptr->width;
+         unsigned int pd = png_ptr->pixel_depth;
+         png_alloc_size_t cb_base;
+         int pass;
 
-         /* zlib itself detects an incomplete state on deflateEnd */
-         if (ret == Z_OK) switch (state)
+         for (cb_base=0, pass=0; pass<=6; ++pass)
          {
-#           ifdef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
-               case PNG_ZLIB_FOR_TEXT:
-                  ret = deflateInit2(&png_ptr->zstream,
-                     png_ptr->zlib_text_level, png_ptr->zlib_text_method,
-                     png_ptr->zlib_text_window_bits,
-                     png_ptr->zlib_text_mem_level, png_ptr->zlib_text_strategy);
-                  who = "text";
-                  break;
-#           endif
+            png_uint_32 pw = PNG_PASS_COLS(w, pass);
 
-            case PNG_ZLIB_FOR_IDAT:
-               ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_level,
-                   png_ptr->zlib_method, png_ptr->zlib_window_bits,
-                   png_ptr->zlib_mem_level, png_ptr->zlib_strategy);
-               who = "IDAT";
-               break;
-
-            default:
-               png_error(png_ptr, "invalid zlib state");
+            if (pw > 0)
+               cb_base += (PNG_ROWBYTES(pd, pw)+1) * PNG_PASS_ROWS(h, pass);
          }
 
-         if (ret == Z_OK)
-            png_ptr->zlib_state = state;
+         return cb_base;
+      }
 
-         else /* an error in deflateEnd or deflateInit2 */
-         {
-            size_t pos = 0;
-            char msg[64];
+      else
+         return (png_ptr->rowbytes+1) * h;
+   }
 
-            pos = png_safecat(msg, sizeof msg, pos,
-               "zlib failed to initialize compressor (");
-            pos = png_safecat(msg, sizeof msg, pos, who);
+   else
+      return 0xffffffffU;
+}
 
-            switch (ret)
-            {
-               case Z_VERSION_ERROR:
-                  pos = png_safecat(msg, sizeof msg, pos, ") version error");
-                  break;
+#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
+   /* This is the code to hack the first two bytes of the deflate stream (the
+    * deflate header) to correct the windowBits value to match the actual data
+    * size.  Note that the second argument is the *uncompressed* size but the
+    * first argument is the *compressed* data (and it must be deflate
+    * compressed.)
+    */
+static void
+optimize_cmf(png_bytep data, png_alloc_size_t data_size)
+{
+   /* Optimize the CMF field in the zlib stream.  The resultant zlib stream is
+    * still compliant to the stream specification.
+    */
+   if (data_size <= 16384) /* else windowBits must be 15 */
+   {
+      unsigned int z_cmf = data[0];  /* zlib compression method and flags */
 
-               case Z_STREAM_ERROR:
-                  pos = png_safecat(msg, sizeof msg, pos, ") stream error");
-                  break;
+      if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70)
+      {
+         unsigned int z_cinfo;
+         unsigned int half_z_window_size;
 
-               case Z_MEM_ERROR:
-                  pos = png_safecat(msg, sizeof msg, pos, ") memory error");
-                  break;
+         z_cinfo = z_cmf >> 4;
+         half_z_window_size = 1U << (z_cinfo + 7);
 
-               default:
-                  pos = png_safecat(msg, sizeof msg, pos, ") unknown error");
-                  break;
+         if (data_size <= half_z_window_size) /* else no change */
+         {
+            unsigned int tmp;
+
+            do
+            {
+               half_z_window_size >>= 1;
+               --z_cinfo;
             }
+            while (z_cinfo > 0 && data_size <= half_z_window_size);
+
+            z_cmf = (z_cmf & 0x0f) | (z_cinfo << 4);
 
-            png_error(png_ptr, msg);
+            data[0] = (png_byte)z_cmf;
+            tmp = data[1] & 0xe0;
+            tmp += 0x1f - ((z_cmf << 8) + tmp) % 0x1f;
+            data[1] = (png_byte)tmp;
          }
       }
-
-      /* Here on success, claim the zstream: */
-      png_ptr->zlib_state |= PNG_ZLIB_IN_USE;
    }
-
-   else
-      png_error(png_ptr, "zstream already in use (internal error)");
 }
+#else
+#  define optimize_cmf(dp,dl) ((void)0)
+#endif /* PNG_WRITE_OPTIMIZE_CMF_SUPPORTED */
 
-/* The opposite: release the stream.  It is also reset, this API will warn on
- * error but will not fail.
- */
-static void
-png_zlib_release(png_structp png_ptr)
+/* Initialize the compressor for the appropriate type of compression. */
+static int
+png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
+   png_alloc_size_t data_size)
 {
-   if (png_ptr->zlib_state & PNG_ZLIB_IN_USE)
+   if (png_ptr->zowner != 0)
    {
-      int ret = deflateReset(&png_ptr->zstream);
+      char msg[64];
+
+      PNG_STRING_FROM_CHUNK(msg, owner);
+      msg[4] = ':';
+      msg[5] = ' ';
+      PNG_STRING_FROM_CHUNK(msg+6, png_ptr->zowner);
+      /* So the message that results is "<chunk> using zstream"; this is an
+       * internal error, but is very useful for debugging.  i18n requirements
+       * are minimal.
+       */
+      (void)png_safecat(msg, (sizeof msg), 10, " using zstream");
+#     if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC
+         png_warning(png_ptr, msg);
+
+         /* Attempt sane error recovery */
+         if (png_ptr->zowner == png_IDAT) /* don't steal from IDAT */
+         {
+            png_ptr->zstream.msg = PNGZ_MSG_CAST("in use by IDAT");
+            return Z_STREAM_ERROR;
+         }
+
+         png_ptr->zowner = 0;
+#     else
+         png_error(png_ptr, msg);
+#     endif
+   }
 
-      png_ptr->zlib_state &= ~PNG_ZLIB_IN_USE;
+   {
+      int level = png_ptr->zlib_level;
+      int method = png_ptr->zlib_method;
+      int windowBits = png_ptr->zlib_window_bits;
+      int memLevel = png_ptr->zlib_mem_level;
+      int strategy; /* set below */
+      int ret; /* zlib return code */
 
-      if (ret != Z_OK)
+      if (owner == png_IDAT)
       {
-         png_const_charp err;
-         PNG_WARNING_PARAMETERS(p)
+         if (png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY)
+            strategy = png_ptr->zlib_strategy;
 
-         switch (ret)
-         {
-            case Z_VERSION_ERROR:
-               err = "version";
-               break;
+         else if (png_ptr->do_filter != PNG_FILTER_NONE)
+            strategy = PNG_Z_DEFAULT_STRATEGY;
 
-            case Z_STREAM_ERROR:
-               err = "stream";
-               break;
+         else
+            strategy = PNG_Z_DEFAULT_NOFILTER_STRATEGY;
+      }
 
-            case Z_MEM_ERROR:
-               err = "memory";
-               break;
+      else
+      {
+#        ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
+            level = png_ptr->zlib_text_level;
+            method = png_ptr->zlib_text_method;
+            windowBits = png_ptr->zlib_text_window_bits;
+            memLevel = png_ptr->zlib_text_mem_level;
+            strategy = png_ptr->zlib_text_strategy;
+#        else
+            /* If customization is not supported the values all come from the
+             * IDAT values except for the strategy, which is fixed to the
+             * default.  (This is the pre-1.6.0 behavior too, although it was
+             * implemented in a very different way.)
+             */
+            strategy = Z_DEFAULT_STRATEGY;
+#        endif
+      }
 
-            default:
-               err = "unknown";
-               break;
+      /* Adjust 'windowBits' down if larger than 'data_size'; to stop this
+       * happening just pass 32768 as the data_size parameter.  Notice that zlib
+       * requires an extra 262 bytes in the window in addition to the data to be
+       * able to see the whole of the data, so if data_size+262 takes us to the
+       * next windowBits size we need to fix up the value later.  (Because even
+       * though deflate needs the extra window, inflate does not!)
+       */
+      if (data_size <= 16384)
+      {
+         /* IMPLEMENTATION NOTE: this 'half_window_size' stuff is only here to
+          * work round a Microsoft Visual C misbehavior which, contrary to C-90,
+          * widens the result of the following shift to 64-bits if (and,
+          * apparently, only if) it is used in a test.
+          */
+         unsigned int half_window_size = 1U << (windowBits-1);
+
+         while (data_size + 262 <= half_window_size)
+         {
+            half_window_size >>= 1;
+            --windowBits;
          }
+      }
 
-         png_warning_parameter_signed(p, 1, PNG_NUMBER_FORMAT_d, ret);
-         png_warning_parameter(p, 2, err);
+      /* Check against the previous initialized values, if any. */
+      if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) &&
+         (png_ptr->zlib_set_level != level ||
+         png_ptr->zlib_set_method != method ||
+         png_ptr->zlib_set_window_bits != windowBits ||
+         png_ptr->zlib_set_mem_level != memLevel ||
+         png_ptr->zlib_set_strategy != strategy))
+      {
+         if (deflateEnd(&png_ptr->zstream) != Z_OK)
+            png_warning(png_ptr, "deflateEnd failed (ignored)");
 
-         if (png_ptr->zstream.msg)
-            err = png_ptr->zstream.msg;
-         else
-            err = "[no zlib message]";
+         png_ptr->flags &= ~PNG_FLAG_ZSTREAM_INITIALIZED;
+      }
 
-         png_warning_parameter(p, 3, err);
+      /* For safety clear out the input and output pointers (currently zlib
+       * doesn't use them on Init, but it might in the future).
+       */
+      png_ptr->zstream.next_in = NULL;
+      png_ptr->zstream.avail_in = 0;
+      png_ptr->zstream.next_out = NULL;
+      png_ptr->zstream.avail_out = 0;
 
-         png_formatted_warning(png_ptr, p,
-            "zlib failed to reset compressor: @1(@2): @3");
+      /* Now initialize if required, setting the new parameters, otherwise just
+       * to a simple reset to the previous parameters.
+       */
+      if (png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED)
+         ret = deflateReset(&png_ptr->zstream);
+
+      else
+      {
+         ret = deflateInit2(&png_ptr->zstream, level, method, windowBits,
+            memLevel, strategy);
+
+         if (ret == Z_OK)
+            png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
       }
+
+      /* The return code is from either deflateReset or deflateInit2; they have
+       * pretty much the same set of error codes.
+       */
+      if (ret == Z_OK)
+         png_ptr->zowner = owner;
+
+      else
+         png_zstream_error(png_ptr, ret);
+
+      return ret;
    }
+}
 
-   else
-      png_warning(png_ptr, "zstream not in use (internal error)");
+/* Clean up (or trim) a linked list of compression buffers. */
+void /* PRIVATE */
+png_free_buffer_list(png_structrp png_ptr, png_compression_bufferp *listp)
+{
+   png_compression_bufferp list = *listp;
+
+   if (list != NULL)
+   {
+      *listp = NULL;
+
+      do
+      {
+         png_compression_bufferp next = list->next;
+
+         png_free(png_ptr, list);
+         list = next;
+      }
+      while (list != NULL);
+   }
 }
 
 #ifdef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
 /* This pair of functions encapsulates the operation of (a) compressing a
  * text string, and (b) issuing it later as a series of chunk data writes.
  * The compression_state structure is shared context for these functions
- * set up by the caller in order to make the whole mess thread-safe.
+ * set up by the caller to allow access to the relevant local variables.
+ *
+ * compression_buffer (new in 1.6.0) is just a linked list of zbuffer_size
+ * temporary buffers.  From 1.6.0 it is retained in png_struct so that it will
+ * be correctly freed in the event of a write error (previous implementations
+ * just leaked memory.)
  */
-
 typedef struct
 {
-   png_const_bytep input;   /* The uncompressed input data */
-   png_size_t input_len;    /* Its length */
-   int num_output_ptr;      /* Number of output pointers used */
-   int max_output_ptr;      /* Size of output_ptr */
-   png_bytep *output_ptr;   /* Array of pointers to output */
+   png_const_bytep      input;        /* The uncompressed input data */
+   png_alloc_size_t     input_len;    /* Its length */
+   png_uint_32          output_len;   /* Final compressed length */
+   png_byte             output[1024]; /* First block of output */
 } compression_state;
 
-/* Compress given text into storage in the png_ptr structure */
-static int /* PRIVATE */
-png_text_compress(png_structp png_ptr,
-    png_const_charp text, png_size_t text_len, int compression,
-    compression_state *comp)
+static void
+png_text_compress_init(compression_state *comp, png_const_bytep input,
+   png_alloc_size_t input_len)
 {
-   int ret;
-
-   comp->num_output_ptr = 0;
-   comp->max_output_ptr = 0;
-   comp->output_ptr = NULL;
-   comp->input = NULL;
-   comp->input_len = text_len;
-
-   /* We may just want to pass the text right through */
-   if (compression == PNG_TEXT_COMPRESSION_NONE)
-   {
-      comp->input = (png_const_bytep)text;
-      return((int)text_len);
-   }
-
-   if (compression >= PNG_TEXT_COMPRESSION_LAST)
-   {
-      PNG_WARNING_PARAMETERS(p)
+   comp->input = input;
+   comp->input_len = input_len;
+   comp->output_len = 0;
+}
 
-      png_warning_parameter_signed(p, 1, PNG_NUMBER_FORMAT_d,
-         compression);
-      png_formatted_warning(png_ptr, p, "Unknown compression type @1");
-   }
+/* Compress the data in the compression state input */
+static int
+png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name,
+   compression_state *comp, png_uint_32 prefix_len)
+{
+   int ret;
 
-   /* We can't write the chunk until we find out how much data we have,
-    * which means we need to run the compressor first and save the
-    * output.  This shouldn't be a problem, as the vast majority of
-    * comments should be reasonable, but we will set up an array of
-    * malloc'd pointers to be sure.
+   /* To find the length of the output it is necessary to first compress the
+    * input, the result is buffered rather than using the two-pass algorithm
+    * that is used on the inflate side; deflate is assumed to be slower and a
+    * PNG writer is assumed to have more memory available than a PNG reader.
     *
-    * If we knew the application was well behaved, we could simplify this
-    * greatly by assuming we can always malloc an output buffer large
-    * enough to hold the compressed text ((1001 * text_len / 1000) + 12)
-    * and malloc this directly.  The only time this would be a bad idea is
-    * if we can't malloc more than 64K and we have 64K of random input
-    * data, or if the input string is incredibly large (although this
-    * wouldn't cause a failure, just a slowdown due to swapping).
+    * IMPLEMENTATION NOTE: the zlib API deflateBound() can be used to find an
+    * upper limit on the output size, but it is always bigger than the input
+    * size so it is likely to be more efficient to use this linked-list
+    * approach.
     */
-   png_zlib_claim(png_ptr, PNG_ZLIB_FOR_TEXT);
-
-   /* Set up the compression buffers */
-   /* TODO: the following cast hides a potential overflow problem. */
-   png_ptr->zstream.avail_in = (uInt)text_len;
+   ret = png_deflate_claim(png_ptr, chunk_name, comp->input_len);
 
-   /* NOTE: assume zlib doesn't overwrite the input */
-   png_ptr->zstream.next_in = (Bytef *)text;
-   png_ptr->zstream.avail_out = png_ptr->zbuf_size;
-   png_ptr->zstream.next_out = png_ptr->zbuf;
+   if (ret != Z_OK)
+      return ret;
 
-   /* This is the same compression loop as in png_write_row() */
-   do
+   /* Set up the compression buffers, we need a loop here to avoid overflowing a
+    * uInt.  Use ZLIB_IO_MAX to limit the input.  The output is always limited
+    * by the output buffer size, so there is no need to check that.  Since this
+    * is ANSI-C we know that an 'int', hence a uInt, is always at least 16 bits
+    * in size.
+    */
    {
-      /* Compress the data */
-      ret = deflate(&png_ptr->zstream, Z_NO_FLUSH);
+      png_compression_bufferp *end = &png_ptr->zbuffer_list;
+      png_alloc_size_t input_len = comp->input_len; /* may be zero! */
+      png_uint_32 output_len;
 
-      if (ret != Z_OK)
-      {
-         /* Error */
-         if (png_ptr->zstream.msg != NULL)
-            png_error(png_ptr, png_ptr->zstream.msg);
+      /* zlib updates these for us: */
+      png_ptr->zstream.next_in = PNGZ_INPUT_CAST(comp->input);
+      png_ptr->zstream.avail_in = 0; /* Set below */
+      png_ptr->zstream.next_out = comp->output;
+      png_ptr->zstream.avail_out = (sizeof comp->output);
 
-         else
-            png_error(png_ptr, "zlib error");
-      }
+      output_len = png_ptr->zstream.avail_out;
 
-      /* Check to see if we need more room */
-      if (!(png_ptr->zstream.avail_out))
+      do
       {
-         /* Make sure the output array has room */
-         if (comp->num_output_ptr >= comp->max_output_ptr)
-         {
-            int old_max;
+         uInt avail_in = ZLIB_IO_MAX;
 
-            old_max = comp->max_output_ptr;
-            comp->max_output_ptr = comp->num_output_ptr + 4;
-            if (comp->output_ptr != NULL)
-            {
-               png_bytepp old_ptr;
+         if (avail_in > input_len)
+            avail_in = (uInt)input_len;
 
-               old_ptr = comp->output_ptr;
+         input_len -= avail_in;
 
-               comp->output_ptr = (png_bytepp)png_malloc(png_ptr,
-                   (comp->max_output_ptr * png_sizeof(png_bytep)));
+         png_ptr->zstream.avail_in = avail_in;
 
-               png_memcpy(comp->output_ptr, old_ptr, old_max
-                   * png_sizeof(png_bytep));
+         if (png_ptr->zstream.avail_out == 0)
+         {
+            png_compression_buffer *next;
 
-               png_free(png_ptr, old_ptr);
+            /* Chunk data is limited to 2^31 bytes in length, so the prefix
+             * length must be counted here.
+             */
+            if (output_len + prefix_len > PNG_UINT_31_MAX)
+            {
+               ret = Z_MEM_ERROR;
+               break;
             }
-            else
-               comp->output_ptr = (png_bytepp)png_malloc(png_ptr,
-                   (comp->max_output_ptr * png_sizeof(png_bytep)));
-         }
-
-         /* Save the data */
-         comp->output_ptr[comp->num_output_ptr] =
-             (png_bytep)png_malloc(png_ptr, png_ptr->zbuf_size);
-
-         png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
-             png_ptr->zbuf_size);
-
-         comp->num_output_ptr++;
 
-         /* and reset the buffer */
-         png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
-         png_ptr->zstream.next_out = png_ptr->zbuf;
-      }
-   /* Continue until we don't have any more to compress */
-   } while (png_ptr->zstream.avail_in);
-
-   /* Finish the compression */
-   do
-   {
-      /* Tell zlib we are finished */
-      ret = deflate(&png_ptr->zstream, Z_FINISH);
-
-      if (ret == Z_OK)
-      {
-         /* Check to see if we need more room */
-         if (!(png_ptr->zstream.avail_out))
-         {
-            /* Check to make sure our output array has room */
-            if (comp->num_output_ptr >= comp->max_output_ptr)
+            /* Need a new (malloc'ed) buffer, but there may be one present
+             * already.
+             */
+            next = *end;
+            if (next == NULL)
             {
-               int old_max;
+               next = png_voidcast(png_compression_bufferp, png_malloc_base
+                  (png_ptr, PNG_COMPRESSION_BUFFER_SIZE(png_ptr)));
 
-               old_max = comp->max_output_ptr;
-               comp->max_output_ptr = comp->num_output_ptr + 4;
-               if (comp->output_ptr != NULL)
+               if (next == NULL)
                {
-                  png_bytepp old_ptr;
-
-                  old_ptr = comp->output_ptr;
-
-                  /* This could be optimized to realloc() */
-                  comp->output_ptr = (png_bytepp)png_malloc(png_ptr,
-                      (png_alloc_size_t)(comp->max_output_ptr *
-                      png_sizeof(png_charp)));
-
-                  png_memcpy(comp->output_ptr, old_ptr,
-                      old_max * png_sizeof(png_charp));
-
-                  png_free(png_ptr, old_ptr);
+                  ret = Z_MEM_ERROR;
+                  break;
                }
 
-               else
-                  comp->output_ptr = (png_bytepp)png_malloc(png_ptr,
-                      (png_alloc_size_t)(comp->max_output_ptr *
-                      png_sizeof(png_charp)));
+               /* Link in this buffer (so that it will be freed later) */
+               next->next = NULL;
+               *end = next;
             }
 
-            /* Save the data */
-            comp->output_ptr[comp->num_output_ptr] =
-                (png_bytep)png_malloc(png_ptr,
-                (png_alloc_size_t)png_ptr->zbuf_size);
+            png_ptr->zstream.next_out = next->output;
+            png_ptr->zstream.avail_out = png_ptr->zbuffer_size;
+            output_len += png_ptr->zstream.avail_out;
 
-            png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
-                png_ptr->zbuf_size);
+            /* Move 'end' to the next buffer pointer. */
+            end = &next->next;
+         }
 
-            comp->num_output_ptr++;
+         /* Compress the data */
+         ret = deflate(&png_ptr->zstream,
+            input_len > 0 ? Z_NO_FLUSH : Z_FINISH);
 
-            /* and reset the buffer pointers */
-            png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
-            png_ptr->zstream.next_out = png_ptr->zbuf;
-         }
+         /* Claw back input data that was not consumed (because avail_in is
+          * reset above every time round the loop).
+          */
+         input_len += png_ptr->zstream.avail_in;
+         png_ptr->zstream.avail_in = 0; /* safety */
       }
-      else if (ret != Z_STREAM_END)
-      {
-         /* We got an error */
-         if (png_ptr->zstream.msg != NULL)
-            png_error(png_ptr, png_ptr->zstream.msg);
+      while (ret == Z_OK);
 
-         else
-            png_error(png_ptr, "zlib error");
+      /* There may be some space left in the last output buffer, this needs to
+       * be subtracted from output_len.
+       */
+      output_len -= png_ptr->zstream.avail_out;
+      png_ptr->zstream.avail_out = 0; /* safety */
+      comp->output_len = output_len;
+
+      /* Now double check the output length, put in a custom message if it is
+       * too long.  Otherwise ensure the z_stream::msg pointer is set to
+       * something.
+       */
+      if (output_len + prefix_len >= PNG_UINT_31_MAX)
+      {
+         png_ptr->zstream.msg = PNGZ_MSG_CAST("compressed data too long");
+         ret = Z_MEM_ERROR;
       }
-   } while (ret != Z_STREAM_END);
 
-   /* Text length is number of buffers plus last buffer */
-   text_len = png_ptr->zbuf_size * comp->num_output_ptr;
+      else
+         png_zstream_error(png_ptr, ret);
+
+      /* Reset zlib for another zTXt/iTXt or image data */
+      png_ptr->zowner = 0;
+
+      /* The only success case is Z_STREAM_END, input_len must be 0, if not this
+       * is an internal error.
+       */
+      if (ret == Z_STREAM_END && input_len == 0)
+      {
+         /* Fix up the deflate header, if required */
+         optimize_cmf(comp->output, comp->input_len);
 
-   if (png_ptr->zstream.avail_out < png_ptr->zbuf_size)
-      text_len += png_ptr->zbuf_size - (png_size_t)png_ptr->zstream.avail_out;
+         /* But Z_OK is returned, not Z_STREAM_END; this allows the claim
+          * function above to return Z_STREAM_END on an error (though it never
+          * does in the current versions of zlib.)
+          */
+         return Z_OK;
+      }
 
-   return((int)text_len);
+      else
+         return ret;
+   }
 }
 
 /* Ship the compressed text out via chunk writes */
-static void /* PRIVATE */
-png_write_compressed_data_out(png_structp png_ptr, compression_state *comp,
-   png_size_t data_len)
+static void
+png_write_compressed_data_out(png_structrp png_ptr, compression_state *comp)
 {
-   int i;
+   png_uint_32 output_len = comp->output_len;
+   png_const_bytep output = comp->output;
+   png_uint_32 avail = (sizeof comp->output);
+   png_compression_buffer *next = png_ptr->zbuffer_list;
 
-   /* Handle the no-compression case */
-   if (comp->input)
+   for (;;)
    {
-      png_write_chunk_data(png_ptr, comp->input, data_len);
+      if (avail > output_len)
+         avail = output_len;
 
-      return;
-   }
+      png_write_chunk_data(png_ptr, output, avail);
 
-#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
-   /* The zbuf_size test is because the code below doesn't work if zbuf_size is
-    * '1'; simply skip it to avoid memory overwrite.
-    */
-   if (data_len >= 2 && comp->input_len < 16384 && png_ptr->zbuf_size > 1)
-   {
-      unsigned int z_cmf;  /* zlib compression method and flags */
+      output_len -= avail;
 
-      /* Optimize the CMF field in the zlib stream.  This hack of the zlib
-       * stream is compliant to the stream specification.
-       */
+      if (output_len == 0 || next == NULL)
+         break;
 
-      if (comp->num_output_ptr)
-        z_cmf = comp->output_ptr[0][0];
-      else
-        z_cmf = png_ptr->zbuf[0];
+      avail = png_ptr->zbuffer_size;
+      output = next->output;
+      next = next->next;
+   }
 
-      if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70)
-      {
-         unsigned int z_cinfo;
-         unsigned int half_z_window_size;
-         png_size_t uncompressed_text_size = comp->input_len;
+   /* This is an internal error; 'next' must have been NULL! */
+   if (output_len > 0)
+      png_error(png_ptr, "error writing ancillary chunked compressed data");
+}
+#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
 
-         z_cinfo = z_cmf >> 4;
-         half_z_window_size = 1 << (z_cinfo + 7);
+#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
+    defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
+/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification,
+ * and if invalid, correct the keyword rather than discarding the entire
+ * chunk.  The PNG 1.0 specification requires keywords 1-79 characters in
+ * length, forbids leading or trailing whitespace, multiple internal spaces,
+ * and the non-break space (0x80) from ISO 8859-1.  Returns keyword length.
+ *
+ * The 'new_key' buffer must be 80 characters in size (for the keyword plus a
+ * trailing '\0').  If this routine returns 0 then there was no keyword, or a
+ * valid one could not be generated, and the caller must png_error.
+ */
+static png_uint_32
+png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
+{
+   png_const_charp orig_key = key;
+   png_uint_32 key_len = 0;
+   int bad_character = 0;
+   int space = 1;
 
-         while (uncompressed_text_size <= half_z_window_size &&
-             half_z_window_size >= 256)
-         {
-            z_cinfo--;
-            half_z_window_size >>= 1;
-         }
+   png_debug(1, "in png_check_keyword");
 
-         z_cmf = (z_cmf & 0x0f) | (z_cinfo << 4);
+   if (key == NULL)
+   {
+      *new_key = 0;
+      return 0;
+   }
 
-         if (comp->num_output_ptr)
-         {
+   while (*key && key_len < 79)
+   {
+      png_byte ch = (png_byte)(0xff & *key++);
 
-           if (comp->output_ptr[0][0] != z_cmf)
-           {
-              int tmp;
+      if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/))
+         *new_key++ = ch, ++key_len, space = 0;
 
-              comp->output_ptr[0][0] = (png_byte)z_cmf;
-              tmp = comp->output_ptr[0][1] & 0xe0;
-              tmp += 0x1f - ((z_cmf << 8) + tmp) % 0x1f;
-              comp->output_ptr[0][1] = (png_byte)tmp;
-           }
-         }
-         else
-         {
-            int tmp;
+      else if (!space)
+      {
+         /* A space or an invalid character when one wasn't seen immediately
+          * before; output just a space.
+          */
+         *new_key++ = 32, ++key_len, space = 1;
 
-            png_ptr->zbuf[0] = (png_byte)z_cmf;
-            tmp = png_ptr->zbuf[1] & 0xe0;
-            tmp += 0x1f - ((z_cmf << 8) + tmp) % 0x1f;
-            png_ptr->zbuf[1] = (png_byte)tmp;
-         }
+         /* If the character was not a space then it is invalid. */
+         if (ch != 32)
+            bad_character = ch;
       }
 
-      else
-         png_error(png_ptr,
-             "Invalid zlib compression method or flags in non-IDAT chunk");
+      else if (!bad_character)
+         bad_character = ch; /* just skip it, record the first error */
    }
-#endif /* PNG_WRITE_OPTIMIZE_CMF_SUPPORTED */
 
-   /* Write saved output buffers, if any */
-   for (i = 0; i < comp->num_output_ptr; i++)
+   if (key_len > 0 && space) /* trailing space */
    {
-      png_write_chunk_data(png_ptr, comp->output_ptr[i],
-          (png_size_t)png_ptr->zbuf_size);
-
-      png_free(png_ptr, comp->output_ptr[i]);
+      --key_len, --new_key;
+      if (!bad_character)
+         bad_character = 32;
    }
 
-   if (comp->max_output_ptr != 0)
-      png_free(png_ptr, comp->output_ptr);
+   /* Terminate the keyword */
+   *new_key = 0;
+
+   if (key_len == 0)
+      return 0;
+
+   /* Try to only output one warning per keyword: */
+   if (*key) /* keyword too long */
+      png_warning(png_ptr, "keyword truncated");
+
+   else if (bad_character)
+   {
+      PNG_WARNING_PARAMETERS(p)
+
+      png_warning_parameter(p, 1, orig_key);
+      png_warning_parameter_signed(p, 2, PNG_NUMBER_FORMAT_02x, bad_character);
 
-   /* Write anything left in zbuf */
-   if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size)
-      png_write_chunk_data(png_ptr, png_ptr->zbuf,
-          (png_size_t)(png_ptr->zbuf_size - png_ptr->zstream.avail_out));
+      png_formatted_warning(png_ptr, p, "keyword \"@1\": bad character '0x@2'");
+   }
 
-   /* Reset zlib for another zTXt/iTXt or image data */
-   png_zlib_release(png_ptr);
+   return key_len;
 }
-#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
+#endif
 
 /* Write the IHDR chunk, and update the png_struct with the necessary
  * information.  Note that the rest of this code depends upon this
  * information being correct.
  */
 void /* PRIVATE */
-png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
+png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
     int bit_depth, int color_type, int compression_type, int filter_type,
     int interlace_type)
 {
@@ -818,11 +898,6 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
    /* Write the chunk */
    png_write_complete_chunk(png_ptr, png_IHDR, buf, (png_size_t)13);
 
-   /* Initialize zlib with PNG info */
-   png_ptr->zstream.zalloc = png_zalloc;
-   png_ptr->zstream.zfree = png_zfree;
-   png_ptr->zstream.opaque = (voidpf)png_ptr;
-
    if (!(png_ptr->do_filter))
    {
       if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE ||
@@ -833,55 +908,6 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
          png_ptr->do_filter = PNG_ALL_FILTERS;
    }
 
-   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY))
-   {
-      if (png_ptr->do_filter != PNG_FILTER_NONE)
-         png_ptr->zlib_strategy = Z_FILTERED;
-
-      else
-         png_ptr->zlib_strategy = Z_DEFAULT_STRATEGY;
-   }
-
-   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_LEVEL))
-      png_ptr->zlib_level = Z_DEFAULT_COMPRESSION;
-
-   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL))
-      png_ptr->zlib_mem_level = 8;
-
-   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS))
-      png_ptr->zlib_window_bits = 15;
-
-   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD))
-      png_ptr->zlib_method = 8;
-
-#ifdef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
-#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
-   if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_STRATEGY))
-      png_ptr->zlib_text_strategy = Z_DEFAULT_STRATEGY;
-
-   if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_LEVEL))
-      png_ptr->zlib_text_level = png_ptr->zlib_level;
-
-   if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_MEM_LEVEL))
-      png_ptr->zlib_text_mem_level = png_ptr->zlib_mem_level;
-
-   if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_WINDOW_BITS))
-      png_ptr->zlib_text_window_bits = png_ptr->zlib_window_bits;
-
-   if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_METHOD))
-      png_ptr->zlib_text_method = png_ptr->zlib_method;
-#else
-   png_ptr->zlib_text_strategy = Z_DEFAULT_STRATEGY;
-   png_ptr->zlib_text_level = png_ptr->zlib_level;
-   png_ptr->zlib_text_mem_level = png_ptr->zlib_mem_level;
-   png_ptr->zlib_text_window_bits = png_ptr->zlib_window_bits;
-   png_ptr->zlib_text_method = png_ptr->zlib_method;
-#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
-#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
-
-   /* Record that the compressor has not yet been initialized. */
-   png_ptr->zlib_state = PNG_ZLIB_UNINITIALIZED;
-
    png_ptr->mode = PNG_HAVE_IHDR; /* not READY_FOR_ZTXT */
 }
 
@@ -890,7 +916,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
  * structure.
  */
 void /* PRIVATE */
-png_write_PLTE(png_structp png_ptr, png_const_colorp palette,
+png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
     png_uint_32 num_pal)
 {
    png_uint_32 i;
@@ -958,94 +984,165 @@ png_write_PLTE(png_structp png_ptr, png_const_colorp palette,
    png_ptr->mode |= PNG_HAVE_PLTE;
 }
 
-/* Write an IDAT chunk */
+/* This is similar to png_text_compress, above, except that it does not require
+ * all of the data at once and, instead of buffering the compressed result,
+ * writes it as IDAT chunks.  Unlike png_text_compress it *can* png_error out
+ * because it calls the write interface.  As a result it does its own error
+ * reporting and does not return an error code.  In the event of error it will
+ * just call png_error.  The input data length may exceed 32-bits.  The 'flush'
+ * parameter is exactly the same as that to deflate, with the following
+ * meanings:
+ *
+ * Z_NO_FLUSH: normal incremental output of compressed data
+ * Z_SYNC_FLUSH: do a SYNC_FLUSH, used by png_write_flush
+ * Z_FINISH: this is the end of the input, do a Z_FINISH and clean up
+ *
+ * The routine manages the acquire and release of the png_ptr->zstream by
+ * checking and (at the end) clearing png_ptr->zowner, it does some sanity
+ * checks on the 'mode' flags while doing this.
+ */
 void /* PRIVATE */
-png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
+png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
+   png_alloc_size_t input_len, int flush)
 {
-   png_debug(1, "in png_write_IDAT");
+   if (png_ptr->zowner != png_IDAT)
+   {
+      /* First time.   Ensure we have a temporary buffer for compression and
+       * trim the buffer list if it has more than one entry to free memory.
+       * If 'WRITE_COMPRESSED_TEXT' is not set the list will never have been
+       * created at this point, but the check here is quick and safe.
+       */
+      if (png_ptr->zbuffer_list == NULL)
+      {
+         png_ptr->zbuffer_list = png_voidcast(png_compression_bufferp,
+            png_malloc(png_ptr, PNG_COMPRESSION_BUFFER_SIZE(png_ptr)));
+         png_ptr->zbuffer_list->next = NULL;
+      }
 
-#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
-   if (!(png_ptr->mode & PNG_HAVE_IDAT) &&
-       png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)
+      else
+         png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list->next);
+
+      /* It is a terminal error if we can't claim the zstream. */
+      if (png_deflate_claim(png_ptr, png_IDAT, png_image_size(png_ptr)) != Z_OK)
+         png_error(png_ptr, png_ptr->zstream.msg);
+
+      /* The output state is maintained in png_ptr->zstream, so it must be
+       * initialized here after the claim.
+       */
+      png_ptr->zstream.next_out = png_ptr->zbuffer_list->output;
+      png_ptr->zstream.avail_out = png_ptr->zbuffer_size;
+   }
+
+   /* Now loop reading and writing until all the input is consumed or an error
+    * terminates the operation.  The _out values are maintained across calls to
+    * this function, but the input must be reset each time.
+    */
+   png_ptr->zstream.next_in = PNGZ_INPUT_CAST(input);
+   png_ptr->zstream.avail_in = 0; /* set below */
+   for (;;)
    {
-      /* Optimize the CMF field in the zlib stream.  This hack of the zlib
-       * stream is compliant to the stream specification.
+      int ret;
+
+      /* INPUT: from the row data */
+      uInt avail = ZLIB_IO_MAX;
+
+      if (avail > input_len)
+         avail = (uInt)input_len; /* safe because of the check */
+
+      png_ptr->zstream.avail_in = avail;
+      input_len -= avail;
+
+      ret = deflate(&png_ptr->zstream, input_len > 0 ? Z_NO_FLUSH : flush);
+
+      /* Include as-yet unconsumed input */
+      input_len += png_ptr->zstream.avail_in;
+      png_ptr->zstream.avail_in = 0;
+
+      /* OUTPUT: write complete IDAT chunks when avail_out drops to zero, note
+       * that these two zstream fields are preserved across the calls, therefore
+       * there is no need to set these up on entry to the loop.
        */
-      unsigned int z_cmf = data[0];  /* zlib compression method and flags */
+      if (png_ptr->zstream.avail_out == 0)
+      {
+         png_bytep data = png_ptr->zbuffer_list->output;
+         uInt size = png_ptr->zbuffer_size;
 
-      if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70)
+         /* Write an IDAT containing the data then reset the buffer.  The
+          * first IDAT may need deflate header optimization.
+          */
+#        ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
+            if (!(png_ptr->mode & PNG_HAVE_IDAT) &&
+               png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)
+               optimize_cmf(data, png_image_size(png_ptr));
+#        endif
+
+         png_write_complete_chunk(png_ptr, png_IDAT, data, size);
+         png_ptr->mode |= PNG_HAVE_IDAT;
+
+         png_ptr->zstream.next_out = data;
+         png_ptr->zstream.avail_out = size;
+
+         /* For SYNC_FLUSH or FINISH it is essential to keep calling zlib with
+          * the same flush parameter until it has finished output, for NO_FLUSH
+          * it doesn't matter.
+          */
+         if (ret == Z_OK && flush != Z_NO_FLUSH)
+            continue;
+      }
+
+      /* The order of these checks doesn't matter much; it just effect which
+       * possible error might be detected if multiple things go wrong at once.
+       */
+      if (ret == Z_OK) /* most likely return code! */
       {
-         /* Avoid memory underflows and multiplication overflows.
-          *
-          * The conditions below are practically always satisfied;
-          * however, they still must be checked.
+         /* If all the input has been consumed then just return.  If Z_FINISH
+          * was used as the flush parameter something has gone wrong if we get
+          * here.
           */
-         if (length >= 2 &&
-             png_ptr->height < 16384 && png_ptr->width < 16384)
+         if (input_len == 0)
          {
-            /* Compute the maximum possible length of the datastream */
+            if (flush == Z_FINISH)
+               png_error(png_ptr, "Z_OK on Z_FINISH with output space");
 
-            /* Number of pixels, plus for each row a filter byte
-             * and possibly a padding byte, so increase the maximum
-             * size to account for these.
-             */
-            unsigned int z_cinfo;
-            unsigned int half_z_window_size;
-            png_uint_32 uncompressed_idat_size = png_ptr->height *
-                ((png_ptr->width *
-                png_ptr->channels * png_ptr->bit_depth + 15) >> 3);
-
-            /* If it's interlaced, each block of 8 rows is sent as up to
-             * 14 rows, i.e., 6 additional rows, each with a filter byte
-             * and possibly a padding byte
-             */
-            if (png_ptr->interlaced)
-               uncompressed_idat_size += ((png_ptr->height + 7)/8) *
-                   (png_ptr->bit_depth < 8 ? 12 : 6);
+            return;
+         }
+      }
 
-            z_cinfo = z_cmf >> 4;
-            half_z_window_size = 1 << (z_cinfo + 7);
+      else if (ret == Z_STREAM_END && flush == Z_FINISH)
+      {
+         /* This is the end of the IDAT data; any pending output must be
+          * flushed.  For small PNG files we may still be at the beginning.
+          */
+         png_bytep data = png_ptr->zbuffer_list->output;
+         uInt size = png_ptr->zbuffer_size - png_ptr->zstream.avail_out;
 
-            while (uncompressed_idat_size <= half_z_window_size &&
-                half_z_window_size >= 256)
-            {
-               z_cinfo--;
-               half_z_window_size >>= 1;
-            }
+#        ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
+            if (!(png_ptr->mode & PNG_HAVE_IDAT) &&
+               png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)
+               optimize_cmf(data, png_image_size(png_ptr));
+#        endif
 
-            z_cmf = (z_cmf & 0x0f) | (z_cinfo << 4);
+         png_write_complete_chunk(png_ptr, png_IDAT, data, size);
+         png_ptr->zstream.avail_out = 0;
+         png_ptr->zstream.next_out = NULL;
+         png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT;
 
-            if (data[0] != z_cmf)
-            {
-               int tmp;
-               data[0] = (png_byte)z_cmf;
-               tmp = data[1] & 0xe0;
-               tmp += 0x1f - ((z_cmf << 8) + tmp) % 0x1f;
-               data[1] = (png_byte)tmp;
-            }
-         }
+         png_ptr->zowner = 0; /* Release the stream */
+         return;
       }
 
       else
-         png_error(png_ptr,
-             "Invalid zlib compression method or flags in IDAT");
+      {
+         /* This is an error condition. */
+         png_zstream_error(png_ptr, ret);
+         png_error(png_ptr, png_ptr->zstream.msg);
+      }
    }
-#endif /* PNG_WRITE_OPTIMIZE_CMF_SUPPORTED */
-
-   png_write_complete_chunk(png_ptr, png_IDAT, data, length);
-   png_ptr->mode |= PNG_HAVE_IDAT;
-
-   /* Prior to 1.5.4 this code was replicated in every caller (except at the
-    * end, where it isn't technically necessary).  Since this function has
-    * flushed the data we can safely reset the zlib output buffer here.
-    */
-   png_ptr->zstream.next_out = png_ptr->zbuf;
-   png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
 }
 
 /* Write an IEND chunk */
 void /* PRIVATE */
-png_write_IEND(png_structp png_ptr)
+png_write_IEND(png_structrp png_ptr)
 {
    png_debug(1, "in png_write_IEND");
 
@@ -1056,7 +1153,7 @@ png_write_IEND(png_structp png_ptr)
 #ifdef PNG_WRITE_gAMA_SUPPORTED
 /* Write a gAMA chunk */
 void /* PRIVATE */
-png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
+png_write_gAMA_fixed(png_structrp png_ptr, png_fixed_point file_gamma)
 {
    png_byte buf[4];
 
@@ -1071,7 +1168,7 @@ png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
 #ifdef PNG_WRITE_sRGB_SUPPORTED
 /* Write a sRGB chunk */
 void /* PRIVATE */
-png_write_sRGB(png_structp png_ptr, int srgb_intent)
+png_write_sRGB(png_structrp png_ptr, int srgb_intent)
 {
    png_byte buf[1];
 
@@ -1089,94 +1186,70 @@ png_write_sRGB(png_structp png_ptr, int srgb_intent)
 #ifdef PNG_WRITE_iCCP_SUPPORTED
 /* Write an iCCP chunk */
 void /* PRIVATE */
-png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type,
-    png_const_charp profile, int profile_len)
+png_write_iCCP(png_structrp png_ptr, png_const_charp name,
+    png_const_bytep profile)
 {
-   png_size_t name_len;
-   png_charp new_name;
+   png_uint_32 name_len;
+   png_uint_32 profile_len;
+   png_byte new_name[81]; /* 1 byte for the compression byte */
    compression_state comp;
-   int embedded_profile_len = 0;
 
    png_debug(1, "in png_write_iCCP");
 
-   comp.num_output_ptr = 0;
-   comp.max_output_ptr = 0;
-   comp.output_ptr = NULL;
-   comp.input = NULL;
-   comp.input_len = 0;
-
-   if ((name_len = png_check_keyword(png_ptr, name, &new_name)) == 0)
-      return;
-
-   if (compression_type != PNG_COMPRESSION_TYPE_BASE)
-      png_warning(png_ptr, "Unknown compression type in iCCP chunk");
-
+   /* These are all internal problems: the profile should have been checked
+    * before when it was stored.
+    */
    if (profile == NULL)
-      profile_len = 0;
+      png_error(png_ptr, "No profile for iCCP chunk"); /* internal error */
 
-   if (profile_len > 3)
-      embedded_profile_len =
-          ((*( (png_const_bytep)profile    ))<<24) |
-          ((*( (png_const_bytep)profile + 1))<<16) |
-          ((*( (png_const_bytep)profile + 2))<< 8) |
-          ((*( (png_const_bytep)profile + 3))    );
+   profile_len = png_get_uint_32(profile);
 
-   if (embedded_profile_len < 0)
-   {
-      png_warning(png_ptr,
-          "Embedded profile length in iCCP chunk is negative");
+   if (profile_len < 132)
+      png_error(png_ptr, "ICC profile too short");
 
-      png_free(png_ptr, new_name);
-      return;
-   }
+   if (profile_len & 0x03)
+      png_error(png_ptr, "ICC profile length invalid (not a multiple of 4)");
 
-   if (profile_len < embedded_profile_len)
    {
-      png_warning(png_ptr,
-          "Embedded profile length too large in iCCP chunk");
+      png_uint_32 embedded_profile_len = png_get_uint_32(profile);
 
-      png_free(png_ptr, new_name);
-      return;
+      if (profile_len != embedded_profile_len)
+         png_error(png_ptr, "Profile length does not match profile");
    }
 
-   if (profile_len > embedded_profile_len)
-   {
-      png_warning(png_ptr,
-          "Truncating profile to actual length in iCCP chunk");
+   name_len = png_check_keyword(png_ptr, name, new_name);
 
-      profile_len = embedded_profile_len;
-   }
+   if (name_len == 0)
+      png_error(png_ptr, "iCCP: invalid keyword");
 
-   if (profile_len)
-      profile_len = png_text_compress(png_ptr, profile,
-          (png_size_t)profile_len, PNG_COMPRESSION_TYPE_BASE, &comp);
+   new_name[++name_len] = PNG_COMPRESSION_TYPE_BASE;
 
    /* Make sure we include the NULL after the name and the compression type */
-   png_write_chunk_header(png_ptr, png_iCCP,
-       (png_uint_32)(name_len + profile_len + 2));
+   ++name_len;
 
-   new_name[name_len + 1] = 0x00;
+   png_text_compress_init(&comp, profile, profile_len);
 
-   png_write_chunk_data(png_ptr, (png_bytep)new_name,
-       (png_size_t)(name_len + 2));
+   /* Allow for keyword terminator and compression byte */
+   if (png_text_compress(png_ptr, png_iCCP, &comp, name_len) != Z_OK)
+      png_error(png_ptr, png_ptr->zstream.msg);
 
-   if (profile_len)
-   {
-      png_write_compressed_data_out(png_ptr, &comp, profile_len);
-   }
+   png_write_chunk_header(png_ptr, png_iCCP, name_len + comp.output_len);
+
+   png_write_chunk_data(png_ptr, new_name, name_len);
+
+   png_write_compressed_data_out(png_ptr, &comp);
 
    png_write_chunk_end(png_ptr);
-   png_free(png_ptr, new_name);
 }
 #endif
 
 #ifdef PNG_WRITE_sPLT_SUPPORTED
 /* Write a sPLT chunk */
 void /* PRIVATE */
-png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette)
+png_write_sPLT(png_structrp png_ptr, png_const_sPLT_tp spalette)
 {
-   png_size_t name_len;
-   png_charp new_name;
+   png_uint_32 name_len;
+   png_byte new_name[80];
    png_byte entrybuf[10];
    png_size_t entry_size = (spalette->depth == 8 ? 6 : 10);
    png_size_t palette_size = entry_size * spalette->nentries;
@@ -1187,8 +1260,10 @@ png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette)
 
    png_debug(1, "in png_write_sPLT");
 
-   if ((name_len = png_check_keyword(png_ptr,spalette->name, &new_name))==0)
-      return;
+   name_len = png_check_keyword(png_ptr, spalette->name, new_name);
+
+   if (name_len == 0)
+      png_error(png_ptr, "sPLT: invalid keyword");
 
    /* Make sure we include the NULL after the name */
    png_write_chunk_header(png_ptr, png_sPLT,
@@ -1221,7 +1296,7 @@ png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette)
          png_save_uint_16(entrybuf + 8, ep->frequency);
       }
 
-      png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size);
+      png_write_chunk_data(png_ptr, entrybuf, entry_size);
    }
 #else
    ep=spalette->entries;
@@ -1245,19 +1320,18 @@ png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette)
          png_save_uint_16(entrybuf + 8, ep[i].frequency);
       }
 
-      png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size);
+      png_write_chunk_data(png_ptr, entrybuf, entry_size);
    }
 #endif
 
    png_write_chunk_end(png_ptr);
-   png_free(png_ptr, new_name);
 }
 #endif
 
 #ifdef PNG_WRITE_sBIT_SUPPORTED
 /* Write the sBIT chunk */
 void /* PRIVATE */
-png_write_sBIT(png_structp png_ptr, png_const_color_8p sbit, int color_type)
+png_write_sBIT(png_structrp png_ptr, png_const_color_8p sbit, int color_type)
 {
    png_byte buf[4];
    png_size_t size;
@@ -1316,42 +1390,33 @@ png_write_sBIT(png_structp png_ptr, png_const_color_8p sbit, int color_type)
 #ifdef PNG_WRITE_cHRM_SUPPORTED
 /* Write the cHRM chunk */
 void /* PRIVATE */
-png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
-    png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y,
-    png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x,
-    png_fixed_point blue_y)
+png_write_cHRM_fixed(png_structrp png_ptr, const png_xy *xy)
 {
    png_byte buf[32];
 
    png_debug(1, "in png_write_cHRM");
 
    /* Each value is saved in 1/100,000ths */
-#ifdef PNG_CHECK_cHRM_SUPPORTED
-   if (png_check_cHRM_fixed(png_ptr, white_x, white_y, red_x, red_y,
-       green_x, green_y, blue_x, blue_y))
-#endif
-   {
-      png_save_uint_32(buf, (png_uint_32)white_x);
-      png_save_uint_32(buf + 4, (png_uint_32)white_y);
+   png_save_int_32(buf,      xy->whitex);
+   png_save_int_32(buf +  4, xy->whitey);
 
-      png_save_uint_32(buf + 8, (png_uint_32)red_x);
-      png_save_uint_32(buf + 12, (png_uint_32)red_y);
+   png_save_int_32(buf +  8, xy->redx);
+   png_save_int_32(buf + 12, xy->redy);
 
-      png_save_uint_32(buf + 16, (png_uint_32)green_x);
-      png_save_uint_32(buf + 20, (png_uint_32)green_y);
+   png_save_int_32(buf + 16, xy->greenx);
+   png_save_int_32(buf + 20, xy->greeny);
 
-      png_save_uint_32(buf + 24, (png_uint_32)blue_x);
-      png_save_uint_32(buf + 28, (png_uint_32)blue_y);
+   png_save_int_32(buf + 24, xy->bluex);
+   png_save_int_32(buf + 28, xy->bluey);
 
-      png_write_complete_chunk(png_ptr, png_cHRM, buf, (png_size_t)32);
-   }
+   png_write_complete_chunk(png_ptr, png_cHRM, buf, 32);
 }
 #endif
 
 #ifdef PNG_WRITE_tRNS_SUPPORTED
 /* Write the tRNS chunk */
 void /* PRIVATE */
-png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha,
+png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha,
     png_const_color_16p tran, int num_trans, int color_type)
 {
    png_byte buf[6];
@@ -1362,7 +1427,8 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha,
    {
       if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette)
       {
-         png_warning(png_ptr, "Invalid number of transparent colors specified");
+         png_app_warning(png_ptr,
+             "Invalid number of transparent colors specified");
          return;
       }
 
@@ -1376,7 +1442,7 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha,
       /* One 16 bit value */
       if (tran->gray >= (1 << png_ptr->bit_depth))
       {
-         png_warning(png_ptr,
+         png_app_warning(png_ptr,
              "Ignoring attempt to write tRNS chunk out-of-range for bit_depth");
 
          return;
@@ -1398,7 +1464,7 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha,
       if (buf[0] | buf[2] | buf[4])
 #endif
       {
-         png_warning(png_ptr,
+         png_app_warning(png_ptr,
            "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8");
          return;
       }
@@ -1408,7 +1474,7 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha,
 
    else
    {
-      png_warning(png_ptr, "Can't write tRNS with an alpha channel");
+      png_app_warning(png_ptr, "Can't write tRNS with an alpha channel");
    }
 }
 #endif
@@ -1416,7 +1482,7 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha,
 #ifdef PNG_WRITE_bKGD_SUPPORTED
 /* Write the background chunk */
 void /* PRIVATE */
-png_write_bKGD(png_structp png_ptr, png_const_color_16p back, int color_type)
+png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
 {
    png_byte buf[6];
 
@@ -1478,7 +1544,7 @@ png_write_bKGD(png_structp png_ptr, png_const_color_16p back, int color_type)
 #ifdef PNG_WRITE_hIST_SUPPORTED
 /* Write the histogram */
 void /* PRIVATE */
-png_write_hIST(png_structp png_ptr, png_const_uint_16p hist, int num_hist)
+png_write_hIST(png_structrp png_ptr, png_const_uint_16p hist, int num_hist)
 {
    int i;
    png_byte buf[3];
@@ -1506,234 +1572,95 @@ png_write_hIST(png_structp png_ptr, png_const_uint_16p hist, int num_hist)
 }
 #endif
 
-#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
-    defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
-/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification,
- * and if invalid, correct the keyword rather than discarding the entire
- * chunk.  The PNG 1.0 specification requires keywords 1-79 characters in
- * length, forbids leading or trailing whitespace, multiple internal spaces,
- * and the non-break space (0x80) from ISO 8859-1.  Returns keyword length.
- *
- * The new_key is allocated to hold the corrected keyword and must be freed
- * by the calling routine.  This avoids problems with trying to write to
- * static keywords without having to have duplicate copies of the strings.
- */
-png_size_t /* PRIVATE */
-png_check_keyword(png_structp png_ptr, png_const_charp key, png_charpp new_key)
-{
-   png_size_t key_len;
-   png_const_charp ikp;
-   png_charp kp, dp;
-   int kflag;
-   int kwarn=0;
-
-   png_debug(1, "in png_check_keyword");
-
-   *new_key = NULL;
-
-   if (key == NULL || (key_len = png_strlen(key)) == 0)
-   {
-      png_warning(png_ptr, "zero length keyword");
-      return ((png_size_t)0);
-   }
-
-   png_debug1(2, "Keyword to be checked is '%s'", key);
-
-   *new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2));
-
-   if (*new_key == NULL)
-   {
-      png_warning(png_ptr, "Out of memory while procesing keyword");
-      return ((png_size_t)0);
-   }
-
-   /* Replace non-printing characters with a blank and print a warning */
-   for (ikp = key, dp = *new_key; *ikp != '\0'; ikp++, dp++)
-   {
-      if ((png_byte)*ikp < 0x20 ||
-         ((png_byte)*ikp > 0x7E && (png_byte)*ikp < 0xA1))
-      {
-         PNG_WARNING_PARAMETERS(p)
-
-         png_warning_parameter_unsigned(p, 1, PNG_NUMBER_FORMAT_02x,
-            (png_byte)*ikp);
-         png_formatted_warning(png_ptr, p, "invalid keyword character 0x@1");
-         *dp = ' ';
-      }
-
-      else
-      {
-         *dp = *ikp;
-      }
-   }
-   *dp = '\0';
-
-   /* Remove any trailing white space. */
-   kp = *new_key + key_len - 1;
-   if (*kp == ' ')
-   {
-      png_warning(png_ptr, "trailing spaces removed from keyword");
-
-      while (*kp == ' ')
-      {
-         *(kp--) = '\0';
-         key_len--;
-      }
-   }
-
-   /* Remove any leading white space. */
-   kp = *new_key;
-   if (*kp == ' ')
-   {
-      png_warning(png_ptr, "leading spaces removed from keyword");
-
-      while (*kp == ' ')
-      {
-         kp++;
-         key_len--;
-      }
-   }
-
-   png_debug1(2, "Checking for multiple internal spaces in '%s'", kp);
-
-   /* Remove multiple internal spaces. */
-   for (kflag = 0, dp = *new_key; *kp != '\0'; kp++)
-   {
-      if (*kp == ' ' && kflag == 0)
-      {
-         *(dp++) = *kp;
-         kflag = 1;
-      }
-
-      else if (*kp == ' ')
-      {
-         key_len--;
-         kwarn = 1;
-      }
-
-      else
-      {
-         *(dp++) = *kp;
-         kflag = 0;
-      }
-   }
-   *dp = '\0';
-   if (kwarn)
-      png_warning(png_ptr, "extra interior spaces removed from keyword");
-
-   if (key_len == 0)
-   {
-      png_free(png_ptr, *new_key);
-      png_warning(png_ptr, "Zero length keyword");
-   }
-
-   if (key_len > 79)
-   {
-      png_warning(png_ptr, "keyword length must be 1 - 79 characters");
-      (*new_key)[79] = '\0';
-      key_len = 79;
-   }
-
-   return (key_len);
-}
-#endif
-
 #ifdef PNG_WRITE_tEXt_SUPPORTED
 /* Write a tEXt chunk */
 void /* PRIVATE */
-png_write_tEXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
+png_write_tEXt(png_structrp png_ptr, png_const_charp key, png_const_charp text,
     png_size_t text_len)
 {
-   png_size_t key_len;
-   png_charp new_key;
+   png_uint_32 key_len;
+   png_byte new_key[80];
 
    png_debug(1, "in png_write_tEXt");
 
-   if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0)
-      return;
+   key_len = png_check_keyword(png_ptr, key, new_key);
+
+   if (key_len == 0)
+      png_error(png_ptr, "tEXt: invalid keyword");
 
    if (text == NULL || *text == '\0')
       text_len = 0;
 
    else
-      text_len = png_strlen(text);
+      text_len = strlen(text);
+
+   if (text_len > PNG_UINT_31_MAX - (key_len+1))
+      png_error(png_ptr, "tEXt: text too long");
 
    /* Make sure we include the 0 after the key */
    png_write_chunk_header(png_ptr, png_tEXt,
-       (png_uint_32)(key_len + text_len + 1));
+       (png_uint_32)/*checked above*/(key_len + text_len + 1));
    /*
     * We leave it to the application to meet PNG-1.0 requirements on the
     * contents of the text.  PNG-1.0 through PNG-1.2 discourage the use of
     * any non-Latin-1 characters except for NEWLINE.  ISO PNG will forbid them.
     * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.
     */
-   png_write_chunk_data(png_ptr, (png_bytep)new_key,
-       (png_size_t)(key_len + 1));
+   png_write_chunk_data(png_ptr, new_key, key_len + 1);
 
    if (text_len)
-      png_write_chunk_data(png_ptr, (png_const_bytep)text,
-          (png_size_t)text_len);
+      png_write_chunk_data(png_ptr, (png_const_bytep)text, text_len);
 
    png_write_chunk_end(png_ptr);
-   png_free(png_ptr, new_key);
 }
 #endif
 
 #ifdef PNG_WRITE_zTXt_SUPPORTED
 /* Write a compressed text chunk */
 void /* PRIVATE */
-png_write_zTXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
+png_write_zTXt(png_structrp png_ptr, png_const_charp key, png_const_charp text,
     png_size_t text_len, int compression)
 {
-   png_size_t key_len;
-   png_byte buf;
-   png_charp new_key;
+   png_uint_32 key_len;
+   png_byte new_key[81];
    compression_state comp;
 
    png_debug(1, "in png_write_zTXt");
+   PNG_UNUSED(text_len) /* Always use strlen */
 
-   comp.num_output_ptr = 0;
-   comp.max_output_ptr = 0;
-   comp.output_ptr = NULL;
-   comp.input = NULL;
-   comp.input_len = 0;
-
-   if ((key_len = png_check_keyword(png_ptr, key, &new_key)) == 0)
+   if (compression == PNG_TEXT_COMPRESSION_NONE)
    {
-      png_free(png_ptr, new_key);
+      png_write_tEXt(png_ptr, key, text, 0);
       return;
    }
 
-   if (text == NULL || *text == '\0' || compression==PNG_TEXT_COMPRESSION_NONE)
-   {
-      png_write_tEXt(png_ptr, new_key, text, (png_size_t)0);
-      png_free(png_ptr, new_key);
-      return;
-   }
+   if (compression != PNG_TEXT_COMPRESSION_zTXt)
+      png_error(png_ptr, "zTXt: invalid compression type");
 
-   text_len = png_strlen(text);
+   key_len = png_check_keyword(png_ptr, key, new_key);
 
-   /* Compute the compressed data; do it now for the length */
-   text_len = png_text_compress(png_ptr, text, text_len, compression,
-       &comp);
+   if (key_len == 0)
+      png_error(png_ptr, "zTXt: invalid keyword");
 
-   /* Write start of chunk */
-   png_write_chunk_header(png_ptr, png_zTXt,
-       (png_uint_32)(key_len+text_len + 2));
+   /* Add the compression method and 1 for the keyword separator. */
+   new_key[++key_len] = PNG_COMPRESSION_TYPE_BASE;
+   ++key_len;
 
-   /* Write key */
-   png_write_chunk_data(png_ptr, (png_bytep)new_key,
-       (png_size_t)(key_len + 1));
+   /* Compute the compressed data; do it now for the length */
+   png_text_compress_init(&comp, (png_const_bytep)text,
+      text == NULL ? 0 : strlen(text));
 
-   png_free(png_ptr, new_key);
+   if (png_text_compress(png_ptr, png_zTXt, &comp, key_len) != Z_OK)
+      png_error(png_ptr, png_ptr->zstream.msg);
 
-   buf = (png_byte)compression;
+   /* Write start of chunk */
+   png_write_chunk_header(png_ptr, png_zTXt, key_len + comp.output_len);
 
-   /* Write compression */
-   png_write_chunk_data(png_ptr, &buf, (png_size_t)1);
+   /* Write key */
+   png_write_chunk_data(png_ptr, new_key, key_len);
 
    /* Write the compressed data */
-   png_write_compressed_data_out(png_ptr, &comp, text_len);
+   png_write_compressed_data_out(png_ptr, &comp);
 
    /* Close the chunk */
    png_write_chunk_end(png_ptr);
@@ -1743,100 +1670,104 @@ png_write_zTXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
 #ifdef PNG_WRITE_iTXt_SUPPORTED
 /* Write an iTXt chunk */
 void /* PRIVATE */
-png_write_iTXt(png_structp png_ptr, int compression, png_const_charp key,
+png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
     png_const_charp lang, png_const_charp lang_key, png_const_charp text)
 {
-   png_size_t lang_len, key_len, lang_key_len, text_len;
-   png_charp new_lang;
-   png_charp new_key = NULL;
-   png_byte cbuf[2];
+   png_uint_32 key_len, prefix_len;
+   png_size_t lang_len, lang_key_len;
+   png_byte new_key[82];
    compression_state comp;
 
    png_debug(1, "in png_write_iTXt");
 
-   comp.num_output_ptr = 0;
-   comp.max_output_ptr = 0;
-   comp.output_ptr = NULL;
-   comp.input = NULL;
+   key_len = png_check_keyword(png_ptr, key, new_key);
 
-   if ((key_len = png_check_keyword(png_ptr, key, &new_key)) == 0)
-      return;
+   if (key_len == 0)
+      png_error(png_ptr, "iTXt: invalid keyword");
 
-   if ((lang_len = png_check_keyword(png_ptr, lang, &new_lang)) == 0)
+   /* Set the compression flag */
+   switch (compression)
    {
-      png_warning(png_ptr, "Empty language field in iTXt chunk");
-      new_lang = NULL;
-      lang_len = 0;
-   }
-
-   if (lang_key == NULL)
-      lang_key_len = 0;
-
-   else
-      lang_key_len = png_strlen(lang_key);
-
-   if (text == NULL)
-      text_len = 0;
-
-   else
-      text_len = png_strlen(text);
-
-   /* Compute the compressed data; do it now for the length */
-   text_len = png_text_compress(png_ptr, text, text_len, compression - 2,
-       &comp);
+      case PNG_ITXT_COMPRESSION_NONE:
+      case PNG_TEXT_COMPRESSION_NONE:
+         compression = new_key[++key_len] = 0; /* no compression */
+         break;
 
+      case PNG_TEXT_COMPRESSION_zTXt:
+      case PNG_ITXT_COMPRESSION_zTXt:
+         compression = new_key[++key_len] = 1; /* compressed */
+         break;
 
-   /* Make sure we include the compression flag, the compression byte,
-    * and the NULs after the key, lang, and lang_key parts
-    */
+      default:
+         png_error(png_ptr, "iTXt: invalid compression");
+   }
 
-   png_write_chunk_header(png_ptr, png_iTXt, (png_uint_32)(
-        5 /* comp byte, comp flag, terminators for key, lang and lang_key */
-        + key_len
-        + lang_len
-        + lang_key_len
-        + text_len));
+   new_key[++key_len] = PNG_COMPRESSION_TYPE_BASE;
+   ++key_len; /* for the keywod separator */
 
    /* We leave it to the application to meet PNG-1.0 requirements on the
     * contents of the text.  PNG-1.0 through PNG-1.2 discourage the use of
-    * any non-Latin-1 characters except for NEWLINE.  ISO PNG will forbid them.
+    * any non-Latin-1 characters except for NEWLINE.  ISO PNG, however,
+    * specifies that the text is UTF-8 and this really doesn't require any
+    * checking.
+    *
     * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.
+    *
+    * TODO: validate the language tag correctly (see the spec.)
     */
-   png_write_chunk_data(png_ptr, (png_bytep)new_key, (png_size_t)(key_len + 1));
+   if (lang == NULL) lang = ""; /* empty language is valid */
+   lang_len = strlen(lang)+1;
+   if (lang_key == NULL) lang_key = ""; /* may be empty */
+   lang_key_len = strlen(lang_key)+1;
+   if (text == NULL) text = ""; /* may be empty */
+
+   prefix_len = key_len;
+   if (lang_len > PNG_UINT_31_MAX-prefix_len)
+      prefix_len = PNG_UINT_31_MAX;
+   else
+      prefix_len = (png_uint_32)(prefix_len + lang_len);
 
-   /* Set the compression flag */
-   if (compression == PNG_ITXT_COMPRESSION_NONE ||
-       compression == PNG_TEXT_COMPRESSION_NONE)
-      cbuf[0] = 0;
+   if (lang_key_len > PNG_UINT_31_MAX-prefix_len)
+      prefix_len = PNG_UINT_31_MAX;
+   else
+      prefix_len = (png_uint_32)(prefix_len + lang_key_len);
 
-   else /* compression == PNG_ITXT_COMPRESSION_zTXt */
-      cbuf[0] = 1;
+   png_text_compress_init(&comp, (png_const_bytep)text, strlen(text));
 
-   /* Set the compression method */
-   cbuf[1] = 0;
+   if (compression)
+   {
+      if (png_text_compress(png_ptr, png_iTXt, &comp, prefix_len) != Z_OK)
+         png_error(png_ptr, png_ptr->zstream.msg);
+   }
 
-   png_write_chunk_data(png_ptr, cbuf, (png_size_t)2);
+   else
+   {
+      if (comp.input_len > PNG_UINT_31_MAX-prefix_len)
+         png_error(png_ptr, "iTXt: uncompressed text too long");
+   }
 
-   cbuf[0] = 0;
-   png_write_chunk_data(png_ptr, (new_lang ? (png_const_bytep)new_lang : cbuf),
-       (png_size_t)(lang_len + 1));
+   png_write_chunk_header(png_ptr, png_iTXt, comp.output_len + prefix_len);
 
-   png_write_chunk_data(png_ptr, (lang_key ? (png_const_bytep)lang_key : cbuf),
-       (png_size_t)(lang_key_len + 1));
+   png_write_chunk_data(png_ptr, new_key, key_len);
 
-   png_write_compressed_data_out(png_ptr, &comp, text_len);
+   png_write_chunk_data(png_ptr, (png_const_bytep)lang, lang_len);
 
-   png_write_chunk_end(png_ptr);
+   png_write_chunk_data(png_ptr, (png_const_bytep)lang_key, lang_key_len);
+
+   if (compression)
+      png_write_compressed_data_out(png_ptr, &comp);
+
+   else
+      png_write_chunk_data(png_ptr, (png_const_bytep)text, comp.input_len);
 
-   png_free(png_ptr, new_key);
-   png_free(png_ptr, new_lang);
+   png_write_chunk_end(png_ptr);
 }
 #endif
 
 #ifdef PNG_WRITE_oFFs_SUPPORTED
 /* Write the oFFs chunk */
 void /* PRIVATE */
-png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
+png_write_oFFs(png_structrp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
     int unit_type)
 {
    png_byte buf[9];
@@ -1856,36 +1787,43 @@ png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
 #ifdef PNG_WRITE_pCAL_SUPPORTED
 /* Write the pCAL chunk (described in the PNG extensions document) */
 void /* PRIVATE */
-png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
+png_write_pCAL(png_structrp png_ptr, png_charp purpose, png_int_32 X0,
     png_int_32 X1, int type, int nparams, png_const_charp units,
     png_charpp params)
 {
-   png_size_t purpose_len, units_len, total_len;
+   png_uint_32 purpose_len;
+   png_size_t units_len, total_len;
    png_size_tp params_len;
    png_byte buf[10];
-   png_charp new_purpose;
+   png_byte new_purpose[80];
    int i;
 
    png_debug1(1, "in png_write_pCAL (%d parameters)", nparams);
 
    if (type >= PNG_EQUATION_LAST)
-      png_warning(png_ptr, "Unrecognized equation type for pCAL chunk");
+      png_error(png_ptr, "Unrecognized equation type for pCAL chunk");
+
+   purpose_len = png_check_keyword(png_ptr, purpose, new_purpose);
+
+   if (purpose_len == 0)
+      png_error(png_ptr, "pCAL: invalid keyword");
+
+   ++purpose_len; /* terminator */
 
-   purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1;
    png_debug1(3, "pCAL purpose length = %d", (int)purpose_len);
-   units_len = png_strlen(units) + (nparams == 0 ? 0 : 1);
+   units_len = strlen(units) + (nparams == 0 ? 0 : 1);
    png_debug1(3, "pCAL units length = %d", (int)units_len);
    total_len = purpose_len + units_len + 10;
 
    params_len = (png_size_tp)png_malloc(png_ptr,
-       (png_alloc_size_t)(nparams * png_sizeof(png_size_t)));
+       (png_alloc_size_t)(nparams * (sizeof (png_size_t))));
 
    /* Find the length of each parameter, making sure we don't count the
     * null terminator for the last parameter.
     */
    for (i = 0; i < nparams; i++)
    {
-      params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1);
+      params_len[i] = strlen(params[i]) + (i == nparams - 1 ? 0 : 1);
       png_debug2(3, "pCAL parameter %d length = %lu", i,
           (unsigned long)params_len[i]);
       total_len += params_len[i];
@@ -1893,7 +1831,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
 
    png_debug1(3, "pCAL total length = %d", (int)total_len);
    png_write_chunk_header(png_ptr, png_pCAL, (png_uint_32)total_len);
-   png_write_chunk_data(png_ptr, (png_const_bytep)new_purpose, purpose_len);
+   png_write_chunk_data(png_ptr, new_purpose, purpose_len);
    png_save_int_32(buf, X0);
    png_save_int_32(buf + 4, X1);
    buf[8] = (png_byte)type;
@@ -1901,8 +1839,6 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
    png_write_chunk_data(png_ptr, buf, (png_size_t)10);
    png_write_chunk_data(png_ptr, (png_const_bytep)units, (png_size_t)units_len);
 
-   png_free(png_ptr, new_purpose);
-
    for (i = 0; i < nparams; i++)
    {
       png_write_chunk_data(png_ptr, (png_const_bytep)params[i], params_len[i]);
@@ -1916,7 +1852,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
 #ifdef PNG_WRITE_sCAL_SUPPORTED
 /* Write the sCAL chunk */
 void /* PRIVATE */
-png_write_sCAL_s(png_structp png_ptr, int unit, png_const_charp width,
+png_write_sCAL_s(png_structrp png_ptr, int unit, png_const_charp width,
     png_const_charp height)
 {
    png_byte buf[64];
@@ -1924,8 +1860,8 @@ png_write_sCAL_s(png_structp png_ptr, int unit, png_const_charp width,
 
    png_debug(1, "in png_write_sCAL_s");
 
-   wlen = png_strlen(width);
-   hlen = png_strlen(height);
+   wlen = strlen(width);
+   hlen = strlen(height);
    total_len = wlen + hlen + 2;
 
    if (total_len > 64)
@@ -1935,8 +1871,8 @@ png_write_sCAL_s(png_structp png_ptr, int unit, png_const_charp width,
    }
 
    buf[0] = (png_byte)unit;
-   png_memcpy(buf + 1, width, wlen + 1);      /* Append the '\0' here */
-   png_memcpy(buf + wlen + 2, height, hlen);  /* Do NOT append the '\0' here */
+   memcpy(buf + 1, width, wlen + 1);      /* Append the '\0' here */
+   memcpy(buf + wlen + 2, height, hlen);  /* Do NOT append the '\0' here */
 
    png_debug1(3, "sCAL total length = %u", (unsigned int)total_len);
    png_write_complete_chunk(png_ptr, png_sCAL, buf, total_len);
@@ -1946,7 +1882,7 @@ png_write_sCAL_s(png_structp png_ptr, int unit, png_const_charp width,
 #ifdef PNG_WRITE_pHYs_SUPPORTED
 /* Write the pHYs chunk */
 void /* PRIVATE */
-png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit,
+png_write_pHYs(png_structrp png_ptr, png_uint_32 x_pixels_per_unit,
     png_uint_32 y_pixels_per_unit,
     int unit_type)
 {
@@ -1970,7 +1906,7 @@ png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit,
  * or png_convert_from_time_t(), or fill in the structure yourself.
  */
 void /* PRIVATE */
-png_write_tIME(png_structp png_ptr, png_const_timep mod_time)
+png_write_tIME(png_structrp png_ptr, png_const_timep mod_time)
 {
    png_byte buf[7];
 
@@ -1997,7 +1933,7 @@ png_write_tIME(png_structp png_ptr, png_const_timep mod_time)
 
 /* Initializes the row writing capability of libpng */
 void /* PRIVATE */
-png_write_start_row(png_structp png_ptr)
+png_write_start_row(png_structrp png_ptr)
 {
 #ifdef PNG_WRITE_INTERLACING_SUPPORTED
    /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
@@ -2099,15 +2035,11 @@ png_write_start_row(png_structp png_ptr)
       png_ptr->num_rows = png_ptr->height;
       png_ptr->usr_width = png_ptr->width;
    }
-
-   png_zlib_claim(png_ptr, PNG_ZLIB_FOR_IDAT);
-   png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
-   png_ptr->zstream.next_out = png_ptr->zbuf;
 }
 
 /* Internal use only.  Called when finished processing a row of data. */
 void /* PRIVATE */
-png_write_finish_row(png_structp png_ptr)
+png_write_finish_row(png_structrp png_ptr)
 {
 #ifdef PNG_WRITE_INTERLACING_SUPPORTED
    /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
@@ -2125,8 +2057,6 @@ png_write_finish_row(png_structp png_ptr)
    static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
 #endif
 
-   int ret;
-
    png_debug(1, "in png_write_finish_row");
 
    /* Next row */
@@ -2177,7 +2107,7 @@ png_write_finish_row(png_structp png_ptr)
       if (png_ptr->pass < 7)
       {
          if (png_ptr->prev_row != NULL)
-            png_memset(png_ptr->prev_row, 0,
+            memset(png_ptr->prev_row, 0,
                 (png_size_t)(PNG_ROWBYTES(png_ptr->usr_channels*
                 png_ptr->usr_bit_depth, png_ptr->width)) + 1);
 
@@ -2188,42 +2118,7 @@ png_write_finish_row(png_structp png_ptr)
 
    /* If we get here, we've just written the last row, so we need
       to flush the compressor */
-   do
-   {
-      /* Tell the compressor we are done */
-      ret = deflate(&png_ptr->zstream, Z_FINISH);
-
-      /* Check for an error */
-      if (ret == Z_OK)
-      {
-         /* Check to see if we need more room */
-         if (!(png_ptr->zstream.avail_out))
-         {
-            png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
-            png_ptr->zstream.next_out = png_ptr->zbuf;
-            png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
-         }
-      }
-
-      else if (ret != Z_STREAM_END)
-      {
-         if (png_ptr->zstream.msg != NULL)
-            png_error(png_ptr, png_ptr->zstream.msg);
-
-         else
-            png_error(png_ptr, "zlib error");
-      }
-   } while (ret != Z_STREAM_END);
-
-   /* Write any extra space */
-   if (png_ptr->zstream.avail_out < png_ptr->zbuf_size)
-   {
-      png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size -
-          png_ptr->zstream.avail_out);
-   }
-
-   png_zlib_release(png_ptr);
-   png_ptr->zstream.data_type = Z_BINARY;
+   png_compress_IDAT(png_ptr, NULL, 0, Z_FINISH);
 }
 
 #ifdef PNG_WRITE_INTERLACING_SUPPORTED
@@ -2387,7 +2282,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
 
                /* Move the pixel */
                if (dp != sp)
-                  png_memcpy(dp, sp, pixel_bytes);
+                  memcpy(dp, sp, pixel_bytes);
 
                /* Next pixel */
                dp += pixel_bytes;
@@ -2411,7 +2306,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
  * been specified by the application, and then writes the row out with the
  * chosen filter.
  */
-static void png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row,
+static void png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
    png_size_t row_bytes);
 
 #define PNG_MAXSUM (((png_uint_32)(-1)) >> 1)
@@ -2419,7 +2314,7 @@ static void png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row,
 #define PNG_LOMASK ((png_uint_32)0xffffL)
 #define PNG_HIMASK ((png_uint_32)(~PNG_LOMASK >> PNG_HISHIFT))
 void /* PRIVATE */
-png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
+png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
 {
    png_bytep best_row;
 #ifdef PNG_WRITE_FILTER_SUPPORTED
@@ -3090,66 +2985,14 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
 
 /* Do the actual writing of a previously filtered row. */
 static void
-png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row,
-   png_size_t avail/*includes filter byte*/)
+png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
+   png_size_t full_row_length/*includes filter byte*/)
 {
    png_debug(1, "in png_write_filtered_row");
 
    png_debug1(2, "filter = %d", filtered_row[0]);
-   /* Set up the zlib input buffer */
-
-   png_ptr->zstream.next_in = filtered_row;
-   png_ptr->zstream.avail_in = 0;
-   /* Repeat until we have compressed all the data */
-   do
-   {
-      int ret; /* Return of zlib */
-
-      /* Record the number of bytes available - zlib supports at least 65535
-       * bytes at one step, depending on the size of the zlib type 'uInt', the
-       * maximum size zlib can write at once is ZLIB_IO_MAX (from pngpriv.h).
-       * Use this because on 16 bit systems 'rowbytes' can be up to 65536 (i.e.
-       * one more than 16 bits) and, in this case 'rowbytes+1' can overflow a
-       * uInt.  ZLIB_IO_MAX can be safely reduced to cause zlib to be called
-       * with smaller chunks of data.
-       */
-      if (png_ptr->zstream.avail_in == 0)
-      {
-         if (avail > ZLIB_IO_MAX)
-         {
-            png_ptr->zstream.avail_in  = ZLIB_IO_MAX;
-            avail -= ZLIB_IO_MAX;
-         }
-
-         else
-         {
-            /* So this will fit in the available uInt space: */
-            png_ptr->zstream.avail_in = (uInt)avail;
-            avail = 0;
-         }
-      }
-
-      /* Compress the data */
-      ret = deflate(&png_ptr->zstream, Z_NO_FLUSH);
 
-      /* Check for compression errors */
-      if (ret != Z_OK)
-      {
-         if (png_ptr->zstream.msg != NULL)
-            png_error(png_ptr, png_ptr->zstream.msg);
-
-         else
-            png_error(png_ptr, "zlib error");
-      }
-
-      /* See if it is time to write another IDAT */
-      if (!(png_ptr->zstream.avail_out))
-      {
-         /* Write the IDAT and reset the zlib output buffer */
-         png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
-      }
-   /* Repeat until all data has been compressed */
-   } while (avail > 0 || png_ptr->zstream.avail_in > 0);
+   png_compress_IDAT(png_ptr, filtered_row, full_row_length, Z_NO_FLUSH);
 
    /* Swap the current and previous rows */
    if (png_ptr->prev_row != NULL)
index 7cdaa29b76eb9dc3ceed052c40f2f29744930e23..907292fedc1f2ff0f8e1406dcb8afca5d7cc6d86 100644 (file)
@@ -1,9 +1,9 @@
 
-Makefiles for  libpng version 1.5.14 - January 24, 2013
+Makefiles for  libpng version 1.6.0 - February 14, 2013
 
 pnglibconf.h.prebuilt       =>  Stores configuration settings
  makefile.linux    =>  Linux/ELF makefile
-                       (gcc, creates libpng15.so.15.1.5.14)
+                       (gcc, creates libpng16.so.16.1.6.0)
  makefile.gcc      =>  Generic makefile (gcc, creates static libpng.a)
  makefile.knr      =>  Archaic UNIX Makefile that converts files with
                        ansi2knr (Requires ansi2knr.c from
@@ -15,13 +15,12 @@ pnglibconf.h.prebuilt       =>  Stores configuration settings
  makefile.bc32     =>  32-bit Borland C++ (all modules compiled in C mode)
  makefile.beos     =>  beos makefile
  makefile.bor      =>  Borland makefile (uses bcc)
- makefile.cegcc    =>  minge32ce for Windows CE makefile (only included in the
-                       tar distributions, because it depends on "configure")
+ makefile.cegcc    =>  minge32ce for Windows CE makefile
  makefile.darwin   =>  Darwin makefile, can use on MacosX
  makefile.dec      =>  DEC Alpha UNIX makefile
  makefile.dj2      =>  DJGPP 2 makefile
  makefile.elf      =>  Linux/ELF makefile symbol versioning,
-                       (gcc, creates libpng15.so.15.1.5.14)
+                       (gcc, creates libpng16.so.16.1.6.0)
  makefile.freebsd  =>  FreeBSD makefile
  makefile.gcc      =>  Generic gcc makefile
  makefile.hpgcc    =>  HPUX makefile using gcc
@@ -36,12 +35,12 @@ pnglibconf.h.prebuilt       =>  Stores configuration settings
  makefile.os2      =>  OS/2 Makefile (gcc and emx, requires libpng.def)
  makefile.sco      =>  For SCO OSr5  ELF and Unixware 7 with Native cc
  makefile.sggcc    =>  Silicon Graphics (gcc,
-                       creates libpng15.so.15.1.5.14)
+                       creates libpng16.so.16.1.6.0)
  makefile.sgi      =>  Silicon Graphics IRIX makefile (cc, creates static lib)
  makefile.solaris  =>  Solaris 2.X makefile (gcc,
-                       creates libpng15.so.15.1.5.14)
+                       creates libpng16.so.16.1.6.0)
  makefile.so9      =>  Solaris 9 makefile (gcc,
-                       creates libpng15.so.15.1.5.14)
+                       creates libpng16.so.16.1.6.0)
  makefile.std      =>  Generic UNIX makefile (cc, creates static libpng.a)
  makefile.sunos    =>  Sun makefile
  makefile.32sunu   =>  Sun Ultra 32-bit makefile
@@ -58,20 +57,30 @@ Other supporting scripts:
  libpng-config-body.in => used by several makefiles to create libpng-config
  libpng-config-head.in => used by several makefiles to create libpng-config
  libpng.pc.in      =>  Used by several makefiles to create libpng.pc
- pngwin.rc         =>  Used by the visualc71 and vstudio projects.
+ pngwin.rc         =>  Used by the visualc71 project.
  pngwin.def        =>  Used by makefile.os2
  pngwin.dfn        =>  Used to maintain pngwin.def
  SCOPTIONS.ppc     =>  Used with smakefile.ppc
 
-checksym.awk       =>  Used for maintaining pnglibconf.h
-def.dfn            =>  Used for maintaining pnglibconf.h
-options.awk        =>  Used for maintaining pnglibconf.h
-pnglibconf.dfa     =>  Used for maintaining pnglibconf.h
-pnglibconf.mak     =>  Used for maintaining pnglibconf.h
-sym.dfn            =>  Used for symbol versioning
-symbols.def        =>  Used for symbol versioning
-symbols.dfn        =>  Used for symbol versioning
-vers.dfn           =>  Used for symbol versioning
+ checksym.awk       =>  Used for maintaining pnglibconf.h
+ def.dfn            =>  Used for maintaining pnglibconf.h
+ options.awk        =>  Used for maintaining pnglibconf.h
+ pnglibconf.dfa     =>  Used for maintaining pnglibconf.h
+ pnglibconf.mak     =>  Used for maintaining pnglibconf.h
+ sym.dfn            =>  Used for symbol versioning
+ symbols.def        =>  Used for symbol versioning
+ symbols.dfn        =>  Used for symbol versioning
+ vers.dfn           =>  Used for symbol versioning
+
+ libtool.m4        =>  Used by autoconf tools
+ ltoptions.m4      =>  Used by autoconf tools
+ ltsugar.m4        =>  Used by autoconf tools
+ ltversion.m4      =>  Used by autoconf tools
+ lt~obsolete.m4    =>  Used by autoconf tools
+
+ intprefix.dfn     =>  Used by autoconf tools
+ macro.lst         =>  Used by autoconf tools
+ prefix.dfn        =>  Used by autoconf tools
 
 
 Further information can be found in comments in the individual makefiles.
index ba4c99b564d7e94cab08d2ac9c26eac49322799e..6857dff1c9202d7361e3d9543da94999f962a57b 100755 (executable)
@@ -5,8 +5,9 @@
 # awk -f checksym.awk official-def list-to-check
 #
 # Output is a file in the current directory called 'symbols.new',
-# stdout holds error messages.  Error code indicates success or
-# failure.
+# the value of the awk variable "of" (which can be changed on the
+# command line if required.)  stdout holds error messages.  Error
+# code indicates success or failure.
 #
 # NOTE: this is a pure, old fashioned, awk script.  It will
 # work with any awk
@@ -21,6 +22,7 @@ BEGIN{
    mastero = 0      # highest ordinal in master file
    symbolo = 0      # highest ordinal in png.h
    missing = "error"# log an error on missing symbols
+   of="symbols.new" # default to a fixed name
 }
 
 # Read existing definitions from the master file (the first
@@ -151,11 +153,11 @@ END{
 
       # Finally generate symbols.new
       if (symbol[o] != "")
-         print " " symbol[o], "@" o > "symbols.new"
+         print " " symbol[o], "@" o > of
    }
 
    if (err != 0) {
-      print "*** A new list is in symbols.new ***"
+      print "*** A new list is in", of, "***"
       exit 1
    }
 }
index f9918631dec2f514893c9d18e1ecf6cbf346418c..cac3cd8566965b4f3c93f28ca1bd3ad8700fa385 100644 (file)
@@ -25,7 +25,7 @@ S-OS2 DESCRIPTION "PNG image compression library"-E
 S-OS2 CODE PRELOAD MOVEABLE DISCARDABLE-E
 S--E
 S-EXPORTS-E
-S-;Version 1.5.0beta58-E
+S-;Version 1.6.0-E
 
 /* NOTE: PNG_JOIN is interpreted by the calling script as a signal to
  * join the two things on either side, so we can do symbol
index 99ea1abccd161799e244162d9278bb77ca3b0ae0..eb9a80713152fca658c1984ca56dd140c1feacc7 100644 (file)
@@ -33,20 +33,20 @@ clean :
 
 
 # Other dependencies.
-png.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngpread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngset.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngget.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngrtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngrutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngerror.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngmem.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngrio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngwio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngtrans.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngwrite.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngwtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
-pngwutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
+png.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngpread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngset.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngget.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngrtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngrutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngerror.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngmem.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngrio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngwio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngtrans.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngwrite.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngwtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
+pngwutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,             pnginfo.h, pngdebug.h
 
 pngtest.obj : png.h, pngconf.h
diff --git a/l4/pkg/libpng/lib/dist/scripts/intprefix.dfn b/l4/pkg/libpng/lib/dist/scripts/intprefix.dfn
new file mode 100644 (file)
index 0000000..d48d540
--- /dev/null
@@ -0,0 +1,19 @@
+
+/* intprefix.dfn - generate an unprefixed internal symbol list
+ *
+ * Last changed in libpng version 1.6.0 [January 30, 2012]
+ * Copyright (c) 2012 Glenn Randers-Pehrson
+ *
+ * This code is released under the libpng license.
+ * For conditions of distribution and use, see the disclaimer
+ * and license in png.h
+ */
+
+#define PNG_INTERNAL_DATA(type, name, array)\
+       PNG_DEFN_MAGIC-name-PNG_DEFN_END
+
+#define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\
+       PNG_DEFN_MAGIC-name-PNG_DEFN_END
+
+#define PNGPREFIX_H /* self generation */
+#include "../pngpriv.h"
index 8dacda2b2ef43066707c9bcf3d85bddfa7742870..02d74009be12093f8c3c834a1b2e545b09d51d53 100755 (executable)
@@ -11,7 +11,7 @@
 
 # Modeled after libxml-config.
 
-version=1.5.14
+version=1.6.0
 prefix=""
 libdir=""
 libs=""
index ca0510675d4bf62afb4cb29771f9ebccfe7cb059..367b38c9fa94379ac3525349c5291abc8a14d529 100644 (file)
@@ -1,10 +1,10 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
-includedir=@includedir@/libpng15
+includedir=@includedir@/libpng16
 
 Name: libpng
 Description: Loads and saves PNG files
-Version: 1.5.14
-Libs: -L${libdir} -lpng15
+Version: 1.6.0
+Libs: -L${libdir} -lpng16
 Cflags: -I${includedir}
diff --git a/l4/pkg/libpng/lib/dist/scripts/libtool.m4 b/l4/pkg/libpng/lib/dist/scripts/libtool.m4
new file mode 100644 (file)
index 0000000..44e0ecf
--- /dev/null
@@ -0,0 +1,7982 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+                  [m4_fatal([Libtool version $1 or higher is required],
+                            63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\    *)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+       [m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+       [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+       [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+          m4_quote(lt_decl_varnames),
+       m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+                       lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+                                          [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+       dnl If the libtool generation code has been placed in $CONFIG_LT,
+       dnl instead of duplicating it all over again into config.status,
+       dnl then we will have config.status run $CONFIG_LT later, so it
+       dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_REPLACE_SHELLFNS
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],                 [_LT_LANG(C)],
+  [C++],               [_LT_LANG(CXX)],
+  [Go],                        [_LT_LANG(GO)],
+  [Java],              [_LT_LANG(GCJ)],
+  [Fortran 77],                [_LT_LANG(F77)],
+  [Fortran],           [_LT_LANG(FC)],
+  [Windows Resource],  [_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC],     [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+  fi
+fi
+if test -z "$GOC"; then
+  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+       [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+       [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+       [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+  [LT_LANG(GO)],
+  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       # If there is a non-empty error log, and "single_module"
+       # appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+         cat conftest.err >&AS_MESSAGE_LOG_FD
+       # Otherwise, if the output was created with a 0 exit code from
+       # the compiler, it worked.
+       elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+         lt_cv_apple_cc_single_mod=yes
+       else
+         cat conftest.err >&AS_MESSAGE_LOG_FD
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi])
+
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+       [lt_cv_ld_exported_symbols_list=yes],
+       [lt_cv_ld_exported_symbols_list=no])
+       LDFLAGS="$save_LDFLAGS"
+    ])
+
+    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+      [lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+       cat conftest.err >&AS_MESSAGE_LOG_FD
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+       lt_cv_ld_force_load=yes
+      else
+       cat conftest.err >&AS_MESSAGE_LOG_FD
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[[012]]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+  else
+    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+  lt_aix_libpath_sed='[
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }]'
+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi],[])
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+  fi
+  ])
+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*" 
+}
+
+case "$ECHO" in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[  --with-sysroot[=DIR] Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted.  We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_ERROR([The sysroot must be an absolute path.])
+   ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_i386"
+           ;;
+         ppc64-*linux*|powerpc64-*linux*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         ppc*-*linux*|powerpc*-*linux*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
+      *)
+       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+         LD="${LD-ld} -64"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+     [echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([lt_ar_try])
+      if test "$ac_status" -eq 0; then
+       # Ensure the archiver fails upon bogus file names.
+       rm -f conftest.$ac_objext libconftest.a
+       AC_TRY_EVAL([lt_ar_try])
+       if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[        ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+         [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+       [AC_CHECK_FUNC([dlopen],
+             [lt_cv_dlopen="dlopen"],
+         [AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+           [AC_CHECK_LIB([svld], [dlopen],
+                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+             [AC_CHECK_LIB([dld], [dld_link],
+                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+             ])
+           ])
+         ])
+       ])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+         lt_cv_dlopen_self, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+         lt_cv_dlopen_self_static, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+        [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+        [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+        [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+       [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+       [], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[23]].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux # correct to gnu/linux during the next big refactor
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+        LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+        [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+        [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+    [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+    [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+       [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[    ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT@&t@_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_globsym_save_LIBS=$LIBS
+         lt_globsym_save_CFLAGS=$CFLAGS
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+         if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS=$lt_globsym_save_LIBS
+         CFLAGS=$lt_globsym_save_CFLAGS
+       else
+         echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+    [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       else
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+       # This hack is so that the source file can tell whether it is being
+       # built for inclusion in a dll (and should export symbols for example).
+       m4_if([$1], [GCJ], [],
+         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           if test "$host_cpu" != ia64; then
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+           fi
+           ;;
+         aCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      interix*)
+       # This is c89, which is MS Visual C++ (no shared libs)
+       # Anyone wants to do a port?
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         ecpc* )
+           # old Intel C++ for x86_64 which still supported -KPIC.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         icpc* )
+           # Intel C++, used to be incompatible with GCC.
+           # ICC 10 doesn't accept -KPIC any more.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         pgCC* | pgcpp*)
+           # Portland Group C++ compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         cxx*)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+           # IBM XL 8.0, 9.0 on PPC and BlueGene
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      vxworks*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+       ;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+       ;;
+      nagfor*)
+       # NAG Fortran compiler
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+         ;;
+       *Sun\ F* | *Sun*Fortran*)
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+        *Intel*\ [[CF]]*Compiler*)
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+         ;;
+       *Portland\ Group*)
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+       [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+       [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+       [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    cl*)
+      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+      ;;
+    esac
+    ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # 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.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+         *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=' $pic_flag'
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         _LT_TAGVAR(whole_archive_flag_spec, $1)=
+         tmp_sharedflag='--shared' ;;
+       xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+         if test "x$supports_anon_versioning" = xyes; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&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.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       _LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[[012]]|aix4.[[012]].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         _LT_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+         _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+         fi
+         _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+       # Native MSVC
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       _LT_TAGVAR(always_export_symbols, $1)=yes
+       _LT_TAGVAR(file_list_spec, $1)='@'
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+         else
+           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+         fi~
+         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+         linknames='
+       # The linker will not automatically build a static lib if we build a DLL.
+       # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+       _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+       # Don't use ranlib
+       _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+       _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+         lt_tool_outputfile="@TOOL_OUTPUT@"~
+         case $lt_outputfile in
+           *.exe|*.EXE) ;;
+           *)
+             lt_outputfile="$lt_outputfile.exe"
+             lt_tool_outputfile="$lt_tool_outputfile.exe"
+             ;;
+         esac~
+         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+           $RM "$lt_outputfile.manifest";
+         fi'
+       ;;
+      *)
+       # Assume MSVC wrapper
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+       # The linker will automatically build a .lib file if we build a DLL.
+       _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+       # FIXME: Should let the user specify the lib program.
+       _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       ;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+       m4_if($1, [], [
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         _LT_LINKER_OPTION([if $CC understands -b],
+           _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+           [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+         [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_TAGVAR(hardcode_direct, $1)=no
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         ;;
+       *)
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+       # This should be the same for all languages, so no per-tag cache variable.
+       AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+         [lt_cv_irix_exported_symbol],
+         [save_LDFLAGS="$LDFLAGS"
+          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+          AC_LINK_IFELSE(
+            [AC_LANG_SOURCE(
+               [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+                             [C++], [[int foo (void) { return 0; }]],
+                             [Fortran 77], [[
+      subroutine foo
+      end]],
+                             [Fortran], [[
+      subroutine foo
+      end]])])],
+             [lt_cv_irix_exported_symbol=yes],
+             [lt_cv_irix_exported_symbol=no])
+           LDFLAGS="$save_LDFLAGS"])
+       if test "$lt_cv_irix_exported_symbol" = yes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+       fi
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       else
+         case $host_os in
+          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+            _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+            ;;
+          *)
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+         _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+       motorola)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       _LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+       [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+       [$RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+         pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+         _LT_TAGVAR(allow_undefined_flag, $1)=
+         if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+         then
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+         else
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         fi
+         _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+       ])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+         $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+           for ld_flag in $LDFLAGS; do
+             case $ld_flag in
+             *-brtl*)
+               aix_use_runtimelinking=yes
+               break
+               ;;
+             esac
+           done
+           ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+           # We have reworked collect2
+           :
+         else
+           # We have old collect2
+           _LT_TAGVAR(hardcode_direct, $1)=unsupported
+           # It fails to find uninstalled libraries when the uninstalled
+           # path is not listed in the libpath.  Setting hardcode_minus_L
+           # to unsupported forces relinking
+           _LT_TAGVAR(hardcode_minus_L, $1)=yes
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+          esac
+          shared_flag='-shared'
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag="$shared_flag "'${wl}-G'
+         fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+         # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+          else
+           if test "$aix_use_runtimelinking" = yes; then
+             shared_flag='${wl}-G'
+           else
+             shared_flag='${wl}-bM:SRE'
+           fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+       # export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX([$1])
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+           _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+           # Determine the default libpath from the value encoded in an
+           # empty executable.
+           _LT_SYS_MODULE_PATH_AIX([$1])
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+           # Warning - without using the other run time loading flags,
+           # -berok will link without error, but may produce a broken library.
+           _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+           _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+           if test "$with_gnu_ld" = yes; then
+             # We only use this code for GNU lds that support --whole-archive.
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           else
+             # Exported symbols can be pulled into shared objects from archives
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+           fi
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+           # This is similar to how AIX traditionally builds its shared
+           # libraries.
+           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+         # support --undefined.  This deserves some investigation.  FIXME
+         _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+         # FIXME: insert proper C++ library support
+         _LT_TAGVAR(ld_shlibs, $1)=no
+         ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+       case $GXX,$cc_basename in
+       ,cl* | no,cl*)
+         # Native MSVC
+         # hardcode_libdir_flag_spec is actually meaningless, as there is
+         # no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=yes
+         _LT_TAGVAR(file_list_spec, $1)='@'
+         # Tell ltmain to make .lib files, not .a files.
+         libext=lib
+         # Tell ltmain to make .dll files, not .so files.
+         shrext_cmds=".dll"
+         # FIXME: Setting linknames here is a bad hack.
+         _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+             $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+           else
+             $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+           fi~
+           $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+           linknames='
+         # The linker will not automatically build a static lib if we build a DLL.
+         # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+         # Don't use ranlib
+         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+           lt_tool_outputfile="@TOOL_OUTPUT@"~
+           case $lt_outputfile in
+             *.exe|*.EXE) ;;
+             *)
+               lt_outputfile="$lt_outputfile.exe"
+               lt_tool_outputfile="$lt_tool_outputfile.exe"
+               ;;
+           esac~
+           func_to_tool_file "$lt_outputfile"~
+           if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+             $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+             $RM "$lt_outputfile.manifest";
+           fi'
+         ;;
+       *)
+         # g++
+         # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+         # as there is no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=no
+         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+         if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+           # If the export-symbols file already is a .def file (1st line
+           # is EXPORTS), use it as is; otherwise, prepend...
+           _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+             cp $export_symbols $output_objdir/$soname.def;
+           else
+             echo EXPORTS > $output_objdir/$soname.def;
+             cat $export_symbols >> $output_objdir/$soname.def;
+           fi~
+           $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+         ;;
+       esac
+       ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+       ;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          ghcx*)
+           # Green Hills C++ Compiler
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      freebsd2.*)
+        # C++ shared libraries reported to be fairly broken before
+       # switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                            # but as the default
+                                            # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                                # but as the default
+                                                # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          aCC*)
+           case $host_cpu in
+             hppa*64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             ia64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             *)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+           esac
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test $with_gnu_ld = no; then
+               case $host_cpu in
+                 hppa*64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 ia64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 *)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+               esac
+             fi
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+       _LT_TAGVAR(hardcode_direct, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+       # Instead, shared libraries are loaded at an image base (0x10000000 by
+       # default) and relocated if they conflict, which is a slow very memory
+       # consuming and fragmenting process.  To avoid this, we pick a random,
+       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       ;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+           # SGI C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+           # Archives containing C++ object files must be created using
+           # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test "$with_gnu_ld" = no; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+             else
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+             fi
+           fi
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+           ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+           # Archives containing C++ object files must be created using
+           # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+           ;;
+         icpc* | ecpc* )
+           # Intel C++
+           with_gnu_ld=yes
+           # version 8.0 and above of icpc choke on multiply defined symbols
+           # if we add $predep_objects and $postdep_objects, however 7.1 and
+           # earlier do not add the objects themselves.
+           case `$CC -V 2>&1` in
+             *"Version 7."*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+             *)  # Version 8.0 or newer
+               tmp_idyn=
+               case $host_cpu in
+                 ia64*) tmp_idyn=' -i_dynamic';;
+               esac
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+           esac
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+           case `$CC -V` in
+           *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+             _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+             _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+               $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+               $RANLIB $oldlib'
+             _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           *) # Version 6 and above use weak symbols
+             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+         cxx*)
+           # Compaq C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+           runpath_var=LD_RUN_PATH
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+           ;;
+         xl* | mpixl* | bgxl*)
+           # IBM XL 8.0 on PPC, with GNU ld
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           if test "x$supports_anon_versioning" = xyes; then
+             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+               echo "local: *; };" >> $output_objdir/$libname.ver~
+               $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+           fi
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+             _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+             _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+             # Not sure whether something based on
+             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+             # would be better.
+             output_verbose_link_cmd='func_echo_all'
+
+             # Archives containing C++ object files must be created using
+             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+             # necessary to make sure instantiated templates are included
+             # in the archive.
+             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+         *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+       esac
+       ;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+         wlarc=
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       fi
+       # Workaround some broken pre-1.5 toolchains
+       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+       ;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+       ;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      openbsd*)
+       if test -f /usr/libexec/ld.so; then
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+         if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+         fi
+         output_verbose_link_cmd=func_echo_all
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Archives containing C++ object files must be created using
+           # the KAI C++ compiler.
+           case $host in
+             osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+             *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+           esac
+           ;;
+          RCC*)
+           # Rational C++ 2.4.1
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          cxx*)
+           case $host in
+             osf3*)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+               ;;
+             *)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+                 echo "-hidden">> $lib.exp~
+                 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+                 $RM $lib.exp'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+               ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+         *)
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+             case $host in
+               osf3*)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+               *)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+             esac
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+             # Commands to make compiler produce verbose output that lists
+             # what "hidden" libraries, object files and flags are used when
+             # linking a shared library.
+             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+           # Sun C++ 4.x
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          lcc*)
+           # Lucid
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+           _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+             $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+           case $host_os in
+             solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+             *)
+               # The compiler driver will combine and reorder linker options,
+               # but understands `-z linker_flag'.
+               # Supported since Solaris 2.6 (maybe 2.5.1?)
+               _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+               ;;
+           esac
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+           output_verbose_link_cmd='func_echo_all'
+
+           # Archives containing C++ object files must be created using
+           # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+           ;;
+          gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+           # The C++ compiler must be used to create the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+           ;;
+          *)
+           # GNU C++ compiler with Solaris linker
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+             if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             else
+               # g++ 2.7 appears to require `-G' NOT `-shared' on this
+               # platform.
+               _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             fi
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+             case $host_os in
+               solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+               *)
+                 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+                 ;;
+             esac
+           fi
+           ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+       # Note: We can NOT use -z defs as we might desire, because we do not
+       # link with -lc, and that would cause any symbols used from libc to
+       # always be unresolved, which means just about no library would
+       # ever link correctly.  If we're not using GNU ld we use -z text
+       # though, which does catch some bad symbols but isn't as heavy-handed
+       # as -z defs.
+       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+       _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+       _LT_TAGVAR(link_all_deplibs, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+       runpath_var='LD_RUN_PATH'
+
+       case $cc_basename in
+          CC*)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+             '"$_LT_TAGVAR(old_archive_cmds, $1)"
+           _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+             '"$_LT_TAGVAR(reload_cmds, $1)"
+           ;;
+         *)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           ;;
+       esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+           # NonStop-UX NCC 3.20
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case ${prev}${p} in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+        prev=$p
+        continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test "$pre_test_object_deps_done" = no; then
+        case ${prev} in
+        -L | -R)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+            _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+          else
+            _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+          _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+        else
+          _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+        fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+          _LT_TAGVAR(predep_objects, $1)="$p"
+        else
+          _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+        fi
+       else
+        if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+          _LT_TAGVAR(postdep_objects, $1)="$p"
+        else
+          _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+  CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([    ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary parameter first.
+    func_stripname_result=${3}
+    func_stripname_result=${func_stripname_result#"${1}"}
+    func_stripname_result=${func_stripname_result%"${2}"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+    func_split_long_opt_name=${1%%=*}
+    func_split_long_opt_arg=${1#*=}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+    func_split_short_opt_arg=${1#??}
+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+    case ${1} in
+      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+      *)    func_lo2o_result=${1} ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+
+  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+
+  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+    func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+         [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+         [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/l4/pkg/libpng/lib/dist/scripts/ltoptions.m4 b/l4/pkg/libpng/lib/dist/scripts/ltoptions.m4
new file mode 100644 (file)
index 0000000..5d9acd8
--- /dev/null
@@ -0,0 +1,384 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+           [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+                     [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+                  [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+       [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+       [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+       [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+       [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+        [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+       IFS="$lt_save_ifs"
+       if test "X$lt_pkg" = "X$lt_p"; then
+         pic_mode=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+                [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+                [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+                [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+                [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+                [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/l4/pkg/libpng/lib/dist/scripts/ltsugar.m4 b/l4/pkg/libpng/lib/dist/scripts/ltsugar.m4
new file mode 100644 (file)
index 0000000..9000a05
--- /dev/null
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+          m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+            [m4_foreach([_Lt_suffix],
+               ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+       [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+         [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+                [lt_append([$1], [$2], [$3])$4],
+                [$5])],
+         [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+       m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+       [$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+                     [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/l4/pkg/libpng/lib/dist/scripts/ltversion.m4 b/l4/pkg/libpng/lib/dist/scripts/ltversion.m4
new file mode 100644 (file)
index 0000000..07a8602
--- /dev/null
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers                      -*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2'
+macro_revision='1.3337'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/l4/pkg/libpng/lib/dist/scripts/lt~obsolete.m4 b/l4/pkg/libpng/lib/dist/scripts/lt~obsolete.m4
new file mode 100644 (file)
index 0000000..c573da9
--- /dev/null
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],  [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],             [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],        [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],         [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],    [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],           [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],             [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],    [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],           [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],       [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],               [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],        [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],    [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],    [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],         [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],            [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],  [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],             [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],            [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],    [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],   [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],          [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],            [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],           [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],  [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],    [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],          [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],          [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],                [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],     [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],          [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],   [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],           [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],           [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],           [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],  [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],      [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],    [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],    [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],    [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],     [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],         [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],       [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],        [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],                [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],        [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],   [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],              [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],               [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],              [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/l4/pkg/libpng/lib/dist/scripts/macro.lst b/l4/pkg/libpng/lib/dist/scripts/macro.lst
new file mode 100644 (file)
index 0000000..57124b7
--- /dev/null
@@ -0,0 +1,3 @@
+get_uint_32(buf)
+get_uint_16(buf)
+get_int_32(buf)
index b5e5a33a06f3140ef4138aa4889c7dbe9ff6d43d..6eef5b7b452e425531a2ea321e0bd3cfc7745f28 100644 (file)
@@ -9,8 +9,8 @@
 # and license in png.h
 
 # Library name:
-LIBNAME=libpng15
-PNGMAJ = 15
+LIBNAME=libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -29,7 +29,7 @@ RM_F=/bin/rm -f
 SUN_CC_FLAGS=-fast -xtarget=ultra
 SUN_LD_FLAGS=-fast -xtarget=ultra
 
-# where make install puts libpng.a, libpng15.so and libpng15/png.h
+# where make install puts libpng.a, libpng16.so and libpng16/png.h
 prefix=/a
 exec_prefix=$(prefix)
 
@@ -95,7 +95,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -106,7 +106,7 @@ libpng-config:
        echo R_opts=\"-R$(LIBPATH)\"; \
        echo ccopts=\"-xtarget=ultra\"; \
        echo ldopts=\"-xtarget=ultra\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -222,20 +222,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index a0331d670e0a367ee372dffdd4c65b9057e08a80..1aaf6962589247599b1e3c6580b016bccdbd7580 100644 (file)
@@ -9,8 +9,8 @@
 # and license in png.h
 
 # Library name:
-LIBNAME=libpng15
-PNGMAJ = 15
+LIBNAME=libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -29,7 +29,7 @@ RM_F=/bin/rm -f
 SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
 SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
 
-# where make install puts libpng.a, libpng15.so and libpng15/png.h
+# where make install puts libpng.a, libpng16.so and libpng16/png.h
 prefix=/a
 exec_prefix=$(prefix)
 
@@ -47,7 +47,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
        -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
 CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \
        # $(WARNMORE) -g -DPNG_DEBUG=5
-LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng15 -lz -lm
+LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
@@ -95,7 +95,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -106,7 +106,7 @@ libpng-config:
        echo R_opts=\"-R$(LIBPATH)\"; \
        echo ccopts=\"-xtarget=ultra -xarch=v9\"; \
        echo ldopts=\"-xtarget=ultra -xarch=v9\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -222,20 +222,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index bb4c40d4b0dd7fb78a12216e3db1e6dedfdcd9ff..ae89cd441efc4891f729c748870cf80c78ea23ce 100644 (file)
@@ -21,8 +21,8 @@ RANLIB = ranlib
 RM_F = rm -f
 LN_SF = ln -f -s
 
-LIBNAME=libpng15
-PNGMAJ = 15
+LIBNAME=libpng16
+PNGMAJ = 16
 
 prefix=/usr/local
 INCPATH=$(prefix)/include
@@ -47,7 +47,7 @@ CRELEASE = -O2
 LDRELEASE = -s
 WARNMORE=-W -Wall
 CFLAGS = -I$(ZLIBINC) $(WARNMORE) $(CRELEASE)
-LDFLAGS = -L. -L$(ZLIBLIB) -lpng15 -lz -lm $(LDRELEASE)
+LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm $(LDRELEASE)
 
 # File extensions
 O=.o
@@ -102,20 +102,20 @@ install: $(LIBNAME)$(A)
 clean:
        $(RM_F) *.o $(LIBNAME)$(A) pngtest pngout.png pnglibconf.h
 
-png$(O):      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread$(O):  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png$(O):      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread$(O):  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest$(O):  png.h pngconf.h pnglibconf.h
index ebbd5ce3d2702462acf0c778f78cbbd36b54ce8d..b58c571aeeb3e40250cba4c5ba8d7e358b668ca4 100644 (file)
@@ -114,21 +114,21 @@ test: pngtest.exe
 pnglibconf.h: scripts\pnglibconf.h.prebuilt
        copy scripts\pnglibconf.h.prebuilt $@
 
-png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 pngtest.obj: pngtest.c png.h pngconf.h pnglibconf.h
 
 $(LIBNAME): $(OBJS)
index 749db78ad32ebe310740c6bbe73f8ec866112613..9bf0c0765cdc13eaae1ae782ca274611ea1acf42 100644 (file)
@@ -9,8 +9,8 @@
 # and license in png.h
 
 # Library name:
-LIBNAME=libpng15
-PNGMAJ = 15
+LIBNAME=libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -45,7 +45,7 @@ CFLAGS=-I$(ZLIBINC) -W -Wall -O1 -funroll-loops \
 # LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
 LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz
 
-# where make install puts libpng.a, libpng15.so*, and png.h
+# where make install puts libpng.a, libpng16.so*, and png.h
 prefix=/usr/local
 exec_prefix=$(prefix)
 INCPATH=$(prefix)/include
@@ -91,13 +91,13 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
        echo prefix=\"$(prefix)\"; \
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
-       echo libs=\"-lpng15 -lz \"; \
+       echo libs=\"-lpng16 -lz \"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -110,7 +110,7 @@ $(LIBSOMAJ): $(OBJSDLL)
        $(LIBSOMAJ) $(OBJSDLL) $(LDFLAGS)
 
 pngtest: pngtest.o $(LIBSO)
-       $(CC) -L$(ZLIBLIB) -L. -lz -lpng15 -o pngtest pngtest.o
+       $(CC) -L$(ZLIBLIB) -L. -lz -lpng16 -o pngtest pngtest.o
 
 test: pngtest
        ./pngtest
@@ -196,20 +196,20 @@ clean:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 96d5e861a3adb5129904b6ec26110b646e8724fe..e3b36a51e34854f07af467581d2ea4e77e802a04 100644 (file)
@@ -121,21 +121,21 @@ test: pngtest$(MODEL).exe
 
 ## Minor Targets
 
-png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 $(LIBNAME): $(OBJS)
        -del $(LIBNAME)
index aa3179fe68cd24bf9394a17c2b3c4c51401b1db6..820518aec741f9b4f5350a2dc5a7ff715cd39888 100644 (file)
 # make clean
 
 VERMAJ = 1
-VERMIN = 5
-VERMIC = 14
+VERMIN = 6
+VERMIC = 0
 VER = $(VERMAJ).$(VERMIN).$(VERMIC)
 NAME = libpng
 PACKAGE = $(NAME)-$(VER)
 
-BIN = libpng15-0.dll
-LIB = libpng15.a libpng15.dll.a libpng.a libpng.dll.a
-INCLUDE = png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-PC = libpng15.pc libpng.pc
+BIN = libpng16-0.dll
+LIB = libpng16.a libpng16.dll.a libpng.a libpng.dll.a
+INCLUDE = png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+PC = libpng16.pc libpng.pc
 
 MANIFESTVERBIN = "Libpng-$(VER): Binary files"
 MANIFESTVERDEV = "Libpng-$(VER): Developer files"
index 48805d4a7df9b399cc7f3316fdc09253d6591815..814fef50251a3803f1e10ed71a5d8c9034b7ec90 100644 (file)
@@ -9,7 +9,7 @@
 # For conditions of distribution and use, see the disclaimer
 # and license in png.h
 
-# where "make install" puts libpng.a, libpng15.dylib, png.h, pngconf.h,
+# where "make install" puts libpng.a, libpng16.dylib, png.h, pngconf.h,
 # and pnglibconf.h
 prefix=/usr/local
 exec_prefix=$(prefix)
@@ -19,8 +19,8 @@ ZLIBLIB=/usr/lib
 ZLIBINC=/usr/include
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
+LIBNAME = libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).dylib
@@ -39,7 +39,7 @@ ARCH=-arch ppc -arch i386 -arch x86_64
 
 # CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops
 CFLAGS=-I$(ZLIBINC) -W -Wall -O -funroll-loops $(ARCH)
-LDFLAGS=-L. -L$(ZLIBLIB) -lpng15 -lz $(ARCH)
+LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz $(ARCH)
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
@@ -87,14 +87,14 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
        echo prefix=\"$(prefix)\"; \
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz\"; \
+       echo libs=\"-lpng16 -lz\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -104,8 +104,8 @@ $(LIBSO): $(LIBSOMAJ)
 $(LIBSOMAJ): $(OBJSDLL)
        $(CC) -dynamiclib \
         -install_name $(LIBPATH)/$(LIBSOMAJ) \
-        -current_version 15 -compatibility_version 15 \
-        $(ARCH) -o $(LIBSOMAJ) \
+        -current_version 16 -compatibility_version 16 \
+        $(ARCH) -o $(LIBSOMAJ) \
         $(OBJSDLL) -L$(ZLIBLIB) -lz
 
 pngtest: pngtest.o $(LIBSO)
@@ -199,20 +199,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 5301d87d33eda2bbde1f19e95eea24860bc1f230..79e3724740cddb00029b90d0dc41a8d7f99e2294 100644 (file)
@@ -7,8 +7,8 @@
 # and license in png.h
 
 # Library name:
-PNGMAJ = 15
-LIBNAME = libpng15
+PNGMAJ = 16
+LIBNAME = libpng16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -75,7 +75,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -83,7 +83,7 @@ libpng-config:
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
        echo ccopts=\"-std\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -183,20 +183,20 @@ clean:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 87a05a364ac9d1520bf053fc01fce5834efb5de6..ad117bc5e2ef5b9139244d456714a572e82ea0dc 100644 (file)
@@ -43,20 +43,20 @@ clean:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 5af43b184520c711277a1e2e80a2b63d4ee566d0..15a8ee67b0893da3fb2c0388f22af78a1610073e 100644 (file)
@@ -1,4 +1,4 @@
-# makefile for libpng.a and libpng15.so on Linux ELF with gcc
+# makefile for libpng.a and libpng16.so on Linux ELF with gcc
 # Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2011 Greg Roelofs
 # and Glenn Randers-Pehrson
 # Copyright (C) 1996, 1997 Andreas Dilger
 # Modified for Debian by Junichi Uekawa and Josselin Mouette
 # Major modifications are:
 #    * link libpng explicitly with libz and libm
-#    * $(OLDSO).15 is a symlink rather than a different library
+#    * $(OLDSO).16 is a symlink rather than a different library
 #    * versioned symbols
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
+LIBNAME = libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
 LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
 LIBSOREL=$(LIBSOMAJ).$(RELEASE)
 OLDSO=libpng.so
-OLDSOMAJ=libpng.so.15
+OLDSOMAJ=libpng.so.16
 
 # Utilities:
 AR_RC=ar rc
@@ -32,8 +32,8 @@ LN_SF=ln -sf
 RANLIB=ranlib
 RM_F=/bin/rm -f
 
-# where "make install" puts libpng15.a, libpng15.so*,
-# libpng15/png.h, libpng15/pngconf.h, and libpng15/pnglibconf.h
+# where "make install" puts libpng16.a, libpng16.so*,
+# libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h
 # Prefix must be a full pathname.
 prefix=/usr/local
 exec_prefix=$(prefix)
@@ -57,7 +57,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 CFLAGS=-W -Wall -D_REENTRANT -O2 \
        $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
 
-LDFLAGS=-L. -lpng15
+LDFLAGS=-L. -lpng16
 LDFLAGS_A=libpng.a -lz -lm
 LIBADDFLAGS=-lz -lm
 
@@ -108,11 +108,11 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng.syms: png.h pngconf.h pnglibconf.h
        $(CC) $(CFLAGS) -E -DPNG_BUILDSYMS -DPNG_INTERNAL png.h |\
-       awk -F '[\t [\\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG15_%s {global:\n",PNGMAJ)}\
+       awk -F '[\t [\\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG16_%s {global:\n",PNGMAJ)}\
        { for (i=1;i+2<=NF;++i)\
                if ($$(i)=="PNG_FUNCTION_EXPORT" && $$(i+2)=="END")\
                        print $$(i+1) ";";\
@@ -129,8 +129,8 @@ libpng-config:
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
        echo L_opts=\"\"; \
        echo R_opts=\"\"; \
-       echo libs=\"-lpng15\"; \
-       echo all_libs=\"-lpng15 $(LIBADDFLAGS)\"; \
+       echo libs=\"-lpng16\"; \
+       echo all_libs=\"-lpng16 $(LIBADDFLAGS)\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -244,20 +244,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 38cd921214379c27bf741a7752f94788cf0edf2b..bc033934bdbf327207897bd2d2e2931e8d26fab3 100644 (file)
@@ -6,7 +6,7 @@
 # and license in png.h
 
 PREFIX?=        /usr/local
-SHLIB_VER?=     15
+SHLIB_VER?=     16
 
 LIB=           png
 SHLIB_MAJOR=   ${SHLIB_VER}
@@ -17,7 +17,7 @@ NO_OBJ=          YES
 # where make install puts libpng.a and png.h
 DESTDIR=       ${PREFIX}
 LIBDIR=                /lib
-INCS=          png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+INCS=          png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 INCSDIR=       /include/libpng
 INCDIR=                ${INCSDIR}              # for 4.x bsd.lib.mk
 MAN=           libpng.3 libpngpf.3 png.5
@@ -27,7 +27,7 @@ SYMLINKS=       libpng/png.h ${INCSDIR}/../png.h \
                libpng/pnglibconf.h ${INCSDIR}/../pnglibconf.h
 
 LDADD+=         -lm -lz
-#LDADD+=         -lm -lz -lssp_nonshared   # for OSVERSION >= 800000 ?
+#LDADD+=         -lm -lz -lssp_nonshared   # for OSVERSION < 800000 ?
 
 DPADD+=         ${LIBM} ${LIBZ}
 
index 2e5b611367f5e20a30884a84038abe02ff1ec6cf..78faa63b233aa59b4c3c7ca41abe79e7c49cf30c 100644 (file)
@@ -68,20 +68,20 @@ pngtest$(EXE): pngtest$(O) libpng$(A)
 clean:
        $(RM_F) *$(O) libpng$(A) pngtest$(EXE) pngout.png pnglibconf.h
 
-png$(O):      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread$(O):  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png$(O):      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread$(O):  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest$(O):  png.h pngconf.h pnglibconf.h
index b5b631d11c7d28b1398d0bde8063ccd56c5743c6..bf51962471d9f2ed271743d8696ae010bf70fc2a 100644 (file)
@@ -19,8 +19,8 @@ ZLIBINC=/opt/zlib/include
 #   SHAREDLIB=libz.sl
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
+LIBNAME = libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).sl
@@ -44,7 +44,7 @@ CCFLAGS=-I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64 \
 
 LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
 
-# where make install puts libpng.a, libpng15.sl, and png.h
+# where make install puts libpng.a, libpng16.sl, and png.h
 prefix=/opt/libpng
 exec_prefix=$(prefix)
 INCPATH=$(prefix)/include
@@ -93,7 +93,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -101,7 +101,7 @@ libpng-config:
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
        echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -205,20 +205,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 3fe21177a4c1c400874abe7e198cd6d16354886e..bf44d2262c2fd65a1cd342bebf56be87055552e0 100644 (file)
@@ -9,8 +9,8 @@
 # and license in png.h
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
+LIBNAME = libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).sl
@@ -55,8 +55,8 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 
 CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE \
        $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
-#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng15 -lz -lm
-LDFLAGS=-L. -L$(ZLIBLIB) -lpng15 -lz -lm
+#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
+LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
@@ -100,13 +100,13 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
        echo prefix=\"$(prefix)\"; \
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -211,20 +211,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 650ab4f6621d8ec839f71d617df24f5ecb1c54a5..1c2970b7f87c261a69f5c334e1cbb4ef25fb9230 100644 (file)
@@ -19,8 +19,8 @@ ZLIBINC=/opt/zlib/include
 #   SHAREDLIB=libz.sl
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
+LIBNAME = libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).sl
@@ -36,7 +36,7 @@ LN_SF=ln -sf
 RANLIB=ranlib
 RM_F=/bin/rm -f
 
-# where make install puts libpng.a, libpng15.sl, and png.h
+# where make install puts libpng.a, libpng16.sl, and png.h
 prefix=/opt/libpng
 exec_prefix=$(prefix)
 INCPATH=$(prefix)/include
@@ -90,7 +90,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -98,7 +98,7 @@ libpng-config:
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
        echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -202,20 +202,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 209d513b1cbae812c17a10d45708f25402d7b11e..a19090dfe9a1ac4f6f2724d8bf671f24542f2135 100644 (file)
@@ -63,20 +63,20 @@ clean:
        $(RM) pngtest$(E)
        $(RM) pngout.png
 
-png$(O):      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread$(O):  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png$(O):      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread$(O):  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio$(O):   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest$(O):  png.h pngconf.h pnglibconf.h
index 1cb9ef37497f8cc944e939cc6c6a391075b0d676..3a45014cf3fefd35cdc6f7621e552490faffef85 100644 (file)
@@ -48,49 +48,49 @@ all: test
 pnglibconf.h: scripts/pnglibconf.h.prebuilt
        cp scripts/pnglibconf.h.prebuilt $@
 
-png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
-pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) $(CFLAGS) $*.c $(ERRFILE)
 
 libpng.lib: $(OBJS)
index 18a39f53755f618c67578052761ca25ca5343ee0..e2d2d4e591058575369972d9b9245fae42645754 100644 (file)
@@ -90,20 +90,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 79faf93bdca02ebe44ee744a4ebe2727360e9379..6e95c878c639454be480b2f0e9323e946bec174f 100644 (file)
@@ -1,4 +1,4 @@
-# makefile for libpng.a and libpng15.so on Linux ELF with gcc
+# makefile for libpng.a and libpng16.so on Linux ELF with gcc
 # Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2011 Greg Roelofs and
 # Glenn Randers-Pehrson
 # Copyright (C) 1996, 1997 Andreas Dilger
@@ -8,9 +8,9 @@
 # and license in png.h
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
-RELEASE = 14
+LIBNAME = libpng16
+PNGMAJ = 16
+RELEASE = 0
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -26,8 +26,8 @@ LN_SF=ln -sf
 RANLIB=ranlib
 RM_F=/bin/rm -f
 
-# where "make install" puts libpng15.a, libpng15.so*,
-# libpng15/png.h, libpng15/pngconf.h, and libpng15/pnglibconf.h
+# where "make install" puts libpng16.a, libpng16.so*,
+# libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h
 # Prefix must be a full pathname.
 prefix=/usr/local
 exec_prefix=$(prefix)
@@ -51,7 +51,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops \
        $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
 
-LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng15 -lz -lm
+LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
 LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
 
 INCPATH=$(prefix)/include
@@ -100,7 +100,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -108,7 +108,7 @@ libpng-config:
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
        echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -220,20 +220,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 179d3850b69906a4aacd3cd7749f22dec3ac049c..d6a5cc31b48ae0a49a95febec891b8ad0157f07d 100644 (file)
@@ -75,20 +75,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index baa863dad99ad70cb439f6fded894bfc0f5a2240..e3ad73e757537ddf9c425303c1e0fb630c344b3c 100644 (file)
@@ -31,49 +31,49 @@ all: libpng.lib
 pnglibconf.h: scripts/pnglibconf.h.prebuilt
        cp scripts/pnglibconf.h.prebuilt $@
 
-png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
                  $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
                  $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
 libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3)
index 8e693d1e4c74e7b0898149d906cb814ae0f66207..074fb5811099aedc422ee51c34d626d531edde9e 100644 (file)
@@ -16,9 +16,9 @@ prefix=/usr/local
 exec_prefix=$(prefix)
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
-RELEASE = 14
+LIBNAME = libpng16
+PNGMAJ = 16
+RELEASE = 0
 
 # Shared library names:
 LIBSO=$(LIBNAME).dll
@@ -129,7 +129,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -137,7 +137,7 @@ libpng-config:
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
        echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
 
 install-shared: install-headers $(LIBSOMAJ) libpng.pc
index 8ce099c0257e7792f06c47ea253ba2f4e3ff9011..a20bc4e6eded26c5bfcfdc02b40bab0fd7bd4604 100644 (file)
 LOCALBASE?=/usr/local
 LIBDIR=        ${LOCALBASE}/lib
 MANDIR= ${LOCALBASE}/man
-INCSDIR=${LOCALBASE}/include/libpng15
+INCSDIR=${LOCALBASE}/include/libpng16
 
-LIB=   png15
+LIB=   png16
 SHLIB_MAJOR=   0
-SHLIB_MINOR=   1.5.14
+SHLIB_MINOR=   1.6.0
 SRCS=  png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
        pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
        pngwtran.c pngmem.c pngerror.c pngpread.c
index fa5b66ed5fe55a6372e1543442e8188c3b222f67..719e8c34759a79a83c1b643b0aa22c687b97fe5e 100644 (file)
@@ -8,7 +8,7 @@
 # For conditions of distribution and use, see the disclaimer
 # and license in png.h
 
-# You should also run makefile.ne15bsd
+# You should also run makefile.ne16bsd
 
 LOCALBASE?=/usr/local
 LIBDIR=        ${LOCALBASE}/lib
@@ -16,8 +16,8 @@ MANDIR= ${LOCALBASE}/man
 INCSDIR=${LOCALBASE}/include
 
 LIB=   png
-SHLIB_MAJOR=   15
-SHLIB_MINOR=   1.5.14
+SHLIB_MAJOR=   16
+SHLIB_MINOR=   1.6.0
 SRCS=  png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
        pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
        pngwtran.c pngmem.c pngerror.c pngpread.c
index 309bcca85c755fccee24d60f8ac3a5d64180e8bc..447b38bd44d5b5aa04b21ead470815306d50f222 100644 (file)
@@ -10,8 +10,8 @@ PREFIX?= /usr/local
 LIBDIR=        ${PREFIX}/lib
 MANDIR= ${PREFIX}/man/cat
 
-SHLIB_MAJOR=   15
-SHLIB_MINOR=   1.5.14
+SHLIB_MAJOR=   16
+SHLIB_MINOR=   1.6.0
 
 LIB=   png
 SRCS=  png.c pngerror.c pngget.c pngmem.c pngpread.c \
index 0aad789a981b0eeb529567ddf3e6f81c4e1d337c..c5f254f6ea0d5c1720f251ed441c4b39209e43ec 100644 (file)
@@ -10,8 +10,8 @@
 # and license in png.h
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
+LIBNAME = libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -38,7 +38,7 @@ ZLIBLIB=../zlib
 ZLIBINC=../zlib
 
 CFLAGS= -dy -belf -I$(ZLIBINC) -O3
-LDFLAGS=-L. -L$(ZLIBLIB) -lpng15 -lz -lm
+LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
@@ -86,7 +86,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -94,7 +94,7 @@ libpng-config:
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
        echo ccopts=\"-belf\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -199,20 +199,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 1611638ba6cbf309bdbc5ff029238b4947244ee7..7c427bea65102a5e05b07f21725053b7ee97b1d7 100644 (file)
@@ -1,4 +1,4 @@
-# makefile for libpng.a and libpng15.so, SGI IRIX with 'cc'
+# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
 # Copyright (C) 2001-2002, 2006, 2010-2011 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -7,8 +7,8 @@
 # and license in png.h
 
 # Library name:
-LIBNAME=libpng15
-PNGMAJ = 15
+LIBNAME=libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -24,7 +24,7 @@ LN_SF=ln -sf
 RANLIB=echo
 RM_F=/bin/rm -f
 
-# Where make install puts libpng.a, libpng15.so, and libpng15/png.h
+# Where make install puts libpng.a, libpng16.so, and libpng16/png.h
 # Prefix must be a full pathname.
 
 prefix=/usr/local
@@ -91,7 +91,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -102,7 +102,7 @@ libpng-config:
        echo ldopts=\"$(ABI)\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
        echo libdir=\"$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -209,20 +209,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 83db59f817e097c52072ae4a4e322add2e94941e..f40461e33e965842f8091b846112e785ad7c6a1e 100644 (file)
@@ -1,4 +1,4 @@
-# makefile for libpng.a and libpng15.so, SGI IRIX with 'cc'
+# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
 # Copyright (C) 2001-2002, 2006, 2007, 2010-2011 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -7,8 +7,8 @@
 # and license in png.h
 
 # Library name:
-LIBNAME=libpng15
-PNGMAJ = 15
+LIBNAME=libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -24,7 +24,7 @@ LN_SF=ln -sf
 RANLIB=echo
 RM_F=/bin/rm -f
 
-# Where make install puts libpng.a, libpng15.so, and libpng15/png.h
+# Where make install puts libpng.a, libpng16.so, and libpng16/png.h
 # Prefix must be a full pathname.
 
 prefix=/usr/local
@@ -46,7 +46,7 @@ WARNMORE=-fullwarn
 # Note: -KPIC is the default anyhow
 #CFLAGS= $(ABI) -I$(ZLIBINC) -O $(WARNMORE) -KPIC # -g -DPNG_DEBUG=5
 CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE)
-LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng15 -lz -lm
+LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng16 -lz -lm
 LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
 LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
        -set_version sgi$(PNGMAJ).0
@@ -92,7 +92,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -102,7 +102,7 @@ libpng-config:
        echo ldopts=\"$(ABI)\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
        echo libdir=\"$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -210,20 +210,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 615c2e3458082f96932399d11f1987afd8d643ae..a7773d1837085a77e7b9162b2d19588f72ad7465 100644 (file)
@@ -10,8 +10,8 @@
 # and license in png.h
 
 # Library name:
-PNGMAJ = 15
-LIBNAME = libpng15
+PNGMAJ = 16
+LIBNAME = libpng16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -48,7 +48,7 @@ ZLIBINC=/usr/include
        -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
 #CFLAGS=-I$(ZLIBINC) -W -Wall -O3 $(WARNMORE) -g -DPNG_DEBUG=5 -DPNG_NO_MMX_CODE
 CFLAGS=-I$(ZLIBINC) -O3 -DPNG_NO_MMX_CODE
-LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng15 -lz -lm
+LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
@@ -96,7 +96,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -104,7 +104,7 @@ libpng-config:
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
        echo R_opts=\"-R$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -220,20 +220,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 24bd61033cedabb1b969ebe8e1c4c2e19807da8a..be423a184c4937da7e6a8446c44190fb254ee860 100644 (file)
@@ -9,8 +9,8 @@
 # and license in png.h
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
+LIBNAME = libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -26,7 +26,7 @@ LN_SF=ln -f -s
 RANLIB=echo
 RM_F=/bin/rm -f
 
-# Where make install puts libpng.a, libpng15.so*, and png.h
+# Where make install puts libpng.a, libpng16.so*, and png.h
 prefix=/usr/local
 exec_prefix=$(prefix)
 
@@ -44,7 +44,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
        -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
 CFLAGS=-I$(ZLIBINC) -W -Wall -O \
        # $(WARNMORE) -g -DPNG_DEBUG=5
-LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng15 -lz -lm
+LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
@@ -92,7 +92,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -101,7 +101,7 @@ libpng-config:
        echo cppflags=\"\"; \
        echo L_opts=\"-L$(LIBPATH)\"; \
        echo R_opts=\"-R$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -217,20 +217,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 76467622a85259cea9ec917c4adf8373c04492b5..d41e659c569a447264200b9d736035fd5e87433c 100644 (file)
@@ -9,8 +9,8 @@
 # and license in png.h
 
 # Library name:
-LIBNAME = libpng15
-PNGMAJ = 15
+LIBNAME = libpng16
+PNGMAJ = 16
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -26,7 +26,7 @@ LN_SF=ln -f -s
 RANLIB=echo
 RM_F=/bin/rm -f
 
-# Where make install puts libpng.a, libpng15.so*, and png.h
+# Where make install puts libpng.a, libpng16.so*, and png.h
 prefix=/usr/local
 exec_prefix=$(prefix)
 
@@ -44,7 +44,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
        -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
 CFLAGS=-I$(ZLIBINC) -W -Wall -O \
        # $(WARNMORE) -g -DPNG_DEBUG=5
-LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng15 -lz -lm
+LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
@@ -92,7 +92,7 @@ libpng.pc:
        -e s!@exec_prefix@!$(exec_prefix)! \
        -e s!@libdir@!$(LIBPATH)! \
        -e s!@includedir@!$(INCPATH)! \
-       -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
+       -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
 
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
@@ -101,7 +101,7 @@ libpng-config:
        echo cppflags=\""; \
        echo L_opts=\"-L$(LIBPATH)\"; \
        echo R_opts=\"-R$(LIBPATH)\"; \
-       echo libs=\"-lpng15 -lz -lm\"; \
+       echo libs=\"-lpng16 -lz -lm\"; \
        cat scripts/libpng-config-body.in ) > libpng-config
        chmod +x libpng-config
 
@@ -217,20 +217,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index a04dbb856b4d9bc705301bf8c9074cdf2a7f7ff4..af70328009e8c9c36391087206c97946540fb26d 100644 (file)
@@ -104,20 +104,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 383954987ee15b7a381a26ecb4a5d448564ea624..c1d016505672d9e786f3867e7cdf817866f3018c 100644 (file)
@@ -88,20 +88,20 @@ writelock:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 
 pngtest.o: png.h pngconf.h pnglibconf.h
index 462c47fece92348b8b791d9bcbfc4c31fdd7a1d4..a046bf6ab996cb3499bb52a9d52c38820fdcd304 100644 (file)
@@ -34,52 +34,52 @@ pngtest: pngtest$(E)
 test: pngtest$(E)
        pngtest$(E)
 
-png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
                  $(CC) -c $(CFLAGS) $*.c
 
-pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
                  $(CC) -c $(CFLAGS) $*.c
 
-pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
                  $(CC) -c $(CFLAGS) $*.c
 
-pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
                  $(CC) -c $(CFLAGS) $*.c
 
-pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
                  $(CC) -c $(CFLAGS) $*.c
 
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
                  $(CC) -c $(CFLAGS) $*.c
 
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
                  $(CC) -c $(CFLAGS) $*.c
 
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c
 
-pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c
 
-pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c
 
-pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c
 
 pngtest$(O): png.h pngconf.h pnglibconf.h
        $(CC) -c $(CFLAGS) $*.c
 
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c
 
-pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c
 
-pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c
 
-pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c
 
 libpng$(MODEL).lib: $(OBJS1) $(OBJS2) $(OBJS3)
index 6bfeac03f7e16aa24cbe70cf3acc14292738af16..3ca7a0114843bcc6145005010f61fa3c59efff4f 100644 (file)
@@ -39,49 +39,49 @@ all: libpng.lib
 pnglibconf.h: scripts\pnglibconf.h.prebuilt
        copy scripts\pnglibconf.h.prebuilt $@
 
-png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
-pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
        $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
 
 libpng.lib: $(OBJS)
index f6c326103c25fe7ebd400c5e15a794bd7a12fa52..692855357028585b83a9b02024e18c0b84a35a56 100644 (file)
@@ -54,35 +54,35 @@ $ if make.eqs.""
 $  then
 $   dele pngtest.obj;*
 $   CALL MAKE png.OBJ "cc ''CCOPT' png" -
-       png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngset.OBJ "cc ''CCOPT' pngset" -
-       pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngget.OBJ "cc ''CCOPT' pngget" -
-       pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngread.OBJ "cc ''CCOPT' pngread" -
-       pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" -
-       pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngrtran.OBJ "cc ''CCOPT' pngrtran" -
-       pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngrutil.OBJ "cc ''CCOPT' pngrutil" -
-       pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngerror.OBJ "cc ''CCOPT' pngerror" -
-       pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngmem.OBJ "cc ''CCOPT' pngmem" -
-       pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngrio.OBJ "cc ''CCOPT' pngrio" -
-       pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngwio.OBJ "cc ''CCOPT' pngwio" -
-       pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngtrans.OBJ "cc ''CCOPT' pngtrans" -
-       pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngwrite.OBJ "cc ''CCOPT' pngwrite" -
-       pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngwtran.OBJ "cc ''CCOPT' pngwtran" -
-       pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   CALL MAKE pngwutil.OBJ "cc ''CCOPT' pngwutil" -
-       pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+       pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h             pnginfo.h pngdebug.h
 $   write sys$output "Building Libpng ..."
 $   CALL MAKE libpng.OLB "lib/crea libpng.olb *.obj" *.OBJ
 $   write sys$output "Building pngtest..."
index 2e55697d61b982e69e6caf23d3f40c471b021bb9..cb8cd184583f9ade3409f782aac97634f4007a08 100755 (executable)
@@ -42,7 +42,7 @@ BEGIN{
    comment=start cx             # Comment start
    cend="*/" end                # Comment end
    def=start "#define PNG_" ct  # Arbitrary define
-   sup=ct "_SUPPORTED 1" end    # end supported option
+   sup=ct "_SUPPORTED" end      # end supported option
    und=comment "#undef PNG_" ct # Unsupported option
    une=ct "_SUPPORTED" cend     # end unsupported option
    error=start "ERROR:"         # error message
@@ -287,15 +287,15 @@ $1 == "option" && NF >= 2{
    # Else fall through to the error handler
 }
 
-# chunk NAME [requires OPT] [on|off|disabled]
+# chunk NAME [requires OPT] [enables LIST] [on|off|disabled]
 #   Expands to the 'option' settings appropriate to the reading and
 #   writing of an ancilliary PNG chunk 'NAME':
 #
 #   option READ_NAME requires READ_ANCILLARY_CHUNKS [READ_OPT]
-#   option READ_NAME enables NAME
+#   option READ_NAME enables NAME LIST
 #   [option READ_NAME off]
 #   option WRITE_NAME requires WRITE_ANCILLARY_CHUNKS [WRITE_OPT]
-#   option WRITE_NAME enables NAME
+#   option WRITE_NAME enables NAME LIST
 #   [option WRITE_NAME off]
 
 pre != 0 && $1 == "chunk" && NF >= 2{
@@ -304,6 +304,7 @@ pre != 0 && $1 == "chunk" && NF >= 2{
    onoff = ""
    reqread = ""
    reqwrite = ""
+   enables = ""
    i = 3 # indicates format error
    if (NF > 2) {
       # read the keywords/additional OPTS
@@ -316,21 +317,25 @@ pre != 0 && $1 == "chunk" && NF >= 2{
                else
                   break # on/off conflict
             }
+            req = 0
          } else if ($(i) == "requires")
             req = 1
-         else if (req != 1)
-            break # bad line: handled below
-         else {
+         else if ($(i) == "enables")
+            req = 2
+         else if (req == 1){
             reqread = reqread " READ_" $(i)
             reqwrite = reqwrite " WRITE_" $(i)
-         }
+         } else if (req == 2)
+            enables = enables " " $(i)
+         else
+            break # bad line: handled below
       }
    }
 
    if (i > NF) {
       # Output new 'option' lines to the intermediate file (out)
-      print "option READ_" $2, "requires READ_ANCILLARY_CHUNKS" reqread, "enables", $2, onoff >out
-      print "option WRITE_" $2, "requires WRITE_ANCILLARY_CHUNKS" reqwrite, "enables", $2, onoff >out
+      print "option READ_" $2, "requires READ_ANCILLARY_CHUNKS" reqread, "enables", $2 enables , onoff >out
+      print "option WRITE_" $2, "requires WRITE_ANCILLARY_CHUNKS" reqwrite, "enables", $2 enables, onoff >out
       next
    }
    # Else hit the error handler below - bad line format!
index 794c203ba44d1e2fe21cf9c9928746baf7f1433e..60f6e2bb33662682ac746cac9be667865d0f2c4f 100644 (file)
@@ -8,7 +8,7 @@ com pnglibconf.h - library build configuration
 com
 version
 com
-com Copyright (c) 1998-2011 Glenn Randers-Pehrson
+com Copyright (c) 1998-2012 Glenn Randers-Pehrson
 com
 com This code is released under the libpng license.
 com For conditions of distribution and use, see the disclaimer
@@ -24,7 +24,7 @@ file pnglibconf.h scripts/pnglibconf.dfa PNGLCONF_H
 # pnglibconf.h freezes the definitions selected for the specific
 # build.
 #
-# The syntax is detailed in scripts/options.awk, this is a summary
+# The syntax is detailed in scripts/options.awk; this is a summary
 # only:
 #
 # setting <name> [default]
@@ -32,8 +32,12 @@ file pnglibconf.h scripts/pnglibconf.dfa PNGLCONF_H
 # option <name> [requires ...] [if ...] [enables ...] [disabled]
 #    #define PNG_<name>_SUPPORTED if the requirements are met and
 #    enable the other options listed
-# chunk <name> [requires ...] [disabled]
-#    Enable chunk processing for the given ancillary chunk
+# chunk <name> [requires ...] [enables ...] [disabled]
+#    Enable chunk processing for the given ancillary chunk; any
+#    'requires something' expands to READ_something for read and
+#    WRITE_something for write, but the enables list members are
+#    used as given (e.g. enables GAMMA just expands to that on the
+#    correspond READ_name and WRITE_name lines.)
 #
 # Note that the 'on' and 'off' keywords, while valid on both option
 # and chunk, should not be used in this file because they force the
@@ -44,7 +48,7 @@ file pnglibconf.h scripts/pnglibconf.dfa PNGLCONF_H
 # The following setting, option and chunk values can all be changed
 # while building libpng:
 #
-# setting: change 'setting' lines to fine tune library performance,
+# setting: change 'setting' lines to fine tune library performance;
 #   changes to the settings don't affect the libpng API functionally
 #
 # option: change 'option' lines to remove or add capabilities from
@@ -143,6 +147,12 @@ logunsupported = 1
 @#  endif
 @#endif
 
+# IN DEVELOPMENT
+# These are currently experimental features; define them if you want (NOTE:
+# experimental options must be disabled before they are defined in this file!)
+
+# NONE
+
 # Note that PNG_USR_CONFIG only has an effect when building
 # pnglibconf.h
 
@@ -161,10 +171,33 @@ setting USER_VERSIONINFO_LEGALTRADEMARKS
 
 setting API_RULE default 0
 
+# This allows a prefix to be added to the front of every API functon name (and
+# therefore every symbol) by redefining all the function names with the prefix
+# at the end of pnglibconf.h.  It also turns on similar internal symbol renaming
+# by causing a similar build-time only file, pngprefix.h, to be generated.
+
+setting PREFIX
+
 # Default to using the read macros
 
 setting DEFAULT_READ_MACROS default 1
 
+# These settings configure the default compression level (0-9) and 'strategy';
+# strategy is as defined by the implementors of zlib, it describes the input
+# data and modifies the zlib parameters in an attempt to optimize the balance
+# between search and huffman encoding in the zlib algorithms.  The defaults are
+# the zlib.h defaults - the apparently recursive definition does not arise
+# because the name of the setting is prefixed by PNG_
+#
+# The TEXT values are the defaults when writing compressed text (all forms)
+
+setting Z_DEFAULT_COMPRESSION default Z_DEFAULT_COMPRESSION
+setting Z_DEFAULT_STRATEGY default Z_FILTERED
+setting Z_DEFAULT_NOFILTER_STRATEGY default Z_DEFAULT_STRATEGY
+
+setting TEXT_Z_DEFAULT_COMPRESSION default Z_DEFAULT_COMPRESSION
+setting TEXT_Z_DEFAULT_STRATEGY default Z_DEFAULT_STRATEGY
+
 # The alternative is to call functions to read PNG values, if
 # the functions are turned *off* the read macros must always
 # be enabled, so turning this off will actually force the
@@ -179,10 +212,36 @@ option READ_INT_FUNCTIONS requires READ
 option WRITE_INT_FUNCTIONS disabled
 option WRITE enables WRITE_INT_FUNCTIONS
 
-# Generic options - affect both read and write.
+# Error controls
+#
+# WARNINGS: normally on, if off no warnings are generated
+# ERROR_TEXT: normally on, if off errors happen but there is no message
+# ERROR_NUMBERS: unimplemented feature, therefore disabled
+# BENIGN_ERRORS: support for just issuing warnings for recoverable errors
+#
+# BENIGN_READ_ERRORS:
+#     By default recoverable errors on read should just generate warnings,
+#     generally safe but PNG files that don't conform to the specification will
+#     be accepted if a meaningful result can be produced.
+#
+# BENIGN_WRITE_ERRORS:
+#     By default recoverable errors on write should just generate warnings,
+#     not generally safe because this allows the application to write invalid
+#     PNG files.  Applications should enable this themselves; it's useful
+#     because it means that a failure to write an ancilliary chunk can often be
+#     ignored.
 
 option WARNINGS
+option ERROR_TEXT
+option ERROR_NUMBERS disabled
+
 option BENIGN_ERRORS
+option BENIGN_WRITE_ERRORS requires BENIGN_ERRORS disabled
+option BENIGN_READ_ERRORS requires BENIGN_ERRORS
+
+
+# Generic options - affect both read and write.
+
 option MNG_FEATURES
 
 # Arithmetic options, the first is the big switch that chooses between internal
@@ -193,10 +252,6 @@ option FLOATING_ARITHMETIC
 option FLOATING_POINT enables ok_math
 option FIXED_POINT enables ok_math
 
-# Added at libpng version 1.4.0
-
-option ERROR_TEXT
-
 # The following is always on (defined empty)
 
 setting CALLOC_SUPPORTED default
@@ -223,10 +278,6 @@ option TIME_RFC1123
 option SETJMP
 = NO_SETJMP SETJMP_NOT_SUPPORTED
 
-# For the moment this is disabled (no code support):
-
-option ERROR_NUMBERS disabled
-
 # If this is disabled it is not possible for apps to get the
 # values from the 'info' structure, this effectively removes
 # quite a lot of the READ API.
@@ -290,6 +341,19 @@ option SAFE_LIMITS enables USER_LIMITS disabled
 # See the comments above about how to change options and settings.
 
 # READ options
+#
+# WARNING: in libpng 1.5 maintained configuration compatibility with earlier
+# versions.  In some cases turning off an option turned off other options, in
+# others it was ineffective unless dependent options were also turned off.
+# Libpng 1.6 changes this: in general if you turn off an option that affects
+# APIs it stays off and simply disables APIs that depend on it.
+#
+# As a result if you simply port the libpng 1.5 configuration to libpng 1.6 you
+# will probably see build failures due to missing APIs.  Fixing these failures
+# requires some, perhaps considerable, knowledge of what your libpng using
+# applications are doing, fortunately there is no great reason for you to move
+# to libpng 1.6; the new interfaces in 1.6 will take several years to become
+# popular.
 
 option READ enables READ_INTERLACING
 
@@ -307,27 +371,42 @@ option READ_QUANTIZE requires READ
 option READ_TRANSFORMS requires READ
 = NO_READ_TRANSFORMS READ_TRANSFORMS_NOT_SUPPORTED
 
-option READ_EXPAND requires READ_TRANSFORMS
-option READ_EXPAND_16 requires READ_TRANSFORMS READ_16BIT enables READ_EXPAND
-option READ_SHIFT requires READ_TRANSFORMS
-option READ_PACK requires READ_TRANSFORMS
+# Read gamma handling.  Gamma processing is a core part of libpng and many of
+# the capabilities are dependent on libpng performing gamma correction.
+#
+# In libpng 1.6 disabling gamma processing (setting PNG_NO_READ_GAMMA)
+# consistently disables those parts of the API that depend on it.  Prior to
+# 1.6.0 this was not true; the results were unpredictable and varied between
+# releases.
+#
+# If you disable gamma processing and your program no longer compiles you need
+# to ask whether you really need the APIs that are missing.  If you do then you
+# almost certainly need the gamma processing.
+#
+# If you handle gamma issues outside libpng then you do not need the libpng
+# gamma processing; and it is an enormous waste of space.  You just need to
+# remove the use of libpng APIs that depend on it.
+option READ_GAMMA requires READ_TRANSFORMS READ_gAMA
+
+option READ_ALPHA_MODE requires READ_TRANSFORMS READ_GAMMA
+option READ_BACKGROUND requires READ_TRANSFORMS READ_STRIP_ALPHA READ_GAMMA
 option READ_BGR requires READ_TRANSFORMS
-option READ_SWAP requires READ_TRANSFORMS READ_16BIT
-option READ_PACKSWAP requires READ_TRANSFORMS
-option READ_INVERT requires READ_TRANSFORMS
-option READ_BACKGROUND requires READ_TRANSFORMS enables READ_STRIP_ALPHA
-option READ_STRIP_16_TO_8 requires READ_TRANSFORMS
-option READ_SCALE_16_TO_8 requires READ_TRANSFORMS
+option READ_EXPAND_16 requires READ_TRANSFORMS READ_16BIT READ_EXPAND
+option READ_EXPAND requires READ_TRANSFORMS
 option READ_FILLER requires READ_TRANSFORMS
-option READ_GAMMA requires READ_TRANSFORMS enables READ_gAMA
 option READ_GRAY_TO_RGB requires READ_TRANSFORMS
-
-option READ_ALPHA_MODE requires READ_TRANSFORMS enables READ_GAMMA
-option READ_SWAP_ALPHA requires READ_TRANSFORMS
 option READ_INVERT_ALPHA requires READ_TRANSFORMS
+option READ_INVERT requires READ_TRANSFORMS
+option READ_PACK requires READ_TRANSFORMS
+option READ_PACKSWAP requires READ_TRANSFORMS
+option READ_RGB_TO_GRAY requires READ_TRANSFORMS READ_GAMMA
+option READ_SCALE_16_TO_8 requires READ_TRANSFORMS
+option READ_SHIFT requires READ_TRANSFORMS
+option READ_STRIP_16_TO_8 requires READ_TRANSFORMS
 option READ_STRIP_ALPHA requires READ_TRANSFORMS
+option READ_SWAP_ALPHA requires READ_TRANSFORMS
+option READ_SWAP requires READ_TRANSFORMS READ_16BIT
 option READ_USER_TRANSFORM requires READ_TRANSFORMS
-option READ_RGB_TO_GRAY requires READ_TRANSFORMS
 
 option PROGRESSIVE_READ requires READ
 option SEQUENTIAL_READ requires READ
@@ -351,11 +430,6 @@ option INCH_CONVERSIONS
 
 option BUILD_GRAYSCALE_PALETTE
 
-# IN DEVELOPMENT
-# These are currently experimental features; define them if you want
-
-# NOTHING HERE
-
 # WRITE options
 
 option WRITE
@@ -436,11 +510,59 @@ option WRITE_TEXT requires WRITE_ANCILLARY_CHUNKS enables TEXT
 #   API is implemented, they get recorded in pnglibconf.h, but
 #   can't be changed by the application.
 
-# Check the correctness of cHRM chunks
+# Colorspace support (enabled as required); just the support for colorant
+# information.  Gamma support, likewise, is just support for the gamma
+# information, READ_GAMMA is required for gamma transformations (so it
+# is possible to read PNG gamma without enabling all the libpng transform
+# code - do this for applications that do their own gamma processing)
+#
+# As of 1.6.0 COLORSPACE is only useful if the application processes the
+# information; this is because the library does not do any colorspace
+# processing, it just validates the data in the PNG file.
 
-option CHECK_cHRM requires cHRM
+option GAMMA disabled
+option COLORSPACE enables GAMMA disabled
 
+# When an ICC profile is read, or png_set, it will be checked for a match
+# against known sRGB profiles if the sRGB handling is enabled.  This
+# setting controls how much work is done during the check:
+#
+# 0: Just validate the profile MD5 signature if present, otherwise use
+#    the checks in option 1.
+#
+# 1: Additionally check the length, intent and adler32 checksum of the
+#    actual data.   If enabled this will reject known profiles that have
+#    had the rendering intent in the header changed as well as other edits
+#    done without updating the checksum.  See the discussion below.
+#
+# 2: Additionally checksum all the data using the ethernet CRC32 algorithm.
+#    This makes it more difficult to fake profiles and makes it less likely
+#    to get a false positive on profiles with no signature, but is probably
+#    just a waste of time since all currently approved ICC sRGB profiles have
+#    a secure MD5 signature.
+#
+# The rendering intent.  An ICC profile stores an intended rendering intent,
+# but does not include the value in the signature.  The intent is documented
+# as the intent that should be used when combining two profiles.  The sRGB
+# profile is intended, however, to be used with any of the four defined intents.
+# For this reason the sRGB chunk includes an 'intent' to be used when displaying
+# the image (intent is really a property of the image not the profile.)
+#
+# Unfortunately the iCCP chunk does not.  It may therefore be that some
+# applications modify the intent in profiles (including sRGB profiles) to work
+# round this problem.  Selecting an option other than option '0' will cause such
+# modified profiles to be rejected.
 #
+# Security.  The use of Adler32 and CRC32 checksums does not help significantly
+# with any security issues.  It is relatively easy to produce arbitrary profiles
+# with the required checksums on current computer systems.  Nevertheless
+# security does not seem to be an issue because the only consequence of a false
+# positive is a false assertion that the profile is an sRGB profile.  This might
+# be used to hide data from libpng using applications, but it doesn't seem
+# possible to damage them.
+
+setting sRGB_PROFILE_CHECKS default 2
+
 # Artificially align memory - the code typically aligns to 8 byte
 # boundaries if this is switched on, it's a small waste of space
 # but can help (in theory) on some architectures.  Only affects
@@ -509,20 +631,44 @@ setting sCAL_PRECISION default 5
 
 setting ZBUF_SIZE default 8192
 
+# This is the size of the decompression buffer used when counting or checking
+# the decompressed size of an LZ stream from a compressed ancilliary chunk; the
+# decompressed data is never used so a different size may be optimal.  This size
+# was determined using contrib/libtests/timepng.c with compressed zTXt data
+# around 11MByte in size.  Slight speed improvements (up to about 14% in
+# timepng) can be achieved by very large increases (to 32kbyte) on regular data,
+# but highly compressible data shows only around 2% improvement.   The size is
+# chosen to minimize the effects of DoS attacks based on using very large
+# amounts of highly compressible data.
+
+setting INFLATE_BUF_SIZE default 1024
+
+# This is the maximum amount of IDAT data that the sequential reader will
+# process at one time.  The setting does not affect the size of IDAT chunks
+# read, just the amount read at once.  Neither does it affect the progressive
+# reader, which processes just the amount of data the application gives it.
+# The sequential reader is currently unable to process more than one IDAT at
+# once - it has to read and process each one in turn.  There is no point setting
+# this to a value larger than the IDAT chunks typically encountered (it would
+# just waste memory) but there may be some point in reducing it below the value
+# of ZBUF_SIZE (the size of IDAT chunks written by libpng.)
+
+setting IDAT_READ_SIZE default PNG_ZBUF_SIZE
+
 # Ancillary chunks
 chunk bKGD
-chunk cHRM
-chunk gAMA
+chunk cHRM enables COLORSPACE
+chunk gAMA enables GAMMA
 chunk hIST
-chunk iCCP
+chunk iCCP enables COLORSPACE GAMMA
 chunk iTXt
 chunk oFFs
 chunk pCAL
-chunk sCAL
 chunk pHYs
 chunk sBIT
+chunk sCAL
 chunk sPLT
-chunk sRGB
+chunk sRGB enables COLORSPACE GAMMA
 chunk tEXt requires TEXT
 chunk tIME
 chunk tRNS
@@ -534,9 +680,55 @@ chunk zTXt
 
 option READ_OPT_PLTE requires READ_ANCILLARY_CHUNKS
 
-option READ_UNKNOWN_CHUNKS requires READ
-option READ_UNKNOWN_CHUNKS enables UNKNOWN_CHUNKS READ_USER_CHUNKS
-option READ_USER_CHUNKS requires READ enables USER_CHUNKS
+# Unknown chunk handling
+#
+# 'UNKNOWN_CHUNKS' is a global option to disable all unknown chunk handling on
+# read or write; everything else below requires it (directly or indirectly).
+option UNKNOWN_CHUNKS
+
+# There are three main options to control the ability to read and write unknown
+# chunks.  If either read option is turned on then unknown chunks will be read,
+# otherwise they are skipped.  If the write option is turned on unknown chunks
+# set by png_set_unknown_chunks will be written otherwise it is an error to call
+# that API on a write struct.
+option WRITE_UNKNOWN_CHUNKS requires WRITE requires UNKNOWN_CHUNKS
+option WRITE_UNKNOWN_CHUNKS enables STORE_UNKNOWN_CHUNKS
+
+# The first way to read user chunks is to have libpng save them for a later call
+# to png_get_unknown_chunks, the application must call
+# png_set_keep_unknown_chunks to cause this to actually happen (see png.h)
+option SAVE_UNKNOWN_CHUNKS requires READ requires SET_UNKNOWN_CHUNKS
+option SAVE_UNKNOWN_CHUNKS enables READ_UNKNOWN_CHUNKS STORE_UNKNOWN_CHUNKS
+
+# The second approach is to use an application provided callback to process the
+# chunks, the callback can either handle the chunk entirely itself or request
+# that libpng store the chunk for later retrieval via png_get_unknown_chunks.
+#
+# Note that there is no 'WRITE_USER_CHUNKS' so the USER_CHUNKS option is always
+# the same as READ_USER_CHUNKS at present
+option READ_USER_CHUNKS requires READ requires UNKNOWN_CHUNKS
+option READ_USER_CHUNKS enables READ_UNKNOWN_CHUNKS USER_CHUNKS
+
+# Two further options are provided to allow detailed control of the handling.
+# The first enables png_set_keep_unknown_chunks; this allows the default to be
+# changed from discarding unknown chunks and allows per-chunk control.  This is
+# required to use the SAVE_UNKNOWN_CHUNKS option.  If enabled this option also
+# applies to write (see png.h), otherwise the write API simply writes all the
+# chunks it is given.
+#
+# The second option extends the unknown handling to allow known chunks to be
+# handled as though they were unknown.  This option doesn't change any APIs, it
+# merely turns on the code to check known as well as unknown chunks.
+#
+# This option no longer affects the write code.  It can be safely disabled and
+# will prevent applications stopping libpng reading known chunks.
+option SET_UNKNOWN_CHUNKS requires UNKNOWN_CHUNKS
+option HANDLE_AS_UNKNOWN requires SET_UNKNOWN_CHUNKS
+
+# The following options are derived from the above and should not be turned on
+# explicitly.
+option READ_UNKNOWN_CHUNKS requires UNKNOWN_CHUNKS disabled
+option STORE_UNKNOWN_CHUNKS requires UNKNOWN_CHUNKS disabled
 
 option CONVERT_tIME requires WRITE_ANCILLARY_CHUNKS
 # The "tm" structure is not supported on WindowsCE
@@ -547,13 +739,10 @@ option CONVERT_tIME requires WRITE_ANCILLARY_CHUNKS
 
 option WRITE_FILTER requires WRITE
 
-option WRITE_UNKNOWN_CHUNKS requires WRITE
-
-option HANDLE_AS_UNKNOWN
-
-option SAVE_INT_32 requires WRITE
-
-# png_save_int_32 is required by the ancillary chunks oFFs and pCAL
+option SAVE_INT_32 disabled
+# png_save_int_32 is required internally for writing the ancillary chunks oFFs
+# and pCAL and for both reading and writing iCCP (for the generation/checking of
+# the corresponding cHRM/gAMA chunks) if full ICC is supported.
 
 # added at libpng-1.5.4
 
@@ -588,3 +777,36 @@ option CHECK_FOR_INVALID_INDEX enables WRITE_CHECK_FOR_INVALID_INDEX
 option READ_CHECK_FOR_INVALID_INDEX requires READ CHECK_FOR_INVALID_INDEX
 option WRITE_CHECK_FOR_INVALID_INDEX requires WRITE CHECK_FOR_INVALID_INDEX
 
+# added at libpng-1.5.15
+option GET_PALETTE_MAX enables READ_GET_PALETTE_MAX WRITE_GET_PALETTE_MAX
+option READ_GET_PALETTE_MAX requires READ_CHECK_FOR_INVALID_INDEX disabled
+option WRITE_GET_PALETTE_MAX requires WRITE_CHECK_FOR_INVALID_INDEX disabled
+
+# Simplified API options (added at libpng-1.6.0)
+# Read:
+option SIMPLIFIED_READ requires SEQUENTIAL_READ READ_TRANSFORMS SETJMP
+option SIMPLIFIED_READ requires BENIGN_ERRORS READ_GAMMA
+option SIMPLIFIED_READ enables READ_EXPAND READ_16BIT READ_EXPAND_16
+option SIMPLIFIED_READ enables READ_SCALE_16_TO_8 READ_RGB_TO_GRAY
+option SIMPLIFIED_READ enables READ_ALPHA_MODE READ_BACKGROUND READ_STRIP_ALPHA
+option SIMPLIFIED_READ enables READ_FILLER READ_SWAP
+
+option SIMPLIFIED_READ_AFIRST requires SIMPLIFIED_READ disabled
+option READ_SWAP_ALPHA enables SIMPLIFIED_READ_AFIRST
+
+option SIMPLIFIED_READ_BGR requires SIMPLIFIED_READ disabled
+option READ_BGR enables SIMPLIFIED_READ_BGR
+
+# Write:
+option SIMPLIFIED_WRITE requires WRITE STDIO SETJMP
+option SIMPLIFIED_WRITE enables WRITE_SWAP WRITE_gAMA WRITE_sRGB WRITE_cHRM
+
+option SIMPLIFIED_WRITE_AFIRST requires SIMPLIFIED_WRITE disabled
+option WRITE_SWAP_ALPHA enables SIMPLIFIED_WRITE_AFIRST
+
+option SIMPLIFIED_WRITE_BGR requires SIMPLIFIED_WRITE disabled
+option WRITE_BGR enables SIMPLIFIED_WRITE_BGR
+
+# Formats:
+option FORMAT_AFIRST if SIMPLIFIED_READ_AFIRST SIMPLIFIED_WRITE_AFIRST
+option FORMAT_BGR if SIMPLIFIED_READ_BGR SIMPLIFIED_WRITE_BGR
index b5f56840cd864c778f065c7fafcd10b4bcdf6d79..b31827956459a2191d491d2bc5546a3d13def8bc 100644 (file)
@@ -3,9 +3,9 @@
 
 /* pnglibconf.h - library build configuration */
 
-/* Libpng 1.5.14 - January 24, 2013 */
+/* Libpng 1.6.0 - February 14, 2013 */
 
-/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */
+/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */
 
 /* This code is released under the libpng license. */
 /* For conditions of distribution and use, see the disclaimer */
 #define PNG_COST_SHIFT 3
 #define PNG_DEFAULT_READ_MACROS 1
 #define PNG_GAMMA_THRESHOLD_FIXED 5000
+#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
+#define PNG_INFLATE_BUF_SIZE 1024
 #define PNG_MAX_GAMMA_8 11
 #define PNG_QUANTIZE_BLUE_BITS 5
 #define PNG_QUANTIZE_GREEN_BITS 5
 #define PNG_QUANTIZE_RED_BITS 5
 #define PNG_sCAL_PRECISION 5
+#define PNG_sRGB_PROFILE_CHECKS 2
+#define PNG_TEXT_Z_DEFAULT_COMPRESSION Z_DEFAULT_COMPRESSION
+#define PNG_TEXT_Z_DEFAULT_STRATEGY Z_DEFAULT_STRATEGY
 #define PNG_WEIGHT_SHIFT 8
 #define PNG_ZBUF_SIZE 8192
+#define PNG_Z_DEFAULT_COMPRESSION Z_DEFAULT_COMPRESSION
+#define PNG_Z_DEFAULT_NOFILTER_STRATEGY Z_DEFAULT_STRATEGY
+#define PNG_Z_DEFAULT_STRATEGY Z_FILTERED
 /* end of settings */
 /* options */
 #define PNG_16BIT_SUPPORTED
 #define PNG_ALIGN_MEMORY_SUPPORTED
 #define PNG_BENIGN_ERRORS_SUPPORTED
+#define PNG_BENIGN_READ_ERRORS_SUPPORTED
+/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
 #define PNG_bKGD_SUPPORTED
 #define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
-#define PNG_CHECK_cHRM_SUPPORTED
 #define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
 #define PNG_cHRM_SUPPORTED
+#define PNG_COLORSPACE_SUPPORTED
 #define PNG_CONSOLE_IO_SUPPORTED
 #define PNG_CONVERT_tIME_SUPPORTED
 #define PNG_EASY_ACCESS_SUPPORTED
 #define PNG_FIXED_POINT_SUPPORTED
 #define PNG_FLOATING_ARITHMETIC_SUPPORTED
 #define PNG_FLOATING_POINT_SUPPORTED
+#define PNG_FORMAT_AFIRST_SUPPORTED
+#define PNG_FORMAT_BGR_SUPPORTED
 #define PNG_gAMA_SUPPORTED
+#define PNG_GAMMA_SUPPORTED
+#define PNG_GET_PALETTE_MAX_SUPPORTED
 #define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
 #define PNG_hIST_SUPPORTED
 #define PNG_iCCP_SUPPORTED
@@ -80,6 +94,7 @@
 #define PNG_READ_FILLER_SUPPORTED
 #define PNG_READ_gAMA_SUPPORTED
 #define PNG_READ_GAMMA_SUPPORTED
+#define PNG_READ_GET_PALETTE_MAX_SUPPORTED
 #define PNG_READ_GRAY_TO_RGB_SUPPORTED
 #define PNG_READ_hIST_SUPPORTED
 #define PNG_READ_iCCP_SUPPORTED
 #define PNG_READ_USER_CHUNKS_SUPPORTED
 #define PNG_READ_USER_TRANSFORM_SUPPORTED
 #define PNG_READ_zTXt_SUPPORTED
+/*#undef PNG_SAFE_LIMITS_SUPPORTED*/
 #define PNG_SAVE_INT_32_SUPPORTED
+#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
 #define PNG_sBIT_SUPPORTED
 #define PNG_sCAL_SUPPORTED
 #define PNG_SEQUENTIAL_READ_SUPPORTED
 #define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
 #define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
 #define PNG_SETJMP_SUPPORTED
+#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
 #define PNG_SET_USER_LIMITS_SUPPORTED
+#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
+#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED
+#define PNG_SIMPLIFIED_READ_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_SUPPORTED
 #define PNG_sPLT_SUPPORTED
 #define PNG_sRGB_SUPPORTED
 #define PNG_STDIO_SUPPORTED
+#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
 #define PNG_tEXt_SUPPORTED
 #define PNG_TEXT_SUPPORTED
 #define PNG_TIME_RFC1123_SUPPORTED
 #define PNG_WRITE_FILTER_SUPPORTED
 #define PNG_WRITE_FLUSH_SUPPORTED
 #define PNG_WRITE_gAMA_SUPPORTED
+#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED
 #define PNG_WRITE_hIST_SUPPORTED
 #define PNG_WRITE_iCCP_SUPPORTED
 #define PNG_WRITE_INTERLACING_SUPPORTED
index c04578f31d9e545b716cdb1e4ce33303766bf698..c799fb790b0888254a751c4048752bb9be192e84 100755 (executable)
@@ -18,7 +18,8 @@ SED = sed
 COPY = cp
 DELETE = rm -f
 ECHO = echo
-DFA_XTRA = # Appended to scripts/options.awk
+DFA_XTRA = # Put your configuration file here, see scripts/pnglibconf.dfa.  Eg:
+# DFA_XTRA = pngusr.dfa
 
 # CPPFLAGS should contain the options to control the result,
 # but DEFS and CFLAGS are also supported here, override
@@ -41,13 +42,13 @@ pnglibconf.h: pnglibconf.dfn
        $(COPY) dfn3.out $@
        $(DELETE) dfn.c dfn1.out dfn2.out dfn3.out
 
-pnglibconf.dfn: $(srcdir)/scripts/pnglibconf.dfa $(srcdir)/scripts/options.awk $(srcdir)/pngconf.h
+pnglibconf.dfn: $(srcdir)/scripts/pnglibconf.dfa $(srcdir)/scripts/options.awk $(srcdir)/pngconf.h $(srcdir)/pngusr.dfa
        $(DELETE) $@ dfn1.out dfn2.out
        $(ECHO) "Calling $(AWK) from scripts/pnglibconf.mak" >&2
        $(ECHO) "If 'awk' crashes try a better awk (e.g. AWK='nawk')" >&2
        $(AWK) -f $(srcdir)/scripts/options.awk out=dfn1.out version=search\
                $(srcdir)/pngconf.h $(srcdir)/scripts/pnglibconf.dfa\
-               $(DFA_XTRA) 1>&2
+               $(srcdir)/pngusr.dfa $(DFA_XTRA) 1>&2
        $(AWK) -f $(srcdir)/scripts/options.awk out=dfn2.out dfn1.out 1>&2
        $(COPY) dfn2.out $@
        $(DELETE) dfn1.out dfn2.out
diff --git a/l4/pkg/libpng/lib/dist/scripts/prefix.dfn b/l4/pkg/libpng/lib/dist/scripts/prefix.dfn
new file mode 100644 (file)
index 0000000..1e8561f
--- /dev/null
@@ -0,0 +1,20 @@
+
+/* prefix.dfn - generate an unprefixed symbol list
+ *
+ * Last changed in libpng version 1.6.0 [January 30, 2012]
+ * Copyright (c) 2012 Glenn Randers-Pehrson
+ *
+ * This code is released under the libpng license.
+ * For conditions of distribution and use, see the disclaimer
+ * and license in png.h
+ */
+
+#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
+       PNG_DEFN_MAGIC-name-PNG_DEFN_END
+
+/* The configuration information *before* the additional of symbol renames,
+ * the list is the C name list; no symbol prefix.
+ */
+#include "pnglibconf.out"
+
+#include "../png.h"
index 49ccfed8ce32a76c71b8728382ddce0203ff3dfe..1e150df5a3cc52f3523c63355919ab8aeb76371e 100644 (file)
@@ -5,7 +5,7 @@
 LIBRARY
 
 EXPORTS
-;Version 1.5.14
+;Version 1.6.0
  png_access_version_number @1
  png_set_sig_bytes @2
  png_sig_cmp @3
@@ -205,7 +205,6 @@ EXPORTS
  png_get_y_offset_inches @197
  png_get_pHYs_dpi @198
  png_get_io_state @199
- png_get_io_chunk_name @200
  png_get_uint_32 @201
  png_get_uint_16 @202
  png_get_int_32 @203
@@ -239,4 +238,13 @@ EXPORTS
  png_get_cHRM_XYZ_fixed @231
  png_set_cHRM_XYZ @232
  png_set_cHRM_XYZ_fixed @233
- png_set_check_for_invalid_index @234
+ png_image_begin_read_from_file @234
+ png_image_begin_read_from_stdio @235
+ png_image_begin_read_from_memory @236
+ png_image_finish_read @237
+ png_image_free @238
+ png_image_write_to_file @239
+ png_image_write_to_stdio @240
+ png_convert_to_rfc1123_buffer @241
+ png_set_check_for_invalid_index @242
+ png_get_palette_max @243
index 65d9b9352f91504be35b841b78b5e8a9666ba026..ed339421e002b50ab15b61f65e91cf4371cc9993 100644 (file)
@@ -2,7 +2,6 @@ PKGDIR          ?= ../..
 L4DIR           ?= $(PKGDIR)/../..
 
 TARGET          = libl4png_wrap.a libl4png_wrap.so
-SYSTEMS         = $(SYSTEMS_PLAIN)
 SRC_C           = l4png_wrap.c 
 PC_FILENAME     = libl4png_wrap
 REQUIRES_LIBS   = zlib libpng
index af8d419e15d246c5d8e70556925af077e3bd3ab7..b3ed89a80ad5f8b97294657882a089865d76b6d7 100644 (file)
@@ -1,6 +1,7 @@
 #include <l4/libpng/l4png_wrap.h>
 #include <l4/sys/l4int.h>
 #include <stdlib.h>
+#include <string.h>
 #include <png.h>
 #include <pngstruct.h>
 
index cbf5e243c11a44b45087f832dfc2c18c593b90de..3af06d062922af68b99eefe30227a54f944ea19f 100644 (file)
@@ -41,6 +41,11 @@ public:
     return l4vbus_gpio_config_pad(_bus.cap(), _dev, _pin, func, value);
   }
 
+  int config_get(unsigned func, unsigned *value) const
+  {
+    return l4vbus_gpio_config_get(_bus.cap(), _dev, _pin, func, value);
+  }
+
   int to_irq() const
   {
     return l4vbus_gpio_to_irq(_bus.cap(), _dev, _pin);
index d189b9e2d23d541ceafd32d53dd0f5b6701e595a..ad6b9e277d121862bc832f03d51961911a41f549 100644 (file)
@@ -13,6 +13,7 @@ enum L4vbus_gpio_op
 {
   L4VBUS_GPIO_OP_SETUP,
   L4VBUS_GPIO_OP_CONFIG_PAD,
+  L4VBUS_GPIO_OP_CONFIG_GET,
   L4VBUS_GPIO_OP_GET,
   L4VBUS_GPIO_OP_SET,
   L4VBUS_GPIO_OP_MULTI_SETUP,
index ebd25a45b9f8b07578805113ec2ce65340b6fe85..3ffdae73b24ea90f04a8067b434f37cbe9826ee3 100644 (file)
@@ -29,6 +29,10 @@ int L4_CV
 l4vbus_gpio_config_pad(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
                        unsigned pin, unsigned func, unsigned value);
 
+int L4_CV
+l4vbus_gpio_config_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
+                       unsigned pin, unsigned func, unsigned *value);
+
 int L4_CV
 l4vbus_gpio_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
                 unsigned pin);
index 1ea5f163bafc585ff6f80fc370cebdf6833f16d0..9b7040056aabc9c024e243a31d88d8082b34de67 100644 (file)
@@ -32,6 +32,22 @@ l4vbus_gpio_config_pad(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
   return l4_error(s.call(vbus));
 }
 
+int L4_CV
+l4vbus_gpio_config_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
+                       unsigned pin, unsigned func, unsigned *value)
+{
+  L4::Ipc::Iostream s(l4_utcb());
+  l4vbus_device_msg(handle, L4VBUS_GPIO_OP_CONFIG_GET, s);
+  s << pin << func;
+  int r = l4_error(s.call(vbus));
+  if (r)
+    return r;
+
+  s >> *value;
+
+  return 0;
+}
+
 int L4_CV
 l4vbus_gpio_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin)
 {
index ddc5fb6c2d6ec7d14d02fc4da7c32381993d0280..dfa3384e5d79141d2d742baf0f73d82580f5d9b9 100644 (file)
@@ -620,7 +620,7 @@ end
 --  Generic pointer device handling.
 --
 --  Handles absolute and relative motion events and the buttons
---  corresponding to a pointer device, suahc as a mouse.
+--  corresponding to a pointer device, such as a mouse.
 -- ----------------------------------------------------------------------
 Input_device.Devs.pointer = {};
 
index f17d592c9708890924b3db84b76c69c1ec0bcaee..253b4a460efcccecf0a6c11acc171412a3c4c4c3 100755 (executable)
@@ -5,14 +5,15 @@ echo ""
 echo "[general]"
 echo "   page_fault_handling = rw"
 echo "  threads             = yes"
+echo "  intercept_kip       = yes"
 echo "#  redundancy          = none"
 echo "#  redundancy          = dual"
 echo "#  redundancy          = triple"
 echo ""
-echo "  logbuf               = 16"
-echo "  logreplica           = true"
-echo "  logrdtsc             = true"
-echo "# logtimeout           = 45"
+echo "#  logbuf               = 16"
+echo "#  logreplica           = true"
+echo "#  logrdtsc             = true"
+echo "#  logtimeout           = 15"
 echo ""
 echo "#  print_vcpu_state    = y"
 echo "#  log                 = all"
@@ -28,11 +29,8 @@ for f in $function_list; do
 done
 
 
-kiptime=""
-for line in `objdump -lSCd $1 | grep ff0a0 | cut -d: -f 1`; do
-       kiptime+="0x$line "
-done
-kiptime=`echo $kiptime | sed -re 's/\w$//' | sed -re 's/ 0x/,0x/g'`
 echo ""
 echo "[kip-time]"
-echo "target = $kiptime"
+for v in libc_backend_rt_clock_gettime mono_clock_gettime; do
+       echo -n "  "; nm $1 | grep $v |  sed -re 's/([0-9a-f]+) [wWtT] (.*)/\2 = 0x\1/g';
+done
index 35c47cd017e580e8e6bb955ab7b85c85ab486f32..aeb7891440d28fab45c1406ce1e91ff6c49bb4c7 100644 (file)
@@ -4,6 +4,7 @@ L4DIR   ?= $(PKGDIR)/../..
 TARGET = serial_client \
          trap+emulate \
          hello \
+         large_malloc \
          pthread_hello \
          pthread_mutex \
          eventbuf
index a5baebe15a719e13f44de3e1ead784043bfa8438..2c6fa20378716c4ee7d1a9380a2c7e9939990633 100644 (file)
@@ -1,3 +1,14 @@
+/*
+ * eventbuf/main.cc --
+ *
+ * Test for the shared-memory event buffer
+ *
+ * (c) 2013 Björn Döbel <doebel@os.inf.tu-dresden.de>,
+ *     economic rights: Technische Universität Dresden (Germany)
+ * This file is part of TUD:OS and distributed under the terms of the
+ * GNU General Public License 2.
+ * Please see the COPYING-GPL-2 file for details.
+ */
 #include <cstdlib>
 #include <cstdio>
 #include <cstring>
diff --git a/l4/pkg/plr/ex/large_malloc/Makefile b/l4/pkg/plr/ex/large_malloc/Makefile
new file mode 100644 (file)
index 0000000..cc9bc82
--- /dev/null
@@ -0,0 +1,14 @@
+PKGDIR ?=      ../../..
+L4DIR ?=       $(PKGDIR)/..
+
+SYSTEMS = x86-l4f
+
+TARGET = large_malloc
+SRC_CC = main.cc
+
+REQUIRES_LIBS = libstdc++
+
+CXXFLAGS += -I$(SRC_DIR)/../../server/src/
+include $(L4DIR)/mk/prog.mk
+
+#LDFLAGS += -lpthread_rep -luc_c -levbuf_c
diff --git a/l4/pkg/plr/ex/large_malloc/main.cc b/l4/pkg/plr/ex/large_malloc/main.cc
new file mode 100644 (file)
index 0000000..bbb4618
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * large_malloc/main.cc --
+ * 
+ *    Try out a couple of malloc/l4_touch_rw/free sequences
+ *    to figure out the overhead for Romain's memory management.
+ *
+ * (c) 2013 Björn Döbel <doebel@os.inf.tu-dresden.de>,
+ *     economic rights: Technische Universität Dresden (Germany)
+ * This file is part of TUD:OS and distributed under the terms of the
+ * GNU General Public License 2.
+ * Please see the COPYING-GPL-2 file for details.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <sys/time.h>
+#include <errno.h>
+
+#include <l4/util/util.h>
+#include <l4/re/env.h>
+#include <l4/sys/kdebug.h>
+
+#include "log"
+
+#define NUM_SIZES 5
+
+/*
+ */
+static inline long long US(struct timeval& tv)
+{
+       return tv.tv_sec * 1000000 + tv.tv_usec;
+}
+
+int main(void)
+{
+       l4_umword_t sizes[NUM_SIZES] = {
+                     1024 * 1024, // 1 MB
+                64 * 1024 * 1024, // 64 MB
+               100 * 1024 * 1024, // 100 MB
+               300 * 1024 * 1024, // 300 MB
+               500 * 1024 * 1024, // 500 MB
+       };
+
+       for (unsigned i = 0; i < NUM_SIZES; ++i) {
+               struct timeval tstart, tmalloc, ttouch, tfree;
+
+               printf("%s==== %d -> %lx ====%s\n", BOLD_CYAN, i, sizes[i], NOCOLOR);
+
+               gettimeofday(&tstart, 0);
+               char *p = reinterpret_cast<char*>(malloc(sizes[i]));
+               printf("malloc(%lx) = %p (%d)\n",
+                      sizes[i], p, errno);
+               if (!p)
+                       enter_kdebug("malloc");
+               gettimeofday(&tmalloc, 0);
+               l4_touch_rw(p, sizes[i]);
+               gettimeofday(&ttouch, 0);
+               printf("... touched.\n");
+               free(p);
+               gettimeofday(&tfree, 0);
+               printf("%sfreed.%s\n", BOLD_GREEN, NOCOLOR);
+
+               printf("malloc %10lld Âµs, touch %10lld Âµs, free %10lld Âµs\n",
+                      US(tmalloc) - US(tstart),
+                      US(ttouch)  - US(tmalloc),
+                      US(tfree)   - US(ttouch));
+       }
+
+       enter_kdebug("I am done.");
+       return 0;
+}
index dd38435019c670ca3d191466097fdebe28497d0c..4587a8fa7b26fbea48d9d1e5f0f7dc91d8490388 100644 (file)
@@ -1,3 +1,15 @@
+/*
+ * pthread_mutex/main.c --
+ * 
+ *             Microbenchmark to evaluate the overhead of intercepting
+ *             locking primitives.
+ *
+ * (c) 2012-2013 Björn Döbel <doebel@os.inf.tu-dresden.de>,
+ *     economic rights: Technische Universität Dresden (Germany)
+ * This file is part of TUD:OS and distributed under the terms of the
+ * GNU General Public License 2.
+ * Please see the COPYING-GPL-2 file for details.
+ */
 #include <stdio.h>
 #include <assert.h>
 #include <sys/time.h>
 static int globalcounter;
 pthread_mutex_t mtx;
 
-static const unsigned print_iterations = 100;
-static const unsigned inc_iterations   = 1000;
+#define NUM_THREADS 2
+
+static const unsigned print_iterations = 1000;
+static const unsigned inc_iterations   = 10000 / NUM_THREADS;
 
 static
 void *thread(void *data)
@@ -77,6 +91,7 @@ int main(int argc, char **argv)
        }
 
        pthread_join(pt, NULL);
+       printf("joined\n");
 
        gettimeofday(&stop, NULL);
 
index 56d17a7b818a02622c0e3d213dfd44330aa1342d..96ec73211583d78355c4e7f1a39bb29992d4757a 100644 (file)
@@ -1,7 +1,15 @@
 /*
- * (c) 2009 Technische Universität Dresden
- * This file is part of TUD:OS, which is distributed under the terms of the
- * GNU General Public License 2. Please see the COPYING file for details.
+ * vcpu.cc --
+ * 
+ * VCPU test for comparing different strategies of emulating
+ * write accesses to shared memory.
+ *
+ * (c) 2011-2013 Björn Döbel <doebel@os.inf.tu-dresden.de>,
+ *                              Adam Lackorzynski <adam@os.inf.tu-dresden.de>
+ *     economic rights: Technische Universität Dresden (Germany)
+ * This file is part of TUD:OS and distributed under the terms of the
+ * GNU General Public License 2.
+ * Please see the COPYING-GPL-2 file for details.
  */
 #include <l4/sys/thread>
 #include <l4/sys/factory>
index 01cae0ffe7b6f0c20afeb2044e3abc9ddd57bbbb..dabd78acdb068de30de783725ce132c41deb4186 100644 (file)
@@ -96,6 +96,7 @@ namespace Measurements
                        mtx_unlock
                };
                unsigned eventType;
+               unsigned lockPtr;
        };
 
 
@@ -116,8 +117,9 @@ namespace Measurements
        struct __attribute__((packed))
        BarnesEvent
        {
-               unsigned nodeptr;
-               unsigned seqnum;
+               unsigned ptr;
+               unsigned num;
+               unsigned type;
        };
 
 
@@ -263,4 +265,4 @@ extern "C"
        struct GenericEvent* evbuf_next(void *eb);
 #ifdef __cplusplus
 }
-#endif
\ No newline at end of file
+#endif
index e13ae1ae014f694e8747368c6268ec88849994cf..f0cb249027a1e0175639cd12580775afaec0cef5 100644 (file)
@@ -1,5 +1,6 @@
 #pragma once
 
+#include <l4/sys/types.h>
 #include <l4/util/atomic.h>
 
 struct spinlock
index 5553569ba528fc295bfab6ceb8e6fb697f58fd81..d2967fba158efaa50b5171448be679aa259e45a6 100644 (file)
@@ -43,7 +43,6 @@ int pthread_mutex_unlock_rep(pthread_mutex_t * mutex);
 
 #define YIELD()  yield() 
 #define BARRIER() asm volatile ("" : : : "memory");
-#define ASSERT42(cond, msg) do { /*if (cond) enter_kdebug42(msg);*/ } while (0)
 
 #define GO_TO_SLEEP 0
 
@@ -187,15 +186,28 @@ static void init_replica_mutex(pthread_mutex_t* mtx)
   rep_function_restore_regs();
 }
 
+#if 0
+#define EVENT(_mtx, _type, _data1, _data2) \
+do { \
+  char *evb = evbuf_get_address(); \
+  struct GenericEvent *ev = evbuf_next(evb); \
+  ev->header.tsc          = evbuf_get_time(evb, 1); \
+  ev->header.vcpu         = (unsigned)thread_self(); \
+  ev->header.type         = 9; \
+  ev->data.shml.lockid    = (_mtx)->__m_reserved; \
+  ev->data.shml.type      = _type; \
+  ev->data.shml.epoch     = _data1; \
+  ev->data.shml.owner     = _data2; \
+} while (0)
+#else
+#define EVENT(_mtx, _type, _data1, _data2) do {} while(0)
+#endif
+
 int
 attribute_hidden
 pthread_mutex_lock_rep(pthread_mutex_t * mutex)
 {
   rep_function_save_regs();
-
-  void *evb = evbuf_get_address();
-  struct GenericEvent *ev_in = evbuf_next(evb);
-  struct GenericEvent *ev_out = evbuf_next(evb);
   
        /*
         * not initialized yet? -> happens for statically initialized
@@ -211,13 +223,7 @@ pthread_mutex_lock_rep(pthread_mutex_t * mutex)
   thread_self()->p_epoch  += 1;
   
   ACQ(li, mutex);
-  ev_in->header.tsc          = evbuf_get_time(evb, 1);
-  ev_in->header.vcpu         = (unsigned)thread_self();
-  ev_in->header.type         = 9; // SHMLOCKING
-  ev_in->data.shml.lockid    = mutex->__m_reserved;
-  ev_in->data.shml.type      = 2;
-  ev_in->data.shml.epoch     = thread_self()->p_epoch;
-  ev_in->data.shml.owner     = LOCKli(li, mutex).owner;
+  EVENT(mutex, 2, thread_self()->p_epoch, LOCKli(li, mutex).owner);
   REL(li, mutex);
   
   /*outstring("lock() "); outhex32(thread_self()->p_epoch); outstring("\n");*/
@@ -228,14 +234,9 @@ pthread_mutex_lock_rep(pthread_mutex_t * mutex)
   
     if (LOCKli(li, mutex).owner == lock_unowned)
     {
-      ASSERT42(LOCKli(li, mutex).wait_count != 0, "wait count != 0");
-      ASSERT42(LOCKli(li, mutex).acq_count != 0,  "acq count  != 0");
-      ASSERT42(LOCKli(li, mutex).wake_count != 0, "wake count != 0");
-      
       LOCKli(li, mutex).owner       = (l4_addr_t)thread_self();
       LOCKli(li, mutex).owner_epoch = thread_self()->p_epoch;
-      /* Acquisition count is incremented (not set to!) replica count */
-      LOCKli(li, mutex).acq_count   += li->replica_count;
+      LOCKli(li, mutex).acq_count   = li->replica_count;
       break;
     }
     else if (LOCKli(li, mutex).owner == (l4_addr_t)thread_self())
@@ -245,17 +246,9 @@ pthread_mutex_lock_rep(pthread_mutex_t * mutex)
         REL(li, mutex);
         YIELD();
         continue;
-        
-        // XXX allow multiple subsequent lock acquisitions */
-        /*
-        outhex42(LOCKli(li, mutex).owner_epoch); outchar42(' ');
-        outhex42(thread_self()->p_epoch); outchar42('\n');
-        enter_kdebug42("epoch mismatch");
-        */
       }
 
       break;
-      //enter_kdebug42("mtx owned by me");
     }
     else
     {
@@ -265,12 +258,7 @@ pthread_mutex_lock_rep(pthread_mutex_t * mutex)
     }
   }
 
-  ev_out->header.tsc          = evbuf_get_time(evb, 1);
-  ev_out->header.vcpu         = (unsigned)thread_self();
-  ev_out->header.type         = 9; // SHMLOCKING
-  ev_out->data.shml.lockid    = mutex->__m_reserved;
-  ev_out->data.shml.type      = 3;
-  ev_out->data.shml.epoch     = thread_self()->p_epoch;
+  EVENT(mutex, 3, thread_self()->p_epoch, 0);
 
   REL(li, mutex);
 
@@ -288,36 +276,17 @@ pthread_mutex_unlock_rep(pthread_mutex_t * mutex)
 {
   rep_function_save_regs();
 
-  void *evb = evbuf_get_address();
-  struct GenericEvent *ev_in  = evbuf_next(evb);
-  struct GenericEvent *ev_out = evbuf_next(evb);
-
   lock_info *li = get_lock_info();
   
   ACQ(li, mutex);
-
-  ev_in->header.tsc           = evbuf_get_time(evb, 1);
-  ev_in->header.vcpu          = (unsigned)thread_self();
-  ev_in->header.type          = 9; // SHMLOCKING
-  ev_in->data.shml.type       = 4;
-  ev_in->data.shml.lockid     = mutex->__m_reserved;
-  ev_in->data.shml.epoch      = thread_self()->p_epoch;
-  
-  ASSERT42(LOCKli(li, mutex).owner != (l4_addr_t)thread_self(), "unlock not by owner");
-  ASSERT42(LOCKli(li, mutex).acq_count == 0, "acq count == 0");
+  EVENT(mutex, 4, LOCKli(li, mutex).acq_count, 0);
   
   LOCKli(li, mutex).acq_count -= 1;
   if (LOCKli(li, mutex).acq_count == 0) {
       LOCKli(li, mutex).owner = lock_unowned;
   }
 
-  ev_out->header.tsc          = evbuf_get_time(evb, 1);
-  ev_out->header.vcpu         = (unsigned)thread_self();
-  ev_out->header.type         = 9; // SHMLOCKING
-  ev_out->data.shml.type      = 5;
-  ev_out->data.shml.lockid    = mutex->__m_reserved;
-  ev_out->data.shml.owner     = LOCKli(li, mutex).owner;
-  ev_out->data.shml.epoch     = thread_self()->p_epoch;
+  EVENT(mutex, 5, LOCKli(li, mutex).owner, thread_self()->p_epoch);
 
   REL(li, mutex);
 
index a29ec66e8d93e114cdceb3396813f6eb655c4cc0..91a9ab862d207efa02c8eadbb7f4050c92516554 100644 (file)
@@ -141,39 +141,6 @@ class App_instance
                }
 
 
-               /*
-                * Map a local region to a remote region using the least
-                * possible amount of map operations (XXX).
-                */
-               void map(l4_addr_t local_start, l4_addr_t remote_start,/* l4_size_t size,*/
-                                unsigned pageflags, l4_size_t size = L4_PAGESIZE)
-               {
-                       //DEBUG() << "map " << std::hex << local_start << " -> " << remote_start
-                       //        << " size " << size;
-
-                       while (size > 0) {
-                               unsigned frame_l = local_start  >> L4_PAGESHIFT;
-                               unsigned frame_r = remote_start >> L4_PAGESHIFT;
-                               (void)frame_l; (void)frame_r;
-                               unsigned shift   = 0;
-                               (void)frame_l; (void)frame_r;
-
-/* Macro checks whether the size fits a given number of pages */
-#define FOO(x) do { \
-       if ((!frame_l & (x-1)) && (!frame_r & (x-1)) && (size >= (x*L4_PAGESIZE))) { \
-               shift += 1; \
-       } \
-} while (0)
-                               //FOO(2); FOO(4); FOO(8); FOO(16); FOO(32); FOO(64);
-                               map_aligned(local_start, remote_start, L4_PAGESHIFT + shift, pageflags);
-                               local_start  += (L4_PAGESIZE << shift);
-                               remote_start += (L4_PAGESIZE << shift);
-                               size -= (L4_PAGESIZE << shift);
-                       }
-                       //enter_kdebug("mapped");
-               }
-
-
                /*
                 * Unmap a flexpage from replica
                 */
index e5e897a34ed8d4b9c4e1570535b4d108ad43a35f..48f4adbf34bc927ee55cb6304f023135dbed3065 100644 (file)
@@ -22,6 +22,10 @@ Romain::App_model::Const_dataspace Romain::App_model::open_file(char const *name
 
        int err = open(name, O_RDONLY);
        MSG() << "fopen: " << err;
+       if (err < 0) {
+               ERROR() << "Could not open binary file '" << name << "'";
+               enter_kdebug("file not found");
+       }
 
        cxx::Ref_ptr<L4Re::Vfs::File> fp = L4Re::Vfs::vfs_ops->get_file(err);
        MSG() << "file ptr @ " << fp;
index c7256c691086565a50ba4d247b31cb1d91e91690..b68f74b39f2df59c1e3a23c13d49927178a74375 100644 (file)
@@ -286,6 +286,7 @@ Romain::Thread_group::control(Romain::App_thread *t, l4_utcb_t *utcb, Romain::Ap
                *reinterpret_cast<l4_umword_t*>(local_addr) = utcb_remote;
                void* tip_addr = am->prog_attach_ds(0, L4_PAGESIZE, ds, 0,
                                                                                        L4Re::Rm::Search_addr, "thread info page", local_addr);
+               DEBUG() << "Remote TIP address: " << tip_addr;
 
                for (unsigned i = 0; i < threads.size(); ++i) {
                        threads[i]->setup_utcb_segdesc(reinterpret_cast<l4_addr_t>(tip_addr), 4);
index eedcd8408e8b1af1ace895d7c46bcbaae57ccc9a..d639982e29ce0c2969db9b5e4eac3144017a0765 100644 (file)
@@ -1,4 +1,4 @@
-// vi: ft=cpp
+// vim: ft=cpp
 #pragma once
 
 /*
index 730655c75f40bb33be4a762db9e1d3a6827e0e79..31f4c9fe8e00ca8da2b1fc149d58105baa929aa9 100644 (file)
@@ -40,6 +40,7 @@ namespace Romain
        enum {
                MAX_REPLICAS        =  3,        // maximum # of allowed replicas
                MAX_OBSERVERS       = 16,        // maximum # of fault observers
+               MAX_CPUS            = 32,        // maximum # of physical CPUs we handle
                TRAMPOLINE_SIZE     = 64,        // size of the per-thread trampoline area
                HANDLER_STACK_SIZE  = (1 << 14), // size of the VCPU handler stack
                DEBUG_ENTRIES       = 1000,      // dbg: # of 64bit entries in thread->_measurements
diff --git a/l4/pkg/plr/server/src/cpuid.h b/l4/pkg/plr/server/src/cpuid.h
new file mode 100644 (file)
index 0000000..e896277
--- /dev/null
@@ -0,0 +1,108 @@
+#pragma once
+
+#include <l4/sys/types.h>
+#include "constants.h"
+
+struct CPU_id
+{
+    l4_umword_t fiasco_id;
+    l4_umword_t apic_id;
+
+    CPU_id(l4_umword_t a=0xf00, l4_umword_t b=0xf00)
+        : fiasco_id(a), apic_id(b)
+    {}
+
+    static bool comp_apic(CPU_id const& i1, CPU_id const& i2)
+    { return i1.apic_id < i2.apic_id; }
+};
+
+class CPUID
+{
+public:
+
+    enum {
+        MAXID     = 0x00,
+        FMS_flags = 0x01,
+        CACHES_o  = 0x02,
+        PSN       = 0x03,
+        CACHES_n  = 0x04,
+        MON       = 0x05,
+        POWER     = 0x06,
+        FLAGS     = 0x07,
+        DCA       = 0x08,
+        PEMO      = 0x09,
+        TOPOLOGY  = 0x0B,
+        XSTATE    = 0x0D,
+    };
+
+    /* Perform CPUID */
+    static unsigned cpuid(l4_umword_t code, l4_umword_t* a, l4_umword_t* b,
+                          l4_umword_t *c, l4_umword_t *d)
+    {
+        asm volatile ("cpuid"
+         : "=a"(*a), "=b"(*b), "=c"(*c), "=d"(*d)
+         : "a" (code), "b" (*b), "c" (*c), "d" (*d));
+        return *a;
+    }
+
+
+    /*
+     * Check if CPU supports CPUID.
+     *
+     * From http://wiki.osdev.org/CPUID
+     */
+     static bool have_cpuid()
+     {
+        l4_umword_t ret;
+        asm volatile (
+            "pushf\t\n"
+            "pop %%eax\t\n"
+            "mov %%eax, %%ecx\t\n"
+            "xor $0x200000, %%eax\t\n"
+            "push %%eax\t\n"
+            "popf\t\n"
+            "pushf\t\n"
+            "pop %%eax\t\n"
+            "xor %%ecx, %%eax\t\n"
+            "shr $21, %%eax\t\n"
+            "and $1, %%eax\t\n"
+            "push %%ecx\t\n"
+            "popf\t\n"
+            : "=a" (ret));
+
+        return (ret == 1);
+    }
+
+
+    static CPU_id current_apicid(unsigned fiascoID)
+    {
+        CPU_id ret;
+        l4_umword_t a,b,c,d;
+        a = 0; b = 0; c = 0; d = 0;
+        a = CPUID::cpuid(CPUID::TOPOLOGY, &a, &b, &c, &d);
+        ret.fiasco_id = fiascoID;
+        ret.apic_id   = d;
+        return ret;
+    }
+
+
+    static l4_umword_t num_cpus()
+    {
+        if (CPUID::max_cpuid() < CPUID::TOPOLOGY) {
+            return Romain::MAX_CPUS;
+        }
+        l4_umword_t a,b,c,d;
+        a = 0; b = 0; c = 1; d = 0;
+        a = CPUID::cpuid(CPUID::TOPOLOGY, &a, &b, &c, &d);
+        return b;
+    }
+
+
+
+    static l4_umword_t max_cpuid()
+    {
+        l4_umword_t a, b, c, d;
+        a = b = c = d = 0;
+        return CPUID::cpuid(CPUID::MAXID, &a, &b, &c, &d);
+    }
+};
\ No newline at end of file
index f99aa7c9ff80fbf89ba796c2342825f403376d29..b23b59ef24cf6fb1071a5b6e38f83b1d555aad6d 100644 (file)
@@ -40,7 +40,6 @@ void Romain::SimpleDebugObserver::startup_notify(Romain::App_instance *i,
                _bp->activate(i, am);
                DEBUG() << "Activated breakpoint in instance " << i->id()
                                << " @ address " << std::hex << _bp->address();
-               enter_kdebug();
        }
 }
 
@@ -60,7 +59,7 @@ Romain::SimpleDebugObserver::notify(Romain::App_instance *i,
                        ++_int1_seen;
                        t->vcpu()->print_state();
                        INFO() << "INT1 seen: " << _int1_seen;
-                       enter_kdebug("single step exception");
+                       //enter_kdebug("single step exception");
                        break;
                case 3:
                        DEBUG() << "INT3 @ " << std::hex << t->vcpu()->r()->ip
index 7dd908c5179a8d67a1197eadf1b914630bb26b10..cb7aef240263d30898a92e5060f97c5a1a9764a7 100644 (file)
@@ -27,12 +27,14 @@ class KipTimeObserver_priv : public KIPTimeObserver
 {
        private:
                std::vector<Breakpoint*> _breakpoints;
+               unsigned                 _hitcount;
 
                void configureBreakpoint(char *str)
                {
+                       errno = 0;
                        l4_addr_t a = strtol(str, NULL, 16); // XXX check return
                        if (errno) {
-                               ERROR() << "Conversion error.";
+                               ERROR() << "Conversion error: " << errno << std::hex << " (" << a << ")";
                        } else {
                                _breakpoints.push_back(new Breakpoint(a));
                        }                       
@@ -49,32 +51,36 @@ Romain::KIPTimeObserver* Romain::KIPTimeObserver::Create()
 }
 
 Romain::KipTimeObserver_priv::KipTimeObserver_priv()
+  : _hitcount(0)
 {
-       char *rtget = strdup(ConfigStringValue("kip-time:libc_backend_rt_clock_gettime", NULL));
-       if (rtget) {
+       char *rtget = strdup(ConfigStringValue("kip-time:libc_backend_rt_clock_gettime", ""));
+       if (strlen(rtget) != 0) {
                INFO() << "BP @ " << rtget;
                configureBreakpoint(rtget);
        } else {
                ERROR() << "No set address for libc_backend_rt_clock_gettime()";
-               enter_kdebug("??");
+               //enter_kdebug("??");
        }
 
-       char *monoget = strdup(ConfigStringValue("kip-time:mono_clock_gettime", NULL));
-       if (monoget) {
+       char *monoget = strdup(ConfigStringValue("kip-time:mono_clock_gettime", ""));
+       if (strlen(monoget) != 0) {
                INFO() << "BP @ " << monoget;
                configureBreakpoint(monoget);
        } else {
                ERROR() << "No set address for mono_clock_gettime()";
-               enter_kdebug("??");
+               //enter_kdebug("??");
        }
 
        free(monoget);
        free(rtget);
-       enter_kdebug("kiptime");
+       //enter_kdebug("kiptime");
 }
 
 
-void Romain::KipTimeObserver_priv::status() const { }
+void Romain::KipTimeObserver_priv::status() const
+{
+       INFO() << "[time] gettime() calls: " << _hitcount;
+}
 
 /*****************************************************************
  *                      Debugging stuff                          *
@@ -102,14 +108,15 @@ Romain::KipTimeObserver_priv::notify(Romain::App_instance *i,
 
        for (auto it = _breakpoints.begin(); it != _breakpoints.end(); ++it) {
                if ((*it)->was_hit(t)) {
-                       INFO() << "BP @ " << std::hex << (*it)->address() << " was hit.";
-                       INFO() << "stack ptr 0x" << std::hex << t->vcpu()->r()->sp;
+                       ++_hitcount;
+                       DEBUG() << "BP @ " << std::hex << (*it)->address() << " was hit.";
+                       DEBUG() << "stack ptr 0x" << std::hex << t->vcpu()->r()->sp;
 
                        l4_addr_t stack      = am->rm()->remote_to_local(t->vcpu()->r()->sp, i->id());
                        l4_addr_t ret        = *(l4_addr_t*)stack;
                        l4_addr_t specptr    = *(l4_addr_t*)(stack + 1 * sizeof(l4_addr_t));
                        l4_addr_t spec_local = am->rm()->remote_to_local(specptr, i->id());
-                       INFO() << "Retaddr " << std::hex << ret << ", ptr " << specptr;
+                       DEBUG() << "Retaddr " << std::hex << ret << ", ptr " << specptr;
 
                        int rv = libc_backend_rt_clock_gettime((struct timespec*)(spec_local));
                        t->vcpu()->r()->ax   = rv;
@@ -124,7 +131,7 @@ Romain::KipTimeObserver_priv::notify(Romain::App_instance *i,
                                        continue;
 
                                l4_addr_t specptr_rep = am->rm()->remote_to_local(specptr, rep);
-                               INFO() << "memcpy " << std::hex << specptr_rep << " <- " << spec_local;
+                               //INFO() << "memcpy " << std::hex << specptr_rep << " <- " << spec_local;
                                memcpy((void*)specptr_rep, (void*)spec_local, sizeof(struct timespec));
                        }
 
index 4295bb4b92ac4fa24b3bd59b32b49745b509b9b2..e9aeb08c4c044c08741c12a67bb307a055229610 100644 (file)
 
 #define DEBUGt(t) DEBUG() <<  "[" << t->vcpu() << "] "
 
-#define EVENT(event) \
+#define EVENT(event, ptr) \
     do { \
                Measurements::GenericEvent* ev = Romain::_the_instance_manager->logbuf()->next(); \
                ev->header.tsc                 = Romain::_the_instance_manager->logbuf()->getTime(Log::logLocalTSC); \
                ev->header.vcpu                = (l4_uint32_t)t->vcpu(); \
                ev->header.type                = Measurements::Locking; \
                ev->data.lock.eventType        = event; \
+               ev->data.lock.lockPtr          = ptr; \
     } while (0)
 
 Romain::PThreadLockObserver*
@@ -33,14 +34,14 @@ namespace Romain {
 
 void Romain::PThreadLock_priv::status() const
 {
-       INFO() << "LOCK.lock   = " << det_lock_count;
-       INFO() << "LOCK.unlock = " << det_unlock_count;
-       INFO() << "MTX.lock    = " << mtx_lock_count;
-       INFO() << "MTX.unlock  = " << mtx_unlock_count;
-       INFO() << "pt.lock     = " << pt_lock_count;
-       INFO() << "pt.unlock   = " << pt_unlock_count;
-       INFO() << "# ignored   = " << ignore_count;
-       INFO() << "Total count = " << total_count;
+       INFO() << "[lock] LOCK.lock   = " << det_lock_count;
+       INFO() << "[lock] LOCK.unlock = " << det_unlock_count;
+       INFO() << "[lock] MTX.lock    = " << mtx_lock_count;
+       INFO() << "[lock] MTX.unlock  = " << mtx_unlock_count;
+       INFO() << "[lock] pt.lock     = " << pt_lock_count;
+       INFO() << "[lock] pt.unlock   = " << pt_unlock_count;
+       INFO() << "[lock] # ignored   = " << ignore_count;
+       INFO() << "[lock] Total count = " << total_count;
 }
 
 
@@ -139,7 +140,7 @@ void Romain::PThreadLock_priv::startup_notify(Romain::App_instance *inst,
                 * because code is shared across all replicas.
                 */
                for (unsigned idx = 0; idx < pt_max_wrappers; ++idx) {
-                       DEBUG() << idx;
+                       //DEBUG() << idx;
                        _functions[idx].activate(inst, am);
                }
 #if INTERNAL_DETERMINISM
@@ -194,7 +195,7 @@ void Romain::PThreadLock_priv::lock(Romain::App_instance *inst,
        l4_umword_t ret  = *(l4_umword_t*)stack;
        l4_umword_t lock = t->vcpu()->r()->ax;
 
-       EVENT(Measurements::LockEvent::lock);
+       EVENT(Measurements::LockEvent::lock, lock);
 
        DEBUG() << "Stack ptr " << std::hex << t->vcpu()->r()->sp << " => "
                << stack;
@@ -222,7 +223,7 @@ void Romain::PThreadLock_priv::unlock(Romain::App_instance *inst,
        l4_umword_t retaddr = *(l4_umword_t*)stack;
        l4_umword_t lock    = *(l4_umword_t*)(stack + 1*sizeof(l4_umword_t));
 
-       EVENT(Measurements::LockEvent::unlock);
+       EVENT(Measurements::LockEvent::unlock, lock);
 
        DEBUG() << "Return addr " << std::hex << retaddr;
        DEBUG() << "Lock @ " << std::hex << lock;
@@ -249,7 +250,7 @@ void Romain::PThreadLock_priv::mutex_lock(Romain::App_instance* inst, Romain::Ap
        l4_umword_t retaddr = *(l4_umword_t*)stack;
        l4_umword_t lock    = *(l4_umword_t*)(stack + 1*sizeof(l4_umword_t));
 
-       EVENT(Measurements::LockEvent::mtx_lock);
+       EVENT(Measurements::LockEvent::mtx_lock, lock);
 
        DEBUG() << "lock @ " << std::hex << lock << " ESP.local = " << stack;
        PThreadMutex* mtx = _locks[lock];
@@ -286,7 +287,7 @@ void Romain::PThreadLock_priv::mutex_unlock(Romain::App_instance* inst, Romain::
        l4_umword_t retaddr = *(l4_umword_t*)stack;
        l4_umword_t lock    = *(l4_umword_t*)(stack + 1*sizeof(l4_umword_t));
 
-       EVENT(Measurements::LockEvent::mtx_unlock);
+       EVENT(Measurements::LockEvent::mtx_unlock, lock);
 
        int ret = lookup_or_fail(lock)->unlock();
        DEBUG() << "unlock @ " << std::hex << lock << " = " << ret;
index 964f9d397339b58361af8ff7b8b7edf44b7530b6..87c230e91c996470b67ce5415c2b4b56fbaafb0c 100644 (file)
@@ -139,7 +139,9 @@ namespace Romain
                void activate(Romain::App_instance *inst, Romain::App_model* am)
                {
 #if INTERNAL_DETERMINISM
-                       if (function_id == pt_lock_id or function_id == pt_unlock_id) {
+                       if (((function_id == pt_lock_id) or
+                            (function_id == pt_unlock_id)) and 
+                               (orig_address != ~0UL)) {
                                /* Assumption: __pthread_(un)lock are called seldomly, so
                                 * we simply use the bp functionality here */
                                bp = new Breakpoint(orig_address);
@@ -165,8 +167,10 @@ namespace Romain
                                << NOCOLOR << " ===============";
 
                        lock_info* lockinfo = reinterpret_cast<lock_info*>(am->lockinfo_local());
-                       if (wrapper_address == ~0)
+                       if (wrapper_address == ~0) {
+                               DEBUG() << BLUE << "   no known address" << NOCOLOR;
                                return;
+                       }
 
                        unsigned char *instructionBuffer = lockinfo->trampolines + function_id * 32;
                        memset(instructionBuffer, 0xff, 32);
index 71749906813b2f9670944f04edcddf2cdf363988..7cd2acad9fbf64cb4f4f6d713f5242961fb02562 100644 (file)
@@ -75,6 +75,10 @@ namespace Romain
                private:
                bool _readonly;
 
+               l4_umword_t fit_alignment(Romain::Region const * local,
+                                         L4Re::Util::Region const * remote,
+                                         l4_umword_t offset, Romain::App_thread *t);
+
                DECLARE_OBSERVER("pf");
                PageFaultObserver();
 
index c45cadb40bddb1228ebe7e5ba25707a53392336c..2492ffb1204e5e24de60a7d2b92b08a9fd2310a4 100644 (file)
@@ -41,10 +41,53 @@ DEFINE_EMPTY_STARTUP(PageFaultObserver)
 
 void Romain::PageFaultObserver::status() const
 {
-       INFO() << "Page faults so far: mapped " << pf_mapped << " write emu "
+       INFO() << "[ pf ] Page faults so far: mapped " << pf_mapped << " write emu "
               << pf_write << " kip " << pf_kip;
 }
 
+
+/*
+ * Prepare for a mapping by finding the largest possible alignment to map a
+ * flexpage that contains the address at (start + offset) from master to replica.
+ */
+l4_umword_t Romain::PageFaultObserver::fit_alignment(Romain::Region const* local,
+                                                                                                        L4Re::Util::Region const * remote,
+                                                                                                        l4_umword_t offset,
+                                                                                                        Romain::App_thread *t)
+{
+       MSGt(t) << "offs in region: " << std::hex << offset;
+       
+       l4_addr_t localbase  = local->start() + offset;
+       l4_addr_t remotebase = remote->start() + offset;
+       MSGt(t) << std::hex << localbase  << "("  << l4util_bsf(localbase) << ") <-> "
+               << remotebase << "(" << l4util_bsf(remotebase) << ")";
+
+       /*
+        * The maximum possible alignment is the minimum of the zero bits in both
+        * addresses.
+        */
+       l4_umword_t align = std::min(l4util_bsf(localbase), l4util_bsf(remotebase));
+
+       /*
+        * The maximum alignment might lead to a mapping that is larger than the
+        * region itself. Therefore we shrink the mapping until it fits the region.
+        */
+       for (; align > 12; --align) {
+               l4_umword_t mask    = (1 << align) - 1;
+               l4_addr_t newlocal  = localbase - (localbase & mask);
+
+               if ((newlocal >= local->start()) and
+                       (newlocal + (1<<align) - 1 <= local->end())) {
+                       break;
+               }
+       }
+
+       return align;
+
+       /* XXX: Use this if you want to test the single-page-mapping version. */
+       //return L4_PAGESHIFT;
+}
+
 Romain::Observer::ObserverReturnVal
 Romain::PageFaultObserver::notify(Romain::App_instance *i, Romain::App_thread *t,
                                   Romain::Thread_group* tg, Romain::App_model *a)
@@ -70,7 +113,7 @@ Romain::PageFaultObserver::notify(Romain::App_instance *i, Romain::App_thread *t
        ev->data.pf.localbase  = 0;
        ev->data.pf.remotebase = 0;
 
-       MSGt(t) << (write_pf ? RED "rite" NOCOLOR : BOLD_BLUE "read" NOCOLOR)
+       MSGt(t) << (write_pf ? RED "write" NOCOLOR : BOLD_BLUE "read" NOCOLOR)
              << " page fault @ 0x" << std::hex << pfa;
 
        Romain::Region_map::Base::Node n = a->rm()->find(pfa);
@@ -110,30 +153,38 @@ Romain::PageFaultObserver::notify(Romain::App_instance *i, Romain::App_thread *t
                } else {
                        ++pf_mapped;
 
-                       l4_addr_t offset_in_region = l4_trunc_page(pfa - n->first.start());
-                       MSGt(t) << "offs in region: " << std::hex << offset_in_region;
+                       Romain::Region_handler const * rh   = &n->second;
+                       Romain::Region const * localregion  = &rh->local_region(i->id());
+                       L4Re::Util::Region const * remote   = &n->first;
+
+                       /*
+                        * We try to map the largest possible flexpage to reduce the
+                        * total number of mappings.
+                        */
+                       l4_addr_t offset_in_region = l4_trunc_page(pfa - remote->start());
+                       l4_umword_t align = fit_alignment(localregion, remote, offset_in_region, t);
+                       MSGt(t) << "fitting align " << align;
+
+                       /* Calculate the map base addresses for the given alignment */
+                       l4_addr_t localbase = localregion->start() + offset_in_region;
+                       localbase  = localbase  - (localbase  & ((1 << align) - 1));
+
+                       l4_addr_t remotebase = remote->start() + offset_in_region;
+                       remotebase = remotebase - (remotebase & ((1 << align) - 1));
+
+                       MSGt(t) << std::hex << "map: " << localbase << " -> "
+                               << remotebase << " size " << (1 << align);
+
+                       //enter_kdebug("pf");
                        
                        // set flags properly, only check ro(), because else we'd already ended
                        // up in the emulation branch above
-                       unsigned pageflags           = n->second.is_ro() ? L4_FPAGE_RO : L4_FPAGE_RW;
-                       unsigned map_size            = L4_PAGESIZE;
-                       unsigned size_left_in_region = n->first.end() - (n->first.start() + offset_in_region);
-                       (void)size_left_in_region;
-
-#if 0
-#define MAX_MAP_SHIFT 0
-                       for (unsigned x = 1; x < MAX_MAP_SHIFT; ++x) {
-                               if (size_left_in_region >= (1 << (L4_PAGESHIFT + x)))
-                                       map_size *= 2;
-                       }
-#undef MAX_MAP_SHIFT
-#endif
-                       ev->data.pf.localbase  = n->second.local_region(i->id()).start() + offset_in_region;
-                       ev->data.pf.remotebase = n->first.start() + offset_in_region;
-
-                       i->map(n->second.local_region(i->id()).start() + offset_in_region, // local addr
-                                  n->first.start() + offset_in_region,                        // remote addr
-                                  pageflags, map_size);
+                       unsigned pageflags           = rh->is_ro() ? L4_FPAGE_RO : L4_FPAGE_RW;
+
+                       ev->data.pf.localbase  = localregion->start() + offset_in_region;
+                       ev->data.pf.remotebase = remote->start() + offset_in_region;
+
+                       i->map_aligned(localbase, remotebase, align, pageflags);
                }
 
        } else if ((a->prog_info()->kip <= pfa) && (pfa < a->prog_info()->kip + L4_PAGESIZE)) {
index c52fc834ee7e3735cc053296ddd19aa673836369..d614881826d2f097eb91b2bd5b6c98cf6388ffee 100644 (file)
@@ -35,7 +35,7 @@ static unsigned long num_syscalls;
 
 void Romain::SyscallObserver::status() const
 {
-       INFO() << "System call count: " << num_syscalls;
+       INFO() << "[sys ] System call count: " << num_syscalls;
 }
 
 
@@ -181,7 +181,14 @@ Romain::SyscallObserver::notify(Romain::App_instance *i,
                t->vcpu()->r()->ip = ebx_pre;
                t->vcpu()->r()->sp = ebp_pre;
 
+       } else if (t->vcpu()->r()->err == 0x152) { // INT $42
+               INFO() << "[" << std::hex << (unsigned)t->vcpu() <<  "] INT 42 ("
+                          << t->vcpu()->r()->ip << ")";
+               t->vcpu()->r()->ip += 2;
+               retval = Romain::Observer::Replicatable;
        } else {
+               t->vcpu()->print_state();
+               INFO() << "err = " << std::hex << t->vcpu()->r()->err;
                MSG() << "GPF";
                enter_kdebug("GPF in replica");
        }
index 6bf696cdbe213c61c15e9509216d01b5feefc077..8e3602af35b25d3d6725eb659d29893fc426e33f 100644 (file)
 #include "thread_group.h"
 //#include "app_loading"
 #include "fault_observers"
+#include "cpuid.h"
 
 #include <vector>
 #include <cstdio>
+#include <algorithm>
 
 #include "redundancy.h"
 #include <l4/plr/measurements.h>
@@ -37,17 +39,106 @@ EXTERN_C void *split_handler_fn(void*);
 
 namespace Romain
 {
+       /*
+        * Map logical (=sequential) CPU numbers to the topology of the underlying
+        * platform.
+        *
+        * Background: Fiasco.OC uses sequential CPU numbers to assign threads to CPUs. These
+        *             numbers are assigned during bootup and their order depends on the order
+        *             in which booted CPUs come up. This means, assigning two threads to CPUs
+        *             0 and 1 can in one case mean that they are running on the same core in
+        *             different hyperthreads, while in the next run, they run on the different
+        *             physical CPUs (or even NUMA domains, if we had those).
+        *
+        *             The purpose of this map is to make the assignment less surprising, e.g.,
+        *             for the same platform, assigning to two specific CPU IDs should always
+        *             lead to the same performance.
+        */
+       class LogicalCPUMap
+       {
+               protected:
+               std::vector<CPU_id> _fiasco_cpus;
+
+               static void* topology_scanner(void* data)
+               {
+                       for (unsigned cpu = 0; cpu < CPUID::num_cpus(); ++cpu) {
+                               Romain::LogicalCPUMap *m = reinterpret_cast<Romain::LogicalCPUMap*>(data);
+
+                               L4::Cap<L4::Thread> thread(pthread_getl4cap(pthread_self()));
+                               l4_sched_param_t sp = l4_sched_param(2);
+                               sp.affinity = l4_sched_cpu_set(cpu, 0);
+                               chksys(L4Re::Env::env()->scheduler()->run_thread(thread, sp));
+
+                               m->_fiasco_cpus[cpu] = CPUID::current_apicid(cpu);
+                       }
+                       return 0;
+               }
+
+
+               void scan_topology()
+               {
+                       /* Check if we can perform a topology query. */
+                       if (CPUID::max_cpuid() < CPUID::TOPOLOGY) {
+                               INFO() << "CPU does not provide topology information";
+                               return;
+                       }
+
+                       pthread_t p;
+                       int ret = pthread_create(&p, 0, Romain::LogicalCPUMap::topology_scanner, this);
+                       _check(ret != 0, "error creating topology scanner");
+                       ret = pthread_join(p, 0);
+                       INFO() << "Topology scan completed.";
+               }
+
+
+               void print_map()
+               {
+                       INFO() << "Virtual to Fiasco CPU map";
+
+                       for (unsigned i = 0; i < CPUID::num_cpus(); ++i) {
+                               INFO() << "virt# " << i << " fiasco# " << _fiasco_cpus[i].fiasco_id
+                                      << " apic# " << std::hex << _fiasco_cpus[i].apic_id;
+                       }
+               }
+
+               public:
+                       LogicalCPUMap()
+                               : _fiasco_cpus(MAX_CPUS)
+                       {
+                               /* Default: identity mapping if nothing else works */
+                               for (unsigned i = 0; i < MAX_CPUS; ++i) {
+                                       _fiasco_cpus[i].fiasco_id = i;
+                                       _fiasco_cpus[i].apic_id   = i;
+                               }
+
+                               if (CPUID::have_cpuid()) {
+                                       scan_topology();
+                                       std::sort(_fiasco_cpus.begin(), _fiasco_cpus.end(), CPU_id::comp_apic);
+                                       print_map();
+                               }
+
+                               //enter_kdebug("cpu");
+
+                       }
+
+                       unsigned logicalToCPU(unsigned log)
+                       {
+                               INFO() << log << " -> " << _fiasco_cpus[log].fiasco_id;
+                               return _fiasco_cpus[log].fiasco_id;
+                       }
+       };
+
        /*
         * Set up and keep track of the running instances
         */
-       class InstanceManager
+       class InstanceManager : public LogicalCPUMap
        {
                private:
                        Romain::App_model *_am;
-                       std::vector<Romain::App_instance *> _instances; // instance list
+                       std::vector<Romain::App_instance *> _instances;    // instance list
                        std::vector<Romain::Thread_group *> _threadgroups; // list of thread groups
 
-                       Romain::Observer *_observer_list[Romain::MAX_OBSERVERS];  // exception observer list
+                       Romain::Observer *_observer_list[Romain::MAX_OBSERVERS]; // exception observer list
                        //Romain::RedundancyCallback *_callback;                 // the callback for redundancy checking
                        unsigned _num_observers;
                        
index a839094ffc711747ed947446a414741b03c3cb64..4d8c38d2fa4f7ed57d9ee437e800393479e421ab 100644 (file)
@@ -53,7 +53,8 @@ L4_INLINE l4_umword_t count_online_cpus()
 Romain::InstanceManager::InstanceManager(unsigned int argc,
                                          char const **argv,
                                          unsigned num_instances)
-       : _am(0),
+       : LogicalCPUMap(),
+         _am(0),
          _instances(),
          _threadgroups(),
          _num_observers(0),
@@ -139,8 +140,10 @@ void Romain::InstanceManager::configure_fault_observers()
         * First, register those observers that don't interfere
         * with anyone else and get notified all the time.
         */
+       DEBUG() << "[observer] vcpu state.";
        BoolObserverConfig("general:print_vcpu_state",
                           this, "vcpu_state");
+       DEBUG() << "[observer] trap limit.";
        ObserverConfig(this, "trap_limit");
 
        /*
@@ -148,14 +151,22 @@ void Romain::InstanceManager::configure_fault_observers()
         * calls they are expected to see, so that we minimize
         * the amount of unnecessary observer callbacks.
         */
+       DEBUG() << "[observer] page faults.";
        ObserverConfig(this, "pagefaults");
+       DEBUG() << "[observer] syscalls.";
        ObserverConfig(this, "syscalls");
+       DEBUG() << "[observer] threads.";
        BoolObserverConfig("general:threads", this, "threads");
+       DEBUG() << "[observer] trap.";
        ObserverConfig(this, "trap");
 
+       DEBUG() << "[observer] simpledbg.";
        StringObserverConfig("general:debug", this);
+       DEBUG() << "[observer] intercept-kip.";
        BoolObserverConfig("general:intercept_kip", this, "kip-time");
+       DEBUG() << "[observer] swifi.";
        BoolObserverConfig("general:swifi", this, "swifi");
+       DEBUG() << "[observer] logreplica.";
        BoolObserverConfig("general:logreplica", this, "replicalog");
 }
 
@@ -453,22 +464,34 @@ Romain::InstanceManager::create_thread(l4_umword_t eip, l4_umword_t esp,
                if (_num_cpu > 1) {
                        INFO() << instance_id << " " << (instance_id+1) % _num_cpu << " " << _num_cpu;
                        
+                       unsigned logCPU = 1;
+
                        /* XXX REPLICAS PER CPU XXX */
-                       at->cpu(group->uid % _num_cpu);
+                       //logCPU = logicalToCPU(group->uid % _num_cpu);
 
                        /* XXX INSTANCES PER CPU XXX */
-                       //at->cpu((instance_id + 1) % _num_cpu);
+                       //logCPU = logicalToCPU((instance_id + 1) % _num_cpu);
 
                        /* XXX OVERLAPPING REPLICAS XXX */
-                       //at->cpu((group->uid + instance_id) % _num_cpu);
+                       //logCPU = logicalToCPU((group->uid + instance_id) % _num_cpu);
 
                        /* XXX RANDOM PLACEMENT XXX */
-                       //at->cpu(random() % _num_cpu);
+                       //logCPU = logicalToCPU(random() % _num_cpu);
                        
                        /* XXX Threads assigned RR to CPUs */
-                       //static int threadcount = 1;
-                       //at->cpu(threadcount % _num_cpu);
+                       static int threadcount = 0;
+                       logCPU = logicalToCPU(threadcount % _num_cpu);
+                       threadcount++;
+
+                       /* XXX The hard-coded placement map */
+                       //int cpumap[12] = {0, 1, 2,
+                       //                  0, 0, 0,
+                       //                  3, 4, 5,
+                       //                  0, 0, 0};
+                       //logCPU = logicalToCPU(cpumap[threadcount]);
                        //threadcount++;
+
+                       at->cpu(logCPU);
                } else {
                        at->cpu(0);
                }
index d7e47a2a8465c4677fde5ad91ebccbe098fb4c1d..07d282a9fbe1e77aebc42d8b3359d01d68a6ee56 100644 (file)
@@ -27,6 +27,7 @@
 #include <l4/re/util/cap_alloc>
 #include <l4/re/util/region_mapping>
 #include <l4/re/util/dataspace_svr>
+#include <l4/util/bitops.h>
 
 #include <l4/sys/kdebug.h>
 
@@ -145,21 +146,23 @@ namespace Romain
                        };
 
                private:
-                       l4_cap_idx_t             _cap; // capability of the underlying dataspace
+                       l4_cap_idx_t             _cap;       // capability of the underlying dataspace
                        Romain::Region            _local_regions[Romain::MAX_REPLICAS]; // replicated regions (writable regions exist in
                                                                                            // multiple instances)
-                       l4_addr_t                _offs; // offset in DS
+                       l4_addr_t                _offs;      // offset in DS
                        DS                       _mem[Romain::MAX_REPLICAS]; // DS capabilities of underlying dataspaces
-                       unsigned char            _flags; // region flags
-                       RegionWritableType       _row; // rw state
-                       bool                     _shared; // is DS shared across all replicas (true for internal determinism's lock info page)
+                       unsigned char            _flags;     // region flags
+                       RegionWritableType       _row;       // rw state
+                       bool                     _shared;    // is DS shared across all replicas
+                                                            // (true for internal determinism's lock info page)
+                       l4_umword_t              _alignment; // alignment of this DS within master
 
                public:
 
                        Region_handler_template()
                                : _cap(L4_INVALID_CAP),  _offs(0), _flags(),
                              _row(Romain::Region_handler_template<DS, OPS>::Read_only),
-                             _shared(false)
+                             _shared(false), _alignment(L4_PAGESHIFT)
                        {}
 
 
@@ -168,7 +171,8 @@ namespace Romain
                                  _offs(o.offset()),
                                  _flags(o.flags()),
                                  _row(o.writable()),
-                                 _shared(o.shared())
+                                 _shared(o.shared()),
+                                 _alignment(o.alignment())
                        {
                                for (unsigned i = 0; i < o.local_region_count(); ++i) {
                                        _local_regions[i] = o.local_region(i);
@@ -178,7 +182,7 @@ namespace Romain
 
                        Region_handler_template(DSCAP cap, l4_cap_idx_t client_cap = L4_INVALID_CAP, l4_addr_t offset = 0,
                                                unsigned flags = 0, Romain::Region local_reg = Romain::Region(0,0))
-                               : _cap(client_cap), _offs(offset), _flags(flags), _shared(false)
+                               : _cap(client_cap), _offs(offset), _flags(flags), _shared(false), _alignment(L4_PAGESHIFT)
                        {
                                _local_regions[0] = local_reg;
                                _mem[0]           = cap;
@@ -225,6 +229,31 @@ namespace Romain
 
                        bool         shared() const throw()                 { return _shared; }
                        void         shared(bool yn) { _shared = yn; }
+                       l4_umword_t  alignment() const throw()                          { return _alignment; }
+
+                       /* Compute the target alignment for attaching locally.
+                        *
+                        * This alignment is necessary to make sure that a large region
+                        * is attached to matching addresses in the replica and master
+                        * address spaces. Only then can we map memory in chunks of more
+                        * than one page a time when resolving page faults.
+                        */
+                       void alignToAddressAndSize(l4_addr_t address, l4_size_t size)
+                       {
+                               _alignment = l4util_bsf(address);
+                               DEBUG() << std::hex << address << " --> target alignment: "
+                                       << _alignment;
+                               if (_alignment > L4_SUPERPAGESHIFT) {
+                                       _alignment = L4_SUPERPAGESHIFT;
+                               }
+                               DEBUG() << std::hex << address << " --> [max: super page] alignment: "
+                                       << _alignment;
+                               if (_alignment > l4util_bsr(size)) {
+                                       _alignment = l4util_bsr(size);
+                               }
+                               DEBUG() << std::hex << address << " --> [max: size " << size
+                                       << "] alignment: " << _alignment;
+                       }
 
                        void         take() const                           { Ops::take(this); }
                        void         release() const                        { Ops::release(this); }
@@ -266,6 +295,13 @@ namespace Romain
        };
 
 
+       /* Note to self: L4Re's Region_map is a cxx::avl_map<> that maps from a Region key to
+        * Region_handler data. It can be indexed using the find() funtion that takes an l4_addr_t
+        * and returns the respective tree node. The node's entries are:
+        *
+        *   node->first  -> the Region object
+        *   node->second -> the Region_handler object
+        */
        class Region_map
                : public L4Re::Util::Region_map<Romain::Region_handler,
                                                Romain::Allocator>
@@ -314,7 +350,7 @@ namespace Romain
                                L4::Cap<L4Re::Dataspace> mem;
                                unsigned long size = r.local_region(orig_id).size();
 
-                               l4_addr_t a = Romain::Region_map::allocate_and_attach(&mem, size);
+                               l4_addr_t a = Romain::Region_map::allocate_and_attach(&mem, size, 0, r.alignment());
                                _check(a == 0, "DS allocation failed");
 
                                memcpy((void*)a, (void*)r.local_region(orig_id).start(), size);
index 00ba7913b589fd4fa07a15cda01edf2da9594cf0..8677d1807f2efbd7890a8a940610f6dfb924ba9a 100644 (file)
@@ -96,20 +96,38 @@ Romain::Region_map::Region_map()
 }
 
 
+/*
+ * Attach a replica region locally in the master AS.
+ *
+ * The Romain::Master manages replicas' region map. As a part of this, the master
+ * attaches a copy of every region attached to one of the replicas to its own
+ * address space. This local region is then used to service page faults caused by
+ * the replicas.
+ *
+ * For read-only replica dataspaces, the master creates a writable copy of the
+ * original region in a separate dataspace. This allows us to modify their content
+ * if necessary (e.g., setting debug breakpoints on read-only code).
+ *
+ * For writable dataspaces, the master simply attaches the same region that has
+ * already been attached to the replica AS into its own address space.
+ */
 void *Romain::Region_map::attach_locally(void* addr, unsigned long size,
                                          Romain::Region_handler *hdlr,
                                          unsigned flags, unsigned char align)
 {
-       long r; (void)align; (void)addr;
+       long r; (void)addr;
        Romain::Region_handler::Dataspace const *ds = &hdlr->memory(0);
        L4Re::Dataspace::Stats dsstat;
        (*ds)->info(&dsstat);
 
-#if 0
-       MSG() << "attaching DS " << std::hex << ds->cap()
+#if 1
+       MSG() << PURPLE
+                 << "attaching DS " << std::hex << ds->cap()
              << ", addr = "     << addr
              << ", flags = "    << flags << " (" << dsstat.flags << ")"
-             << ", size = "     << size;
+             << ", size = "     << size
+             << ", align = "    << (unsigned int)align
+             << NOCOLOR;
 #endif
 
        if (!ds->is_valid()) {
@@ -200,12 +218,14 @@ void *Romain::Region_map::attach_locally(void* addr, unsigned long size,
        l4_addr_t a = 0;
        r = L4Re::Env::env()->rm()->attach(&a, eff_size,
                                           L4Re::Rm::Search_addr | flags,
-                                          *ds, page_base);
+                                          *ds, page_base, align);
        _check(r != 0, "attach error");
 
        Romain::Region reg(a, a+eff_size - 1);
        reg.touch_rw();
 
+       MSG() << "set_local_region(" << _active_instance << ", "
+                 << std::hex << reg.start() << ")";
        hdlr->set_local_region(_active_instance, reg);
        return (void*)(a + offset_in_page);
 }
@@ -215,20 +235,49 @@ void *Romain::Region_map::attach(void* addr, unsigned long size,
                                  unsigned flags, unsigned char align, bool shared)
 {
        void *ret = 0;
-       Romain::Region_handler _handler(hdlr);
 
+       /*
+        * XXX: the only reason for this Region_handler to exist is to copy
+        *      the shared parameter into the handler. Shouldn't the caller
+        *      do this???
+        */
+       Romain::Region_handler _handler(hdlr);
        _handler.shared(shared);
 
+       /*
+        * First, do the attach() in the remote address space. Thereby we get
+        * the remote address and can then during local attaching make sure
+        * that the memory alignment of the local mapping matches the remote
+        * alignment. This allows us to play mapping tricks later.
+        */
+       ret = Base::attach(addr, size, _handler, flags, align);
+
+       /*
+        * The node is now present in the region map. This means we now need
+        * to continue working with the node's handler member instead of our
+        * local copy (because the attach() call has made a copy of it).
+        */
+       Romain::Region_map::Base::Node n = find((l4_addr_t)ret);
+       // and the region handler is const by default ... *grrrml*
+       Romain::Region_handler* theHandler = const_cast<Romain::Region_handler*>(&(n->second));
+       
+       /*
+        * Figure out the best possible alignment we can have between the local
+        * and the remote region. If the alignments match, we can later map more
+        * than one page at a time.
+        */
+       theHandler->alignToAddressAndSize(reinterpret_cast<l4_addr_t>(ret), size);
+
        /* Only attach locally, if this hasn't been done beforehand yet. */
-       if (!_handler.local_region(_active_instance).start()) {
-               void* a = attach_locally(addr, size, &_handler, flags, align);
+       if (!n->second.local_region(_active_instance).start()) {
+               void* a = attach_locally(addr, size, theHandler,
+                                        flags, theHandler->alignment());
                _check(a == 0, "Error in local attach");
        }
-       ret = Base::attach(addr, size, _handler, flags, align);
 
        MSG() << "new mapping (" << _active_instance << ") "
-             << "[" << std::hex << _handler.local_region(_active_instance).start()
-             << " - " << _handler.local_region(_active_instance).end()
+             << "[" << std::hex << n->second.local_region(_active_instance).start()
+             << " - " << n->second.local_region(_active_instance).end()
              << "] -> " << ret;
        //enter_kdebug("after attach");
 
index 1fb02d5d73ace0dc10740b585f515969e677b548..96fcad4882aa94eeca27ec5b3e5e31594bc6d3b1 100644 (file)
@@ -115,11 +115,13 @@ Romain::DMR::checksum_replicas()
                                ERROR() << "--- instance " << cnt << " @ "
                                        << _orig_vcpu[cnt]->vcpu() << " (cs: "
                                        << std::hex << csums[cnt] << ") ---";
-                               if (_orig_vcpu[cnt])
+                               if (_orig_vcpu[cnt]) {
                                        _orig_vcpu[cnt]->vcpu()->print_state();
+                                       ERROR() << "vcpu.err = " << std::hex << _orig_vcpu[cnt]->vcpu()->r()->err;
+                               }
                        }
                        ERROR() << "Instances: " << _num_instances << " this inst " << idx;
-                       enter_kdebug("checksum");
+                       //enter_kdebug("checksum");
 #endif
                        return false;
                }
@@ -133,10 +135,15 @@ class RecoverAbort
        public:
                static __attribute__((noreturn)) void recover()
                {
-                       ERROR() << "Aborting after error.";
-                       Romain::_the_instance_manager->logdump();
-                       enter_kdebug("abort");
-                       throw("ERROR -> abort");
+                       static bool used = false;
+
+                       if (!used){
+                               used = true;
+                               ERROR() << "Aborting after error.";
+                               Romain::_the_instance_manager->show_stats();
+                               enter_kdebug("abort");
+                               throw("ERROR -> abort");
+                       }
                }
 };
 
index 9b5e17e6eeba1c9a2dd878690349dfdd48031c8b..f74f9fbb3938acca5cd51e86e878620486f2ab65 100755 (executable)
@@ -15,7 +15,6 @@
 
 import gzip
 import operator
-import os
 import re
 import sys
 import struct
index f94d3fcb036be453ecfbc1e905aaaaf8df991e41..65c23c1c48b3bac0acbbf938f5da8bf648576ab8 100644 (file)
@@ -193,18 +193,18 @@ class LockingEvent(Event):
     """Lock interception event"""
     def __init__(self, raw, time=0, utcb=0, uid=None):
         Event.__init__(self, time, Event.LOCKING_TYPE, utcb, uid)
-        (self.locktype, ) = \
-            struct.unpack_from("I", raw[Event.HEADSIZE:])
+        (self.locktype, self.lockptr) = \
+            struct.unpack_from("II", raw[Event.HEADSIZE:])
 
         self.typenames = ["__lock", "__unlock", "mtx_lock", "mtx_unlock"]
 
     def __repr__(self):
         res = Event.__repr__(self)
-        res += "LOCK(%d)" % self.locktype
+        res += "%s(%lx)" % (self.typenames[self.locktype], self.lockptr)
         return res
 
     def pretty(self):
-        return ["Lock(%s)" % self.typenames[self.locktype]]
+        return ["%s(%lx)" % (self.typenames[self.locktype], self.lockptr)]
 
 
 class SHMLockingEvent(Event):
@@ -233,12 +233,15 @@ class SHMLockingEvent(Event):
             else:
                 st3 = "(owner: \033[31;1m%x\033[0m)" % self.owner
 
+        if self.evtype == 4:
+            st1 += (" AQ %d" % self.epoch)
+
         if self.evtype == 2:
             return ["\033[34;1m==========\033[0m", st1, st2, st3]
         if self.evtype == 5:
             return [st1, st3, "\033[34m==========\033[0m"]
 
-        return [st1]
+        return [st1, st2]
 
 
 class BarnesEvent(Event):
@@ -253,4 +256,4 @@ class BarnesEvent(Event):
 
     def pretty(self):
         return ["\033[32mbarnes(%d)\033[0m" % self.type,
-                "%x %d\033[0m" % (self.ptr, self.num)]
+                "%x %x\033[0m" % (self.ptr, self.num)]
index bfaa179fcd71a5d82f07796b7e0b8eb5dd9a1cd1..f33a203c4fb6285e366dc3c2bf1bd32c494105f4 100644 (file)
@@ -43,6 +43,22 @@ class Condition:
             return "Cond(%s == 0x%x)" % (self.attrib, self.value)
 
 
+class Action:
+    """Represents a modification action"""
+    def __init__(self, act):
+        (self.dest, val) = act.split(":")
+        self.deststring = (val[0] == "\"")
+        if self.deststring:
+            self.destval = val[1:-1]
+        else:
+            self.destval = int(val, 0)
+
+    def action(self, obj):
+        """Perform the write action"""
+        #print "Rewriting: %s -> %s" % (self.dest, self.destval)
+        setattr(obj, self.dest, self.destval)
+
+
 class ProcessorRule:
     """Representation of a single rewrite rule.
 
@@ -57,17 +73,14 @@ class ProcessorRule:
     """
     def __init__(self, _input):
         self.conditions = []
+        self.actions = []
         #print _input
         #print "Conditions: "
         for cond in _input[0].split(","):
             self.conditions += [Condition(cond)]
 
-        (self.dest, val) = _input[1].split(":")
-        self.deststring = (val[0] == "\"")
-        if self.deststring:
-            self.destval = val[1:-1]
-        else:
-            self.destval = int(val, 0)
+        for act in _input[1].split(","):
+            self.actions += [Action(act)]
 
     def apply(self, event):
         """Apply the rewrite rule to a given event object.
@@ -76,14 +89,14 @@ class ProcessorRule:
         the event's target attribute is rewritten.
         """
         for c in self.conditions:
-            #print event
-            #print c
+            #print event, c
             if not c.apply(event):
                 #print "Cond did not hold"
                 return
 
         #print "Rewriting: %s -> %s" % (self.dest, self.destval)
-        setattr(event, self.dest, self.destval)
+        for act in self.actions:
+            act.action(event)
 
 
 class EventPreprocessor:
@@ -117,6 +130,8 @@ class EventPreprocessor:
                 self.rulefile = file(envrule, "r")
         except IOError:
             self.rulefile = None
+        except TypeError:
+            self.rulefile = None
 
     def parseRules(self):
         """Read rules from the rule file found."""
index cc8a266ff302d1d380839b9929a8d3f1b80ec349..614645ebec432510df3a3d8a9456e82ce24097dc 100644 (file)
@@ -1,8 +1,8 @@
 VERSION = 3
-PATCHLEVEL = 7
+PATCHLEVEL = 8
 SUBLEVEL = 0
 EXTRAVERSION =
-NAME = Terrified Chipmunk
+NAME = Unicycling Gorilla
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
@@ -124,7 +124,7 @@ $(if $(KBUILD_OUTPUT),, \
 PHONY += $(MAKECMDGOALS) sub-make
 
 $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
-       $(Q)@:
+       @:
 
 sub-make: FORCE
        $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
@@ -169,7 +169,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
                                  -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-                                 -e s/sh[234].*/sh/ )
+                                 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
 
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
@@ -981,6 +981,12 @@ _modinst_post: _modinst_
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modinst
        $(call cmd,depmod)
 
+ifeq ($(CONFIG_MODULE_SIG), y)
+PHONY += modules_sign
+modules_sign:
+       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modsign
+endif
+
 else # CONFIG_MODULES
 
 # Modules not configured
@@ -1021,11 +1027,14 @@ clean: rm-dirs  := $(CLEAN_DIRS)
 clean: rm-files := $(CLEAN_FILES)
 clean-dirs      := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples)
 
-PHONY += $(clean-dirs) clean archclean
+PHONY += $(clean-dirs) clean archclean vmlinuxclean
 $(clean-dirs):
        $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 
-clean: archclean
+vmlinuxclean:
+       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
+
+clean: archclean vmlinuxclean
 
 # mrproper - Delete all generated files, including .config
 #
@@ -1252,7 +1261,6 @@ scripts: ;
 endif # KBUILD_EXTMOD
 
 clean: $(clean-dirs)
-       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
        $(call cmd,rmdirs)
        $(call cmd,rmfiles)
        @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
index 3d87ce199d0032571691fc5e715282f2d832f85b..7c04e27841d5144545c2dd9323ff4f01c1071e55 100644 (file)
@@ -1,3 +1,3 @@
 
-kconfig taken from vanilla Linux 3.7, and slightly patched.
+kconfig taken from vanilla Linux 3.8, and slightly patched.
 
index 0be6f110cce79be4c4acd2f4dbf4ac2ce7d24057..bdf42fdf64c9adb0095a1ff0ad3437499d0ba87c 100644 (file)
@@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
 quiet_cmd_dtc = DTC     $@
 cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
 
+$(obj)/%.dtb: $(src)/%.dts FORCE
+       $(call if_changed_dep,dtc)
+
 # Bzip2
 # ---------------------------------------------------------------------------
 
diff --git a/repomgr b/repomgr
index 022a516ecd5cce1df7366120108fbd055498167a..88eea37ea93e62f793e953f8175fda61901f574d 100755 (executable)
--- a/repomgr
+++ b/repomgr
@@ -82,6 +82,7 @@ my %modules =
                    fb/Makefile
                    fb/spectrum
                    misc/eb_leds
+                   misc/fortran-hello
                    misc/reboot
                    libs/inputtst
                    libs/libc_thread_safe
@@ -123,6 +124,7 @@ my %modules =
                    libcrypto
                    libevent
                    libgfxbitmap
+                   libgfortran
                    libgomp
                    libiniparser
                    libio